diff --git a/repos/base/run/ds_ownership.run b/repos/base/run/ds_ownership.run deleted file mode 100644 index cff640d1bf..0000000000 --- a/repos/base/run/ds_ownership.run +++ /dev/null @@ -1,35 +0,0 @@ -build "core init test/ds_ownership" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-ds_ownership" - -append qemu_args "-nographic " - -run_genode_until {.*test succeeded.*\n} 20 - diff --git a/repos/base/run/fpu.run b/repos/base/run/fpu.run deleted file mode 100644 index 73dd43a071..0000000000 --- a/repos/base/run/fpu.run +++ /dev/null @@ -1,58 +0,0 @@ -# -# Build -# - -build "core init test/fpu" - -# -# Boot image -# - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-fpu" - -# -# Execution -# - -append qemu_args "-nographic " - -run_genode_until "test done.*\n" 60 - -grep_output {^\[init -\> test\]} - -compare_output_to { - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] FPU user started - [init -> test] test done -} - diff --git a/repos/base/run/mmio.run b/repos/base/run/mmio.run deleted file mode 100644 index 8adaea8c63..0000000000 --- a/repos/base/run/mmio.run +++ /dev/null @@ -1,41 +0,0 @@ -# -# Build -# - -build "core init test/mmio" - -# -# Boot image -# - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-mmio" - -# -# Execution -# - -append qemu_args "-nographic " - -run_genode_until "child \"test\" exited with exit value 0" 20 diff --git a/repos/base/run/new_delete.run b/repos/base/run/new_delete.run deleted file mode 100644 index fce903b4b7..0000000000 --- a/repos/base/run/new_delete.run +++ /dev/null @@ -1,82 +0,0 @@ -build "core init test/new_delete" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-new_delete" - -append qemu_args "-nographic " - -run_genode_until "Test done.*\n" 20 - -grep_output {^\[init -> test-new_delete\]} - -compare_output_to { - [init -> test-new_delete] Allocator::alloc() - [init -> test-new_delete] A - [init -> test-new_delete] C - [init -> test-new_delete] B - [init -> test-new_delete] D - [init -> test-new_delete] E - [init -> test-new_delete] ~E - [init -> test-new_delete] ~D - [init -> test-new_delete] ~B - [init -> test-new_delete] ~C - [init -> test-new_delete] ~A - [init -> test-new_delete] Allocator::free() - [init -> test-new_delete] Allocator::alloc() - [init -> test-new_delete] A - [init -> test-new_delete] C - [init -> test-new_delete] B - [init -> test-new_delete] D - [init -> test-new_delete] E - [init -> test-new_delete] throw exception - [init -> test-new_delete] ~D - [init -> test-new_delete] ~B - [init -> test-new_delete] ~C - [init -> test-new_delete] ~A - [init -> test-new_delete] Allocator::free() - [init -> test-new_delete] exception caught - [init -> test-new_delete] Allocator::alloc() - [init -> test-new_delete] A - [init -> test-new_delete] C - [init -> test-new_delete] B - [init -> test-new_delete] D - [init -> test-new_delete] E - [init -> test-new_delete] ~E - [init -> test-new_delete] ~D - [init -> test-new_delete] ~B - [init -> test-new_delete] ~C - [init -> test-new_delete] ~A - [init -> test-new_delete] Allocator::free() - [init -> test-new_delete] Allocator::alloc() - [init -> test-new_delete] A - [init -> test-new_delete] C - [init -> test-new_delete] B - [init -> test-new_delete] D - [init -> test-new_delete] E - [init -> test-new_delete] throw exception - [init -> test-new_delete] ~D - [init -> test-new_delete] ~B - [init -> test-new_delete] ~C - [init -> test-new_delete] ~A - [init -> test-new_delete] Allocator::free() - [init -> test-new_delete] exception caught -} diff --git a/repos/base/run/reconstructible.run b/repos/base/run/reconstructible.run deleted file mode 100644 index 8dd2ba3901..0000000000 --- a/repos/base/run/reconstructible.run +++ /dev/null @@ -1,67 +0,0 @@ -build "core init test/reconstructible" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-reconstructible" - -append qemu_args "-nographic " - -run_genode_until {.*--- Reconstructible utility test finished ---.*\n} 20 - -grep_output {-> test-reconstructible} - -compare_output_to { -[init -> test-reconstructible] --- Reconstructible utility test --- -[init -> test-reconstructible] construct Object 1 -[init -> test-reconstructible] construct Object 2 -[init -> test-reconstructible] create Compound object -[init -> test-reconstructible] construct Member_with_reference -[init -> test-reconstructible] construct Compound -[init -> test-reconstructible] compound.member.constructed returns 1 -[init -> test-reconstructible] compound.lazy_member.constructed returns 0 -[init -> test-reconstructible] construct lazy member -[init -> test-reconstructible] construct Member_with_reference -[init -> test-reconstructible] compound.lazy_member.constructed returns 1 -[init -> test-reconstructible] call method on member (with reference to Object 1) -[init -> test-reconstructible] const method called on Object 1 -[init -> test-reconstructible] reconstruct member with Object 2 as reference -[init -> test-reconstructible] destruct Member_with_reference -[init -> test-reconstructible] construct Member_with_reference -[init -> test-reconstructible] call method on member -[init -> test-reconstructible] const method called on Object 2 -[init -> test-reconstructible] destruct member -[init -> test-reconstructible] destruct Member_with_reference -[init -> test-reconstructible] try to call method on member, catch exception -[init -> test-reconstructible] got exception, as expected -[init -> test-reconstructible] destruct Compound and Objects 1 and 2 -[init -> test-reconstructible] destruct Compound -[init -> test-reconstructible] destruct Member_with_reference -[init -> test-reconstructible] destruct Object 2 -[init -> test-reconstructible] destruct Object 1 -[init -> test-reconstructible] construct Throwing object -[init -> test-reconstructible] construct Throwing -> don't throw -[init -> test-reconstructible] destruct Throwing -[init -> test-reconstructible] construct Throwing -> throw exception -[init -> test-reconstructible] got exception, as expected -[init -> test-reconstructible] --- Reconstructible utility test finished --- -} - diff --git a/repos/base/run/registry.run b/repos/base/run/registry.run deleted file mode 100644 index 67a1d8f939..0000000000 --- a/repos/base/run/registry.run +++ /dev/null @@ -1,27 +0,0 @@ -build "core init test/registry" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-registry" - -append qemu_args "-nographic " - -run_genode_until ".*child \"test-registry\" exited with exit value 0.*\n" 20 diff --git a/repos/base/run/rm_fault.run b/repos/base/run/rm_fault.run deleted file mode 100644 index e318addff9..0000000000 --- a/repos/base/run/rm_fault.run +++ /dev/null @@ -1,47 +0,0 @@ -if {[have_spec linux]} { - puts "Platform does not support managed dataspaces"; exit } - -# -# We skip the non-executable fault test on platforms where this functionality -# is not supported. -# -proc non_executable_supported { } { - - if {[have_spec hw] && [have_spec x86_64]} { return true } - if {[have_spec hw] && [have_spec arm]} { return true } - if {[have_spec nova] && [have_spec x86_64]} { return true } - if {[have_spec foc] && [have_spec x86_64]} { return true } - if {[have_spec foc] && [have_spec arm]} { return true } - if {[have_spec sel4] && [have_spec arm]} { return true } - - return false -} - -build "core init test/rm_fault" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-rm_fault" - -append qemu_args "-nographic " - -run_genode_until {child "test-rm_fault" exited with exit value 0.*} 300 diff --git a/repos/base/run/rm_nested.run b/repos/base/run/rm_nested.run deleted file mode 100644 index c87a0960e4..0000000000 --- a/repos/base/run/rm_nested.run +++ /dev/null @@ -1,34 +0,0 @@ -if {[have_spec linux]} { - puts "Platform does not support managed dataspaces"; exit } - -build "core init test/rm_nested" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-rm_nested" - -append qemu_args "-nographic " - -run_genode_until ".*--- finished nested region map test ---.*\n" 300 - -grep_output {(Error)} -compare_output_to {} diff --git a/repos/base/run/synced_interface.run b/repos/base/run/synced_interface.run deleted file mode 100644 index 4d6ae432fd..0000000000 --- a/repos/base/run/synced_interface.run +++ /dev/null @@ -1,39 +0,0 @@ -build "core init test/synced_interface" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-synced_interface" - -append qemu_args "-nographic " - -run_genode_until {.*--- Synced interface test finished ---.*\n} 20 - -grep_output {-> test-synced_interface} - -compare_output_to { -[init -> test-synced_interface] --- Synced interface test --- -[init -> test-synced_interface] lock -[init -> test-synced_interface] adding 13 + 14 -[init -> test-synced_interface] unlock -[init -> test-synced_interface] result is 27 -[init -> test-synced_interface] --- Synced interface test finished --- -} diff --git a/repos/base/run/xml_generator.run b/repos/base/run/xml_generator.run deleted file mode 100644 index 85a490f777..0000000000 --- a/repos/base/run/xml_generator.run +++ /dev/null @@ -1,85 +0,0 @@ -build "core init test/xml_generator" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-xml_generator" - -append qemu_args "-nographic " - -run_genode_until "--- XML generator test finished ---.*\n" 30 - -grep_output {^\[init -> test-xml_generator} - -compare_output_to { -[init -> test-xml_generator] --- XML generator test started --- -[init -> test-xml_generator] -[init -> test-xml_generator] used 308 bytes, result: -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] buffer exceeded (expected error) -[init -> test-xml_generator] -[init -> test-xml_generator] exception with value 10 on level 4 (expected error) -[init -> test-xml_generator] exception with value 20 on level 8 (expected error) -[init -> test-xml_generator] exception with value 30 on level 4 (expected error) -[init -> test-xml_generator] exception with value 11 on level 4 (expected error) -[init -> test-xml_generator] exception with value 21 on level 8 (expected error) -[init -> test-xml_generator] exception with value 31 on level 4 (expected error) -[init -> test-xml_generator] exception with value 12 on level 4 (expected error) -[init -> test-xml_generator] exception with value 22 on level 8 (expected error) -[init -> test-xml_generator] exception with value 32 on level 4 (expected error) -[init -> test-xml_generator] exception with value 40 on level 2 (expected error) -[init -> test-xml_generator] -[init -> test-xml_generator] used 419 bytes, result: -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] -[init -> test-xml_generator] --- XML generator test finished --- -} diff --git a/repos/base/run/xml_node.run b/repos/base/run/xml_node.run deleted file mode 100644 index 871f189de8..0000000000 --- a/repos/base/run/xml_node.run +++ /dev/null @@ -1,135 +0,0 @@ -build "core init test/xml_node" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-xml_node" - -append qemu_args "-nographic " - -run_genode_until {.*child "test-xml_node" exited with exit value 0.*\n} 20 - -# pay only attention to the output of init and its children -grep_output {^\[init \-\> test\-xml_node\]} -trim_lines - -compare_output_to { -[init -> test-xml_node] --- XML-token test --- -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="<" -[init -> test-xml_node] token type="IDENT", len=6, content="config" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content=">" -[init -> test-xml_node] token type="WHITESPACE", len=2, content=" " -[init -> test-xml_node] token type="IDENT", len=9, content="sometext1" -[init -> test-xml_node] token type="WHITESPACE", len=2, content=" " -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="<" -[init -> test-xml_node] token type="IDENT", len=7, content="program" -[init -> test-xml_node] token type="WHITESPACE", len=1, content=" " -[init -> test-xml_node] token type="IDENT", len=4, content="attr" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="=" -[init -> test-xml_node] token type="STRING", len=6, content=""abcd"" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="/" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content=">" -[init -> test-xml_node] token type="WHITESPACE", len=2, content=" " -[init -> test-xml_node] token type="IDENT", len=9, content="sometext2" -[init -> test-xml_node] token type="WHITESPACE", len=2, content=" " -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="<" -[init -> test-xml_node] token type="IDENT", len=7, content="program" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content=">" -[init -> test-xml_node] token type="IDENT", len=9, content="inProgram" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="<" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="/" -[init -> test-xml_node] token type="IDENT", len=7, content="program" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content=">" -[init -> test-xml_node] token type="WHITESPACE", len=2, content=" " -[init -> test-xml_node] token type="IDENT", len=9, content="sometext3" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="<" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content="/" -[init -> test-xml_node] token type="IDENT", len=6, content="config" -[init -> test-xml_node] token type="SINGLECHAR", len=1, content=">" -[init -> test-xml_node] --- XML-parser test --- -[init -> test-xml_node] -- Test valid XML structure -- -[init -> test-xml_node] XML node: name = "config", number of subnodes = 3 -[init -> test-xml_node] XML node: name = "program", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "filename", leaf content = "init" -[init -> test-xml_node] XML node: name = "quota", leaf content = "16M" -[init -> test-xml_node] XML node: name = "program", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "filename", leaf content = "timer" -[init -> test-xml_node] XML node: name = "quota", leaf content = "64K" -[t] child "client" exited with exit value 0init -> test-xml_node] XML node: name = "program", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "filename", leaf content = "framebuffer" -[init -> test-xml_node] XML node: name = "quota", leaf content = "8M" -[init -> test-xml_node] -[init -> test-xml_node] -- Test invalid XML structure (broken tag) -- -[init -> test-xml_node] XML node: name = "config", number of subnodes = 3 -[init -> test-xml_node] XML node: name = "program", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "filename", leaf content = "init" -[init -> test-xml_node] XML node: name = "quota", leaf content = "16M" -[init -> test-xml_node] XML node: name = "program", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "filename", leaf content = "timer" -[init -> test-xml_node] XML node: name = "quota", leaf content = "64K" -[init -> test-xml_node] XML node: name = "program", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "filename", leaf content = "framebuffer" -[init -> test-xml_node] XML node: name = "quota", leaf content = "8M" -[init -> test-xml_node] -[init -> test-xml_node] -- Test invalid XML structure (truncated) -- -[init -> test-xml_node] string has invalid XML syntax -[init -> test-xml_node] -[init -> test-xml_node] -- Test invalid XML structure (truncated comment) -- -[init -> test-xml_node] string has invalid XML syntax -[init -> test-xml_node] -[init -> test-xml_node] -- Test invalid XML structure (unfinished string) -- -[init -> test-xml_node] string has invalid XML syntax -[init -> test-xml_node] -[init -> test-xml_node] -- Test node access by key -- -[init -> test-xml_node] content of sub node "filename" = "init" -[init -> test-xml_node] content of sub node "quota" = "16M" -[init -> test-xml_node] sub node "info" is not defined -[init -> test-xml_node] -[init -> test-xml_node] -- Test access to XML attributes -- -[init -> test-xml_node] XML node: name = "config", number of subnodes = 3 -[init -> test-xml_node] attribute name="priolevels", value="4" -[init -> test-xml_node] XML node: name = "program", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "filename", leaf content = "init" -[init -> test-xml_node] XML node: name = "quota", leaf content = "16M" -[init -> test-xml_node] XML node: name = "single-tag", leaf content = "" -[init -> test-xml_node] XML node: name = "single-tag-with-attr", leaf content = "" -[init -> test-xml_node] attribute name="name", value="ein_name" -[init -> test-xml_node] attribute name="quantum", value="2K" -[init -> test-xml_node] -[init -> test-xml_node] -- Test parsing XML with nodes mixed with text -- -[init -> test-xml_node] XML node: name = "config", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "program", leaf content = "" -[init -> test-xml_node] attribute name="attr", value="abcd" -[init -> test-xml_node] XML node: name = "program", leaf content = "inProgram" -[init -> test-xml_node] -[init -> test-xml_node] -- Test parsing XML with comments -- -[init -> test-xml_node] XML node: name = "config", number of subnodes = 2 -[init -> test-xml_node] XML node: name = "visible-tag", leaf content = "" -[init -> test-xml_node] XML node: name = "visible-tag", leaf content = "" -[init -> test-xml_node] -[init -> test-xml_node] -- Test exporting decoded content from XML node -- -[init -> test-xml_node] step 1 -[init -> test-xml_node] step 2 -[init -> test-xml_node] step 3 -[init -> test-xml_node] step 4 -[init -> test-xml_node] step 5 -[init -> test-xml_node] -[init -> test-xml_node] --- End of XML-parser test --- -} diff --git a/repos/gems/run/depot_autopilot.run b/repos/gems/run/depot_autopilot.run new file mode 100644 index 0000000000..74513627a3 --- /dev/null +++ b/repos/gems/run/depot_autopilot.run @@ -0,0 +1,615 @@ +#################### +## User interface ## +#################### + +# +# Convenience variables for debugging one specific test +# +# single_test_pkg: if set to one of the test packages, only this one is run +# single_test_build: list of components that shall be build from repos +# single_test_modules: list of boot modules to overlay the test-depot content +# +# To get a hint which build components and which boot modules you may want to +# enter for a given test package please see these files: +# +# repos//recipes/pkg//archives +# repos//recipes/pkg//runtime ( tag) +# +# Example: +# +# set single_test_pkg "test-libc_vfs" +# set single_test_build { server/ram_fs test/libc_vfs } +# set single_test_modules { ram_fs test-libc_vfs vfs.lib.so } +# +set single_test_pkg "" +set single_test_build { } +set single_test_modules { } + +# +# The list of available test packages - was obtained by issuing: +# +# ! cd /repos +# ! find . -type d -wholename *recipes/pkg/test-* -printf '%f\n' | sort +# +set avail_test_pkgs { + test-ada + test-ada_exception + test-ada_secondary_stack + test-blk + test-blk_cache + test-clipboard + test-ds_ownership + test-dynamic_config + test-dynamic_config_loader + test-dynamic_config_slave + test-expat + test-fault_detection + test-fpu + test-fs_log + test-fs_packet + test-fs_report + test-fs_rom_update + test-fs_rom_update_fs + test-fs_rom_update_ram + test-init + test-init_loop + test-ldso + test-libc + test-libc_counter + test-libc_getenv + test-libc_pipe + test-libc_vfs + test-libc_vfs_audit + test-libc_vfs_block + test-libc_vfs_counter + test-libc_vfs_fs + test-libc_vfs_fs_chained + test-libc_vfs_ram + test-log + test-lx_block + test-magic_ring_buffer + test-mmio + test-new_delete + test-nic_loopback + test-part_blk_gpt + test-part_blk_mbr + test-pipe + test-pthread + test-python + test-ram_fs_chunk + test-read_only_rom + test-reconstructible + test-registry + test-report_rom + test-resource_request + test-resource_yield + test-rm_fault + test-rm_fault_no_nox + test-rm_nested + test-rom_blk + test-rom_filter + test-rtc + test-rust + test-sequence + test-signal + test-slab + test-stdcxx + test-synced_interface + test-tcp_bulk_lwip + test-tcp_bulk_lxip + test-terminal_crosslink + test-timed_semaphore + test-timer + test-trace + test-trace_logger + test-utf8 + test-vfs_stress_fs + test-vfs_stress_ram + test-weak_ptr + test-xml_generator + test-xml_node +} + +if { $single_test_pkg != "" && [lsearch -exact $avail_test_pkgs $single_test_pkg] == -1} { + puts stderr "Error: single_test_pkg \"$single_test_pkg\" not available" + exit 1 +} + +# +# Whether the platform supports non-executable dataspaces +# +proc non_executable_supported { } { + if {[have_spec hw] && [have_spec x86_64]} { return true } + if {[have_spec hw] && [have_spec arm]} { return true } + if {[have_spec nova] && [have_spec x86_64]} { return true } + if {[have_spec foc] && [have_spec x86_64]} { return true } + if {[have_spec foc] && [have_spec arm]} { return true } + if {[have_spec sel4] && [have_spec arm]} { return true } + return false +} + +# +# Whether to skip a test - if undefined for a test, the test is not skipped +# +set skip_test_pkg(test-slab) [expr [get_cmd_switch --autopilot] && [have_include "power_on/qemu"]] +set skip_test_pkg(test-rm_nested) [expr [have_spec linux]] +set skip_test_pkg(test-fault_detection) [expr [have_spec pistachio] || [have_spec fiasco]] +set skip_test_pkg(test-fs_packet) [expr [get_cmd_switch --autopilot] && [have_include "power_on/qemu"]] +set skip_test_pkg(test-rtc) [expr [have_spec linux] || ![have_spec x86]] +set skip_test_pkg(test-rm_fault) [expr [have_spec linux] || ![non_executable_supported]] +set skip_test_pkg(test-rm_fault_no_nox) [expr [have_spec linux] || !$skip_test_pkg(test-rm_fault)] +set skip_test_pkg(test-lx_block) [expr ![have_spec linux]] +set skip_test_pkg(test-tcp_bulk_lwip) [expr ![have_spec x86]] +set skip_test_pkg(test-tcp_bulk_lxip) [expr ![have_spec x86]] + + +############################################################## +## Local copies of run tool procedures with small adaptions ## +## ## +## FIXME: Adapt original and remove local copies ## +############################################################## + +proc autopilot_wait_for_output { wait_for_re timeout_value running_spawn_id } { + global output + + if {$wait_for_re == "forever"} { + set timeout -1 + interact { + \003 { + send_user "Expect: 'interact' received 'strg+c' and was cancelled\n"; + exit + } + -i $running_spawn_id + } + } else { + set timeout $timeout_value + } + + set platform_msg [run_boot_string] + if {$platform_msg eq ""} { + set platform_msg "undefined platform command startup string sequence" + } + + expect { + -i $running_spawn_id $platform_msg { puts stderr "Error: platform rebooted unexpectedly"; exit -4 } + -i $running_spawn_id -re $wait_for_re { } + eof { puts stderr "Error: Spawned process died unexpectedly"; exit -3 } + timeout { + puts stderr "Error: Test execution timed out"; + global last_test_timed_out + set last_test_timed_out 1 + return + } + } + append output $expect_out(buffer) +} + +proc autopilot_create_tar_from_depot_binaries { archive_path args } { + + # filter out api and src archives from requested depot content + set content {} + foreach subdir [_collect_from_depot $args] { + if {[regexp [_depot_archive_versioned_path_pattern] $subdir dummy user type]} { + if {$type == "src"} continue; + if {$type == "api"} continue; + } + lappend content $subdir + } + + check_for_missing_depot_archives + + eval "exec tar cf $archive_path -T /dev/null -C [depot_dir] [lsort -unique $content]" +} + +proc autopilot_run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id -1}} { + # + # If a running_spawn_id is specified, wait for the expected output + # + if {$running_spawn_id != -1} { + autopilot_wait_for_output $wait_for_re $timeout_value $running_spawn_id + return; + } + + set retry 3 + while { $retry != 0 } { + + if {[expr [run_power_on] == false]} { + puts "Power on step failed, retry." + sleep 3 + incr retry -1; + continue + } + + if {![run_load]} { + puts "Load step failed, retry." + + # kill the spawned load process if there is one + if {[load_spawn_id] != -1} { + set pid [exp_pid -i [load_spawn_id]] + exec kill -9 $pid + } + + incr retry -1; + continue; + } + + if {![run_log $wait_for_re $timeout_value]} { + puts "Log step failed, retry." + incr retry -1; + continue; + } + + return; + } + + puts stderr "Boot process failed 3 times in series. I give up!"; + exit -1; +} + + +######################## +## Utility procedures ## +######################## + +# +# Check if archives are available without doing anything with them +# +proc check_archives_available { args } { + + # filter out api and src archives from requested depot content + set content {} + foreach subdir [_collect_from_depot $args] { + if {[regexp [_depot_archive_versioned_path_pattern] $subdir dummy user type]} { + if {$type == "src"} continue; + if {$type == "api"} continue; + } + lappend content $subdir + } + + check_for_missing_depot_archives +} + +# +# Return routes for boot modules that shall overlay the test-depot content +# +proc single_test_module_routes { } { + + global single_test_modules + set result "" + foreach module $single_test_modules { + append result { + } + } + return $result +} + +# +# Return autopilot start-nodes for the test packages that shall be run +# +proc test_pkgs_start_nodes { } { + + global test_pkgs + global skip_test_pkg + + set result "" + foreach test_pkg $test_pkgs { + if { [info exists skip_test_pkg($test_pkg)] && $skip_test_pkg($test_pkg)} { + append result { + } + } else { + append result { + } + } + } + return $result +} + + +# +# Prepare to call run_genode_until (again, with a changed setup) +# +proc prepare_to_run_genode { } { + + global output + global qemu_args + global previous_results + global previous_time_ms + global skip_test_pkg + global test_pkgs + global single_test_build + global single_test_modules + global last_test_pkg + global last_test_timed_out + global serial_id + global timeout + + set qemu_args " -nographic -serial mon:stdio" + + + # + # Create a depot archive that contains the test packages + # + + create_boot_directory + + set depot_tar_archives "" + set import_archives "" + + foreach test_pkg $test_pkgs { + if { [info exists skip_test_pkg($test_pkg)] } { + append_if [expr !$skip_test_pkg($test_pkg)] depot_tar_archives " genodelabs/pkg/$test_pkg " + } else { + append depot_tar_archives " genodelabs/pkg/$test_pkg " + } + } + + append import_archives { + genodelabs/src/} [base_src] { + genodelabs/src/report_rom + genodelabs/src/fs_rom + genodelabs/src/vfs + genodelabs/src/loader + genodelabs/src/init + genodelabs/src/depot_query + } + if {!$skip_test_pkg(test-lx_block)} { + append import_archives { genodelabs/raw/test-lx_block } + } + + set all_archives [concat $depot_tar_archives $import_archives] + check_archives_available {*}$all_archives + + autopilot_create_tar_from_depot_binaries [run_dir]/genode/depot.tar {*}$depot_tar_archives + + + # + # Install the root-init config + # + append config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } [single_test_module_routes] { + + + + + + + + + + + + + } $previous_results { + + } [test_pkgs_start_nodes] { + + + + + + + + + + + + + + + + + + + + + } [single_test_module_routes] { + + + + + + + + + + + + + } + install_config $config + + + # + # Create the rest of the boot modules + # + + set build_components { app/depot_autopilot } + append build_components $single_test_build + build $build_components + + import_from_depot {*}$import_archives + + + # + # Build boot image from boot modules + # + + set boot_modules { depot_autopilot } + append boot_modules $single_test_modules + build_boot_image $boot_modules + + set last_test_pkg "" + set last_test_timed_out 0 + set serial_id -1 + set timeout 20 +} + + +################## +## Main routine ## +################## + +# +# Check platform support +# +if {[expr ![have_spec x86] && \ + ![have_spec arm_v7a] ]} \ +{ + puts "\n Run script is not supported on this platform. \n"; + exit 0 +} + +# +# Compose the test_pkgs list from a list of available test packages by +# applying the single_test_pkg variable. +# +set test_pkgs "" +foreach test_pkg $avail_test_pkgs { + if { $single_test_pkg == "" || $single_test_pkg == $test_pkg } { + append test_pkgs " $test_pkg " + } +} + +set previous_results "" +set previous_time_ms 0 +prepare_to_run_genode + +while {1} { + + # wait for the next autopilot event + if {$serial_id == -1} { + run_genode_until {depot_autopilot\] --- .*?\n} $timeout + } else { + set init_time_ms [clock clicks -millisec] + autopilot_run_genode_until {depot_autopilot\] --- .*?\n} $timeout $serial_id + set previous_time_ms [expr $previous_time_ms + [expr ([clock clicks -millisec] - $init_time_ms)] ] + } + # remove last test from list and check if we have to reboot the system + set serial_id [output_spawn_id] + if {$last_test_pkg != ""} { + set test_pkgs [lsearch -all -inline -not -exact $test_pkgs $last_test_pkg] + if {$last_test_timed_out} { + + # shut-down running system + exec kill -9 [exp_pid -i $serial_id] + + # remember result of last test + if {$previous_results != ""} { + append previous_results \012 + } + append previous_results { } [format {%-31s %-6s %7s} $last_test_pkg "failed " "$timeout.000"] { reboot} + + # prepare system re-boot + prepare_to_run_genode + continue + } + } + # if the autopilot finished all tests, evaluate its return value + if {[regexp {depot_autopilot\] --- Finished} $output]} { + set output "" + run_genode_until {child "depot_autopilot" exited with exit value.*?\n} 10 $serial_id + grep_output {^\[init\] } + compare_output_to {[init] child "depot_autopilot" exited with exit value 0} + exit 0 + } + # if the autopilot started a new test, set a new timeout + if {[regexp {depot_autopilot\] --- Run} $output]} { + + if {$last_test_pkg != ""} { + + # remember result of last test in case the system must be restartet + set last_test_result "" + regexp {depot_autopilot\] ( [^\033]+)} $output ignored last_test_result + regsub -all {<} $last_test_result {\<} last_test_result + if {$previous_results != ""} { + append previous_results \012 + } + append previous_results $last_test_result + } + + # determine timeout for the next timeout + set min_timeout 10 + regexp {depot_autopilot\] --- Run "(.*?)" \(max ([0-9]*?) } $output] ignore last_test_pkg min_timeout + set timeout [expr $min_timeout + 10] + + set output "" + } +} diff --git a/repos/gems/run/fs_report.run b/repos/gems/run/fs_report.run deleted file mode 100644 index 0981db2ab4..0000000000 --- a/repos/gems/run/fs_report.run +++ /dev/null @@ -1,100 +0,0 @@ -# -# Build -# -set build_components { - core init drivers/timer - lib/vfs/import - server/fs_report - server/fs_rom - server/vfs - test/fs_report -} - -build $build_components - -create_boot_directory - -# -# Generate config -# -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# -set boot_modules { - core ld.lib.so init timer - fs_report fs_rom test-fs_report - vfs vfs.lib.so vfs_import.lib.so -} - -build_boot_image $boot_modules - -append qemu_args " -nographic" - -run_genode_until {child "test-fs_report" exited with exit value 0.*\n} 30 diff --git a/repos/gems/run/libc_vfs_audit.run b/repos/gems/run/libc_vfs_audit.run deleted file mode 100644 index b67031b6d7..0000000000 --- a/repos/gems/run/libc_vfs_audit.run +++ /dev/null @@ -1,80 +0,0 @@ -# -# \brief Test for auditing the vfs -# \author Emery Hemingway -# \date 2018-03-22 -# - -# -# Build -# - -build { core init server/vfs test/libc_vfs lib/vfs/audit } - -create_boot_directory - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - - - - - - - - - - - - - } -append_if [have_include "power_on/qemu"] config { - } -append config { - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -build_boot_image { - core init vfs - ld.lib.so libc.lib.so vfs.lib.so - test-libc_vfs - vfs_audit.lib.so -} - -# -# Execute test case -# - -append qemu_args " -nographic " -run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 60 - -# vi: set ft=tcl : diff --git a/repos/gems/run/magic_ring_buffer.run b/repos/gems/run/magic_ring_buffer.run deleted file mode 100644 index 4c9d59cab6..0000000000 --- a/repos/gems/run/magic_ring_buffer.run +++ /dev/null @@ -1,29 +0,0 @@ -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build "core init test/magic_ring_buffer" - -build_boot_image { - core ld.lib.so init test-magic_ring_buffer -} - -append qemu_args " -nographic " - -run_genode_until "child .* exited with exit value 0.*\n" 10 diff --git a/repos/gems/run/pipe.run b/repos/gems/run/pipe.run deleted file mode 100644 index abff30452b..0000000000 --- a/repos/gems/run/pipe.run +++ /dev/null @@ -1,40 +0,0 @@ -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build "core init app/pipe" - -build_boot_image { - core init pipe - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so -} - -append qemu_args " -nographic " - -run_genode_until "child .* exited with exit value 0.*\n" 10 diff --git a/repos/gems/src/app/depot_autopilot/README b/repos/gems/src/app/depot_autopilot/README new file mode 100644 index 0000000000..6a72db4ba5 --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/README @@ -0,0 +1,315 @@ +The Depot Autopilot can be used to successively evaluate a given set of test +packages and produce an overview which makes it easy to see the most important +findings for each test. This is a brief overview of the features thereby +provided: + +* Execute multiple tests in a sub-init successively in a given order +* Each test can define multiple log patterns and timeouts that render it + either failed or succeeded +* A tests definition and ingredients come in the form of a Genode package + archive that gets queried by the Autopilot on demand +* Forward the log of each test to the log session of the Autopilot prefixed + with a timestamp and the test-local label +* After the last test, print an overview that lists for each test the test + result, why this result was assumed, and the test duration +* Consider that tests might crash the whole system. Thus, the Autopilot + provides information on when to consider a system reboot. And it makes it + possible to gather all findings from before a system reboot to hand them + in at the next run. +* Consider tests that are "not supported" so the overview tables of different + platforms are comparable + + +The Depot Autopilot is accompanied by the run script +'repos/gems/run/depot_autopilot.run' which doesn't describe a classical test +but rather helps integrating the Autopilot into a linux-based test +environment. The run script provides the following features: + +* The user only lists the desired test packages and selectively defines the + platform compatibility for tests where this is necessary +* The run script executes the Autopilot scenario on the target platform, + repeadedly if necessary, until an overview with all tests can be presented +* Each time the system gets booted, the Autopilot is configured only with + the remaining tests +* Tests that caused the run script to re-boot the target platform are listed + as "failed" with cause "reboot" in the overview +* Exits with 0 if a complete overview can be accomplished and all tests are + either "ok" or "skipped" and otherwise with a value < 0 +* Provides a convenient interface for debugging single tests + + +Depot Autopilot component +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Configuration +------------- + +This is an example configuration of the Depot Autopilot: + +! +! +! +! +! +! ... +! +! +! +! +! +! +! ... +! +! +! test-rm_fault_no_nox skipped +! test-rm_nested failed 0.653 log "Error: " +! +! +! +! +! ... +! + +:: + + Defines the architecture that the Autopilot is running on for querying the + appropriate variant of the test packages. Must be one of "x86_64", "x86_32", + "arm_v7a". + +:config children_label_prefix: + + Label prefix of LOG sessions of the components of a test. This is required + to relate incoming LOG-session request to a running test. + +:: + + Contains Init configuration that shall always be added to the configuration + of the target Init that runs the test scenarios. For information about the + format of the content of this tag see 'repos/os/src/init/config.xsd' + +:: + + Contains a routing configuration like in a tag of an Init + node that shall be added to the routing configuration of the runtime-Init + of each test. + +:: + + Contains a string that shall preceed the overview table. Each line of the + string is expected to have the format: + " $NAME $SEC.$MS $RESULT $ADDITIONAL_INFO" where $NAME is the name of the + test package right-padded with whitespaces to a size of 32, $SEC are the + seconds of the test duration left-padded with whitespaces to a size of 3, + $MS are the milliseconds of the test duration left-padded with zeros to a + size of 3, $RESULT is one of "ok", "failed", "skipped" right-padded with + whitespaces to a size of 7, and $ADDITIONAL_INFO is an arbitrary string. + This format is the same as in the result line printed out by the Autopilot + after each single test. The string is taken as is and should not contain '<' + or additional tabulators, whitespaces or newlines. It is suggested that all + occurences of '<' are replaced with "<", so, they can be sanitized in the + future. + +:: + + Contains a time in seconds that shall be added to the total time shown in + header of the overview. + +:: + + Each node stands for a test that shall be evaluated by the Autopilot. + The tests are evaluated in the order that the start nodes state. Also the + result overview is ordered this way. + +:: + + This string is used to identify the test in the log output of the Autopilot + and to name the runtime component of the test. It should be unique amongst + all nodes. + +:: + + Defines the Genode package path of the test package in the format + "$DEPOT_USER/pkg/$NAME/$VERSION". + +:: + + A boolean value. Its default value is false. If set to true, the test is not + evaluated at all, no package or "pkg" attribute is needed. The test only + appears in the overview with the result "skipped". + + +Format of test packages +----------------------- + +Besides the mandatory package content, a test package is expected to provide a +'runtime' file. This is an example runtime file: + +! +! +! +! +! +! +! Ignores tabs +! and newlines but no whitespaces ! +! Some XML: <my-node my_attr="123"/> +! [init -> test-example] Wildcarded *text *literal star * ampersand & +! +! +! +! +! +! +! +! +! +! ... +! +! +! ... +! +! +! +! +! +! +! + +:: + + Amount of RAM quota that is donated to the tests root component. + +:: + + Amount of CAP quota that is donated to the tests root component. + +:: + + Name of the binary of the tests root component. + +:: + + Not examined yet. Should contain a sub-node for every individual resource + that the test expects to be provided by the world outside its sub-tree. This + exists mainly for the annotation of required drivers. Normally, drivers + should not be part of a test sub-tree as we don't want to get into the + situation of restarting them. + +:: + + Lists events that may occur during the test and that shall imply a reaction + by the Autopilot. + +:: + + This event occurs when the test execution lasts the given time in seconds. + +:: + + One of "succeeded", "failed". Both imply the test to be treated as finished + (gets terminated) with the test result set to the given value. + +:: + + Contains a string pattern. The event occurs as soon as the pattern could be + completely matched against the LOG-session output of the test. Tabs and + newlines are ignored in the pattern as well as in the test output. Literal + characters '<', '&', '*' in the pattern must be escaped as "<", "&", + "*". A character '*' in the pattern is treated as non-greedy wildcard. + +:: + + See . + +:: + + Lists required files from the test-package build besides the root-component + binary. + +:: + + Requirement for a file with the given name. + +:: + + Contains the configuration for the tests root component. + + +Integration +----------- + +:Required sessions: + +* A Timer session for realizing timeout events stated in the test + runtime-files and providing timing information in the LOG output. + +* A Report session labeled "query". Through this report, the Depot Autopilot + requests the blueprint for the test-package required next. This is an + example content of this report: + + ! + ! + ! + + The format is compliant to that of the "query" ROM required by the Depot + Query component in 'repos/gems/src/app/depot_query'. + +* A ROM session labeled "blueprint". The blueprint ROM is expected to contain + the information requested via the above stated "query" Report. It may look + like this: + + ! + ! + ! + ! + ! ... # further and tags + ! + ! + ! ... # content of the tests runtime file + ! + ! + ! + + The format is compliant to that of the "blueprint" Report provided by the + Depot Query component in 'repos/gems/src/app/depot_query'. + +* A Report session labeled "init.config". Through this report a configuration + for an Init component is provided in a way that it serves as parent for the + root components of the tests. It may look like this: + + ! + ! ... # content of tag in Autopilot configuration + ! + ! + ! + ! + ! + ! ... # from the tests runtime file + ! + ! + ! ... # content of tag in Autopilot configuration + ! + ! # routes for each tags in the tests runtime file + ! + ! + ! + ! ... + ! + ! + ! + ! + +:Provided services: + +* A LOG service for matching LOG-event patterns stated in the test runtime- + files against the LOG output of the test components. Thus, you should take + care that all LOG session requests of test components are routed to the + Depot Autopilot. You can still receive the whole LOG output of the test + components as part of the LOG output of the Depot Autopilot. + + +Examples +-------- + +See the run script 'repos/gems/run/depot_autopilot.run' for a comprehensive +example of how to use the Depot Autopilot. diff --git a/repos/gems/src/app/depot_autopilot/child.cc b/repos/gems/src/app/depot_autopilot/child.cc new file mode 100644 index 0000000000..d2d5ff13d5 --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/child.cc @@ -0,0 +1,893 @@ + +/* + * \brief Child representation + * \author Norman Feske + * \date 2018-01-23 + */ + +/* + * Copyright (C) 2018 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +/* local includes */ +#include + +using namespace Depot_deploy; + +static void forward_to_log(unsigned long const sec, + unsigned long const ms, + char const *const base, + char const *const end) +{ + log(sec, ".", ms < 10 ? "00" : ms < 100 ? "0" : "", ms, " ", + Cstring(base, end - base)); +} + + +void Child::gen_start_node(Xml_generator &xml, + Xml_node common, + Depot_rom_server const &cached_depot_rom, + Depot_rom_server const &uncached_depot_rom) +{ + if (_state != UNFINISHED) { + while (Timeout_event *event = _timeout_events.first()) { + _timeout_events.remove(event); + destroy(_alloc, event); + } + while (Log_event *event = _log_events.first()) { + _log_events.remove(event); + destroy(_alloc, event); + } + return; + } + + if (_skip) { + + log(""); + log("--- Run \"", _name, "\" (max 1 sec) ---"); + log(""); + + _state = State::SUCCEEDED; + + char name_padded[32]; + for (size_t i = 0; i < sizeof(name_padded) - 1; name_padded[i++] = ' '); + name_padded[sizeof(name_padded) - 1] = '\0'; + memcpy(name_padded, _name.string(), min(_name.length() - 1, sizeof(name_padded) - 1)); + + _conclusion = Conclusion { + Cstring(name_padded), " skipped" }; + + log(" ", _conclusion); + _config_handler.submit(); + + return; + } + + if (!_configured() || _condition == UNSATISFIED) + return; + + if (_defined_by_launcher() && !_launcher_xml.constructed()) + return; + + if (!_pkg_xml->xml().has_sub_node("runtime")) { + warning("blueprint for '", _name, "' lacks runtime information"); + return; + } + + Xml_node const runtime = _pkg_xml->xml().sub_node("runtime"); + + xml.node("start", [&] () { + + xml.attribute("name", _name); + + unsigned long caps = _pkg_cap_quota; + if (_defined_by_launcher()) + caps = _launcher_xml->xml().attribute_value("caps", caps); + caps = _start_xml->xml().attribute_value("caps", caps); + + xml.attribute("caps", caps); + + typedef String<64> Version; + Version const version = _start_xml->xml().attribute_value("version", Version()); + if (version.valid()) + xml.attribute("version", version); + + xml.node("binary", [&] () { xml.attribute("name", _binary_name); }); + + Number_of_bytes ram = _pkg_ram_quota; + if (_defined_by_launcher()) + ram = _launcher_xml->xml().attribute_value("ram", ram); + ram = _start_xml->xml().attribute_value("ram", ram); + + xml.node("resource", [&] () { + xml.attribute("name", "RAM"); + xml.attribute("quantum", String<32>(ram)); + }); + + /* + * Insert inline '' node if provided by the start node, + * the launcher definition (if a launcher is user), or the + * blueprint. The former is preferred over the latter. + */ + if (_start_xml->xml().has_sub_node("config")) { + _gen_copy_of_sub_node(xml, _start_xml->xml(), "config"); + } else { + if (_defined_by_launcher() && _launcher_xml->xml().has_sub_node("config")) { + _gen_copy_of_sub_node(xml, _launcher_xml->xml(), "config"); + } else { + if (runtime.has_sub_node("config")) + _gen_copy_of_sub_node(xml, runtime, "config"); + } + } + + /* + * Declare services provided by the subsystem. + */ + if (runtime.has_sub_node("provides")) { + xml.node("provides", [&] () { + runtime.sub_node("provides").for_each_sub_node([&] (Xml_node service) { + _gen_provides_sub_node(xml, service, "audio_in", "Audio_in"); + _gen_provides_sub_node(xml, service, "audio_out", "Audio_out"); + _gen_provides_sub_node(xml, service, "block", "Block"); + _gen_provides_sub_node(xml, service, "file_system", "File_system"); + _gen_provides_sub_node(xml, service, "framebuffer", "Framebuffer"); + _gen_provides_sub_node(xml, service, "input", "Input"); + _gen_provides_sub_node(xml, service, "log", "LOG"); + _gen_provides_sub_node(xml, service, "nic", "Nic"); + _gen_provides_sub_node(xml, service, "nitpicker", "Nitpicker"); + _gen_provides_sub_node(xml, service, "report", "Report"); + _gen_provides_sub_node(xml, service, "rom", "ROM"); + _gen_provides_sub_node(xml, service, "terminal", "Terminal"); + _gen_provides_sub_node(xml, service, "timer", "Timer"); + }); + }); + } + + xml.node("route", [&] () { + _gen_routes(xml, common, cached_depot_rom, uncached_depot_rom); }); + }); + if (_running) { + return; } + + unsigned long max_timeout_sec = 0; + try { + Xml_node const events = _pkg_xml->xml().sub_node("runtime").sub_node("events"); + events.for_each_sub_node("timeout", [&] (Xml_node const &event) { + try { + Timeout_event &timeout = *new (_alloc) Timeout_event(_timer, *this, event); + if (timeout.sec() > max_timeout_sec) { + max_timeout_sec = timeout.sec(); + } + _timeout_events.insert(&timeout); + } + catch (Timeout_event::Invalid) { warning("Invalid timeout event"); } + }); + events.for_each_sub_node("log", [&] (Xml_node const &event) { + _log_events.insert(new (_alloc) Log_event(event)); + }); + } + catch (...) { } + log(""); + log("--- Run \"", _name, "\" (max ", max_timeout_sec, " sec) ---"); + log(""); + _running = true; + init_time_us = _timer.curr_time().trunc_to_plain_us().value; +} + + +void Child::_gen_routes(Xml_generator &xml, + Xml_node common, + Depot_rom_server const &cached_depot_rom, + Depot_rom_server const &uncached_depot_rom) const +{ + if (_skip) { + return; } + + if (!_pkg_xml.constructed()) + return; + + typedef String<160> Path; + + /* + * Add routes given in the start node. + */ + if (_start_xml->xml().has_sub_node("route")) { + Xml_node const route = _start_xml->xml().sub_node("route"); + xml.append(route.content_base(), route.content_size()); + } + + /* + * Add routes given in the launcher definition. + */ + if (_launcher_xml.constructed() && _launcher_xml->xml().has_sub_node("route")) { + Xml_node const route = _launcher_xml->xml().sub_node("route"); + xml.append(route.content_base(), route.content_size()); + } + + /** + * Return name of depot-ROM server used for obtaining the 'path' + * + * If the depot path refers to the depot-user "local", route the + * session request to the non-cached ROM service. + */ + auto rom_server = [&] (Path const &path) { + + return (String<7>(path) == "local/") ? uncached_depot_rom + : cached_depot_rom; + }; + + /* + * Redirect config ROM request to label as given in the 'config' attribute, + * if present. We need to search the blueprint's nodes for the + * matching ROM module to rewrite the label with the configuration's path + * within the depot. + */ + if (_config_name.valid()) { + _pkg_xml->xml().for_each_sub_node("rom", [&] (Xml_node rom) { + + if (!rom.has_attribute("path")) + return; + + if (rom.attribute_value("label", Name()) != _config_name) + return; + + /* we found the node for the config ROM */ + xml.node("service", [&] () { + xml.attribute("name", "ROM"); + xml.attribute("label", "config"); + typedef String<160> Path; + Path const path = rom.attribute_value("path", Path()); + + if (cached_depot_rom.valid()) + xml.node("child", [&] () { + xml.attribute("name", rom_server(path)); + xml.attribute("label", path); }); + else + xml.node("parent", [&] () { + xml.attribute("label", path); }); + }); + }); + } + + /* + * Add common routes as defined in our config. + */ + xml.append(common.content_base(), common.content_size()); + + /* + * Add ROM routing rule with the label rewritten to the path within the + * depot. + */ + _pkg_xml->xml().for_each_sub_node("rom", [&] (Xml_node rom) { + + if (!rom.has_attribute("path")) + return; + + typedef Name Label; + Path const path = rom.attribute_value("path", Path()); + Label const label = rom.attribute_value("label", Label()); + + xml.node("service", [&] () { + xml.attribute("name", "ROM"); + xml.attribute("label_last", label); + + if (cached_depot_rom.valid()) { + xml.node("child", [&] () { + xml.attribute("name", rom_server(path)); + xml.attribute("label", path); + }); + } else { + xml.node("parent", [&] () { + xml.attribute("label", path); }); + } + }); + }); +} + + +bool Child::_defined_by_launcher() const +{ + if (_skip) { + return false; } + + /* + * If the node lacks a 'pkg' attribute, we expect the + * policy to be defined by a launcher XML snippet. + */ + return _start_xml.constructed() && !_start_xml->xml().has_attribute("pkg"); +} + + +Archive::Path Child::_config_pkg_path() const +{ + if (_skip) { + return Archive::Path(); } + + if (_defined_by_launcher() && _launcher_xml.constructed()) + return _launcher_xml->xml().attribute_value("pkg", Archive::Path()); + + return _start_xml->xml().attribute_value("pkg", Archive::Path()); +} + + +Child::Launcher_name Child::_launcher_name() const +{ + if (_skip) { + return Launcher_name(); } + + if (!_defined_by_launcher()) + return Launcher_name(); + + if (_start_xml->xml().has_attribute("launcher")) + return _start_xml->xml().attribute_value("launcher", Launcher_name()); + + return _start_xml->xml().attribute_value("name", Launcher_name()); +} + + +bool Child::_configured() const +{ + if (_skip) { + return false; } + + return _pkg_xml.constructed() + && (_config_pkg_path() == _blueprint_pkg_path); +} + + +void Child::_gen_provides_sub_node(Xml_generator &xml, + Xml_node service, + Xml_node::Type const &node_type, + Service::Name const &service_name) +{ + if (service.type() == node_type) + xml.node("service", [&] () { + xml.attribute("name", service_name); }); +} + + +void Child::_gen_copy_of_sub_node(Xml_generator &xml, + Xml_node from_node, + Xml_node::Type const &sub_node_type) +{ + if (!from_node.has_sub_node(sub_node_type.string())) + return; + + Xml_node const sub_node = from_node.sub_node(sub_node_type.string()); + xml.append(sub_node.addr(), sub_node.size()); +} + + +Child::Child(Allocator &alloc, + Xml_node start_node, + Timer::Connection &timer, + Signal_context_capability const &config_handler) +: + _skip { start_node.attribute_value("skip", false) }, + _alloc { alloc }, + _start_xml { _alloc, start_node }, + _name { _start_xml->xml().attribute_value("name", Name()) }, + _timer { timer }, + _config_handler { config_handler } +{ } + + +void Child::log_session_write(Log_event::Line const &log_line) +{ + if (_skip) { + return; } + + enum { ASCII_ESC = 27 }; + enum { ASCII_LF = 10 }; + enum { ASCII_TAB = 9 }; + + struct Break : Exception { }; + + + struct Skip_escape_sequence + { + char const * const base; + size_t const size; + }; + struct Replace_ampersend_sequence + { + char const * const base; + size_t const size; + char const by; + }; + static Skip_escape_sequence skip_esc_seq[5] + { + { "[0m", 3 }, + { "[31m", 4 }, + { "[32m", 4 }, + { "[33m", 4 }, + { "[34m", 4 }, + }; + static Replace_ampersend_sequence replace_amp_seq[3] + { + { "lt;", 3, '<' }, + { "amp;", 4, '&' }, + { "#42;", 4, '*' } + }; + + /* calculate timestamp that prefixes*/ + unsigned long const time_us { _timer.curr_time().trunc_to_plain_us().value - init_time_us }; + unsigned long time_ms { time_us / 1000UL }; + unsigned long const time_sec { time_ms / 1000UL }; + time_ms = time_ms - time_sec * 1000UL; + + char const *const log_base { log_line.string() }; + char const *const log_end { log_base + strlen(log_base) }; + try { + char const *log_print { log_base }; + _log_events.for_each([&] (Log_event &log_event) { + + bool match { false }; + char const *pattern_end { log_event.remaining_end() }; + char const *pattern_curr { log_event.remaining_base() }; + char const *log_curr { log_base }; + + for (;;) { + + /* handle end of pattern */ + if (pattern_curr == pattern_end) { + match = true; + log_event.remaining_base() = log_event.base(); + log_event.reset_to() = log_event.base(); + log_event.reset_retry() = false; + break; + } + /* skip irrelevant characters in the pattern */ + if (*pattern_curr == ASCII_LF || *pattern_curr == ASCII_TAB) { + pattern_curr++; + continue; + } + if (*pattern_curr == '*') { + pattern_curr++; + log_event.reset_to() = pattern_curr; + log_event.reset_retry() = false; + continue; + } + /* handle end of log line */ + if (log_curr == log_end) { + log_event.remaining_base() = pattern_curr; + break; + } + /* skip irrelevant characters in the log line */ + if (*log_curr == ASCII_LF) { + + /* forward to our log session a complete line */ + if (log_print < log_curr) { + forward_to_log(time_sec, time_ms, log_print, log_curr); + log_print = log_curr + 1; + } + log_curr++; + continue; + } + if (*log_curr == ASCII_TAB) { + log_curr++; + continue; + } + /* skip irrelevant escape sequences in the log line */ + if (*log_curr == ASCII_ESC) { + + bool seq_match { false }; + + for (unsigned i = 0; i < sizeof(skip_esc_seq)/sizeof(skip_esc_seq[0]); i++) { + + char const *seq_curr { skip_esc_seq[i].base }; + char const *seq_end { seq_curr + skip_esc_seq[i].size }; + + for (char const *log_seq_curr { log_curr + 1 } ; ; log_seq_curr++, seq_curr++) { + + if (seq_curr == seq_end) { + seq_match = true; + log_curr = log_seq_curr; + break; + } + if (log_seq_curr == log_end) { + break; } + + if (*log_seq_curr != *seq_curr) { + break; } + } + if (seq_match) { + break; } + } + if (seq_match) { + continue; } + } + char pattern_curr_san = *pattern_curr; + size_t pattern_curr_san_sz = 1; + + /* replace ampersend sequences in the pattern */ + if (*pattern_curr == '&') { + + bool seq_match { false }; + + for (unsigned i = 0; i < sizeof(replace_amp_seq)/sizeof(replace_amp_seq[0]); i++) { + + char const *seq_curr { replace_amp_seq[i].base }; + char const *seq_end { seq_curr + replace_amp_seq[i].size }; + + for (char const *pattern_seq_curr { pattern_curr + 1 } ; ; pattern_seq_curr++, seq_curr++) { + + if (seq_curr == seq_end) { + seq_match = true; + pattern_curr_san = replace_amp_seq[i].by; + pattern_curr_san_sz = replace_amp_seq[i].size + 1; + break; + } + if (pattern_seq_curr == pattern_end) { + break; } + + if (*pattern_seq_curr != *seq_curr) { + break; } + } + if (seq_match) { + break; + } + } + } + /* check if log keeps matching pattern */ + if (*log_curr != pattern_curr_san) { + pattern_curr = log_event.reset_to(); + if (!log_event.reset_retry()) { + + log_curr++; } + else { + log_event.reset_retry() = false; } + } else { + pattern_curr += pattern_curr_san_sz; + log_curr++; + log_event.reset_retry() = true; + } + } + /* forward to our log session what is left */ + if (log_print < log_curr) { + for (;; log_curr++) { + + if (log_curr == log_end) { + + forward_to_log(time_sec, time_ms, log_print, log_curr); + log_print = log_curr; + break; + } + if (*log_curr == ASCII_LF) { + + forward_to_log(time_sec, time_ms, log_print, log_curr); + log_print = log_curr + 1; + break; + } + } + } + /* check if log line finished a match with the pattern */ + if (!match) { + return; } + + /* execute event handler and stop trying further events */ + event_occured(log_event, time_us); + throw Break(); + }); + } + catch (...) { } +} + + +void Child::apply_config(Xml_node start_node) +{ + if (_skip) { + return; } + + /* + * String-compare new with current start node to quicky skip + * the start nodes that have not changed. + */ + bool const start_node_changed = + (start_node.size() != _start_xml->xml().size()) || + (strcmp(start_node.addr(), _start_xml->xml().addr(), + start_node.size()) != 0); + + if (!start_node_changed) + return; + + Archive::Path const old_pkg_path = _config_pkg_path(); + + /* import new start node */ + _start_xml.construct(_alloc, start_node); + + Archive::Path const new_pkg_path = _config_pkg_path(); + + /* invalidate blueprint if 'pkg' path changed */ + if (old_pkg_path != new_pkg_path) { + _blueprint_pkg_path = new_pkg_path; + _pkg_xml.destruct(); + + /* reset error state, attempt to obtain the blueprint again */ + _pkg_incomplete = false; + } +} + + +void Child::apply_blueprint(Xml_node pkg) +{ + if (_skip) { + return; } + + if (pkg.attribute_value("path", Archive::Path()) != _blueprint_pkg_path) + return; + + try { + Xml_node const runtime = pkg.sub_node("runtime"); + + /* package was missing but is installed now */ + _pkg_incomplete = false; + + _pkg_ram_quota = runtime.attribute_value("ram", Number_of_bytes()); + _pkg_cap_quota = runtime.attribute_value("caps", 0UL); + + _binary_name = runtime.attribute_value("binary", Binary_name()); + _config_name = runtime.attribute_value("config", Config_name()); + + /* keep copy of the blueprint info */ + _pkg_xml.construct(_alloc, pkg); + } + catch (Xml_node::Nonexistent_sub_node) { + error("missing runtime subnode in packege blueprint"); + } +} + + +void Child::apply_launcher(Launcher_name const &name, + Xml_node launcher) +{ + if (_skip) { + return; } + + if (!_defined_by_launcher()) + return; + + if (_launcher_name() != name) + return; + + if (_launcher_xml.constructed()) { + bool const launcher_changed = + (launcher.size() != _launcher_xml->xml().size()) || + (strcmp(launcher.addr(), _launcher_xml->xml().addr(), + launcher.size()) != 0); + + if (!launcher_changed) + return; + } + + _launcher_xml.construct(_alloc, launcher); + + _blueprint_pkg_path = _config_pkg_path(); +} + + +Child::State_name Child::_padded_state_name() const +{ + if (_skip) { + return "?"; } + + switch (_state) { + case SUCCEEDED: return "ok "; + case FAILED: return "failed "; + case UNFINISHED: ; + } + return "?"; +} + + +void Child::conclusion(int &result) +{ + log(" ", _conclusion); + if (_state != SUCCEEDED) { + result = -1; } +} + + +void Child::mark_as_incomplete(Xml_node missing) +{ + if (_skip) { + return; } + + /* print error message only once */ + if(_pkg_incomplete) + return; + + Archive::Path const path = missing.attribute_value("path", Archive::Path()); + if (path != _blueprint_pkg_path) + return; + + log(path, " incomplete or missing"); + + _pkg_incomplete = true; +} + + +void Child::reset_incomplete() +{ + if (_skip) { + return; } + + if (_pkg_incomplete) { + _pkg_incomplete = false; + _pkg_xml.destruct(); + } +} + + +bool Child::gen_query(Xml_generator &xml) const +{ + if (_skip) { + return false; } + + if (_configured() || _pkg_incomplete) + return false; + + if (_defined_by_launcher() && !_launcher_xml.constructed()) + return false; + + xml.node("blueprint", [&] () { + xml.attribute("pkg", _blueprint_pkg_path); }); + + return true; +} + + +void Child::gen_installation_entry(Xml_generator &xml) const +{ + if (_skip) { + return; } + + if (!_pkg_incomplete) return; + + xml.node("archive", [&] () { + xml.attribute("path", _config_pkg_path()); + xml.attribute("source", "no"); + }); +} + + +void Child::event_occured(Event const &event, + unsigned long const time_us) +{ + if (_skip) { + return; } + + if (_state != UNFINISHED) { + return; } + + if (event.meaning() == "succeeded") { _finished(SUCCEEDED, event, time_us); } + else if (event.meaning() == "failed" ) { _finished(FAILED, event, time_us); } +} + + +void Child::_finished(State state, + Event const &event, + unsigned long const time_us) +{ + if (_skip) { + return; } + + _running = false; + _state = state; + + unsigned long time_ms { time_us / 1000UL }; + unsigned long const time_sec { time_ms / 1000UL }; + time_ms = time_ms - time_sec * 1000UL; + + char name_padded[32]; + for (size_t i = 0; i < sizeof(name_padded) - 1; name_padded[i++] = ' '); + name_padded[sizeof(name_padded) - 1] = '\0'; + memcpy(name_padded, _name.string(), min(_name.length() - 1, sizeof(name_padded) - 1)); + + if (event.has_type(Event::Type::LOG)) { + + enum { MAX_EXPL_SZ = 32 }; + + Log_event const &log_event = *static_cast(&event); + + char const *const pattern_base = log_event.base(); + size_t const pattern_sz = log_event.size(); + char const *const pattern_end = pattern_base + pattern_sz; + + char const *expl_base = pattern_base; + for (; expl_base < pattern_end && *expl_base < 33; expl_base++) ; + + char const *expl_end = expl_base; + for (; expl_end < pattern_end && *expl_end > 31; expl_end++) ; + + size_t const expl_sz = min((size_t)(expl_end - expl_base), (size_t)MAX_EXPL_SZ); + + _conclusion = Conclusion { + Cstring(name_padded), " ", _padded_state_name(), " ", + time_sec < 10 ? " " : time_sec < 100 ? " " : "", time_sec, ".", + time_ms < 10 ? "00" : time_ms < 100 ? "0" : "", time_ms, + " log \"", Cstring(expl_base, expl_sz), + expl_sz < MAX_EXPL_SZ ? "" : " ...", "\"" }; + + } else if (event.has_type(Event::Type::TIMEOUT)) { + + Timeout_event const &timeout_event = *static_cast(&event); + + _conclusion = Conclusion { + Cstring(name_padded), " ", _padded_state_name(), " ", + time_sec < 10 ? " " : time_sec < 100 ? " " : "", time_sec, ".", + time_ms < 10 ? "00" : time_ms < 100 ? "0" : "", time_ms, + " timeout ", timeout_event.sec(), " sec" }; + + } else { + + _conclusion = Conclusion { _padded_state_name(), " ", _name }; + + } + log(""); + log(" ", _conclusion); + _config_handler.submit(); +} + + +/******************* + ** Timeout_event ** + *******************/ + +Timeout_event::Timeout_event(Timer::Connection &timer, + Child &child, + Xml_node const &event) +: + Event { event, Type::TIMEOUT }, + _child { child }, + _timer { timer }, + _sec { event.attribute_value("sec", 0UL) }, + _timeout { timer, *this, &Timeout_event::_handle_timeout } +{ + if (!_sec) { + throw Invalid(); } + + _timeout.schedule(Microseconds(_sec * 1000 * 1000)); +} + + +void Timeout_event::_handle_timeout(Duration) +{ + _child.event_occured(*this, _timer.curr_time().trunc_to_plain_us().value - _child.init_time_us); +} + + +/*************** + ** Log_event ** + ***************/ + +Log_event::Log_event(Xml_node const &xml) +: + Event { xml, Type::LOG }, + _base { xml.content_base() }, + _size { xml.content_size() }, + _remaining_base { xml.content_base() }, + _remaining_end { _remaining_base + xml.content_size() }, + _reset_to { xml.content_base() } +{ } + + +/*********** + ** Event ** + ***********/ + +Event::Event(Xml_node const &node, + Type type) +: + _meaning { node.attribute_value("meaning", Meaning_string()) }, + _type { type } +{ + if (_meaning != Meaning_string("failed") && + _meaning != Meaning_string("succeeded")) + { + throw Invalid(); + } +} diff --git a/repos/gems/src/app/depot_autopilot/child.h b/repos/gems/src/app/depot_autopilot/child.h new file mode 100644 index 0000000000..feb83718d2 --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/child.h @@ -0,0 +1,303 @@ +/* + * \brief Child representation + * \author Norman Feske + * \date 2018-01-23 + */ + +/* + * Copyright (C) 2018 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +#ifndef _CHILD_H_ +#define _CHILD_H_ + +/* Genode includes */ +#include +#include +#include +#include +#include +#include +#include +#include + +/* local includes */ +#include + +namespace Depot_deploy { + + using namespace Depot; + + class Child; + class Event; + class Timeout_event; + class Log_event; +} + + +class Depot_deploy::Event +{ + public: + + using Meaning_string = Genode::String<12>; + + struct Invalid : Genode::Exception { }; + + enum class Type { LOG, TIMEOUT }; + + private: + + Meaning_string const _meaning; + Type const _type; + + public: + + Event(Genode::Xml_node const &node, + Type type); + + bool has_type(Type type) const { return _type == type; }; + + Meaning_string const &meaning() const { return _meaning; } +}; + + +class Depot_deploy::Log_event : public Event, + public List::Element +{ + public: + + using Line = Genode::String; + + private: + + char const *_base; + Genode::size_t const _size; + char const *_remaining_base; + char const *_remaining_end; + bool _reset_retry { false }; + char const *_reset_to; + + public: + + Log_event(Genode::Xml_node const &xml); + + + /*************** + ** Accessors ** + ***************/ + + Genode::size_t size() const { return _size; } + char const * base() const { return _base; } + char const * &reset_to() { return _reset_to; } + bool &reset_retry() { return _reset_retry; } + char const * &remaining_base() { return _remaining_base; } + char const * &remaining_end() { return _remaining_end; } +}; + + +class Depot_deploy::Timeout_event : public Event, + public List::Element +{ + private: + + Child &_child; + Timer::Connection &_timer; + unsigned long const _sec; + Timer::One_shot_timeout _timeout; + + void _handle_timeout(Duration); + + public: + + struct Invalid : Exception { }; + + Timeout_event(Timer::Connection &timer, + Child &child, + Genode::Xml_node const &event); + + /*************** + ** Accessors ** + ***************/ + + unsigned long sec() const { return _sec; } +}; + + +class Depot_deploy::Child : public List_model::Element +{ + public: + + typedef String<100> Name; + typedef String<80> Binary_name; + typedef String<80> Config_name; + typedef String<32> Depot_rom_server; + typedef String<16> State_name; + typedef String<100> Launcher_name; + typedef String<128> Conclusion; + + private: + + /* + * State of the condition check for generating the start node of + * the child. I.e., if the child is complete and configured but + * a used server component is missing, we need to suppress the start + * node until the condition is satisfied. + */ + enum Condition { UNCHECKED, SATISFIED, UNSATISFIED }; + enum State { UNFINISHED, SUCCEEDED, FAILED }; + + bool const _skip; + Allocator &_alloc; + Reconstructible _start_xml; + Constructible _launcher_xml { }; + Constructible _pkg_xml { }; + Condition _condition { UNCHECKED }; + Name const _name; + Archive::Path _blueprint_pkg_path { _config_pkg_path() }; + Number_of_bytes _pkg_ram_quota { 0 }; + unsigned long _pkg_cap_quota { 0 }; + Binary_name _binary_name { }; + Config_name _config_name { }; + bool _pkg_incomplete { false }; + List _timeout_events { }; + List _log_events { }; + Timer::Connection &_timer; + State _state { UNFINISHED }; + Signal_transmitter _config_handler; + bool _running { false }; + Conclusion _conclusion { }; + + bool _defined_by_launcher() const; + + Archive::Path _config_pkg_path() const; + + Launcher_name _launcher_name() const; + + bool _configured() const; + + void _gen_routes(Xml_generator &, + Xml_node , + Depot_rom_server const &, + Depot_rom_server const &) const; + + static void _gen_provides_sub_node(Xml_generator &xml, + Xml_node service, + Xml_node::Type const &node_type, + Service::Name const &service_name); + + static void _gen_copy_of_sub_node(Xml_generator &xml, + Xml_node from_node, + Xml_node::Type const &sub_node_type); + + void _finished(State state, + Event const &event, + unsigned long const time_us); + + State_name _padded_state_name() const; + + public: + + unsigned long init_time_us { 0 }; + + Child(Genode::Allocator &alloc, + Genode::Xml_node start_node, + Timer::Connection &timer, + Genode::Signal_context_capability const &config_handler); + + void log_session_write(Log_event::Line const &log_line); + + void conclusion(int &result); + + void event_occured(Event const &event, + unsigned long const time_us); + + void apply_config(Xml_node start_node); + + void apply_blueprint(Xml_node pkg); + + void apply_launcher(Launcher_name const &name, + Xml_node launcher); + + void mark_as_incomplete(Xml_node missing); + + /** + * Reconsider deployment of child after installing missing archives + */ + void reset_incomplete(); + + bool gen_query(Xml_generator &xml) const; + + /** + * Generate start node of init configuration + * + * \param common session routes to be added in addition to + * the ones found in the pkg blueprint + * \param cached_depot_rom name of the server that provides the depot + * content as ROM modules. If the string is + * invalid, ROM requests are routed to the + * parent. + * \param uncached_depot_rom name of the depot-ROM server used to obtain + * the content of the depot user "local", which + * is assumed to be mutable + */ + void gen_start_node(Xml_generator &, + Xml_node common, + Depot_rom_server const &cached_depot_rom, + Depot_rom_server const &uncached_depot_rom); + + /** + * Generate installation entry needed for the completion of the child + */ + void gen_installation_entry(Xml_generator &xml) const; + + template + void apply_if_unsatisfied(FN const &fn) const + { + if (_skip) { + return; } + + Xml_node launcher_xml = _launcher_xml.constructed() + ? _launcher_xml->xml() + : Xml_node(""); + + if (_condition == UNSATISFIED && _start_xml.constructed()) + fn(_start_xml->xml(), launcher_xml); + } + + /* + * \return true if condition changed + */ + template + bool apply_condition(COND_FN const &fn) + { + if (_skip) { + return false; } + + Condition const orig_condition = _condition; + + Xml_node launcher_xml = _launcher_xml.constructed() + ? _launcher_xml->xml() + : Xml_node(""); + + if (_start_xml.constructed()) + _condition = fn(_start_xml->xml(), launcher_xml) + ? SATISFIED : UNSATISFIED; + + return _condition != orig_condition; + } + + + /*************** + ** Accessors ** + ***************/ + + Name name() const { return _name; } + bool pkg_incomplete() const { return _pkg_incomplete; } + bool running() const { return _running; } + bool finished() const { return _state != UNFINISHED; } +}; + +#endif /* _CHILD_H_ */ diff --git a/repos/gems/src/app/depot_autopilot/children.h b/repos/gems/src/app/depot_autopilot/children.h new file mode 100644 index 0000000000..223d919d7f --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/children.h @@ -0,0 +1,230 @@ +/* + * \brief State tracking of subsystems deployed from depot packages + * \author Norman Feske + * \date 2018-01-23 + */ + +/* + * Copyright (C) 2018 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +#ifndef _CHILDREN_H_ +#define _CHILDREN_H_ + +/* Genode includes */ +#include +#include +#include +#include + +/* local includes */ +#include "child.h" +#include + +namespace Depot_deploy { class Children; } + + +class Depot_deploy::Children +{ + private: + + Genode::Allocator &_alloc; + Timer::Connection &_timer; + Genode::Signal_context_capability const &_config_handler; + Local::Const_pointer _curr_child { }; + + List_model _children { }; + + struct Model_update_policy : List_model::Update_policy + { + Genode::Allocator &_alloc; + Timer::Connection &_timer; + Genode::Signal_context_capability const &_config_handler; + + Model_update_policy(Genode::Allocator &alloc, + Timer::Connection &timer, + Genode::Signal_context_capability const &config_handler) + : + _alloc { alloc }, + _timer { timer }, + _config_handler { config_handler } + { } + + void destroy_element(Child &c) { destroy(_alloc, &c); } + + Child &create_element(Xml_node node) + { + return *new (_alloc) + Child { _alloc, node, _timer, _config_handler }; + } + + void update_element(Child &c, Xml_node node) { c.apply_config(node); } + + static bool element_matches_xml_node(Child const &child, Xml_node node) + { + return node.attribute_value("name", Child::Name()) == child.name(); + } + + static bool node_is_element(Xml_node node) { return node.has_type("start"); } + + } _model_update_policy { _alloc, _timer, _config_handler }; + + public: + + struct No_match : Exception { }; + struct Finished : Exception { }; + + Children(Genode::Allocator &alloc, + Timer::Connection &timer, + Genode::Signal_context_capability const &config_handler) + : + _alloc { alloc }, + _timer { timer }, + _config_handler { config_handler } + { } + + void apply_config(Xml_node config) + { + _children.update_from_xml(_model_update_policy, config); + } + + void apply_launcher(Child::Launcher_name const &name, Xml_node launcher) + { + _children.for_each([&] (Child &child) { + child.apply_launcher(name, launcher); }); + } + + void apply_blueprint(Xml_node blueprint) + { + blueprint.for_each_sub_node("pkg", [&] (Xml_node pkg) { + _children.for_each([&] (Child &child) { + child.apply_blueprint(pkg); }); }); + + blueprint.for_each_sub_node("missing", [&] (Xml_node missing) { + _children.for_each([&] (Child &child) { + child.mark_as_incomplete(missing); }); }); + } + + /* + * \return true if the condition of any child changed + */ + template + bool apply_condition(COND_FN const &fn) + { + bool any_condition_changed = false; + _children.for_each([&] (Child &child) { + any_condition_changed |= child.apply_condition(fn); }); + return any_condition_changed; + } + + /** + * Call 'fn' with start 'Xml_node' of each child that has an + * unsatisfied start condition. + */ + template + void for_each_unsatisfied_child(FN const &fn) const + { + _children.for_each([&] (Child const &child) { + child.apply_if_unsatisfied(fn); }); + } + + void reset_incomplete() + { + _children.for_each([&] (Child &child) { + child.reset_incomplete(); }); + } + + bool gen_start_nodes(Xml_generator &xml, Xml_node common, + Child::Depot_rom_server const &cached_depot_rom, + Child::Depot_rom_server const &uncached_depot_rom) + { + struct Break : Exception { }; + bool finished = true; + try { + _children.for_each([&] (Child &child) { + + child.gen_start_node(xml, common, cached_depot_rom, uncached_depot_rom); + + if (!child.finished()) { + finished = false; + throw Break(); + } + }); + } + catch (Break) { } + return finished; + } + + int conclusion() + { + int result = 0; + _children.for_each([&] (Child &child) { + child.conclusion(result); + }); + return result; + } + + void gen_queries(Xml_generator &xml) + { + try { + Child const &child = _curr_child(); + if (child.finished()) { + throw Local::Const_pointer::Invalid(); } + + child.gen_query(xml); + } + catch (Local::Const_pointer::Invalid) { + struct Break : Exception { }; + try { + _children.for_each([&] (Child const &child) { + if (child.gen_query(xml)) { + _curr_child = child; + throw Break(); + } + }); + } catch (Break) { } + } + } + + void gen_installation_entries(Xml_generator &xml) const + { + _children.for_each([&] (Child const &child) { + child.gen_installation_entry(xml); }); + } + + bool any_incomplete() const { + + bool result = false; + _children.for_each([&] (Child const &child) { + result |= child.pkg_incomplete(); }); + return result; + } + + bool exists(Child::Name const &name) const + { + bool result = false; + _children.for_each([&] (Child const &child) { + if (child.name() == name) + result = true; }); + return result; + } + + + Child &find_by_name(Child::Name const &name) + { + Child *result = nullptr; + _children.for_each([&] (Child const &child) { + if (child.name() == name) { + result = const_cast(&child); } + }); + if (!result) { + throw No_match(); } + + return *result; + } +}; + +#endif /* _CHILDREN_H_ */ diff --git a/repos/gems/src/app/depot_autopilot/config.xsd b/repos/gems/src/app/depot_autopilot/config.xsd new file mode 100644 index 0000000000..6336b4f491 --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/config.xsd @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/repos/gems/src/app/depot_autopilot/list.h b/repos/gems/src/app/depot_autopilot/list.h new file mode 100644 index 0000000000..6f896499c1 --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/list.h @@ -0,0 +1,49 @@ +/* + * \brief Genode list with additional functions needed by NIC router + * \author Martin Stein + * \date 2016-08-19 + */ + +/* + * Copyright (C) 2016-2017 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +#ifndef _LIST_H_ +#define _LIST_H_ + +/* Genode includes */ +#include +#include + +namespace Depot_deploy { template class List; } + + +template +struct Depot_deploy::List : Genode::List +{ + using Base = Genode::List; + + template + void for_each(FUNC && functor) + { + for (LT *elem = Base::first(); elem; ) + { + LT *const next = elem->Base::Element::next(); + functor(*elem); + elem = next; + } + } + + void destroy_each(Genode::Deallocator &dealloc) + { + while (LT *elem = Base::first()) { + Base::remove(elem); + destroy(dealloc, elem); + } + } +}; + +#endif /* _LIST_H_ */ diff --git a/repos/gems/src/app/depot_autopilot/main.cc b/repos/gems/src/app/depot_autopilot/main.cc new file mode 100644 index 0000000000..5f0c62e3e4 --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/main.cc @@ -0,0 +1,200 @@ +/* + * \brief Tool for turning a subsystem blueprint into an init configuration + * \author Norman Feske + * \date 2017-07-07 + */ + +/* + * Copyright (C) 2017 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +/* Genode includes */ +#include +#include +#include +#include +#include +#include + +/* local includes */ +#include "children.h" + +namespace Depot_deploy { + + class Log_session_component; + class Log_root; + struct Main; +} + + +class Depot_deploy::Log_session_component : public Rpc_object +{ + private: + + Session_label const _child_label; + Child &_child; + + public: + + Log_session_component(Session_label const &child_label, + Child &child) + : + _child_label(child_label), + _child(child) + { } + + size_t write(String const &line) override + { + if (_child.finished()) { + return 0; } + + Log_event::Line line_labeled{ "[", _child_label.string(), "] ", line.string() }; + _child.log_session_write(line_labeled); + return strlen(line.string()); + } +}; + + +class Depot_deploy::Log_root : public Root_component +{ + public: + + Children &_children; + Session_label const &_children_label_prefix; + + Log_root(Entrypoint &ep, + Allocator &md_alloc, + Children &children, + Session_label const &children_label_prefix) + : + Root_component { ep, md_alloc }, + _children { children }, + _children_label_prefix { children_label_prefix } + { } + + Log_session_component *_create_session(const char *args, Affinity const &) + { + using Name_delimiter = String<5>; + + Session_label const label { label_from_args(args) }; + size_t const label_prefix_len { strlen(_children_label_prefix.string()) }; + Session_label const label_prefix { Cstring(label.string(), label_prefix_len) }; + + if (label_prefix != _children_label_prefix) { + warning("LOG session label does not have children label-prefix"); + throw Service_denied(); + } + char const *const name_base { label.string() + label_prefix_len }; + Name_delimiter const name_delim { " -> " }; + + size_t name_len { 0 }; + for (char const *str = name_base; str[name_len] && + name_delim != Name_delimiter(str + name_len); name_len++); + + Child::Name name { Cstring(name_base, name_len) }; + char const *const label_base { name_base + name_len }; + + try { + return new (md_alloc()) + Log_session_component(Session_label("init", label_base), + _children.find_by_name(name)); + } + catch (Children::No_match) { + warning("Cannot find child by LOG session label"); + throw Service_denied(); + } + } +}; + + +struct Depot_deploy::Main +{ + typedef String<128> Name; + + Env &_env; + Attached_rom_dataspace _config { _env, "config" }; + Attached_rom_dataspace _blueprint { _env, "blueprint" }; + Expanding_reporter _query_reporter { _env, "query" , "query"}; + Expanding_reporter _init_config_reporter { _env, "config", "init.config"}; + Heap _heap { _env.ram(), _env.rm() }; + Reconstructible _children_label_prefix { }; + Timer::Connection _timer { _env }; + Signal_handler
_config_handler { _env.ep(), *this, &Main::_handle_config }; + Children _children { _heap, _timer, _config_handler }; + Log_root _log_root { _env.ep(), _heap, _children, *_children_label_prefix }; + + void _handle_config() + { + _config.update(); + _blueprint.update(); + + Xml_node const config = _config.xml(); + + _children_label_prefix.construct(config.attribute_value("children_label_prefix", String<160>())); + _children.apply_config(config); + _children.apply_blueprint(_blueprint.xml()); + + /* determine CPU architecture of deployment */ + typedef String<16> Arch; + Arch const arch = config.attribute_value("arch", Arch()); + if (!arch.valid()) + warning("config lacks 'arch' attribute"); + + /* generate init config containing all configured start nodes */ + bool finished; + _init_config_reporter.generate([&] (Xml_generator &xml) { + Xml_node static_config = config.sub_node("static"); + xml.append(static_config.content_base(), static_config.content_size()); + Child::Depot_rom_server const parent { }; + finished = _children.gen_start_nodes(xml, config.sub_node("common_routes"), + parent, parent); + }); + if (finished) { + + unsigned long previous_time_sec { 0UL }; + if (config.has_sub_node("previous-results")) { + previous_time_sec += config.sub_node("previous-results").attribute_value("time_sec", 0UL); + } + unsigned long const time_us { _timer.curr_time().trunc_to_plain_us().value }; + unsigned long time_ms { time_us / 1000UL }; + unsigned long const time_sec { time_ms / 1000UL }; + time_ms = time_ms - time_sec * 1000UL; + + log("\n--- Finished after ", time_sec + previous_time_sec, ".", time_ms < 10 ? "00" : time_ms < 100 ? "0" : "", time_ms, " sec ---\n"); + if (config.has_sub_node("previous-results")) { + Xml_node const previous_results = config.sub_node("previous-results"); + if (previous_results.content_size()) { + log(Cstring(previous_results.content_base(), previous_results.content_size())); + } + } + int result = _children.conclusion(); + log(""); + _env.parent().exit(result); + + } + + /* update query for blueprints of all unconfigured start nodes */ + if (arch.valid()) { + _query_reporter.generate([&] (Xml_generator &xml) { + xml.attribute("arch", arch); + _children.gen_queries(xml); + }); + } + } + + Main(Env &env) : _env(env) + { + _config .sigh(_config_handler); + _blueprint.sigh(_config_handler); + + _handle_config(); + _env.parent().announce(_env.ep().manage(_log_root)); + } +}; + + +void Component::construct(Genode::Env &env) { static Depot_deploy::Main main(env); } + diff --git a/repos/gems/src/app/depot_autopilot/pointer.h b/repos/gems/src/app/depot_autopilot/pointer.h new file mode 100644 index 0000000000..ea90b58fa8 --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/pointer.h @@ -0,0 +1,80 @@ +/* + * \brief Pointer that can be dereferenced only when valid + * \author Martin Stein + * \date 2016-08-24 + */ + +/* + * Copyright (C) 2016-2017 Genode Labs GmbH + * + * This file is part of the Genode OS framework, which is distributed + * under the terms of the GNU Affero General Public License version 3. + */ + +#ifndef _POINTER_H_ +#define _POINTER_H_ + +/* Genode includes */ +#include + +namespace Local { + + template class Pointer; + template class Const_pointer; +} + + +template +class Local::Pointer +{ + private: + + T *_obj; + + public: + + struct Invalid : Genode::Exception { }; + + Pointer() : _obj(nullptr) { } + + Pointer(T &obj) : _obj(&obj) { } + + T &operator () () const + { + if (_obj == nullptr) + throw Invalid(); + + return *_obj; + } + + bool valid() const { return _obj != nullptr; } +}; + + +template +class Local::Const_pointer +{ + private: + + T const *_obj; + + public: + + struct Invalid : Genode::Exception { }; + + Const_pointer() : _obj(nullptr) { } + + Const_pointer(T const &obj) : _obj(&obj) { } + + T const &operator () () const + { + if (_obj == nullptr) + throw Invalid(); + + return *_obj; + } + + bool valid() const { return _obj != nullptr; } +}; + +#endif /* _POINTER_H_ */ diff --git a/repos/gems/src/app/depot_autopilot/target.mk b/repos/gems/src/app/depot_autopilot/target.mk new file mode 100644 index 0000000000..de47693952 --- /dev/null +++ b/repos/gems/src/app/depot_autopilot/target.mk @@ -0,0 +1,5 @@ +TARGET = depot_autopilot +SRC_CC = main.cc child.cc +INC_DIR += $(PRG_DIR) +LIBS += base +CONFIG_XSD = config.xsd diff --git a/repos/libports/run/ada.run b/repos/libports/run/ada.run deleted file mode 100644 index 34e9f02a89..0000000000 --- a/repos/libports/run/ada.run +++ /dev/null @@ -1,35 +0,0 @@ -build "core init test/ada" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so ada.lib.so init test-ada" - -append qemu_args "-nographic " - -run_genode_until {child "test-ada" exited with exit value 0.*} 20 - -grep_output {init -> test-ada} -unify_output {0x[0-9a-f]+} "UNIFIED" - -compare_output_to { - [init -> test-ada] add called with a=13, b=14, result at address UNIFIED - [init -> test-ada] print_int called with argument 27 -} diff --git a/repos/libports/run/ada_exception.run b/repos/libports/run/ada_exception.run deleted file mode 100644 index 837e8ddd3f..0000000000 --- a/repos/libports/run/ada_exception.run +++ /dev/null @@ -1,33 +0,0 @@ -build "core init test/ada_exception" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so ada.lib.so init test-ada_exception" - -append qemu_args "-nographic " - -run_genode_until {child "test-ada_secondary_stack" exited with exit value 0.*} 20 - -grep_output {successful} - -compare_output_to { - [init -> test-ada_secondary_stack] secondary stack test successful -} diff --git a/repos/libports/run/ada_secondary_stack.run b/repos/libports/run/ada_secondary_stack.run deleted file mode 100644 index 1f548ad508..0000000000 --- a/repos/libports/run/ada_secondary_stack.run +++ /dev/null @@ -1,33 +0,0 @@ -build "core init test/ada_secondary_stack" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so ada.lib.so init test-ada_secondary_stack" - -append qemu_args "-nographic " - -run_genode_until {child "test-ada_secondary_stack" exited with exit value 0.*} 20 - -grep_output {successful} - -compare_output_to { - [init -> test-ada_secondary_stack] secondary stack test successful -} diff --git a/repos/libports/run/expat.run b/repos/libports/run/expat.run deleted file mode 100644 index 7e64758011..0000000000 --- a/repos/libports/run/expat.run +++ /dev/null @@ -1,81 +0,0 @@ -# -# \brief Test for using the expat library -# \author Christian Prochaska -# \date 2012-06-12 -# - -# -# Build -# - -build { core init drivers/timer test/expat } - -create_boot_directory - -# -# Generate config -# - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -# -# Boot modules -# - -build_boot_image { - core init timer - ld.lib.so libc.lib.so vfs.lib.so vfs.lib.so vfs.lib.so expat.lib.so posix.lib.so - test-expat -} - -# -# Execute test case -# - -append qemu_args " -nographic " - -run_genode_until {.*child "test-expat" exited with exit value 0.*} 5 - -grep_output {\[init -> test-expat\] } - -compare_output_to { -[init -> test-expat] start of element: config -[init -> test-expat] start of element: test_tag -[init -> test-expat] attribute: name='test_attribute', value='test_value' -[init -> test-expat] end of element: test_tag -[init -> test-expat] end of element: config -} - -# vi: set ft=tcl : diff --git a/repos/libports/run/ldso.run b/repos/libports/run/ldso.run deleted file mode 100644 index cbc80284ab..0000000000 --- a/repos/libports/run/ldso.run +++ /dev/null @@ -1,146 +0,0 @@ -build "core init test/ldso" - -create_boot_directory - -set config { - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -set boot_modules { - core init test-ldso test-ldso_lib_1.lib.so - test-ldso_lib_2.lib.so test-ldso_lib_dl.lib.so - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so -} - -build_boot_image $boot_modules - -append qemu_args "-nographic " - -run_genode_until {child ".*" exited with exit value 123.*\n} 20 - -# pay only attention to the output of init and its children -grep_output {^\[init } -unify_output {\[init \-\> test\-ldso\] upgrading quota donation for .* \([0-9]+ bytes\)} "" -unify_output {ram_quota=[0-9]+} "ram_quota=UNIFIED" -unify_output {cap_quota=[0-9]+} "cap_quota=UNIFIED" -trim_lines - -compare_output_to { -[init -> test-ldso] Lib_2_global 11223343 -[init -> test-ldso] Lib_1_global_1 5060707 -[init -> test-ldso] Lib_1_global_2 1020303 -[init -> test-ldso] lib_1_attr_constructor_2 4030200f -[init -> test-ldso] lib_1_attr_constructor_1 8070604f -[init -> test-ldso] Global_1 5060707 -[init -> test-ldso] Global_2 1020303 -[init -> test-ldso] attr_constructor_2 4030200f -[init -> test-ldso] attr_constructor_1 8070604f -[init -> test-ldso] -[init -> test-ldso] Dynamic-linker test -[init -> test-ldso] =================== -[init -> test-ldso] -[init -> test-ldso] Global objects and local static objects of program -[init -> test-ldso] -------------------------------------------------- -[init -> test-ldso] global_1 5060706 -[init -> test-ldso] global_2 1020302 -[init -> test-ldso] Local_1 5060707f -[init -> test-ldso] local_1 5060707e -[init -> test-ldso] Local_2 1020303f -[init -> test-ldso] local_2 1020303e -[init -> test-ldso] pod_1 8070604e -[init -> test-ldso] pod_2 4030200e -[init -> test-ldso] -[init -> test-ldso] Access shared lib from program -[init -> test-ldso] ------------------------------ -[init -> test-ldso] lib_2_global 11223342 -[init -> test-ldso] Lib_1_local_3 12345677 -[init -> test-ldso] lib_1_local_3 12345676 -[init -> test-ldso] lib_1_pod_1 8070604d -[init -> test-ldso] Libc::read: -[init -> test-ldso] Error: no plugin found for read(3) -[init -> test-ldso] Libc::abs(-10): 10 -[init -> test-ldso] -[init -> test-ldso] Catch exceptions in program -[init -> test-ldso] --------------------------- -[init -> test-ldso] exception in remote procedure call: -[init -> test-ldso] Error: ROM-session creation failed (ram_quota=UNIFIED, cap_quota=UNIFIED, label="unknown_file") -[init -> test-ldso] Error: Could not open ROM session for "unknown_file" -[init -> test-ldso] caught -[init -> test-ldso] exception in program: caught -[init -> test-ldso] exception in shared lib: caught -[init -> test-ldso] exception in dynamic linker: caught -[init -> test-ldso] -[init -> test-ldso] global objects and local static objects of shared lib -[init -> test-ldso] ----------------------------------------------------- -[init -> test-ldso] lib_1_global_1 5060706 -[init -> test-ldso] lib_1_global_2 1020302 -[init -> test-ldso] Lib_1_local_1 5060707f -[init -> test-ldso] lib_1_local_1 5060707e -[init -> test-ldso] Lib_1_local_2 1020303f -[init -> test-ldso] lib_1_local_2 1020303e -[init -> test-ldso] lib_1_pod_1 8070604e -[init -> test-ldso] lib_1_pod_2 4030200e -[init -> test-ldso] -[init -> test-ldso] Access shared lib from another shared lib -[init -> test-ldso] ----------------------------------------- -[init -> test-ldso] lib_2_global 11223341 -[init -> test-ldso] Lib_2_local 55667787 -[init -> test-ldso] lib_2_local 55667786 -[init -> test-ldso] lib_2_pod_1 87654320 -[init -> test-ldso] -[init -> test-ldso] Catch exceptions in shared lib -[init -> test-ldso] ------------------------------ -[init -> test-ldso] exception in lib: caught -[init -> test-ldso] exception in another shared lib: caught -[init -> test-ldso] -[init -> test-ldso] Test stack alignment -[init -> test-ldso] -------------------- -[init -> test-ldso] -[init -> test-ldso] -[init -> test-ldso] -[init -> test-ldso] -[init -> test-ldso] -[init -> test-ldso] Dynamic cast -[init -> test-ldso] ------------ -[init -> test-ldso] 'Object' called: good -[init -> test-ldso] -[init -> test-ldso] Shared-object API -[init -> test-ldso] ----------------- -[init -> test-ldso] Global object constructed -[init -> test-ldso] -[init -> test-ldso] Destruction -[init -> test-ldso] ----------- -[init -> test-ldso] ~Lib_2_local 55667785 -[init -> test-ldso] ~Lib_1_local_2 1020303d -[init -> test-ldso] ~Lib_1_local_1 5060707d -[init -> test-ldso] ~Lib_1_local_3 12345675 -[init -> test-ldso] ~Local_2 1020303d -[init -> test-ldso] ~Local_1 5060707d -[init -> test-ldso] attr_destructor_2 4030200d -[init -> test-ldso] attr_destructor_1 8070604c -[init -> test-ldso] ~Global_2 1020301 -[init -> test-ldso] ~Global_1 5060705 -[init -> test-ldso] ~Lib_1_global_2 1020301 -[init -> test-ldso] ~Lib_1_global_1 5060705 -[init -> test-ldso] ~Lib_2_global 11223340 -} diff --git a/repos/libports/run/libc.run b/repos/libports/run/libc.run deleted file mode 100644 index 48d328019a..0000000000 --- a/repos/libports/run/libc.run +++ /dev/null @@ -1,42 +0,0 @@ -build "core init drivers/timer test/libc" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image { - core init timer test-libc - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so -} - -append qemu_args " -nographic " - -run_genode_until "child .* exited with exit value 0.*\n" 13 diff --git a/repos/libports/run/libc_counter.run b/repos/libports/run/libc_counter.run deleted file mode 100644 index ca181a59ba..0000000000 --- a/repos/libports/run/libc_counter.run +++ /dev/null @@ -1,84 +0,0 @@ -# -# Build -# - -set build_components { - core init drivers/timer server/terminal_crosslink test/libc_counter -} - -build $build_components - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - - -set boot_modules { - core init timer terminal_crosslink - test-libc_counter-source test-libc_counter-sink - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so -} - -build_boot_image $boot_modules - -append qemu_args "-nographic " - -# -# Execute test case -# - -run_genode_until "child \"test-libc_counter-sink\" exited with exit value 0.*\n" 30 - -# vi: set ft=tcl : diff --git a/repos/libports/run/libc_getenv.run b/repos/libports/run/libc_getenv.run deleted file mode 100644 index c27c318a94..0000000000 --- a/repos/libports/run/libc_getenv.run +++ /dev/null @@ -1,49 +0,0 @@ -build "core init test/libc_getenv" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image { - core init test-libc_getenv - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so -} - -append qemu_args " -nographic " - -run_genode_until "child .* exited with exit value 0.*\n" 20 - -grep_output {\[init -\> test-libc_getenv\]} - -compare_output_to { -[init -> test-libc_getenv] foo="bar" -[init -> test-libc_getenv] bar="foo" -[init -> test-libc_getenv] baz="(null)" -} diff --git a/repos/libports/run/libc_pipe.run b/repos/libports/run/libc_pipe.run deleted file mode 100644 index b6ce704b38..0000000000 --- a/repos/libports/run/libc_pipe.run +++ /dev/null @@ -1,39 +0,0 @@ -build "core init test/libc_pipe" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image { - core init test-libc_pipe posix.lib.so - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so libc_pipe.lib.so pthread.lib.so -} - -append qemu_args " -nographic " - -run_genode_until "child .* exited with exit value 0.*\n" 20 - diff --git a/repos/libports/run/libc_vfs.run b/repos/libports/run/libc_vfs.run deleted file mode 100644 index 5c4e5d7bab..0000000000 --- a/repos/libports/run/libc_vfs.run +++ /dev/null @@ -1,73 +0,0 @@ -# -# \brief Test for using the libc_vfs plugin -# \author Norman Feske -# \date 2014-04-10 -# - -# -# Build -# - -build { core init server/ram_fs test/libc_vfs } - -create_boot_directory - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - - - - - - - } -append_if [have_include "power_on/qemu"] config { - } -append config { - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -build_boot_image { - core init - ld.lib.so libc.lib.so vfs.lib.so - ram_fs test-libc_vfs -} - -# -# Execute test case -# - -append qemu_args " -nographic " -run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 60 - -# vi: set ft=tcl : diff --git a/repos/libports/run/libc_vfs_block.run b/repos/libports/run/libc_vfs_block.run deleted file mode 100644 index 2ed97bd94d..0000000000 --- a/repos/libports/run/libc_vfs_block.run +++ /dev/null @@ -1,87 +0,0 @@ -# -# \brief Test for using the block-session support of the libc_vfs plugin -# \author Norman Feske -# \date 2016-01-28 -# - -# -# Build -# - -build { core init server/ram_blk test/libc_vfs_block } - -create_boot_directory - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -build_boot_image { - core init - ld.lib.so libc.lib.so vfs.lib.so - ram_blk test-libc_vfs_block -} - -# -# Execute test case -# - -append qemu_args " -nographic " -run_genode_until {.*child "test-libc_vfs_block" exited with exit value 0.*} 60 - diff --git a/repos/libports/run/libc_vfs_counter.run b/repos/libports/run/libc_vfs_counter.run deleted file mode 100644 index e35ef11e10..0000000000 --- a/repos/libports/run/libc_vfs_counter.run +++ /dev/null @@ -1,96 +0,0 @@ -# -# Build -# - -set build_components { - core init drivers/timer server/terminal_crosslink server/vfs - test/libc_counter -} - -build $build_components - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - - -set boot_modules { - core init timer terminal_crosslink vfs - test-libc_counter-source test-libc_counter-sink - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so -} - -build_boot_image $boot_modules - -append qemu_args "-nographic " - -# -# Execute test case -# - -run_genode_until "child \"test-libc_counter-sink\" exited with exit value 0.*\n" 30 - -# vi: set ft=tcl : diff --git a/repos/libports/run/libc_vfs_fs.run b/repos/libports/run/libc_vfs_fs.run deleted file mode 100644 index 4c4df94112..0000000000 --- a/repos/libports/run/libc_vfs_fs.run +++ /dev/null @@ -1,76 +0,0 @@ -# -# \brief Test for using the vfs server -# \author Emery Hemingway -# \date 2015-08-17 -# - -# -# Build -# - -build { core init server/vfs test/libc_vfs } - -create_boot_directory - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - - - - - - - - - - } -append_if [have_include "power_on/qemu"] config { - } -append config { - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -build_boot_image { - core init vfs - ld.lib.so libc.lib.so vfs.lib.so - test-libc_vfs -} - -# -# Execute test case -# - -append qemu_args " -nographic " -run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 60 - -# vi: set ft=tcl : diff --git a/repos/libports/run/libc_vfs_fs_chained.run b/repos/libports/run/libc_vfs_fs_chained.run deleted file mode 100644 index d9d6ecc67e..0000000000 --- a/repos/libports/run/libc_vfs_fs_chained.run +++ /dev/null @@ -1,94 +0,0 @@ -# -# \brief Test for using the vfs server -# \author Emery Hemingway -# \date 2015-08-17 -# - -# -# Build -# - -build { core init server/vfs test/libc_vfs } - -create_boot_directory - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } -append_if [have_include "power_on/qemu"] config { - } -append config { - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -build_boot_image { - core init vfs - ld.lib.so libc.lib.so vfs.lib.so - test-libc_vfs -} - -# -# Execute test case -# - -append qemu_args " -nographic " -run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 60 - -# vi: set ft=tcl : diff --git a/repos/libports/run/libc_vfs_ram.run b/repos/libports/run/libc_vfs_ram.run deleted file mode 100644 index 6e90e5fd71..0000000000 --- a/repos/libports/run/libc_vfs_ram.run +++ /dev/null @@ -1,70 +0,0 @@ -# -# \brief Test for using the vfs local ram_fs -# \author Norman Feske -# \date 2014-04-10 -# -# \author Emery Hemingway -# \date 2015-07-21 -# - -# -# Build -# - -build { core init test/libc_vfs } - -create_boot_directory - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - } -append_if [have_include "power_on/qemu"] config { - } -append config { - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -build_boot_image { - core init - ld.lib.so libc.lib.so vfs.lib.so - test-libc_vfs -} - -# -# Execute test case -# - -append qemu_args " -nographic " -run_genode_until {.*child "test-libc_vfs" exited with exit value 0.*} 60 - -# vi: set ft=tcl : diff --git a/repos/libports/run/pthread.run b/repos/libports/run/pthread.run deleted file mode 100644 index 01f8dde114..0000000000 --- a/repos/libports/run/pthread.run +++ /dev/null @@ -1,37 +0,0 @@ -build "core init test/pthread" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image { - core init test-pthread - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so pthread.lib.so posix.lib.so -} - -append qemu_args " -nographic " - -run_genode_until {--- returning from main ---.*\n} 20 diff --git a/repos/libports/run/python.run b/repos/libports/run/python.run deleted file mode 100644 index c2e23846e7..0000000000 --- a/repos/libports/run/python.run +++ /dev/null @@ -1,102 +0,0 @@ -# -# \brief Test for running python -# \author Norman Feske -# \date 2011-11-22 -# - -if {![have_spec x86]} { - puts "Run script is only supported on x86"; exit 0 } - -# -# Build -# - -build { - core init - test/python -} - -create_boot_directory - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - - - - -print " \r\n\r"; -print " -============================-"; -print " || ||"; -print " || Python Core 2.6.4 ||"; -print " || ||"; -print " || Genode 11.11 ||"; -print " || ||"; -print " -============================-"; -print " \r"; -print " 2011 by Genode Labs www.genode-labs.com"; -print " \r\n\r"; - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -# generic modules -set boot_modules { - core init - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so python.lib.so posix.lib.so - test-python -} - -build_boot_image $boot_modules - -# -# Execute test case -# - -append qemu_args " -nographic " - -run_genode_until {.*child "test-python" exited with exit value 0.*} 60 - -grep_output {test-python\] } -compare_output_to { -[init -> test-python] -[init -> test-python] -============================- -[init -> test-python] || || -[init -> test-python] || Python Core 2.6.4 || -[init -> test-python] || || -[init -> test-python] || Genode 11.11 || -[init -> test-python] || || -[init -> test-python] -============================- -[init -> test-python] -[init -> test-python] 2011 by Genode Labs www.genode-labs.com -[init -> test-python] -} - -# vi: set ft=tcl : diff --git a/repos/libports/run/rust.run b/repos/libports/run/rust.run deleted file mode 100644 index 5446642001..0000000000 --- a/repos/libports/run/rust.run +++ /dev/null @@ -1,29 +0,0 @@ -build "core init test/rust" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core init test-rust ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so" - -append qemu_args "-nographic " - -run_genode_until { 42 } 20 - -puts "Test succeeded" diff --git a/repos/libports/run/sequence.run b/repos/libports/run/sequence.run deleted file mode 100644 index 2cea344a8c..0000000000 --- a/repos/libports/run/sequence.run +++ /dev/null @@ -1,118 +0,0 @@ -# -# \brief Test of sequence utility -# \author Emery Hemingway -# \date 2017-08-09 -# - -# -# Build -# - -build { app/sequence test/libc } - -create_boot_directory - -import_from_depot \ - genodelabs/src/[base_src] \ - genodelabs/src/init \ - genodelabs/src/vfs \ - -# -# Generate config -# - -set config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -build_boot_image { - sequence - libc.lib.so vfs.lib.so libm.lib.so posix.lib.so - test-libc -} - -# -# Execute test case -# - -append qemu_args " -nographic " -run_genode_until {.*child "sequence" exited with exit value 0.*} 30 - -# vi: set ft=tcl : diff --git a/repos/libports/run/stdcxx.run b/repos/libports/run/stdcxx.run deleted file mode 100644 index 225f05aec1..0000000000 --- a/repos/libports/run/stdcxx.run +++ /dev/null @@ -1,51 +0,0 @@ -assert_spec linux - -build "core init test/stdcxx" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - -} - -build_boot_image { - core init test-stdcxx - ld.lib.so libc.lib.so vfs.lib.so libm.lib.so stdcxx.lib.so posix.lib.so -} - -append qemu_args " -nographic " - -run_genode_until ".*test-stdcxx finished.*\n" 20 - -grep_output {^\[init } - -compare_output_to { -[init -> test-stdcxx] ° °° °°° test-stdcxx started °°° °° ° -[init -> test-stdcxx] 2015.000000 - 5.000000 - 4 -[init -> test-stdcxx] 2015 - 5 - 4 -[init -> test-stdcxx] 123 -[init -> test-stdcxx] 456 -[init -> test-stdcxx] 7.8 -[init -> test-stdcxx] caught std::invalid_argument -[init -> test-stdcxx] 1 -[init -> test-stdcxx] 2 -[init -> test-stdcxx] ° °° °°° test-stdcxx finished °°° °° ° -} diff --git a/repos/libports/run/tcp_bulk.inc b/repos/libports/run/tcp_bulk.inc deleted file mode 100644 index 8e45d63b39..0000000000 --- a/repos/libports/run/tcp_bulk.inc +++ /dev/null @@ -1,112 +0,0 @@ -create_boot_directory - -append build_components { - core init - drivers/timer - server/nic_bridge - server/nic_loopback - test/tcp -} - -append_socket_fs_build_components - -build $build_components - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <} [socket_fs_plugin] { ip_addr="192.168.1.1" netmask="255.255.255.0"/> - - - - - - - - - - - - - - - - - - - - <} [socket_fs_plugin] { ip_addr="192.168.1.2" netmask="255.255.255.0"/> - - - - - - - - - - -} - -install_config $config - -append boot_modules { - core ld.lib.so init timer - nic_bridge - nic_loopback - posix.lib.so libc.lib.so libm.lib.so vfs.lib.so vfs_lwip.lib.so - test-tcp -} - -append_socket_fs_boot_modules - -build_boot_image $boot_modules - -append qemu_args " -nographic" - -run_genode_until {child "recv" exited with exit value 0} 240 - -# vi: set ft=tcl : diff --git a/repos/libports/run/tcp_bulk_lwip.run b/repos/libports/run/tcp_bulk_lwip.run deleted file mode 100644 index fe9f4f914e..0000000000 --- a/repos/libports/run/tcp_bulk_lwip.run +++ /dev/null @@ -1,2 +0,0 @@ -source ${genode_dir}/repos/libports/run/vfs_lwip.inc -source ${genode_dir}/repos/libports/run/tcp_bulk.inc diff --git a/repos/libports/run/tcp_bulk_lxip.run b/repos/libports/run/tcp_bulk_lxip.run deleted file mode 100644 index 3c5b333692..0000000000 --- a/repos/libports/run/tcp_bulk_lxip.run +++ /dev/null @@ -1,2 +0,0 @@ -source ${genode_dir}/repos/dde_linux/run/vfs_lxip.inc -source ${genode_dir}/repos/libports/run/tcp_bulk.inc diff --git a/repos/libports/src/test/ada_exception/main.cc b/repos/libports/src/test/ada_exception/main.cc index 6872adb240..06731e0fc2 100644 --- a/repos/libports/src/test/ada_exception/main.cc +++ b/repos/libports/src/test/ada_exception/main.cc @@ -15,6 +15,7 @@ #include #include +#include extern "C" void except__raise_task(); @@ -22,7 +23,10 @@ void Component::construct(Genode::Env &env) { Genode::log("Ada exception test"); - except__raise_task(); - - env.parent().exit(0); + try { except__raise_task(); } + catch (Ada::Exception::Program_Error) { + Genode::log("Caught Ada::Exception::Program_Error"); + env.parent().exit(0); + } + env.parent().exit(-1); } diff --git a/repos/os/run/blk.run b/repos/os/run/blk.run deleted file mode 100644 index d8100d2b27..0000000000 --- a/repos/os/run/blk.run +++ /dev/null @@ -1,51 +0,0 @@ -# -# \brief Test of Block session interface -# \author Stefan Kalkowski -# \date 2013-12-10 -# - -# -# Build -# -build { core init drivers/timer test/blk } -create_boot_directory - -# -# Generate config -# -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - } - -# -# Boot modules -# -build_boot_image { core ld.lib.so init timer test-blk-srv test-blk-cli } - -append qemu_args " -nographic " -run_genode_until "Tests finished successfully.*\n" 100 diff --git a/repos/os/run/blk_cache.run b/repos/os/run/blk_cache.run deleted file mode 100644 index 092e1ac2cb..0000000000 --- a/repos/os/run/blk_cache.run +++ /dev/null @@ -1,70 +0,0 @@ -# -# \brief Test of Block session interface provided by server/blk_cache -# - -# -# Build -# -build { - core init - drivers/timer - server/blk_cache - test/blk -} -create_boot_directory - -# -# Generate config -# -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } - -# -# Boot modules -# -build_boot_image { core ld.lib.so init timer test-blk-srv blk_cache test-blk-cli } - -# -# Qemu -# -append qemu_args " -nographic " - -run_genode_until "Tests finished successfully.*\n" 60 diff --git a/repos/os/run/clipboard.run b/repos/os/run/clipboard.run deleted file mode 100644 index 51cbd4670d..0000000000 --- a/repos/os/run/clipboard.run +++ /dev/null @@ -1,104 +0,0 @@ -# -# Build -# - -set build_components { - core init drivers/timer - server/clipboard server/report_rom test/clipboard drivers/timer -} - -build $build_components - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -set boot_modules { core ld.lib.so init timer report_rom clipboard test-clipboard } - -build_boot_image $boot_modules - -append qemu_args " -nographic " - -run_genode_until {.*-- state WAIT_FOR_SUCCESS --.*\n} 40 - - diff --git a/repos/os/run/dynamic_config.run b/repos/os/run/dynamic_config.run deleted file mode 100644 index 8801c4d46e..0000000000 --- a/repos/os/run/dynamic_config.run +++ /dev/null @@ -1,47 +0,0 @@ -build "core init test/dynamic_config" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer test-dynamic_config test-dynamic_config_server" - -append qemu_args "-nographic " - -run_genode_until {obtained counter value 11 from config.*} 100 - -puts "Test succeeded" diff --git a/repos/os/run/dynamic_config_loader.run b/repos/os/run/dynamic_config_loader.run deleted file mode 100644 index 4b5f0a1ce9..0000000000 --- a/repos/os/run/dynamic_config_loader.run +++ /dev/null @@ -1,46 +0,0 @@ -build "core init drivers/timer server/loader test/dynamic_config" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer loader test-dynamic_config test-dynamic_config_loader" - -append qemu_args "-nographic " - -run_genode_until {obtained counter value 11 from config.*} 100 - -puts "Test succeeded" diff --git a/repos/os/run/dynamic_config_slave.run b/repos/os/run/dynamic_config_slave.run deleted file mode 100644 index 403fba261b..0000000000 --- a/repos/os/run/dynamic_config_slave.run +++ /dev/null @@ -1,36 +0,0 @@ -build "core init test/dynamic_config" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer test-dynamic_config test-dynamic_config_master" - -append qemu_args "-nographic " - -run_genode_until {obtained counter value 11 from config.*} 100 - -puts "Test succeeded" diff --git a/repos/os/run/fault_detection.run b/repos/os/run/fault_detection.run deleted file mode 100644 index 5cc436d502..0000000000 --- a/repos/os/run/fault_detection.run +++ /dev/null @@ -1,79 +0,0 @@ -# -# \brief Test reflection of segmentation faults to the user land -# \author Norman Feske -# \date 2012-11-01 -# - -if {[have_spec pistachio]} { - puts "Pistachio is unsupported (see https://github.com/genodelabs/genode/issues/16)" - exit 0 -} -if {[have_spec fiasco]} { - puts "Fiasco is unsupported (see run script for details)" - # - # The L4/Fiasco kernel has known problems with the destruction of threads - # that are currently participating in IPC (the "red-thread issue"). The - # fault-detection test reliably triggers the problem. Since the development - # of the kernel has been stopped, however, this issue is expected to remain - # unresolved. Newer kernels such as Fiasco.OC do not have the problem. - # - exit 0 -} - -# -# Build -# - -build { core init server/loader test/fault_detection test/segfault } - -create_boot_directory - -# -# Generate config -# - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -# -# Boot modules -# - -# generic modules -set boot_modules { core ld.lib.so init loader test-fault_detection test-segfault } - -build_boot_image $boot_modules - -# -# Execute test case -# - -append qemu_args "-nographic " - -run_genode_until "--- finished fault_detection test ---.*\n" 30 diff --git a/repos/os/run/fs_log.run b/repos/os/run/fs_log.run deleted file mode 100644 index b852830eb8..0000000000 --- a/repos/os/run/fs_log.run +++ /dev/null @@ -1,73 +0,0 @@ -# -# Test logging to file system -# - -build { - core init drivers/timer - server/vfs server/fs_log - test/bomb -} - -set timeout 240 -set rounds 20 - -set config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -create_boot_directory - -install_config $config - -build_boot_image "core init ld.lib.so bomb timer vfs fs_log vfs.lib.so" - -append qemu_args " -nographic" - -run_genode_until {.*\[0] Done\..*\n} $timeout diff --git a/repos/os/run/fs_packet.run b/repos/os/run/fs_packet.run deleted file mode 100644 index 0d0a76d847..0000000000 --- a/repos/os/run/fs_packet.run +++ /dev/null @@ -1,101 +0,0 @@ -# -# \brief Test of packet handling and signal scheduling -# \author Emery Hemingway -# \date 2018-07-03 -# - -if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} { - puts "Running fs_packet test in autopilot on Qemu is not recommended.\n" - exit -} - -# -# Build -# -set build_components { - app/sequence - lib/vfs/jitterentropy - server/vfs - test/fs_packet -} - -build $build_components - -create_boot_directory - -import_from_depot \ - genodelabs/src/[base_src] \ - genodelabs/src/init \ - -# -# Generate config -# -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# -set boot_modules { - sequence - test-fs_packet - vfs - vfs.lib.so - vfs_jitterentropy.lib.so -} - -build_boot_image $boot_modules - -append qemu_args " -nographic" - -run_genode_until {child "short-test" exited with exit value 0} 120 diff --git a/repos/os/run/fs_rom_update.run b/repos/os/run/fs_rom_update.run deleted file mode 100644 index 2ef71a6094..0000000000 --- a/repos/os/run/fs_rom_update.run +++ /dev/null @@ -1,116 +0,0 @@ -# -# Build -# -set build_components { - core init - app/rom_logger - app/rom_to_file - drivers/timer - server/dynamic_rom - server/fs_rom - server/ram_fs -} - -build $build_components - -create_boot_directory - -# -# Generate config -# -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - dynamic_rom - fs_rom - ram_fs - rom_logger - rom_to_file - timer -} - -build_boot_image $boot_modules - -append qemu_args " -nographic" - -run_genode_until {.*.*} 60 diff --git a/repos/os/run/fs_rom_update_fs.run b/repos/os/run/fs_rom_update_fs.run deleted file mode 100644 index 8978654689..0000000000 --- a/repos/os/run/fs_rom_update_fs.run +++ /dev/null @@ -1,139 +0,0 @@ -# -# Build -# -set build_components { - core init - app/rom_logger - app/rom_to_file - drivers/timer - server/dynamic_rom - server/fs_rom - server/vfs -} - -build $build_components - -create_boot_directory - -# -# Generate config -# -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - dynamic_rom - fs_rom - rom_logger - rom_to_file - timer - vfs - vfs.lib.so -} - -build_boot_image $boot_modules - -append qemu_args " -nographic" - -run_genode_until {.*.*} 60 diff --git a/repos/os/run/fs_rom_update_ram.run b/repos/os/run/fs_rom_update_ram.run deleted file mode 100644 index 6738576940..0000000000 --- a/repos/os/run/fs_rom_update_ram.run +++ /dev/null @@ -1,124 +0,0 @@ -# -# Build -# -set build_components { - core init - app/rom_logger - app/rom_to_file - drivers/timer - server/dynamic_rom - server/fs_rom - server/vfs -} - -build $build_components - -create_boot_directory - -# -# Generate config -# -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - dynamic_rom - fs_rom - rom_logger - rom_to_file - timer - vfs - vfs.lib.so -} - -build_boot_image $boot_modules - -append qemu_args " -nographic" - -run_genode_until {.*.*} 60 diff --git a/repos/os/run/init.run b/repos/os/run/init.run deleted file mode 100644 index 31837bf22f..0000000000 --- a/repos/os/run/init.run +++ /dev/null @@ -1,1554 +0,0 @@ -# -# Build -# - -set build_components { core init drivers/timer server/report_rom app/dummy test/init } - -build $build_components - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -set boot_modules { core ld.lib.so init timer report_rom test-init dummy } - -build_boot_image $boot_modules - -append qemu_args " -nographic " - -run_genode_until {.*child "test-init" exited with exit value 0.*} 300 - diff --git a/repos/os/run/init_loop.run b/repos/os/run/init_loop.run deleted file mode 100644 index 711765561d..0000000000 --- a/repos/os/run/init_loop.run +++ /dev/null @@ -1,68 +0,0 @@ -create_boot_directory - -import_from_depot genodelabs/src/[base_src] \ - genodelabs/src/report_rom - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build { lib/ld init app/dummy test/init_loop } - -build_boot_image { ld.lib.so init dummy test-init_loop } - -append qemu_args " -nographic " - -run_genode_until {.*child "test-init_loop" exited with exit value 0.*} 100 - diff --git a/repos/os/run/lx_block.run b/repos/os/run/lx_block.run deleted file mode 100644 index df9181903c..0000000000 --- a/repos/os/run/lx_block.run +++ /dev/null @@ -1,59 +0,0 @@ -# -# Test runs only on Linux -# -assert_spec linux - -# -# Build -# -build { core init drivers/timer server/lx_block test/blk/bench } - -create_boot_directory - -# -# Generate config -# -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -# -# Create test file -# -catch { exec dd if=/dev/zero of=bin/lx_block.img bs=1M count=64 } - -# -# Boot modules -# -build_boot_image { core ld.lib.so init timer lx_block lx_block.img test-blk-bench } - -run_genode_until "Done.*\n" 100 - -exec rm -f bin/lx_block.img diff --git a/repos/os/run/nic_loopback.run b/repos/os/run/nic_loopback.run deleted file mode 100644 index 01ec35db89..0000000000 --- a/repos/os/run/nic_loopback.run +++ /dev/null @@ -1,61 +0,0 @@ -# -# Build -# - -set build_components { - core init - test/nic_loopback - server/nic_loopback -} - -build $build_components - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - nic_loopback - test-nic_loopback -} - -build_boot_image $boot_modules - -append qemu_args " -nographic -serial mon:stdio " - -run_genode_until {child .* exited with exit value 0.*} 60 diff --git a/repos/os/run/part_blk.inc b/repos/os/run/part_blk.inc deleted file mode 100644 index 71e619a4e1..0000000000 --- a/repos/os/run/part_blk.inc +++ /dev/null @@ -1,145 +0,0 @@ -# -# \brief Test of Block session interface provided by server/part_blk -# - -set parted [installed_command parted] - -# -# Build -# - -build { - core init - drivers/timer - server/rom_blk - server/part_blk - server/report_rom - test/blk/cli -} - -set img_file ata.$mode.raw -set img_path bin/$img_file - -if { ![file exists $img_path] } then { - set block_count 20480 - - # create empty block device file - catch { exec dd if=/dev/zero of=$img_path bs=512 count=$block_count } - - # create two primary partitions (one is extented) and two logical paritions - puts "using parted to partition disk image" - - if { $mode == "mbr" } { - exec $parted -s $img_path mklabel msdos - exec $parted -s $img_path mkpart primary fat32 2048s 4095s - exec $parted -s $img_path mkpart extended 4096s 20479s - exec $parted -s $img_path mkpart logical fat32 6144s 10239s - exec $parted -s $img_path mkpart logical fat32 12288s 20479s - } else { - exec $parted -s $img_path mklabel gpt - exec $parted -s $img_path mkpart one fat32 2048s 4095s - exec $parted -s $img_path mkpart two fat32 4096s 20446s - } -} - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - } -if { $mode == "mbr" } { - append config { - - - - - } -} else { - append config { - - - - - } -} - -append config { - - - - - - - - - - - - - - - - - - - - - - - - } - -install_config $config - -# -# Boot modules -# - -append boot_modules { - core ld.lib.so init timer - rom_blk part_blk test-blk-cli report_rom -} -append boot_modules $img_file - -build_boot_image $boot_modules - -# -# Qemu -# - -append qemu_args " -nographic " - -run_genode_until "Tests finished successfully.*\n.*Tests finished successfully.*\n" 100 -exec rm $img_path diff --git a/repos/os/run/part_blk.run b/repos/os/run/part_blk.run deleted file mode 100644 index a2f33636fe..0000000000 --- a/repos/os/run/part_blk.run +++ /dev/null @@ -1,3 +0,0 @@ -set mode mbr - -source ${genode_dir}/repos/os/run/part_blk.inc diff --git a/repos/os/run/part_blk_gpt.run b/repos/os/run/part_blk_gpt.run deleted file mode 100644 index dbc5f82fc8..0000000000 --- a/repos/os/run/part_blk_gpt.run +++ /dev/null @@ -1,3 +0,0 @@ -set mode gpt - -source ${genode_dir}/repos/os/run/part_blk.inc diff --git a/repos/os/run/ram_fs_chunk.run b/repos/os/run/ram_fs_chunk.run deleted file mode 100644 index d4f2013eb4..0000000000 --- a/repos/os/run/ram_fs_chunk.run +++ /dev/null @@ -1,83 +0,0 @@ -# -# \brief Unit test for chunk data structure used by RAM fs -# \author Norman Feske -# \date 2012-04-19 -# - -build "core init test/ram_fs_chunk" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-ram_fs_chunk" - -append qemu_args "-nographic " - -run_genode_until {.*--- RAM filesystem chunk test finished ---.*\n} 20 - -grep_output {^\[init -> test-ram_fs_chunk\]} -unify_output { sizeof=[0-9]+} {} - -compare_output_to { - [init -> test-ram_fs_chunk] --- RAM filesystem chunk test --- - [init -> test-ram_fs_chunk] chunk sizes - [init -> test-ram_fs_chunk] level 0: payload=120 - [init -> test-ram_fs_chunk] level 1: payload=24 - [init -> test-ram_fs_chunk] level 2: payload=6 - [init -> test-ram_fs_chunk] level 3: payload=2 - [init -> test-ram_fs_chunk] write "five-o-one" at offset 0 -> content (size=10): "five-o-one" - [init -> test-ram_fs_chunk] write "five" at offset 7 -> content (size=11): "five-o-five" - [init -> test-ram_fs_chunk] write "Nuance" at offset 17 -> content (size=23): "five-o-five......Nuance" - [init -> test-ram_fs_chunk] write "YM-2149" at offset 35 -> content (size=42): "five-o-five......Nuance............YM-2149" - [init -> test-ram_fs_chunk] trunc(30) -> content (size=30): "five-o-five......Nuance......." - [init -> test-ram_fs_chunk] trunc(29) -> content (size=24): "five-o-five......Nuance." - [init -> test-ram_fs_chunk] trunc(28) -> content (size=24): "five-o-five......Nuance." - [init -> test-ram_fs_chunk] trunc(27) -> content (size=24): "five-o-five......Nuance." - [init -> test-ram_fs_chunk] trunc(26) -> content (size=24): "five-o-five......Nuance." - [init -> test-ram_fs_chunk] trunc(25) -> content (size=24): "five-o-five......Nuance." - [init -> test-ram_fs_chunk] trunc(24) -> content (size=24): "five-o-five......Nuance." - [init -> test-ram_fs_chunk] trunc(23) -> content (size=23): "five-o-five......Nuance" - [init -> test-ram_fs_chunk] trunc(22) -> content (size=22): "five-o-five......Nuanc" - [init -> test-ram_fs_chunk] trunc(21) -> content (size=21): "five-o-five......Nuan" - [init -> test-ram_fs_chunk] trunc(20) -> content (size=20): "five-o-five......Nua" - [init -> test-ram_fs_chunk] trunc(19) -> content (size=19): "five-o-five......Nu" - [init -> test-ram_fs_chunk] trunc(18) -> content (size=18): "five-o-five......N" - [init -> test-ram_fs_chunk] trunc(17) -> content (size=17): "five-o-five......" - [init -> test-ram_fs_chunk] trunc(16) -> content (size=14): "five-o-five..." - [init -> test-ram_fs_chunk] trunc(15) -> content (size=14): "five-o-five..." - [init -> test-ram_fs_chunk] trunc(14) -> content (size=14): "five-o-five..." - [init -> test-ram_fs_chunk] trunc(13) -> content (size=12): "five-o-five." - [init -> test-ram_fs_chunk] trunc(12) -> content (size=12): "five-o-five." - [init -> test-ram_fs_chunk] trunc(11) -> content (size=11): "five-o-five" - [init -> test-ram_fs_chunk] trunc(10) -> content (size=10): "five-o-fiv" - [init -> test-ram_fs_chunk] trunc(9) -> content (size=9): "five-o-fi" - [init -> test-ram_fs_chunk] trunc(8) -> content (size=8): "five-o-f" - [init -> test-ram_fs_chunk] trunc(7) -> content (size=7): "five-o-" - [init -> test-ram_fs_chunk] trunc(6) -> content (size=6): "five-o" - [init -> test-ram_fs_chunk] trunc(5) -> content (size=5): "five-" - [init -> test-ram_fs_chunk] trunc(4) -> content (size=4): "five" - [init -> test-ram_fs_chunk] trunc(3) -> content (size=3): "fiv" - [init -> test-ram_fs_chunk] trunc(2) -> content (size=2): "fi" - [init -> test-ram_fs_chunk] trunc(1) -> content (size=1): "f" - [init -> test-ram_fs_chunk] allocator: sum=0 - [init -> test-ram_fs_chunk] --- RAM filesystem chunk test finished --- -} - - diff --git a/repos/os/run/read_only_rom.run b/repos/os/run/read_only_rom.run deleted file mode 100644 index 964df7c8a5..0000000000 --- a/repos/os/run/read_only_rom.run +++ /dev/null @@ -1,58 +0,0 @@ -build { - core init - server/cached_fs_rom - server/vfs - test/immutable_rom -} - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - DONT TOUCH - - - - - - - - - - - - - - - - - - -} - -build_boot_image { - core ld.lib.so init - cached_fs_rom - test-immutable_rom - vfs vfs.lib.so -} - -append qemu_args "-nographic " - -run_genode_until {.*pd='init -> test-immutable_rom'.*} 30 diff --git a/repos/os/run/report_rom.run b/repos/os/run/report_rom.run deleted file mode 100644 index f80607bdba..0000000000 --- a/repos/os/run/report_rom.run +++ /dev/null @@ -1,76 +0,0 @@ -build "core init server/report_rom test/report_rom drivers/timer" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer report_rom test-report_rom" - -append qemu_args "-nographic " - -run_genode_until {child "test-report_rom" exited with exit value 0.*\n} 30 - -grep_output {^\[init -> test-report_rom\] .+} -unify_output {\[init \-\> test\-report_rom\] upgrading quota donation for .* \([0-9]+ bytes\)} "" -trim_lines - -compare_output_to { - [init -> test-report_rom] --- test-report_rom started --- - [init -> test-report_rom] Reporter: open session - [init -> test-report_rom] Reporter: brightness 10 - [init -> test-report_rom] ROM client: request brightness report - [init -> test-report_rom] -> - [init -> test-report_rom] Reporter: updated brightness to 77 - [init -> test-report_rom] ROM client: wait for update notification - [init -> test-report_rom] ROM client: got signal - [init -> test-report_rom] ROM client: request updated brightness report - [init -> test-report_rom] -> - [init -> test-report_rom] Reporter: close report session, wait a bit - [init -> test-report_rom] got timeout - [init -> test-report_rom] -> - [init -> test-report_rom] ROM client: ROM is available despite report was closed - OK - [init -> test-report_rom] Reporter: start reporting (while the ROM client still listens) - [init -> test-report_rom] ROM client: wait for update notification - [init -> test-report_rom] ROM client: try to open the same report again - [init -> test-report_rom] Error: Report-session creation failed (label="brightness", ram_quota=14336, cap_quota=3, buffer_size=4096) - [init -> test-report_rom] ROM client: caught Service_denied - OK - [init -> test-report_rom] --- test-report_rom finished --- -} diff --git a/repos/os/run/resource_request.run b/repos/os/run/resource_request.run deleted file mode 100644 index ace341edb1..0000000000 --- a/repos/os/run/resource_request.run +++ /dev/null @@ -1,55 +0,0 @@ -build "core init server/report_rom test/resource_request drivers/timer" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer report_rom test-resource_request" - -append qemu_args "-nographic " - -run_genode_until {child "test-resource_request" exited with exit value 0.*\n} 60 diff --git a/repos/os/run/resource_yield.run b/repos/os/run/resource_yield.run deleted file mode 100644 index 1e78569a50..0000000000 --- a/repos/os/run/resource_yield.run +++ /dev/null @@ -1,37 +0,0 @@ -build "core init test/resource_yield drivers/timer" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer test-resource_yield" - -append qemu_args "-nographic " - -run_genode_until {--- test-resource_yield finished ---.*\n} 50 diff --git a/repos/os/run/rom_blk.run b/repos/os/run/rom_blk.run deleted file mode 100644 index 0445497a3d..0000000000 --- a/repos/os/run/rom_blk.run +++ /dev/null @@ -1,34 +0,0 @@ -build "core init server/rom_blk test/rom_blk" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init rom_blk test-rom_blk" - -append qemu_args "-nographic " - -run_genode_until {.*--- ROM Block test finished ---.*\n} 20 diff --git a/repos/os/run/rom_filter.run b/repos/os/run/rom_filter.run deleted file mode 100644 index a8b2d5cbef..0000000000 --- a/repos/os/run/rom_filter.run +++ /dev/null @@ -1,145 +0,0 @@ -# -# Build -# - -set build_components { - core init drivers/timer - server/dynamic_rom server/rom_filter app/rom_logger -} - -build $build_components - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
-
- - -
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
} - -install_config $config - -# -# Boot modules -# - -set boot_modules { core ld.lib.so init timer dynamic_rom rom_filter rom_logger } - -build_boot_image $boot_modules - -append qemu_args " -nographic " - -run_genode_until {.*xray: change \(finished\).*\n} 20 - -# pay only attention to the output of the rom_logger -grep_output {^\[init -> rom_logger\] .+} -unify_output {\[init \-\> rom_logger\] upgrading quota donation for .* \([0-9]+ bytes\)} "" -trim_lines - -compare_output_to { -[init -> rom_logger] ROM 'generated': -[init -> rom_logger] -[init -> rom_logger] ROM 'generated': -[init -> rom_logger] -[init -> rom_logger] ROM 'generated': -[init -> rom_logger] -[init -> rom_logger] ROM 'generated': -[init -> rom_logger] -} - diff --git a/repos/os/run/rtc.run b/repos/os/run/rtc.run deleted file mode 100644 index 278a633f31..0000000000 --- a/repos/os/run/rtc.run +++ /dev/null @@ -1,44 +0,0 @@ -# RTC test -assert_spec x86 - -if {[have_spec linux]} { - puts "Platform not supported"; exit } - -build { core init drivers/rtc drivers/timer test/rtc } - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image { core ld.lib.so init timer rtc_drv test-rtc } - -append qemu_args " -nographic " - -run_genode_until ".*--- RTC test finished ---.*\n" 20 diff --git a/repos/os/run/signal.run b/repos/os/run/signal.run deleted file mode 100644 index d12f0134ab..0000000000 --- a/repos/os/run/signal.run +++ /dev/null @@ -1,39 +0,0 @@ -build "core init drivers/timer test/signal" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer test-signal" - -append qemu_args "-nographic " - -run_genode_until {.*--- Signalling test finished ---.*\n} 200 - -grep_output {Error: } - -compare_output_to {} diff --git a/repos/os/run/slab.run b/repos/os/run/slab.run deleted file mode 100644 index 7d3e0e7d31..0000000000 --- a/repos/os/run/slab.run +++ /dev/null @@ -1,42 +0,0 @@ -if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} { - puts "\nRunning slab benchmark in autopilot on Qemu is not recommended.\n" - exit -} - -build "core init drivers/timer test/slab" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer test-slab" - -append qemu_args "-nographic " - -run_genode_until "Test done.*\n" 100 - -puts "Test succeeded" diff --git a/repos/os/run/terminal_crosslink.run b/repos/os/run/terminal_crosslink.run deleted file mode 100644 index 74b123dba1..0000000000 --- a/repos/os/run/terminal_crosslink.run +++ /dev/null @@ -1,71 +0,0 @@ -# -# \brief Cross-link terminal test -# \author Christian Prochaska -# \date 2012-05-16 -# - -# -# Build -# - -build { - core init drivers/timer - server/terminal_crosslink test/terminal_crosslink -} - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -build_boot_image { - core ld.lib.so init timer terminal_crosslink - test-terminal_crosslink -} - -append qemu_args "-nographic " - -# -# Execute test case -# - -run_genode_until "Test succeeded.*" 5 - -# vi: set ft=tcl : diff --git a/repos/os/run/timed_semaphore.run b/repos/os/run/timed_semaphore.run deleted file mode 100644 index 2f20ed81d4..0000000000 --- a/repos/os/run/timed_semaphore.run +++ /dev/null @@ -1,57 +0,0 @@ -# -# Build -# - -build { - core init - drivers/timer - test/timed_semaphore -} - -create_boot_directory - -# -# Generate config -# - -install_config { - - - - - - - - - - - - - - - - - - - - - - -} - -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - timer - test-timed_semaphore -} - -build_boot_image $boot_modules - -append qemu_args " -nographic " - -run_genode_until {.*--- Timed semaphore test finished ---.*\n} 20 diff --git a/repos/os/run/timer.run b/repos/os/run/timer.run deleted file mode 100644 index c98b94162d..0000000000 --- a/repos/os/run/timer.run +++ /dev/null @@ -1,53 +0,0 @@ -# -# \brief Basic test for genode timer-session -# \author Martin Stein -# \date 2012-05-29 -# - -# Build program images -build { core init drivers/timer test/timer } - -# Create directory where boot files are written to -create_boot_directory - -# Define XML configuration for init -install_config { - - - - - - - - - - - - - - - - - - - - - - - -} - -# Build boot files from source binaries -build_boot_image { core ld.lib.so init timer test-timer } - -# Configure Qemu -append qemu_args " -nographic" - -# Execute test in Qemu -run_genode_until {\[init\] child \"client\" exited with exit value.*\n} 60 - -grep_output {\[init\] child \"client\" exited with exit value} - -compare_output_to { - [init] child "client" exited with exit value 0 -} diff --git a/repos/os/run/trace.run b/repos/os/run/trace.run deleted file mode 100644 index e4a1c98c35..0000000000 --- a/repos/os/run/trace.run +++ /dev/null @@ -1,74 +0,0 @@ -# -# Build -# - -set build_components { - core init - drivers/timer - test/trace - lib/trace/policy/null - app/top -} - -build $build_components - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - -# -# Boot modules -# - -# generic modules -set boot_modules { - core ld.lib.so init - timer - top - test-trace - null -} - -build_boot_image $boot_modules - -append qemu_args " -nographic -serial mon:stdio " -append_if [have_spec x86] qemu_args " -smp 2 " - -run_genode_until {.*child "test-trace" exited with exit value 0.*} 30 diff --git a/repos/os/run/trace_logger.run b/repos/os/run/trace_logger.run deleted file mode 100644 index f34ec88aef..0000000000 --- a/repos/os/run/trace_logger.run +++ /dev/null @@ -1,154 +0,0 @@ -# -# Build -# - -set build_components { - core - init - drivers/timer - server/dynamic_rom - app/cpu_burner - test/trace_logger - app/trace_logger - lib/trace/policy/null - lib/trace/policy/rpc_name -} - -build $build_components - -create_boot_directory - -# -# Generate config -# - -append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -install_config $config - - -# -# Boot modules -# - -# generic modules -set boot_modules { - core - ld.lib.so - init - timer - dynamic_rom - cpu_burner - trace_logger - test-trace_logger - null - rpc_name -} - -build_boot_image $boot_modules - -append qemu_args " -nographic " - -set done_string "" -for {set i 50} {$i <= 100} {incr i 1} { - append done_string ".*trace_logger\] $i .*\n" - append done_string ".*trace_logger\] trigger_once.*\n" - append done_string ".*trace_logger\] trigger_once.*\n" -} - -run_genode_until $done_string 60 diff --git a/repos/os/run/utf8.run b/repos/os/run/utf8.run deleted file mode 100644 index fc3ce029f6..0000000000 --- a/repos/os/run/utf8.run +++ /dev/null @@ -1,27 +0,0 @@ -build "core init test/utf8" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init test-utf8" - -append qemu_args "-nographic " - -run_genode_until {.*child "test-utf8" exited with exit value 0.*\n} 30 diff --git a/repos/os/run/vfs_stress_fs.run b/repos/os/run/vfs_stress_fs.run deleted file mode 100644 index 258972cf6e..0000000000 --- a/repos/os/run/vfs_stress_fs.run +++ /dev/null @@ -1,49 +0,0 @@ -# -# \brief VFS stress test -# \author Emery Hemingway -# \date 2015-08-30 -# - -build "core init drivers/timer server/ram_fs test/vfs_stress" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core init ld.lib.so timer ram_fs vfs_stress vfs.lib.so" - -append qemu_args "-nographic -smp cpus=6" - -run_genode_until ".*child \"vfs_stress\" exited with exit value 0.*" 180 diff --git a/repos/os/run/vfs_stress_ram.run b/repos/os/run/vfs_stress_ram.run deleted file mode 100644 index a91f3895ea..0000000000 --- a/repos/os/run/vfs_stress_ram.run +++ /dev/null @@ -1,42 +0,0 @@ -# -# \brief VFS stress test -# \author Emery Hemingway -# \date 2015-08-30 -# - -build "core init drivers/timer test/vfs_stress" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core init ld.lib.so timer vfs_stress vfs.lib.so" - -append qemu_args "-nographic -smp cpus=6" - -run_genode_until ".*child \"vfs_stress\" exited with exit value 0.*" 600 diff --git a/repos/os/run/weak_ptr.run b/repos/os/run/weak_ptr.run deleted file mode 100644 index a5a1a25bb6..0000000000 --- a/repos/os/run/weak_ptr.run +++ /dev/null @@ -1,37 +0,0 @@ -build "core init drivers/timer test/weak_ptr" - -create_boot_directory - -install_config { - - - - - - - - - - - - - - - - - - - - - - - -} - -build_boot_image "core ld.lib.so init timer test-weak_ptr" - -append qemu_args "-nographic " - -run_genode_until "--- finished test-weak_ptr ---.*\n" 30 - -puts "Test succeeded" diff --git a/tool/autopilot.list b/tool/autopilot.list index 49449b2779..ca19b771e6 100644 --- a/tool/autopilot.list +++ b/tool/autopilot.list @@ -1,51 +1,23 @@ -ada -ada_secondary_stack affinity -blk -blk_cache bomb -clipboard cpu_quota cpu_sampler cpu_sampler_noux demo +depot_autopilot depot_download depot_query -ds_ownership -dynamic_config -dynamic_config_loader -dynamic_config_slave extract -fault_detection fb_bench fetchurl_lxip fetchurl_lwip -fpu -fs_log -fs_packet fs_query -fs_report -fs_rom_update -fs_rom_update_fs -fs_rom_update_ram gdb_monitor -init -init_loop init_smp input_filter -ldso libc_fatfs -libc_getenv -libc_pipe -libc_vfs -libc_vfs_block -libc_vfs_fs -libc_vfs_fs_chained -libc_vfs_ram -log log_core lwip -lx_block lx_hybrid_ctors lx_hybrid_exception lx_hybrid_pthread_ipc @@ -61,59 +33,29 @@ netperf_lxip_bridge netperf_lxip_router netperf_lxip_usb30 netperf_lxip_wifi -new_delete nic_bridge nic_dump -nic_loopback nic_router nic_router_flood nic_router_uplinks noux noux_tool_chain_auto nvme -part_blk -part_blk_gpt ping ping_nic_router platform -pthread -python -ram_fs_chunk -read_only_rom -reconstructible -registry -report_rom -resource_request -resource_yield -rm_fault -rm_nested -rom_blk -rom_filter -rtc rump_ext2 -rust sd_card_bench seoul-auto -signal -slab smartcard solo5 -stdcxx sub_rm -synced_interface tar_rom -terminal_crosslink thread -timed_semaphore timeout -timer timer_accuracy -trace -trace_logger tz_vmm usb_hid -utf8 -mmio vbox4_ubuntu_14_04_32 vbox4_ubuntu_14_04_64 vbox4_ubuntu_16_04_32 @@ -138,10 +80,5 @@ vbox5_win7_64_raw vbox5_win7_64_share verify vfs_import -vfs_stress_fs -vfs_stress_ram vmm -weak_ptr -xml_generator -xml_node microcode