Use block_tester instead of test/block/client

Issue #4405
This commit is contained in:
Norman Feske
2022-02-04 14:12:34 +01:00
parent 76c090b694
commit 378e2d9e74
10 changed files with 113 additions and 60 deletions

View File

@ -1,3 +1,3 @@
_/src/init _/src/init
_/src/lx_block _/src/lx_block
_/src/test-block _/src/block_tester

View File

@ -3,14 +3,14 @@
<requires> <timer/> </requires> <requires> <timer/> </requires>
<events> <events>
<timeout meaning="failed" sec="100" /> <timeout meaning="failed" sec="30" />
<log meaning="succeeded">Done</log> <log meaning="succeeded">child "block_tester" exited with exit value 0</log>
<log meaning="failed">Error: </log> <log meaning="failed">Error: </log>
</events> </events>
<content> <content>
<rom label="ld.lib.so"/> <rom label="ld.lib.so"/>
<rom label="test-block-bench"/> <rom label="block_tester"/>
<rom label="lx_block.img"/> <rom label="lx_block.img"/>
<rom label="lx_block"/> <rom label="lx_block"/>
</content> </content>
@ -37,8 +37,18 @@
<provides> <service name="Block"/> </provides> <provides> <service name="Block"/> </provides>
<config file="lx_block.img" block_size="4K" writeable="yes"/> <config file="lx_block.img" block_size="4K" writeable="yes"/>
</start> </start>
<start name="test-block-bench"> <start name="block_tester">
<resource name="RAM" quantum="24M"/> <binary name="block_tester"/>
<resource name="RAM" quantum="5M" />
<config verbose="no" log="yes" stop_on_error="no">
<tests>
<sequential length="256K" size="4K" io_buffer="128K" batch="4"/>
<sequential write="yes" length="256K" size="4K" io_buffer="128K" batch="4"/>
</tests>
</config>
<route>
<any-service> <child name="lx_block" /> <parent/> <any-child/> </any-service>
</route>
</start> </start>
</config> </config>
</runtime> </runtime>

View File

@ -3,5 +3,5 @@ _/src/report_rom
_/src/part_block _/src/part_block
_/src/vfs _/src/vfs
_/src/vfs_block _/src/vfs_block
_/src/test-block _/src/block_tester
_/raw/test-part_block_gpt _/raw/test-part_block_gpt

View File

@ -5,8 +5,8 @@
<events> <events>
<timeout meaning="failed" sec="70" /> <timeout meaning="failed" sec="70" />
<log meaning="succeeded"> <log meaning="succeeded">
--- all tests finished ---* child "test-part*" exited with exit value 0*
--- all tests finished --- child "test-part*" exited with exit value 0
</log> </log>
<log meaning="failed">Error: </log> <log meaning="failed">Error: </log>
</events> </events>
@ -16,7 +16,7 @@
<rom label="vfs_block"/> <rom label="vfs_block"/>
<rom label="vfs.lib.so"/> <rom label="vfs.lib.so"/>
<rom label="part_block"/> <rom label="part_block"/>
<rom label="test-block-client"/> <rom label="block_tester"/>
<rom label="report_rom"/> <rom label="report_rom"/>
<rom label="ata.gpt.raw"/> <rom label="ata.gpt.raw"/>
</content> </content>
@ -68,15 +68,25 @@
<config verbose="yes"/> <config verbose="yes"/>
</start> </start>
<start name="test-part1"> <start name="test-part1">
<binary name="test-block-client"/> <binary name="block_tester"/>
<resource name="RAM" quantum="5M" /> <resource name="RAM" quantum="5M" />
<config verbose="no" log="yes" stop_on_error="no">
<tests>
<sequential length="32K" size="1K" io_buffer="128K" batch="4"/>
</tests>
</config>
<route> <route>
<any-service> <child name="part_block" /> <parent/> <any-child/> </any-service> <any-service> <child name="part_block" /> <parent/> <any-child/> </any-service>
</route> </route>
</start> </start>
<start name="test-part2"> <start name="test-part2">
<binary name="test-block-client"/> <binary name="block_tester"/>
<resource name="RAM" quantum="5M" /> <resource name="RAM" quantum="5M" />
<config verbose="no" log="yes" stop_on_error="no">
<tests>
<sequential length="256K" size="1K" io_buffer="128K" batch="4"/>
</tests>
</config>
<route> <route>
<any-service> <child name="part_block" /> <parent/> <any-child/> </any-service> <any-service> <child name="part_block" /> <parent/> <any-child/> </any-service>
</route> </route>

View File

@ -3,5 +3,5 @@ _/src/report_rom
_/src/part_block _/src/part_block
_/src/vfs _/src/vfs
_/src/vfs_block _/src/vfs_block
_/src/test-block _/src/block_tester
_/raw/test-part_block_mbr _/raw/test-part_block_mbr

View File

@ -5,9 +5,9 @@
<events> <events>
<timeout meaning="failed" sec="60" /> <timeout meaning="failed" sec="60" />
<log meaning="succeeded"> <log meaning="succeeded">
--- all tests finished ---* child "test-part*" exited with exit value 0*
--- all tests finished ---* child "test-part*" exited with exit value 0*
--- all tests finished --- child "test-part*" exited with exit value 0
</log> </log>
<log meaning="failed">Error: </log> <log meaning="failed">Error: </log>
</events> </events>
@ -17,7 +17,7 @@
<rom label="vfs_block"/> <rom label="vfs_block"/>
<rom label="vfs.lib.so"/> <rom label="vfs.lib.so"/>
<rom label="part_block"/> <rom label="part_block"/>
<rom label="test-block-client"/> <rom label="block_tester"/>
<rom label="report_rom"/> <rom label="report_rom"/>
<rom label="ata.mbr.raw"/> <rom label="ata.mbr.raw"/>
</content> </content>
@ -70,22 +70,37 @@
<config verbose="yes"/> <config verbose="yes"/>
</start> </start>
<start name="test-part1"> <start name="test-part1">
<binary name="test-block-client"/> <binary name="block_tester"/>
<resource name="RAM" quantum="5M" /> <resource name="RAM" quantum="5M" />
<config verbose="no" log="yes" stop_on_error="no">
<tests>
<sequential length="32K" size="1K" io_buffer="128K" batch="4"/>
</tests>
</config>
<route> <route>
<any-service> <child name="part_block" /> <parent/> <any-child/> </any-service> <any-service> <child name="part_block" /> <parent/> <any-child/> </any-service>
</route> </route>
</start> </start>
<start name="test-part2"> <start name="test-part2">
<binary name="test-block-client"/> <binary name="block_tester"/>
<resource name="RAM" quantum="5M" /> <resource name="RAM" quantum="5M" />
<config verbose="no" log="yes" stop_on_error="no">
<tests>
<sequential length="256K" size="1K" io_buffer="128K" batch="4"/>
</tests>
</config>
<route> <route>
<any-service> <child name="part_block" /> <parent/> <any-child/> </any-service> <any-service> <child name="part_block" /> <parent/> <any-child/> </any-service>
</route> </route>
</start> </start>
<start name="test-part3"> <start name="test-part3">
<binary name="test-block-client"/> <binary name="block_tester"/>
<resource name="RAM" quantum="5M" /> <resource name="RAM" quantum="5M" />
<config verbose="no" log="yes" stop_on_error="no">
<tests>
<sequential length="128K" size="1K" io_buffer="128K" batch="4"/>
</tests>
</config>
<route> <route>
<any-service> <child name="part_block" /> <parent/> <any-child/> </any-service> <any-service> <child name="part_block" /> <parent/> <any-child/> </any-service>
</route> </route>

View File

@ -10,7 +10,7 @@ set build_components {
core init timer core init timer
drivers/ahci drivers/ahci
server/report_rom server/report_rom
test/block/client app/block_tester
} }
source ${genode_dir}/repos/base/run/platform_drv.inc source ${genode_dir}/repos/base/run/platform_drv.inc
@ -73,18 +73,27 @@ append config {
</route> </route>
</start> </start>
<start name="test-ahci"> <start name="test-ahci">
<binary name="test-block-client" /> <binary name="block_tester" />
<resource name="RAM" quantum="50M" /> <resource name="RAM" quantum="50M" />
<config test_size="100M"></config> <config verbose="no" report="no" log="yes" stop_on_error="no">
<tests>
<sequential length="8M" size="1M" io_buffer="8M" batch="4"/>
<sequential start="1000" write="yes" length="2M" size="1M" io_buffer="8M" batch="4"/>
</tests>
</config>
<route> <route>
<service name="Block"><child name="ahci_drv"/></service> <service name="Block"><child name="ahci_drv"/></service>
<any-service> <parent/> <any-child /> </any-service> <any-service> <parent/> <any-child /> </any-service>
</route> </route>
</start> </start>
<start name="test-ahci-atapi"> <start name="test-ahci-atapi">
<binary name="test-block-client" /> <binary name="block_tester" />
<resource name="RAM" quantum="50M" /> <resource name="RAM" quantum="50M" />
<config test_size="100M"></config> <config verbose="no" report="no" log="yes" stop_on_error="no">
<tests>
<sequential length="1M" size="1M" io_buffer="8M" batch="4"/>
</tests>
</config>
<route> <route>
<service name="Block"><child name="ahci_drv"/></service> <service name="Block"><child name="ahci_drv"/></service>
<any-service> <parent/> <any-child /> </any-service> <any-service> <parent/> <any-child /> </any-service>
@ -97,7 +106,7 @@ install_config $config
# #
# Boot modules # Boot modules
# #
set boot_modules { core ld.lib.so init timer ahci_drv report_rom test-block-client } set boot_modules { core ld.lib.so init timer ahci_drv report_rom block_tester }
append_platform_drv_boot_modules append_platform_drv_boot_modules

View File

@ -30,9 +30,9 @@ set build_components {
core init timer core init timer
drivers/ahci drivers/ahci
server/lx_block server/lx_block
server/report_rom
app/block_tester app/block_tester
server/part_block server/part_block
test/block/client
} }
source ${genode_dir}/repos/base/run/platform_drv.inc source ${genode_dir}/repos/base/run/platform_drv.inc
@ -167,9 +167,13 @@ append config {
append config { append config {
<start name="test-part0"> <start name="test-part0">
<binary name="test-block-client" /> <binary name="block_tester" />
<resource name="RAM" quantum="32M" /> <resource name="RAM" quantum="32M" />
<config test_size="64M" /> <config verbose="no" log="yes" stop_on_error="no">
<tests>
<sequential length="2M" size="256K" io_buffer="8M" batch="4"/>
</tests>
</config>
<route> <route>
<service name="Block"><child name="part_block0"/></service> <service name="Block"><child name="part_block0"/></service>
<any-service> <parent/> <any-child /> </any-service> <any-service> <parent/> <any-child /> </any-service>
@ -251,9 +255,13 @@ append config {
append config { append config {
<start name="test-part1"> <start name="test-part1">
<binary name="test-block-client" /> <binary name="block_tester" />
<resource name="RAM" quantum="32M" /> <resource name="RAM" quantum="32M" />
<config test_size="64M" /> <config verbose="no" log="yes" stop_on_error="no">
<tests>
<sequential length="2M" size="256K" io_buffer="8M" batch="4"/>
</tests>
</config>
<route> <route>
<service name="Block"><child name="part_block1"/></service> <service name="Block"><child name="part_block1"/></service>
<any-service> <parent/> <any-child /> </any-service> <any-service> <parent/> <any-child /> </any-service>
@ -343,8 +351,8 @@ create_disk_image 1
# generic modules # generic modules
set boot_modules { set boot_modules {
core init timer ahci_drv block_tester core init timer ahci_drv block_tester report_rom
ld.lib.so test-block-client part_block ld.lib.so part_block
} }
append_if $use_linux boot_modules { append_if $use_linux boot_modules {

View File

@ -1,11 +1,14 @@
assert_spec pbxa9 if {![have_board pbxa9]} {
puts "Test requires board pbxa9"
exit
}
create_boot_directory create_boot_directory
import_from_depot [depot_user]/src/[base_src] \ import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/init \ [depot_user]/src/init \
[depot_user]/src/platform_drv [depot_user]/src/platform_drv
build { drivers/sd_card test/block/client } build { drivers/sd_card app/block_tester }
install_config { install_config {
<config> <config>
@ -55,20 +58,19 @@ install_config {
</route> </route>
</start> </start>
<start name="test-block-client"> <start name="block_tester">
<resource name="RAM" quantum="1M" /> <resource name="RAM" quantum="64M" />
<route> <config verbose="no" report="no" log="yes" stop_on_error="no">
<service name="ROM"> <parent/> </service> <tests>
<service name="PD"> <parent/> </service> <sequential length="16M" size="1M" io_buffer="8M" batch="4"/>
<service name="RM"> <parent/> </service> <sequential start="4000" write="yes" length="16M" size="1M" io_buffer="8M" batch="4"/>
<service name="CPU"> <parent/> </service> </tests>
<service name="LOG"> <parent/> </service> </config>
<any-service> <any-child/> </any-service> <route> <any-service> <any-child/> <parent/> </any-service> </route>
</route>
</start> </start>
</config> } </config> }
build_boot_image { pl180_sd_card_drv test-block-client } build_boot_image { pl180_sd_card_drv block_tester }
set disk_image "bin/sd_card.img" set disk_image "bin/sd_card.img"
if { [file exists $disk_image] == 0 } then { if { [file exists $disk_image] == 0 } then {

View File

@ -9,8 +9,7 @@ set build_components {
drivers/usb_host drivers/usb_host
drivers/usb_block drivers/usb_block
server/report_rom server/report_rom
test/block/client app/block_tester
test/block/bench
} }
source ${genode_dir}/repos/base/run/platform_drv.inc source ${genode_dir}/repos/base/run/platform_drv.inc
@ -92,21 +91,22 @@ append config {
<start name="usb_block_drv"> <start name="usb_block_drv">
<resource name="RAM" quantum="4M"/> <resource name="RAM" quantum="4M"/>
<provides> <service name="Block"/> </provides> <provides> <service name="Block"/> </provides>
<config report="yes"/> <config report="yes" writeable="no"/>
<route> <route>
<service name="Usb"> <child name="usb_drv"/> </service> <service name="Usb"> <child name="usb_drv"/> </service>
<service name="Report"> <child name="report_rom"/> </service> <service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> <any-child/> </any-service> <any-service> <parent/> <any-child/> </any-service>
</route> </route>
</start> </start>
<start name="test-usb"> <start name="block_tester">
<resource name="RAM" quantum="128M"/> <resource name="RAM" quantum="64M" />
<binary name="test-block-bench"/> <config verbose="no" report="no" log="yes" stop_on_error="no">
<!--binary name="test-block-client"/--> <tests>
<config> <sequential length="8M" size="1M" io_buffer="8M" batch="4"/>
<libc stdout="/dev/log">
<vfs> <dir name="dev"> <log/> </dir> </vfs> <!-- enable 'writeable="yes"' at usb_block_drv for write test -->
</libc> <!-- <sequential write="yes" start="4000" length="2M" size="1M" io_buffer="8M" batch="4"/> -->
</tests>
</config> </config>
<route> <route>
<service name="Block"> <child name="usb_block_drv"/> </service> <service name="Block"> <child name="usb_block_drv"/> </service>
@ -123,8 +123,7 @@ install_config $config
# generic modules # generic modules
set boot_modules { set boot_modules {
core init timer report_rom usb_block_drv core init timer report_rom usb_block_drv block_tester
test-block-client test-block-bench
ld.lib.so ld.lib.so
} }
@ -151,4 +150,4 @@ append qemu_args " -nographic -M pc -boot order=d "
append qemu_args " -drive if=none,id=disk,file=$disk_image,format=raw " append qemu_args " -drive if=none,id=disk,file=$disk_image,format=raw "
append qemu_args " -device usb-ehci,id=ehci -device usb-storage,bus=ehci.0,drive=disk " append qemu_args " -device usb-ehci,id=ehci -device usb-storage,bus=ehci.0,drive=disk "
run_genode_until {.*child "test-usb" exited with exit value 0.*} 100 run_genode_until {.*child "block_tester" exited with exit value 0.*} 100