genode/repos/os/run/ram_fs_chunk.run
Martin Stein ad2d1fe586 os/test: transition to new base API
For all tests
* use Component::construct instead of main
* use new connection constructors with env argument
* use log instead of printf

For some tests
* replace signal receivers with signal handlers
* replace global static variables with Main class members
* remove unnecessary multithreading
* model test steps as classes that are independent from each other and managed
  by Main as constructibles
* use references instead of pointers and exceptions instead of error codes
* use Attached_* helpers intead of doing attach/detach manually
* use helpers like String, Id_space, Registry instead of arrays and lists
* make the run script suitable for automated execution and conclusion

Ref #1987
2017-01-31 12:01:15 +01:00

84 lines
3.9 KiB
Plaintext

#
# \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="RAM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> </any-service>
</default-route>
<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 -m 64"
run_genode_until {.*--- RAM filesystem chunk test finished ---.*\n} 10
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 ---
}