diff --git a/repos/os/run/block_tester.run b/repos/os/run/block_tester.run index 705653d1d..054093b53 100644 --- a/repos/os/run/block_tester.run +++ b/repos/os/run/block_tester.run @@ -2,10 +2,26 @@ assert_spec x86 set use_linux [have_spec linux] +if {[get_cmd_switch --autopilot] && ![have_include "power_on/qemu"]} { + puts "\n Run script is not supported on this platform. \n"; + exit 0 +} + + # # Check used commands # -set dd [installed_command dd] +set dd [installed_command dd] +set sfdisk [installed_command sfdisk] +set sgdisk [installed_command sgdisk] + +set drv0 "ahci_drv" +set drv1 "ahci_drv" + +if { $use_linux } { + set drv0 "lx_block0" + set drv1 "lx_block1" +} # # Build @@ -16,6 +32,8 @@ set build_components { server/ram_block server/lx_block app/block_tester + server/part_block + test/block/client } source ${genode_dir}/repos/base/run/platform_drv.inc @@ -23,10 +41,20 @@ append_platform_drv_build_components build $build_components -# -# Build EXT2-file-system image -# -catch { exec $dd if=/dev/zero of=bin/block.raw bs=1M count=0 seek=32768 } +proc create_disk_image {number} { + global dd + global sfdisk + global sgdisk + + catch { exec $dd if=/dev/zero of=bin/block$number.raw bs=1M count=0 seek=2048 } + + if { $number == 0 } { + exec echo -e "2048 2097151 - -\n2099200 2095070 - -" | $sfdisk -f bin/block$number.raw + } else { + exec $sgdisk --clear bin/block$number.raw + exec $sgdisk -n1:2048:2099199 -n2:2099200:4194270 bin/block$number.raw + } +} create_boot_directory @@ -60,49 +88,116 @@ append config { append_platform_drv_config +append config { + + + + + + +} + append_if [expr !$use_linux] config { - - + + + + - } + + + + + +} append_if $use_linux config { - + - - } + + + + + + + + +} append config { - + + + + + + } + append config " + " + append config { + + + + + + + + + + + + + + } + append config " + " + append config { + + + + + + + + +} + +append config { + + + + + + + + + +} + +append config { + + - - - - + + + - - - - - @@ -149,7 +244,90 @@ append config { - + + + + +} + +append config { + + + + + + + + + +} + +append config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -157,6 +335,9 @@ append config { install_config $config +create_disk_image 0 +create_disk_image 1 + # # Boot modules # @@ -164,25 +345,27 @@ install_config $config # generic modules set boot_modules { core init timer ahci_drv ram_block block_tester - ld.lib.so + ld.lib.so test-block-client part_block } append_if $use_linux boot_modules { - block.raw lx_block + block0.raw block1.raw lx_block } append_platform_drv_boot_modules build_boot_image $boot_modules -#append qemu_args " -m 256 -nographic" +append qemu_args " -nographic -m 512 -nographic" +append qemu_args " -drive id=disk,file=bin/block0.raw,format=raw,if=none \ + -drive id=disk2,file=bin/block1.raw,format=raw,if=none \ + -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 \ + -device ide-hd,drive=disk2,bus=ahci.1 -boot d" -append qemu_args " -nographic -m 512 " -append qemu_args " -drive id=disk,file=bin/block.raw,format=raw,if=none -device ahci,id=ahci -device ide-hd,drive=disk,bus=ahci.0 -boot d" -append qemu_args " -drive id=cd,file=[run_dir]/../block_replay.iso,if=none,media=cdrom -device ide-cd,drive=cd,bus=ahci.1" +run_genode_until {.*--- all tests finished ---.*\n} 360 +set serial_id [output_spawn_id] +run_genode_until {.*--- all tests finished ---.*\n} 360 $serial_id +run_genode_until {.*--- all tests finished ---.*\n} 360 $serial_id +run_genode_until {.*--- all tests finished ---.*\n} 360 $serial_id - -#run_genode_until {.*child "block_tester" exited.*\n} 360 -run_genode_until forever - -exec rm -f bin/block.raw +exec rm -f bin/block0.raw bin/block1.raw diff --git a/repos/os/src/test/block/client/main.cc b/repos/os/src/test/block/client/main.cc index 41224fd18..0205653c1 100644 --- a/repos/os/src/test/block/client/main.cc +++ b/repos/os/src/test/block/client/main.cc @@ -428,7 +428,7 @@ void Component::construct(Genode::Env &env) perform >(env, heap); perform(env, heap, 1000); - log("Tests finished successfully!"); + log("--- all tests finished ---"); } catch (Genode::Service_denied) { error("opening block session was denied!");