assert_spec x86 # perform write tests when requested if {[info exists env(GENODE_TEST_WRITE)]} { set test_write 1 } else { set test_write 0 } set is_qemu [have_include power_on/qemu] set is_old [expr [have_spec fiasco] || [have_spec okl4] || [have_spec pistachio]] set is_32bit_x86_hw [expr !$is_qemu && [have_spec 32bit]] # # Only run tests on supported platforms # if {[expr [have_spec linux] || $is_32bit_x86_hw || [expr $is_qemu && $is_old]]} { puts "This run script is not supported on this platform." exit 0 } # # Qemu and on certain platforms only use the small set of tests # set small_test [expr $is_qemu || [have_spec foc] || [have_spec sel4]] # # Check used commands # set dd [installed_command dd] # # Query writeable for policy # proc writeable { } { global test_write if {$test_write} { return yes } else { return no } } # # Build # set build_components { core init timer drivers/nvme app/block_tester } source ${genode_dir}/repos/base/run/platform_drv.inc append_platform_drv_build_components build $build_components # # Create raw image # catch { exec $dd if=/dev/zero of=bin/nvme.raw bs=1M count=0 seek=32768 } create_boot_directory # # Generate config # append config { } append_platform_drv_config append config { } append_if $small_test config { } append_if [expr !$small_test] config { } append_if $test_write config { } append config { } install_config $config # # Boot modules # set boot_modules { core init timer nvme_drv ld.lib.so block_tester } append_platform_drv_boot_modules build_boot_image $boot_modules append qemu_args " -nographic -m 512 " append qemu_args " -drive id=nvme0,file=bin/nvme.raw,format=raw,if=none " append qemu_args " -device nvme,drive=nvme0,serial=fnord,id=nvme0n1 " run_genode_until {.*child "block_tester" exited with exit value 0.*\n} 300 exec rm -f bin/nvme.raw