run: extend noux to run automatically natively

This commit is contained in:
Alexander Boettcher 2013-03-08 10:45:44 +01:00 committed by Norman Feske
parent 2a761c7fea
commit 5249c0875c
6 changed files with 133 additions and 41 deletions

View File

@ -55,26 +55,30 @@ build_boot_image {
libc_noux.lib.so coreutils.tar
}
#
# Redirect the output of Noux via the virtual serial port 1 into a file to be
# dumped after the successful completion of the test.
#
set noux_output_file "noux_output.log"
if {[is_qemu_available]} {
#
# Redirect the output of Noux via the virtual serial port 1 into a file to be
# dumped after the successful completion of the test.
#
set noux_output_file "noux_output.log"
append qemu_args " -nographic"
append qemu_args " -serial mon:stdio"
append qemu_args " -serial file:$noux_output_file"
append qemu_args " -nographic"
append qemu_args " -serial mon:stdio"
append qemu_args " -serial file:$noux_output_file"
if {[have_spec x86_64]} {
if {[have_spec x86_64]} {
# coreutils.tar is really huge when built for x86_64
append qemu_args " -m 300 "
}
}
run_genode_until "child /bin/ls exited with exit value 0.*\n" 30
puts "[exec cat $noux_output_file]"
if {[is_qemu_available]} {
puts "[exec cat $noux_output_file]"
exec rm bin/coreutils.tar
exec rm $noux_output_file
exec rm bin/coreutils.tar
exec rm $noux_output_file
}
puts "Test succeeded"

View File

@ -3,13 +3,18 @@ if {[have_spec linux]} {
exit 0
}
build {
set build_components {
core init
drivers/timer drivers/uart drivers/nic drivers/pci
noux/net lib/libc_noux
noux-pkg/netcat
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci/device_pd
build $build_components
exec tar cfv bin/noux_netcat.tar -h -C bin/netcat .
#
@ -62,11 +67,25 @@ append config {
<provides> <service name="Nic"/> </provides>
</start>}
append_if [have_spec pci] config {
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="6M"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="2M"/>
<provides><service name="PCI"/> </provides>
</start>}
<provides> <service name="PCI"/> </provides>
</start> }
append config {
<start name="noux_net">
@ -96,40 +115,56 @@ set boot_modules {
}
# platform-specific modules
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
build_boot_image $boot_modules
#
# Redirect the output of Noux via the virtual serial port 1 into a file to be
# dumped after the successful completion of the test.
#
set noux_output_file "noux_output.log"
if {![is_amt_available]} {
#
# Redirect the output of Noux via the virtual serial port 1 into a file to be
# dumped after the successful completion of the test.
#
set noux_output_file "noux_output.log"
append qemu_args " -nographic"
append qemu_args " -serial mon:stdio"
append qemu_args " -serial file:$noux_output_file"
append qemu_args " -nographic"
append qemu_args " -serial mon:stdio"
append qemu_args " -serial file:$noux_output_file"
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 "
append qemu_args " -net user -redir tcp:5555::5555 "
append qemu_args " -net user -redir tcp:5555::5555 "
}
run_genode_until {.*got IP address.*\n} 60
sleep 2
exec echo -e "Hello Genode" | netcat localhost 5555
if [is_amt_available] {
set match_string "got IP address"
grep_output $match_string
unify_output {[\r\n\t]+} ""
unify_output {[\033]\[0m} ""
set pos [string first $match_string $output]
set ip_addr [string replace $output 0 [expr $pos+14]]
} else {
set ip_addr "localhost"
}
exec echo -e "Hello Genode" | netcat $ip_addr 5555
sleep 1
set output [exec cat $noux_output_file]
puts "output:\n$output\n"
if {![is_amt_available]} {
set output [exec cat $noux_output_file]
puts "output:\n$output\n"
exec rm $noux_output_file
}
exec rm bin/noux_netcat.tar
exec rm -r bin/etc
exec rm $noux_output_file
if {![regexp {Hello Genode} $output dummy]} {
puts stderr "Error: output not as expected"
@ -137,4 +172,3 @@ if {![regexp {Hello Genode} $output dummy]} {
}
puts "Test succeeded"
exit 0

View File

@ -14,6 +14,9 @@ set build_components {
test/libports/ncurses
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci/device_pd
set cc_march ""
if {[have_spec arm]} {
@ -103,10 +106,18 @@ append_if [have_spec sdl] config {
</provides>
</start>}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="5M"/>
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [have_spec framebuffer] config {
@ -115,6 +126,12 @@ append_if [have_spec framebuffer] config {
<provides><service name="Framebuffer"/></provides>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="2M"/>
<provides> <service name="PCI"/> </provides>
</start> }
append_if [have_spec ps2] config {
<start name="ps2_drv">
<resource name="RAM" quantum="1M"/>
@ -239,9 +256,9 @@ lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
build_boot_image $boot_modules
append qemu_args " -m 768 "
run_genode_until forever
# vi: set ft=tcl :

View File

@ -0,0 +1,29 @@
#
# \brief Noux environment for building the Genode/NOVA demo scenario on Genode
# \author Christian Prochaska
# \date 2012-11-26
#
set platform "nova_x86_32"
set platform_base_dir "base-nova"
set platform_pkgs ""
set platform_cmds {
make core &&
exit 234
}
source ${genode_dir}/ports/run/noux_tool_chain.inc
append qemu_args " -m 768 "
set time_start [ clock seconds ]
run_genode_until {child /bin/bash exited with exit value 234} 600
set time_end [ clock seconds ]
set git_info [ exec git --git-dir=$genode_dir/.git describe ]
puts "Testing \" [ clock format $time_start -format "%Y-%m-%d %H:%M:%S"], commit: ($git_info)\" in : "
puts "Testing \"all\" in printf.wv:"
puts "! PERF: runtime [expr $time_end - $time_start ] seconds ok"
puts "Test succeeded"

View File

@ -36,3 +36,7 @@ set platform_cmds {
}
source ${genode_dir}/ports/run/noux_tool_chain.inc
append qemu_args " -m 768 "
run_genode_until forever

View File

@ -10,3 +10,7 @@ set platform_pkgs ""
set platform_cmds ""
source ${genode_dir}/ports/run/noux_tool_chain.inc
append qemu_args " -m 768 "
run_genode_until forever