depot_autopilot: evaluate sets of test packages

This commit is contained in:
Martin Stein 2018-10-01 16:53:37 +02:00 committed by Christian Helmuth
parent 146f45f3d4
commit 2d041ac0fc
88 changed files with 2793 additions and 6513 deletions

View File

@ -1,35 +0,0 @@
build "core init test/ds_ownership"
create_boot_directory
install_config {
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<start name="test-ds_ownership" caps="100">
<resource name="RAM" quantum="10M"/>
<route><any-service><parent/></any-service></route>
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
</config>
</start>
</config>
}
build_boot_image "core ld.lib.so init test-ds_ownership"
append qemu_args "-nographic "
run_genode_until {.*test succeeded.*\n} 20

View File

@ -1,58 +0,0 @@
#
# Build
#
build "core init test/fpu"
#
# Boot image
#
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test">
<binary name="test-fpu"/>
<resource name="RAM" quantum="10M"/>
</start>
</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
}

View File

@ -1,41 +0,0 @@
#
# Build
#
build "core init test/mmio"
#
# Boot image
#
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test">
<binary name="test-mmio"/>
<resource name="RAM" quantum="10M"/>
</start>
</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

View File

@ -1,82 +0,0 @@
build "core init test/new_delete"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="ROM"/>
<service name="CPU"/>
<service name="PD"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-new_delete">
<resource name="RAM" quantum="10M"/>
</start>
</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
}

View File

@ -1,67 +0,0 @@
build "core init test/reconstructible"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-reconstructible">
<resource name="RAM" quantum="1M"/>
</start>
</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 ---
}

View File

@ -1,27 +0,0 @@
build "core init test/registry"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="CPU"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="50"/>
<start name="test-registry">
<resource name="RAM" quantum="10M"/>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<start name="test-rm_fault" caps="110">
<resource name="RAM" quantum="10M"/>
<config executable_fault_test="} [non_executable_supported] {"/>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-rm_nested">
<resource name="RAM" quantum="10M"/>
</start>
</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 {}

View File

@ -1,39 +0,0 @@
build "core init test/synced_interface"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-synced_interface">
<resource name="RAM" quantum="1M"/>
</start>
</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 ---
}

View File

@ -1,85 +0,0 @@
build "core init test/xml_generator"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="LOG"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
</parent-provides>
<default-route>
<any-service> <any-child/> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-xml_generator">
<resource name="RAM" quantum="1M"/>
</start>
</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] <config xpos="27" ypos="34">
[init -> test-xml_generator] <box width="320" height="240"/>
[init -> test-xml_generator] <label name="a test">
[init -> test-xml_generator] <sub_label/>
[init -> test-xml_generator] <another_sub_label>
[init -> test-xml_generator] <sub_sub_label/>
[init -> test-xml_generator] </another_sub_label>
[init -> test-xml_generator] </label>
[init -> test-xml_generator] <bool true="true" false="false"/>
[init -> test-xml_generator] <signed int="-1" long="-2" longlong="-3"/>
[init -> test-xml_generator] <unsigned int="1" long="2" longlong="3"/>
[init -> test-xml_generator] </config>
[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] <config>
[init -> test-xml_generator] <level1>
[init -> test-xml_generator] <level2 attr1="2271560481">
[init -> test-xml_generator] <level3 attr1="Hallo" attr2="123000">
[init -> test-xml_generator] <level4_1 attr1="true" attr2="Welt"/>
[init -> test-xml_generator] <level4_2/>
[init -> test-xml_generator] </level3>
[init -> test-xml_generator] <level3 attr1="Hallo" attr2="123001">
[init -> test-xml_generator] <level4_1 attr1="true" attr2="Welt"/>
[init -> test-xml_generator] <level4_2/>
[init -> test-xml_generator] </level3>
[init -> test-xml_generator] <level3 attr1="Hallo" attr2="123002">
[init -> test-xml_generator] <level4_1 attr1="true" attr2="Welt"/>
[init -> test-xml_generator] <level4_2/>
[init -> test-xml_generator] </level3>
[init -> test-xml_generator] </level2>
[init -> test-xml_generator] </level1>
[init -> test-xml_generator] </config>
[init -> test-xml_generator]
[init -> test-xml_generator] --- XML generator test finished ---
}

View File

@ -1,135 +0,0 @@
build "core init test/xml_node"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="CPU"/>
<service name="ROM"/>
<service name="PD"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-xml_node">
<resource name="RAM" quantum="10M"/>
</start>
</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 ---
}

View File

@ -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/<REPO>/recipes/pkg/<TEST_PKG>/archives
# repos/<REPO>/recipes/pkg/<TEST_PKG>/runtime (<content> 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 <GENODE_DIR>/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 {
<service name="ROM" label_last="} $module {"> <parent/> </service>}
}
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 {
<start name="} $test_pkg {" skip="true"/>}
} else {
append result {
<start name="} $test_pkg {" pkg="genodelabs/pkg/} $test_pkg {/} [_current_depot_archive_version pkg $test_pkg] {"/>}
}
}
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 {
<config prio_levels="2">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="TRACE"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer" priority="0">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="report_rom" priority="-1">
<binary name="report_rom"/>
<resource name="RAM" quantum="2M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="no">
<policy label="depot_autopilot -> blueprint" report="depot_query -> blueprint"/>
<policy label="depot_query -> query" report="depot_autopilot -> query"/>
<policy label="dynamic -> config" report="depot_autopilot -> init.config"/>
</config>
</start>
<start name="vfs" priority="-1">
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <tar name="depot.tar"/> </vfs>
<policy label="depot_query -> depot" root="/" />
<policy label="fs_rom -> " root="/" />
</config>
</start>
<start name="fs_rom" priority="-1">
<resource name="RAM" quantum="16M"/>
<provides> <service name="ROM"/> </provides>
</start>
<start name="depot_query" priority="-1">
<resource name="RAM" quantum="2M"/>
<config query="rom">
<vfs> <dir name="depot"> <fs label="depot"/> </dir> </vfs>
</config>
<route>
<service name="ROM" label="query"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="depot_autopilot" priority="-1">
<resource name="RAM" quantum="2M"/>
<provides> <service name="LOG"/> </provides>
<config arch="} [depot_spec] {" children_label_prefix="dynamic -> ">
<static>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="PD"/>
<service name="LOG"/>
<service name="IO_PORT"/>
<service name="RM"/>
<service name="Timer"/>
<service name="TRACE"/>
</parent-provides>
</static>
<common_routes>
} [single_test_module_routes] {
<service name="ROM" label_last="ld.lib.so"> <parent/> </service>
<service name="ROM" label_last="init"> <parent/> </service>
<service name="CPU"> <parent/> </service>
<service name="PD"> <parent/> </service>
<service name="LOG"> <parent/> </service>
<service name="IO_PORT"> <parent/> </service>
<service name="Timer"> <parent/> </service>
<service name="RM"> <parent/> </service>
<service name="TRACE"> <parent/> </service>
</common_routes>
<previous-results time_sec="} [expr ($previous_time_ms + 999) / 1000] {">} $previous_results {</previous-results>
} [test_pkgs_start_nodes] {
</config>
<route>
<service name="PD" unscoped_label="depot_autopilot"> <parent/> </service>
<service name="CPU" unscoped_label="depot_autopilot"> <parent/> </service>
<service name="LOG" unscoped_label="depot_autopilot"> <parent/> </service>
<service name="ROM" unscoped_label="depot_autopilot"> <parent/> </service>
<service name="ROM" unscoped_label="ld.lib.so"> <parent/> </service>
<service name="ROM" label="blueprint"> <child name="report_rom"/> </service>
<service name="Report" label="query"> <child name="report_rom"/> </service>
<service name="Report" label="init.config"> <child name="report_rom"/> </service>
<service name="Timer" label=""> <child name="timer"/> </service>
</route>
</start>
<start name="dynamic" caps="8000" priority="-1">
<resource name="RAM" quantum="420M"/>
<binary name="init"/>
<route>
} [single_test_module_routes] {
<service name="ROM" label_last="ld.lib.so"> <parent/> </service>
<service name="ROM" label_last="init"> <parent/> </service>
<service name="ROM" label="config"> <child name="report_rom"/> </service>
<service name="ROM"> <child name="fs_rom"/> </service>
<service name="LOG" unscoped_label="dynamic"> <parent/> </service>
<service name="LOG"> <child name="depot_autopilot"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>}
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 {\&lt;} 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 ""
}
}

View File

@ -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 {
<config>
<parent-provides>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="vfs">
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs>
<ram/>
<import>
<dir name="test-fs_report">
<inline name="devices">
<devices version="initial"/>
</inline>
</dir>
</import>
</vfs>
<policy label_prefix="fs_report -> " root="/" writeable="yes"/>
<policy label_prefix="fs_rom -> " root="/test-fs_report"/>
<policy label_prefix="test-fs_report -> " root="/test-fs_report" writeable="yes"/>
</config>
</start>
<!--
All reports sent by 'test-fs_report' are prefixed with the label of the
component. Hence, they are written to the 'test-fs_report/' subdirectory.
-->
<start name="fs_report">
<resource name="RAM" quantum="4M"/>
<provides> <service name="Report"/> </provides>
<config> <vfs> <fs/> </vfs> </config>
</start>
<start name="fs_rom">
<resource name="RAM" quantum="4M"/>
<provides> <service name="ROM"/> </provides>
<config/>
</start>
<start name="test-fs_report">
<resource name="RAM" quantum="4M"/>
<config> <vfs> <fs/> </vfs> </config>
<route>
<service name="ROM" label="devices"> <child name="fs_rom"/> </service>
<service name="ROM" label="focus"> <child name="fs_rom"/> </service>
<service name="Report" label="devices"> <child name="fs_report"/> </service>
<service name="Report" label="focus"> <child name="fs_report"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="vfs">
<resource name="RAM" quantum="12M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs>
<dir name="ram"> <ram/> </dir>
<dir name="audit"> <audit path="ram"/> </dir>
</vfs>
<default-policy root="/audit" writeable="yes"/>
</config>
</start>
<start name="test-libc_vfs">
<resource name="RAM" quantum="4M"/>
<config>
<iterations value="1"/>}
append_if [have_include "power_on/qemu"] config {
<write-read size="1M" buffer_size="8K"/>}
append config {
<vfs>
<dir name="tmp"> <fs/> </dir>
<dir name="dev"> <log/> </dir>
</vfs>
<libc stdout="/dev/log" cwd="/tmp"/>
</config>
</start>
</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 :

View File

@ -1,29 +0,0 @@
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<start name="test-magic_ring_buffer" caps="64">
<resource name="RAM" quantum="2M"/>
</start>
</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

View File

@ -1,40 +0,0 @@
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="CPU"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="pipe" caps="128">
<resource name="RAM" quantum="2M"/>
<config>
<vfs>
<rom name="config"/>
<dir name="dev"> <log/> </dir>
</vfs>
<libc stdin="/config" stdout="/dev/log"/>
</config>
</start>
</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

View File

@ -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:
! <config arch="x86_64" children_label_prefix="dynamic -> ">
! <static>
! <parent-provides>
! <service name="ROM"/>
! <service name="CPU"/>
! ...
! </parent-provides>
! </static>
! <common_routes>
! <service name="ROM" label_last="ld.lib.so"> <parent/> </service>
! <service name="ROM" label_last="init"> <parent/> </service>
! <service name="CPU"> <parent/> </service>
! ...
! </common_routes>
!
! <previous-results time_sec="3"> test-rm_fault_no_nox skipped
! test-rm_nested failed 0.653 log "Error: "</previous-results>
!
! <start name="test-mmio" pkg="genodelabs/pkg/test-mmio/2018-10-30"/>
! <start name="test-rtc" skip="true"/>
! <start name="test-xml_node" pkg="genodelabs/pkg/test-xml_node/2018-10-30"/>
! ...
! </config>
:<config arch>:
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.
:<config><static>:
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'
:<config><common_routes>:
Contains a routing configuration like in a <route> tag of an Init <start>
node that shall be added to the routing configuration of the runtime-Init
of each test.
:<config><previous-results>:
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 "&lt;", so, they can be sanitized in the
future.
:<config><previous-results time_sec>:
Contains a time in seconds that shall be added to the total time shown in
header of the overview.
:<config><start>:
Each <start> 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.
:<config><start name>:
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 <start> nodes.
:<config><start pkg>:
Defines the Genode package path of the test package in the format
"$DEPOT_USER/pkg/$NAME/$VERSION".
:<config><start skip>:
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:
! <runtime ram="32M" caps="1000" binary="init">
!
! <requires> <timer/> <nic/> </requires>
!
! <events>
! <timeout meaning="failed" sec="20" />
! <log meaning="succeeded">Ignores tabs
! and newlines but no whitespaces !
! Some XML: &lt;my-node my_attr="123"/>
! [init -> test-example] Wildcarded *text *literal star &#42; ampersand &amp;
! </log>
! </events>
!
! <content>
! <rom label="ld.lib.so"/> <rom label="test-example"/>
! </content>
!
! <config>
! <parent-provides>
! ...
! </parent-provides>
! <default-route>
! ...
! </default-route>
! <default caps="100"/>
! <start name="test-example" caps="500">
! <resource name="RAM" quantum="10M"/>
! </start>
! </config>
! </runtime>
:<runtime ram>:
Amount of RAM quota that is donated to the tests root component.
:<runtime caps>:
Amount of CAP quota that is donated to the tests root component.
:<runtime binary>:
Name of the binary of the tests root component.
:<requires>:
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.
:<events>:
Lists events that may occur during the test and that shall imply a reaction
by the Autopilot.
:<events><timeout sec>:
This event occurs when the test execution lasts the given time in seconds.
:<events><timeout meaning>:
One of "succeeded", "failed". Both imply the test to be treated as finished
(gets terminated) with the test result set to the given value.
:<events><log>:
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 "&lt;", "&amp;",
"&#42;". A character '*' in the pattern is treated as non-greedy wildcard.
:<events><log meaning>:
See <events><timeout meaning>.
:<content>:
Lists required files from the test-package build besides the root-component
binary.
:<content><rom label>:
Requirement for a file with the given name.
:<config>:
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:
! <query arch="x86_64">
! <blueprint pkg="genodelabs/pkg/test-ada/2018-11-02"/>
! </query>
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:
! <blueprint>
! <pkg name="test-ada" path="genodelabs/pkg/test-ada/2018-11-02">
! <rom label="ada.lib.so" path="genodelabs/bin/x86_64/ada/2018-11-01/ada.lib.so"/>
! <missing_rom label="ld.lib.so"/>
! ... # further <rom> and <missing_rom> tags
!
! <runtime ram="32M" caps="1000" binary="init">
! ... # content of the tests runtime file
! </runtime>
! </pkg>
! </blueprint>
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:
! <config>
! ... # content of <static> tag in Autopilot configuration
!
! <start name="test-ada" caps="1000">
! <binary name="init"/>
! <resource name="RAM" quantum="32M"/>
!
! <config ...> ... <config> # from the tests runtime file
!
! <route>
! ... # content of <common_routes> tag in Autopilot configuration
!
! # routes for each <content><rom> tags in the tests runtime file
! <service name="ROM" label_last="test-ada">
! <parent label="genodelabs/bin/x86_64/test-ada/2018-11-02/test-ada"/>
! </service>
! ...
!
! </route>
! </start>
! </config>
: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.

View File

@ -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 <child.h>
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 '<config>' 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 <rom> 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 <rom> 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 <start> 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<Log_event const *>(&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<Timeout_event const *>(&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();
}
}

View File

@ -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 <base/log.h>
#include <util/list_model.h>
#include <base/service.h>
#include <os/reporter.h>
#include <os/buffered_xml.h>
#include <depot/archive.h>
#include <timer_session/connection.h>
#include <log_session/log_session.h>
/* local includes */
#include <list.h>
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<Log_event>::Element
{
public:
using Line = Genode::String<Log_session::MAX_STRING_LEN + 160 + 3>;
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<Timeout_event>::Element
{
private:
Child &_child;
Timer::Connection &_timer;
unsigned long const _sec;
Timer::One_shot_timeout<Timeout_event> _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<Child>::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<Buffered_xml> _start_xml;
Constructible<Buffered_xml> _launcher_xml { };
Constructible<Buffered_xml> _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_event> _timeout_events { };
List<Log_event> _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 <typename FN>
void apply_if_unsatisfied(FN const &fn) const
{
if (_skip) {
return; }
Xml_node launcher_xml = _launcher_xml.constructed()
? _launcher_xml->xml()
: Xml_node("<empty/>");
if (_condition == UNSATISFIED && _start_xml.constructed())
fn(_start_xml->xml(), launcher_xml);
}
/*
* \return true if condition changed
*/
template <typename COND_FN>
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("<empty/>");
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_ */

View File

@ -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 <util/list_model.h>
#include <util/xml_generator.h>
#include <base/service.h>
#include <depot/archive.h>
/* local includes */
#include "child.h"
#include <pointer.h>
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<Child> _curr_child { };
List_model<Child> _children { };
struct Model_update_policy : List_model<Child>::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 <typename COND_FN>
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 <typename FN>
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<Child>::Invalid(); }
child.gen_query(xml);
}
catch (Local::Const_pointer<Child>::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 *>(&child); }
});
if (!result) {
throw No_match(); }
return *result;
}
};
#endif /* _CHILDREN_H_ */

View File

@ -0,0 +1,95 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="base_types.xsd"/>
<xs:include schemaLocation="timeout_types.xsd"/>
<xs:simpleType name="Architecture">
<xs:restriction base="xs:string">
<xs:enumeration value="x86_64" />
<xs:enumeration value="x86_32" />
<xs:enumeration value="arm_v7a" />
</xs:restriction>
</xs:simpleType><!-- Architecture -->
<xs:simpleType name="Child_name">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType><!-- Child_name -->
<xs:simpleType name="Archive_path">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="100"/>
</xs:restriction>
</xs:simpleType><!-- Archive_path -->
<xs:complexType name="Service">
<xs:choice minOccurs="1" maxOccurs="3">
<xs:element name="parent"/>
<xs:element name="any-child"/>
<xs:element name="child">
<xs:complexType>
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="label" type="Session_label" />
</xs:complexType>
</xs:element>
</xs:choice>
<xs:attribute name="name" type="xs:string" />
<xs:attribute name="label" type="Session_label" />
<xs:attribute name="label_prefix" type="Session_label" />
<xs:attribute name="label_suffix" type="Session_label" />
<xs:attribute name="label_last" type="Session_label" />
<xs:attribute name="unscoped_label" type="Session_label" />
</xs:complexType> <!-- Service -->
<xs:complexType name="Route">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="service" type="Service"/>
<xs:element name="any-service" type="Service"/>
</xs:choice>
</xs:complexType> <!-- Route -->
<xs:element name="config">
<xs:complexType>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="static">
<xs:complexType>
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</xs:sequence>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>
</xs:element> <!-- static -->
<xs:element name="common_routes" type="Route"/>
<xs:element name="previous-results">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="time_sec" type="Seconds" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element> <!-- previous-results -->
<xs:element name="start">
<xs:complexType>
<xs:attribute name="name" type="Child_name" />
<xs:attribute name="pkg" type="Archive_path" />
<xs:attribute name="skip" type="Boolean" />
</xs:complexType>
</xs:element> <!-- start -->
</xs:choice>
<xs:attribute name="arch" type="Architecture" />
<xs:attribute name="children_label_prefix" type="Session_label" />
<xs:attribute name="ld_verbose" type="Boolean" />
</xs:complexType>
</xs:element><!-- config -->
</xs:schema>

View File

@ -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 <util/list.h>
#include <base/allocator.h>
namespace Depot_deploy { template <typename> class List; }
template <typename LT>
struct Depot_deploy::List : Genode::List<LT>
{
using Base = Genode::List<LT>;
template <typename FUNC>
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_ */

View File

@ -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 <util/retry.h>
#include <base/component.h>
#include <base/attached_rom_dataspace.h>
#include <base/heap.h>
#include <os/reporter.h>
#include <root/component.h>
/* 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<Log_session>
{
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<Log_session_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<Session_label> _children_label_prefix { };
Timer::Connection _timer { _env };
Signal_handler<Main> _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); }

View File

@ -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 <base/exception.h>
namespace Local {
template <typename> class Pointer;
template <typename> class Const_pointer;
}
template <typename T>
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 <typename T>
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_ */

View File

@ -0,0 +1,5 @@
TARGET = depot_autopilot
SRC_CC = main.cc child.cc
INC_DIR += $(PRG_DIR)
LIBS += base
CONFIG_XSD = config.xsd

View File

@ -1,35 +0,0 @@
build "core init test/ada"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="CPU"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-ada">
<resource name="RAM" quantum="10M"/>
</start>
</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
}

View File

@ -1,33 +0,0 @@
build "core init test/ada_exception"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="CPU"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-ada_exception">
<resource name="RAM" quantum="10M"/>
</start>
</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
}

View File

@ -1,33 +0,0 @@
build "core init test/ada_secondary_stack"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="CPU"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-ada_secondary_stack">
<resource name="RAM" quantum="10M"/>
</start>
</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
}

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="test-expat">
<resource name="RAM" quantum="2M"/>
<config>
<vfs>
<inline name="config"><config>
<test_tag test_attribute="test_value" />
</config>
</inline>
<dir name="dev"> <log/> </dir>
</vfs>
<libc stdout="/dev/log"/>
</config>
</start>
</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 :

View File

@ -1,146 +0,0 @@
build "core init test/ldso"
create_boot_directory
set config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-ldso">
<resource name="RAM" quantum="2M"/>
<config ld_bind_now="no" ld_verbose="no">
<vfs> <dir name="dev"> <log/> </dir> </vfs>
<libc stdout="/dev/log"/>
</config>
</start>
</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] <warning: unsupported format string argument>
[init -> test-ldso] <warning: unsupported format string argument>
[init -> test-ldso] <warning: unsupported format string argument>
[init -> test-ldso] <warning: unsupported format string argument>
[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
}

View File

@ -1,42 +0,0 @@
build "core init drivers/timer test/libc"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="200"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="test-libc">
<resource name="RAM" quantum="400M"/>
<config>
<vfs> <dir name="dev"> <log/> </dir> </vfs>
<libc stdout="/dev/log" stderr="/dev/log"/>
</config>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="terminal_crosslink">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Terminal"/> </provides>
</start>
<start name="test-libc_counter-source">
<resource name="RAM" quantum="8M"/>
<config>
<vfs>
<dir name="dev"> <terminal/> <log/> </dir>
</vfs>
<libc stdin="/dev/terminal" stdout="/dev/terminal" stderr="/dev/log"/>
</config>
</start>
<start name="test-libc_counter-sink">
<resource name="RAM" quantum="8M"/>
<config>
<vfs>
<dir name="dev"> <terminal/> <log/> <null/> </dir>
</vfs>
<libc stdin="/dev/terminal" stdout="/dev/terminal" stderr="/dev/log"/>
</config>
</start>
</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 :

View File

@ -1,49 +0,0 @@
build "core init test/libc_getenv"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-libc_getenv">
<resource name="RAM" quantum="4M"/>
<config>
<vfs> <dir name="dev"> <log/> </dir> </vfs>
<libc stdout="/dev/log"/>
<arg value="test-libc_getenv"/>
<arg value="foo"/>
<arg value="bar"/>
<arg value="baz"/>
<env key="foo" value="bar"/>
<env key="bar" value="foo"/>
</config>
</start>
</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)"
}

View File

@ -1,39 +0,0 @@
build "core init test/libc_pipe"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-libc_pipe">
<resource name="RAM" quantum="4M"/>
<config>
<vfs> <dir name="dev"> <log/> </dir> </vfs>
<libc stdout="/dev/log" stderr="/dev/log"/>
</config>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="ram_fs">
<resource name="RAM" quantum="12M"/>
<provides> <service name="File_system"/> </provides>
<config> <default-policy root="/" writeable="yes"/> </config>
</start>
<start name="test-libc_vfs">
<resource name="RAM" quantum="4M"/>
<config>
<iterations value="1"/>}
append_if [have_include "power_on/qemu"] config {
<write-read size="1M" buffer_size="8K"/>}
append config {
<vfs>
<dir name="tmp"> <fs/> </dir>
<dir name="dev"> <log/> </dir>
</vfs>
<libc stdout="/dev/log" cwd="/tmp"/>
</config>
</start>
</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 :

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="ram_blk">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Block"/> </provides>
<config size="16K" block_size="4096"/>
</start>
<start name="test-libc_vfs_block">
<resource name="RAM" quantum="4M"/>
<config>
<vfs> <dir name="dev"> <block/> </dir> </vfs>
<libc/>
<!-- Populate the block device with a pattern and validate the
write operation by reading back the content. -->
<sequence>
<write content="abcdefghIJKLMNOPqrstuvwxYZABCDEF"/>
<expect content="abcdefghIJKLMNOPqrstuvwxYZABCDEF"/>
</sequence>
<!-- Write single 512 block. This requires the successive reading,
modification, and writing of the compound 4096 block. -->
<sequence>
<write at="9" content="%"/>
<expect content="abcdefghI%KLMNOPqrstuvwxYZABCDEF"/>
</sequence>
<!-- Reset the pattern and write multiple 512 blocks that cross
a 4096 boundary. -->
<sequence>
<write content="abcdefghIJKLMNOPqrstuvwxYZABCDEF"/>
<write at="15" content="123"/>
<expect content="abcdefghIJKLMNO123stuvwxYZABCDEF"/>
</sequence>
</config>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="terminal_crosslink">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Terminal"/> </provides>
</start>
<start name="vfs">
<resource name="RAM" quantum="12M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs>
<terminal/>
</vfs>
<default-policy root="/" writeable="yes"/>
</config>
</start>
<start name="test-libc_counter-source">
<resource name="RAM" quantum="8M"/>
<config>
<vfs>
<dir name="dev"> <terminal/> <log/> </dir>
</vfs>
<libc stdin="/dev/terminal" stdout="/dev/terminal" stderr="/dev/log"/>
</config>
</start>
<start name="test-libc_counter-sink">
<resource name="RAM" quantum="8M"/>
<config>
<vfs>
<dir name="dev"> <log/> <null/> </dir>
<dir name="vfs"> <fs/> </dir>
</vfs>
<libc stdin="/vfs/terminal" stdout="/vfs/terminal" stderr="/dev/log"/>
</config>
</start>
</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 :

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="vfs">
<resource name="RAM" quantum="12M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <ram/> </vfs>
<default-policy root="/" writeable="yes"/>
</config>
</start>
<start name="test-libc_vfs">
<resource name="RAM" quantum="4M"/>
<config>
<iterations value="1"/>}
append_if [have_include "power_on/qemu"] config {
<write-read size="1M" buffer_size="8K"/>}
append config {
<vfs>
<dir name="tmp"> <fs/> </dir>
<dir name="dev"> <log/> </dir>
</vfs>
<libc stdout="/dev/log" cwd="/tmp"/>
</config>
</start>
</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 :

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="vfs1">
<binary name="vfs"/>
<resource name="RAM" quantum="12M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <ram/> </vfs>
<default-policy root="/" writeable="yes"/>
</config>
</start>
<start name="vfs2">
<binary name="vfs"/>
<resource name="RAM" quantum="12M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <fs/> </vfs>
<default-policy root="/" writeable="yes"/>
</config>
<route>
<service name="File_system"><child name="vfs1"/></service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="test-libc_vfs">
<resource name="RAM" quantum="4M"/>
<config>
<iterations value="1"/>}
append_if [have_include "power_on/qemu"] config {
<write-read size="1M" buffer_size="8K"/>}
append config {
<vfs>
<dir name="tmp"> <fs/> </dir>
<dir name="dev"> <log/> </dir>
</vfs>
<libc stdout="/dev/log" cwd="/tmp"/>
</config>
<route>
<service name="File_system"><child name="vfs2"/></service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</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 :

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<start name="test-libc_vfs" caps="100">
<resource name="RAM" quantum="12M"/>
<route>
<any-service> <parent/> </any-service>
</route>
<config>
<iterations value="1"/>}
append_if [have_include "power_on/qemu"] config {
<write-read size="1M" buffer_size="8K"/>}
append config {
<vfs>
<dir name="tmp"> <ram/> </dir>
<dir name="dev"> <log/> </dir>
</vfs>
<libc stdout="/dev/log" cwd="/tmp"/>
</config>
</start>
</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 :

View File

@ -1,37 +0,0 @@
build "core init test/pthread"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="test-pthread" caps="200">
<resource name="RAM" quantum="64M"/>
<config>
<vfs> <dir name="dev"> <log/> </dir> </vfs>
<libc stdout="/dev/log"/>
</config>
</start>
</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

View File

@ -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 {
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-python">
<resource name="RAM" quantum="4M"/>
<config>
<vfs>
<dir name="dev"> <log/> </dir>
<inline name="hello.py">
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";
</inline>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log"/>
<arg value="hello.py"/>
</config>
</start>
</config>
}
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 :

View File

@ -1,29 +0,0 @@
build "core init test/rust"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="ROM"/>
<service name="CPU"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-rust">
<resource name="RAM" quantum="10M"/>
</start>
</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"

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route> <any-service> <parent/> </any-service> </default-route>
<start name="log-1" caps="64">
<binary name="vfs"/>
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <log/> </vfs>
<default-policy writeable="yes"/>
</config>
</start>
<start name="log-2" caps="64">
<binary name="vfs"/>
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <log/> </vfs>
<default-policy writeable="yes"/>
</config>
</start>
<start name="log-3" caps="64">
<binary name="vfs"/>
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <log/> </vfs>
<default-policy writeable="yes"/>
</config>
</start>
<start name="sequence" caps="200">
<resource name="RAM" quantum="512M"/>
<route>
<service name="File_system" label_prefix="test-libc-1">
<child name="log-1"/> </service>
<service name="File_system" label_prefix="test-libc-2">
<child name="log-2"/> </service>
<service name="File_system" label_prefix="test-libc-3">
<child name="log-3"/> </service>
<any-service> <parent/> </any-service>
</route>
<config>
<start name="test-libc-1">
<binary name="test-libc"/>
<config>
<vfs> <dir name="dev"> <fs/> </dir> </vfs>
<libc stdout="/dev/log"/>
</config>
</start>
<start name="test-libc-2">
<binary name="test-libc"/>
<config>
<vfs> <dir name="dev"> <fs/> </dir> </vfs>
<libc stdout="/dev/log"/>
</config>
</start>
<start name="test-libc-3">
<binary name="test-libc"/>
<config>
<vfs> <dir name="dev"> <fs/> </dir> </vfs>
<libc stdout="/dev/log"/>
</config>
</start>
</config>
</start>
</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 :

View File

@ -1,51 +0,0 @@
assert_spec linux
build "core init test/stdcxx"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="LOG"/>
<service name="PD"/>
<service name="ROM"/>
<service name="CPU"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-stdcxx">
<resource name="RAM" quantum="10M"/>
<config>
<vfs> <dir name="dev"> <log/> </dir> </vfs>
<libc stdout="/dev/log"/>
</config>
</start>
</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 °°° °° °
}

View File

@ -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 {
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="256"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="nic_loopback">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Nic"/> </provides>
</start>
<start name="nic_bridge">
<resource name="RAM" quantum="4M"/>
<provides><service name="Nic"/></provides>
<config verbose="no">
<policy label_prefix="recv" ip_addr="192.168.1.1" />
<policy label_prefix="send" ip_addr="192.168.1.2" />
</config>
<route>
<service name="Nic"> <child name="nic_loopback"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="recv">
<binary name="test-tcp"/>
<resource name="RAM" quantum="32M"/>
<config>
<arg value="recv"/>
<libc stdout="/log" stderr="/log" socket="/sockets"/>
<vfs>
<log/>
<dir name="sockets">
<} [socket_fs_plugin] { ip_addr="192.168.1.1" netmask="255.255.255.0"/>
</dir>
</vfs>
</config>
<route>
<service name="Nic"> <child name="nic_bridge"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="send">
<binary name="test-tcp"/>
<resource name="RAM" quantum="32M"/>
<config>
<arg value="send"/>
<arg value="192.168.1.1"/>
<libc stdout="/log" stderr="/log" socket="/sockets"/>
<vfs>
<log/>
<dir name="sockets">
<} [socket_fs_plugin] { ip_addr="192.168.1.2" netmask="255.255.255.0"/>
</dir>
</vfs>
</config>
<route>
<service name="Nic"> <child name="nic_bridge"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>
}
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 :

View File

@ -1,2 +0,0 @@
source ${genode_dir}/repos/libports/run/vfs_lwip.inc
source ${genode_dir}/repos/libports/run/tcp_bulk.inc

View File

@ -1,2 +0,0 @@
source ${genode_dir}/repos/dde_linux/run/vfs_lxip.inc
source ${genode_dir}/repos/libports/run/tcp_bulk.inc

View File

@ -15,6 +15,7 @@
#include <base/log.h>
#include <base/component.h>
#include <ada/exception.h>
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);
}

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="TRACE"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-blk-srv">
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
</start>
<start name="test-blk-cli">
<resource name="RAM" quantum="50M" />
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-blk-srv">
<resource name="RAM" quantum="10M"/>
<provides><service name="Block"/></provides>
</start>
<start name="blk_cache">
<resource name="RAM" quantum="2704K" />
<provides><service name="Block" /></provides>
<route>
<service name="Block"><child name="test-blk-srv" /></service>
<any-service> <parent /> <any-child /></any-service>
</route>
</start>
<start name="test-blk-cli">
<resource name="RAM" quantum="2G" />
<route>
<service name="Block"><child name="blk_cache" /></service>
<any-service> <parent /> <any-child /></any-service>
</route>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="PD"/>
<service name="LOG"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="report_rom">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="yes">
<policy label="clipboard -> focus" report="test-clipboard -> focus"/>
</config>
</start>
<start name="clipboard">
<resource name="RAM" quantum="4M"/>
<provides>
<service name="ROM"/>
<service name="Report"/>
</provides>
<config verbose="yes">
<flow from="hobby" to="work" />
<flow from="hobby" to="admin" />
<flow from="work" to="admin" />
<policy label_prefix="test-clipboard -> win7" domain="work" />
<policy label_prefix="test-clipboard -> linux" domain="hobby" />
<policy label_prefix="test-clipboard -> noux" domain="admin" />
</config>
<route>
<service name="ROM" label="focus"> <child name="report_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="test-clipboard">
<resource name="RAM" quantum="4M"/>
<route>
<!-- for the simulation of nitpicker's focus reports -->
<service name="Report" label="focus"> <child name="report_rom"/> </service>
<!-- for the simulation of clipboard clients -->
<service name="ROM" label="linux -> clipboard"> <child name="clipboard"/> </service>
<service name="ROM" label="win7 -> clipboard"> <child name="clipboard"/> </service>
<service name="ROM" label="noux -> clipboard"> <child name="clipboard"/> </service>
<service name="Report"> <child name="clipboard"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
</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

View File

@ -1,47 +0,0 @@
build "core init test/dynamic_config"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_PORT"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-dynamic_config_server">
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM" /> </provides>
</start>
<start name="test-dynamic_config" caps="500">
<resource name="RAM" quantum="1M"/>
<configfile name="config.dynamic" />
<route>
<service name="ROM" label="config.dynamic">
<child name="test-dynamic_config_server"/>
</service>
<any-service> <parent /> </any-service>
</route>
</start>
</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"

View File

@ -1,46 +0,0 @@
build "core init drivers/timer server/loader test/dynamic_config"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_PORT"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="200"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="loader">
<resource name="RAM" quantum="1M"/>
<provides><service name="Loader"/></provides>
<config>
<policy label_prefix="test-dynamic_config_loader">
<parent-rom name="test-dynamic_config"/>
<parent-rom name="ld.lib.so"/>
</policy>
</config>
</start>
<start name="test-dynamic_config_loader">
<resource name="RAM" quantum="10M"/>
</start>
</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"

View File

@ -1,36 +0,0 @@
build "core init test/dynamic_config"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_PORT"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="200"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-dynamic_config_master">
<resource name="RAM" quantum="2M"/>
</start>
</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"

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="LOG"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="loader" caps="100">
<resource name="RAM" quantum="10M"/>
<provides> <service name="Loader"/> </provides>
<config>
<policy label_prefix="test-fault_detection">
<parent-rom name="test-segfault"/>
<parent-rom name="ld.lib.so"/>
<parent-rom name="init"/>
</policy>
</config>
</start>
<start name="test-fault_detection" caps="500">
<resource name="RAM" quantum="10M"/>
</start>
</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

View File

@ -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 {
<config prio_levels="2">
<parent-provides>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
<service name="IO_PORT"/>
<service name="IO_MEM"/>
<service name="IRQ"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="CPU" quantum="10"/>
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="vfs">
<resource name="RAM" quantum="2M"/>
<provides><service name="File_system"/></provides>
<config>
<vfs>
<log name="bomb-master.log"/>
<dir name="bomb-master"> <log name="bomb_g5.log"/> </dir>
</vfs>
<policy label_prefix="fs_log" writeable="yes"/>
</config>
</start>
<start name="fs_log">
<resource name="RAM" quantum="2M"/>
<provides><service name="LOG"/></provides>
<config>
<policy label="bomb-master"/>
<policy label_prefix="bomb-master" merge="true"/>
</config>
</start>
<start name="bomb-master" priority="-1" caps="500">
<binary name="bomb"/>
<resource name="CPU" quantum="90"/>
<resource name="RAM" quantum="2G"/>
<route>
<any-service> <any-child/> <parent/> </any-service>
</route>
<config rounds="1" generations="1" sleep="500"/>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="PD"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="vfs">
<resource name="RAM" quantum="4M"/>
<provides> <service name="File_system"/> </provides>
<config>
<vfs> <jitterentropy name="test"/> </vfs>
<default-policy root="/" writeable="yes"/>
</config>
</start>
<start name="long-test">
<binary name="test-fs_packet"/>
<resource name="RAM" quantum="2M"/>
<config count="1024"/>
</start>
<start name="short-test">
<binary name="sequence"/>
<resource name="RAM" quantum="4M"/>
<config>
<start name="a">
<binary name="test-fs_packet"/>
<resource name="RAM" quantum="2M"/>
<config count="64"/>
</start>
<start name="b">
<binary name="test-fs_packet"/>
<resource name="RAM" quantum="2M"/>
<config count="64"/>
</start>
</config>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="CPU"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="ram_fs">
<resource name="RAM" quantum="10M"/>
<provides><service name="File_system"/></provides>
<config>
<policy label_prefix="rom_to_file" root="/" writeable="yes"/>
<policy label_prefix="fs_rom" root="/" writeable="no"/>
</config>
</start>
<start name="dynamic_rom">
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="yes">
<rom name="dynamic_rom">
<inline description="iteration 1">
<config iteration="1" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 2">
<config iteration="2" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 3">
<config iteration="3" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 4">
<config iteration="4" />
</inline>
<sleep milliseconds="2000" />
</rom>
</config>
</start>
<start name="rom_to_file">
<resource name="RAM" quantum="2M"/>
<config rom="dynamic_rom"/>
<route>
<service name="ROM" label="dynamic_rom"> <child name="dynamic_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="fs_rom">
<resource name="RAM" quantum="2M"/>
<provides><service name="ROM"/></provides>
</start>
<start name="rom_logger">
<resource name="RAM" quantum="1M"/>
<config rom="dynamic_rom"/>
<route>
<service name="ROM" label="dynamic_rom"> <child name="fs_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
</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 {.*<config iteration="4" />.*} 60

View File

@ -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 {
<config>
<parent-provides>
<service name="CPU"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="vfs_1">
<binary name="vfs"/>
<resource name="RAM" quantum="10M"/>
<provides><service name="File_system"/></provides>
<config>
<vfs> <ram/> </vfs>
<policy label_prefix="rom_to_file" root="/" writeable="yes"/>
<policy label_prefix="vfs_2" root="/" writeable="no"/>
</config>
</start>
<start name="vfs_2">
<binary name="vfs"/>
<resource name="RAM" quantum="10M"/>
<provides><service name="File_system"/></provides>
<config>
<vfs> <fs/> </vfs>
<policy label_prefix="fs_rom" root="/" writeable="no"/>
</config>
<route>
<service name="File_system">
<child name="vfs_1"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="dynamic_rom">
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="yes">
<rom name="dynamic_rom">
<inline description="iteration 1">
<config iteration="1" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 2">
<config iteration="2" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 3">
<config iteration="3" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 4">
<config iteration="4" />
</inline>
<sleep milliseconds="2000" />
</rom>
</config>
</start>
<start name="rom_to_file">
<resource name="RAM" quantum="2M"/>
<config rom="dynamic_rom"/>
<route>
<service name="ROM" label="dynamic_rom"> <child name="dynamic_rom"/> </service>
<service name="File_system" > <child name="vfs_1"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="fs_rom">
<resource name="RAM" quantum="2M"/>
<provides><service name="ROM"/></provides>
<route>
<service name="File_system" > <child name="vfs_2"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="rom_logger">
<resource name="RAM" quantum="1M"/>
<config rom="dynamic_rom"/>
<route>
<service name="ROM" label="dynamic_rom"> <child name="fs_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
</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 {.*<config iteration="4" />.*} 60

View File

@ -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 {
<config>
<parent-provides>
<service name="CPU"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="vfs">
<resource name="RAM" quantum="10M"/>
<provides><service name="File_system"/></provides>
<config>
<vfs> <ram/> </vfs>
<policy label_prefix="rom_to_file" root="/" writeable="yes"/>
<policy label_prefix="fs_rom" root="/" writeable="no"/>
</config>
</start>
<start name="dynamic_rom">
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="yes">
<rom name="dynamic_rom">
<inline description="iteration 1">
<config iteration="1" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 2">
<config iteration="2" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 3">
<config iteration="3" />
</inline>
<sleep milliseconds="2000" />
<inline description="iteration 4">
<config iteration="4" />
</inline>
<sleep milliseconds="2000" />
</rom>
</config>
</start>
<start name="rom_to_file">
<resource name="RAM" quantum="2M"/>
<config rom="dynamic_rom"/>
<route>
<service name="ROM" label="dynamic_rom"> <child name="dynamic_rom"/> </service>
<service name="File_system" > <child name="vfs"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="fs_rom">
<resource name="RAM" quantum="2M"/>
<provides><service name="ROM"/></provides>
<route>
<service name="File_system" > <child name="vfs"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="rom_logger">
<resource name="RAM" quantum="1M"/>
<config rom="dynamic_rom"/>
<route>
<service name="ROM" label="dynamic_rom"> <child name="fs_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
</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 {.*<config iteration="4" />.*} 60

File diff suppressed because it is too large Load Diff

View File

@ -1,68 +0,0 @@
create_boot_directory
import_from_depot genodelabs/src/[base_src] \
genodelabs/src/report_rom
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="PD"/>
<service name="LOG"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
</parent-provides>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
<route> <any-service> <parent/> </any-service> </route>
</start>
<start name="report_rom">
<resource name="RAM" quantum="2M"/>
<provides> <service name="ROM"/> <service name="Report"/> </provides>
<config verbose="no">
<policy label="init -> config" report="test-init_loop -> init.config"/>
<policy label="test-init_loop -> state" report="init -> state"/>
</config>
<route> <any-service> <parent/> </any-service> </route>
</start>
<start name="test-init_loop">
<resource name="RAM" quantum="4M"/>
<provides> <service name="LOG"/> </provides>
<config/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<service name="ROM" label="state"> <child name="report_rom"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="init" caps="2000">
<binary name="init"/>
<resource name="RAM" quantum="8M"/>
<route>
<service name="ROM" label="config"> <child name="report_rom"/> </service>
<service name="Report"> <child name="report_rom"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="TRACE"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="lx_block" ld="no">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Block"/> </provides>
<config file="lx_block.img" block_size="4K" writeable="yes"/>
</start>
<start name="test-blk-bench">
<resource name="RAM" quantum="24M"/>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="nic_loopback">
<resource name="RAM" quantum="1M"/>
<provides><service name="Nic"/></provides>
</start>
<start name="test-nic_loopback">
<resource name="RAM" quantum="2M"/>
</start>
</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

View File

@ -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 {
<config prio_levels="1" verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="rom_blk">
<resource name="RAM" quantum="32M"/>
<provides><service name="Block"/></provides>
<config file="} $img_file {" block_size="512"/>
</start>
<start name="part_blk">
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
<route>
<any-service><child name="rom_blk"/> <parent/><any-child/></any-service>
</route>}
if { $mode == "mbr" } {
append config {
<config>
<report partitions="yes"/>
<policy label_prefix="test-part1" partition="6"/>
<policy label_prefix="test-part2" partition="1"/>
</config>}
} else {
append config {
<config use_gpt="yes">
<report partitions="yes"/>
<policy label_prefix="test-part1" partition="2"/>
<policy label_prefix="test-part2" partition="1"/>
</config>}
}
append config {
</start>
<start name="report_rom">
<provides>
<service name="Report"/>
<service name="ROM"/>
</provides>
<resource name="RAM" quantum="5M" />
<config verbose="yes"/>
</start>
<start name="test-part1">
<binary name="test-blk-cli"/>
<resource name="RAM" quantum="5M" />
<route>
<any-service> <child name="part_blk" /> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="test-part2">
<binary name="test-blk-cli"/>
<resource name="RAM" quantum="5M" />
<route>
<any-service> <child name="part_blk" /> <parent/> <any-child/> </any-service>
</route>
</start>
</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

View File

@ -1,3 +0,0 @@
set mode mbr
source ${genode_dir}/repos/os/run/part_blk.inc

View File

@ -1,3 +0,0 @@
set mode gpt
source ${genode_dir}/repos/os/run/part_blk.inc

View File

@ -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 {
<config>
<parent-provides>
<service name="PD"/>
<service name="ROM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-ram_fs_chunk">
<resource name="RAM" quantum="1M"/>
</start>
</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 ---
}

View File

@ -1,58 +0,0 @@
build {
core init
server/cached_fs_rom
server/vfs
test/immutable_rom
}
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="vfs">
<resource name="RAM" quantum="2M"/>
<provides><service name="File_system"/></provides>
<config>
<vfs>
<inline name="test">DONT TOUCH</inline>
</vfs>
<default-policy root="/"/>
</config>
</start>
<start name="cached_fs_rom">
<resource name="RAM" quantum="4M"/>
<provides> <service name="ROM"/> </provides>
</start>
<start name="test-immutable_rom">
<resource name="RAM" quantum="2M"/>
<route>
<service name="ROM" label="test">
<child name="cached_fs_rom"/>
</service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</config>
}
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

View File

@ -1,76 +0,0 @@
build "core init server/report_rom test/report_rom drivers/timer"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="report_rom">
<resource name="RAM" quantum="2M"/>
<provides> <service name="ROM"/> <service name="Report"/> </provides>
<config>
<policy label_prefix="test-report_rom ->" label_suffix="brightness"
report="test-report_rom -> brightness"/>
</config>
</start>
<start name="test-report_rom">
<resource name="RAM" quantum="2M"/>
<route>
<service name="ROM" label="brightness">
<child name="report_rom"/>
</service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</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] -> <brightness value="10"/>
[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] -> <brightness value="77"/>
[init -> test-report_rom] Reporter: close report session, wait a bit
[init -> test-report_rom] got timeout
[init -> test-report_rom] -> <brightness value="77"/>
[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 ---
}

View File

@ -1,55 +0,0 @@
build "core init server/report_rom test/resource_request drivers/timer"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_PORT"/>
<service name="IO_MEM"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="report_rom">
<resource name="RAM" quantum="2M"/>
<provides> <service name="ROM"/> <service name="Report"/> </provides>
<config verbose="no">
<policy label="init -> config" report="init_monitor -> init.config"/>
<policy label="init_monitor -> state" report="init -> state"/>
</config>
</start>
<start name="init" caps="4000">
<resource name="RAM" quantum="10M"/>
<route>
<service name="ROM" label="config"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="init_monitor">
<binary name="test-resource_request"/>
<resource name="RAM" quantum="2M"/>
<config role="monitor"/>
<route>
<service name="ROM" label="state"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</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

View File

@ -1,37 +0,0 @@
build "core init test/resource_yield drivers/timer"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_PORT"/>
<service name="IO_MEM"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-resource_yield" caps="200">
<resource name="RAM" quantum="16M"/>
<provides> <service name="ROM" /> </provides>
<config/>
</start>
</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

View File

@ -1,34 +0,0 @@
build "core init server/rom_blk test/rom_blk"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <any-child/> <parent/></any-service>
</default-route>
<default caps="100"/>
<start name="rom_blk">
<resource name="RAM" quantum="3M"/>
<provides><service name="Block"/></provides>
<config file="init" block_size="512"/>
</start>
<start name="test-rom_blk">
<resource name="RAM" quantum="3M"/>
<config file="init"/>
</start>
</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

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="LOG"/>
<service name="CPU"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="dynamic_rom">
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="yes">
<rom name="xray">
<sleep milliseconds="1000" />
<inline description="disable X-ray mode">
<xray enabled="no"/>
</inline>
<sleep milliseconds="1000" />
<inline description="enable X-ray mode">
<xray enabled="yes"/>
</inline>
<sleep milliseconds="1000" />
<inline description="leave X-ray mode undefined">
<xray> <!-- undefined -->
<details>
<message reason="error"/> <!-- not selected -->
<message reason="no access" text="system locked"/>
</details>
</xray>
</inline>
<sleep milliseconds="1000" />
<inline description="finished"/>
</rom>
</config>
</start>
<start name="rom_filter">
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="no">
<input name="xray_enabled" rom="xray" node="xray">
<attribute name="enabled" />
</input>
<input name="diagnostic_message" rom="xray" node="xray">
<node type="details">
<node type="message" attribute="reason" value="no access">
<attribute name="text" />
</node>
</node>
</input>
<output node="config">
<attribute name="message" input="diagnostic_message"/>
<if>
<has_value input="xray_enabled" value="yes" />
<then>
<inline><!-- xray enabled --></inline>
</then>
<else>
<inline><!-- ... fallback ... --></inline>
</else>
</if>
</output>
</config>
<route>
<service name="ROM" label="xray"> <child name="dynamic_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="rom_logger">
<resource name="RAM" quantum="1M"/>
<config rom="generated" />
<route>
<service name="ROM" label="generated"> <child name="rom_filter"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
</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] <config><!-- ... fallback ... --></config>
[init -> rom_logger] ROM 'generated':
[init -> rom_logger] <config><!-- ... fallback ... --></config>
[init -> rom_logger] ROM 'generated':
[init -> rom_logger] <config><!-- xray enabled --></config>
[init -> rom_logger] ROM 'generated':
[init -> rom_logger] <config message="system locked"><!-- ... fallback ... --></config>
}

View File

@ -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 {
<config prio_levels="2" verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="rtc_drv" priority="-1">
<resource name="RAM" quantum="1M"/>
<provides><service name="Rtc"/></provides>
</start>
<start name="test-rtc" priority="-1">
<resource name="RAM" quantum="1M"/>
</start>
</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

View File

@ -1,39 +0,0 @@
build "core init drivers/timer test/signal"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_PORT"/>
<service name="IO_MEM"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-signal" caps="500">
<resource name="RAM" quantum="10M"/>
</start>
</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 {}

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_PORT"/>
<service name="IO_MEM"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="120"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-slab" caps="140">
<resource name="RAM" quantum="64M"/>
</start>
</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"

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="200"/>
<start name="timer">
<resource name="RAM" quantum="512K"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="terminal_crosslink">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Terminal"/> </provides>
</start>
<start name="test-terminal_crosslink">
<resource name="RAM" quantum="1M"/>
</start>
</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 :

View File

@ -1,57 +0,0 @@
#
# Build
#
build {
core init
drivers/timer
test/timed_semaphore
}
create_boot_directory
#
# Generate config
#
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-timed_semaphore">
<resource name="RAM" quantum="1M"/>
</start>
</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

View File

@ -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 {
<config prio_levels="2">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service><parent/><any-child/></any-service>
</default-route>
<start name="timer" caps="64" priority="0">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="client" caps="300" priority="-1">
<binary name="test-timer"/>
<resource name="RAM" quantum="10M"/>
</start>
</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
}

View File

@ -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 {
<config>
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="TRACE"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-trace">
<resource name="RAM" quantum="10M"/>
<config>
<trace_policy label="init -> test-trace" module="null" />
</config>
</start>
<start name="top">
<resource name="RAM" quantum="2M"/>
<config period_ms="2000"/>
</start>
</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

View File

@ -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 {
<config prio_levels="2">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="TRACE"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="trace_logger" >
<resource name="RAM" quantum="100M"/>
<config verbose="yes"
session_ram="10M"
session_parent_levels="1"
session_arg_buffer="64K"
period_sec="3"
activity="yes"
affinity="yes"
default_policy="null"
default_buffer="1K">
<policy label_prefix="init -> cpu_burner"
thread="ep"/>
<policy label="init -> test-trace_logger"
thread="ep"
buffer="4K"
policy="rpc_name"/>
</config>
</start>
<start name="dynamic_rom">
<resource name="RAM" quantum="4M"/>
<provides><service name="ROM"/></provides>
<config verbose="yes">
<rom name="cpu_burner1.config">
<inline description="initial state">
<config percent="5"/>
</inline>
<sleep milliseconds="5000" />
<inline description="50%">
<config percent="50" />
</inline>
<sleep milliseconds="5000" />
</rom>
<rom name="cpu_burner2.config">
<inline description="initial state">
<config percent="5"/>
</inline>
<sleep milliseconds="4800" />
<inline description="100%">
<config percent="70" />
</inline>
<sleep milliseconds="2700" />
</rom>
</config>
</start>
<start name="test-trace_logger" >
<resource name="RAM" quantum="1M"/>
</start>
<start name="cpu_burner.1">
<binary name="cpu_burner"/>
<resource name="RAM" quantum="1M"/>
<configfile name="cpu_burner1.config"/>
<route>
<service name="ROM" label="cpu_burner1.config"> <child name="dynamic_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="cpu_burner.2">
<binary name="cpu_burner"/>
<resource name="RAM" quantum="1M"/>
<configfile name="cpu_burner2.config"/>
<route>
<service name="ROM" label="cpu_burner2.config"> <child name="dynamic_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
</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

View File

@ -1,27 +0,0 @@
build "core init test/utf8"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="LOG"/>
<service name="CPU"/>
<service name="PD"/>
</parent-provides>
<default-route>
<any-service> <any-child/> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="test-utf8">
<resource name="RAM" quantum="1M"/>
</start>
</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

View File

@ -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 {
<config>
<affinity-space width="3" height="2"/>
<parent-provides>
<service name="CPU"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="vfs_stress">
<resource name="RAM" quantum="8M"/>
<config depth="16"> <vfs> <fs/> </vfs> </config>
</start>
<start name="ram_fs">
<resource name="RAM" quantum="1G"/>
<provides><service name="File_system"/></provides>
<config>
<default-policy root="/" writeable="yes"/>
</config>
</start>
</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

View File

@ -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 {
<config>
<affinity-space width="3" height="2" />
<parent-provides>
<service name="CPU"/>
<service name="IO_PORT"/>
<service name="IRQ"/>
<service name="LOG"/>
<service name="PD"/>
<service name="RM"/>
<service name="ROM"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="vfs_stress">
<resource name="RAM" quantum="1G"/>
<config depth="16"> <vfs> <ram/> </vfs> </config>
</start>
</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

View File

@ -1,37 +0,0 @@
build "core init drivers/timer test/weak_ptr"
create_boot_directory
install_config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="LOG"/>
<service name="CPU"/>
<service name="RM"/>
<service name="PD"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
</parent-provides>
<default-route>
<any-service> <any-child/> <parent/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="test-weak_ptr">
<resource name="RAM" quantum="10M"/>
</start>
</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"

View File

@ -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