diff --git a/repos/gems/run/aes_cbc_4k.run b/repos/gems/run/aes_cbc_4k.run index a4bc82acb8..0e8ce66482 100644 --- a/repos/gems/run/aes_cbc_4k.run +++ b/repos/gems/run/aes_cbc_4k.run @@ -3,9 +3,9 @@ set block_number 12345 set test_rounds 10000 -if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} { - puts "Autopilot mode is not supported on this platform." - exit 0 +if {[have_cmd_switch --autopilot]} { + assert {![have_board virt_qemu_riscv]} \ + "Autopilot mode is not supported on this platform." } build { core lib/ld init lib/libc lib/vfs lib/libcrypto test/aes_cbc_4k } diff --git a/repos/gems/run/cpu_sampler.run b/repos/gems/run/cpu_sampler.run index c94c4956ea..7741d039b0 100644 --- a/repos/gems/run/cpu_sampler.run +++ b/repos/gems/run/cpu_sampler.run @@ -1,8 +1,8 @@ -if { ![have_spec foc] && ![have_spec hw] && ![have_spec nova] && - ![have_spec okl4] && ![have_spec sel4] } { - puts "Run script is not supported on this platform" - exit 0 -} +assert {[have_spec foc] && + [have_spec hw] && + [have_spec nova] && + [have_spec okl4] && + [have_spec sel4]} set build_components { core lib/ld init timer diff --git a/repos/gems/run/depot_autopilot.run b/repos/gems/run/depot_autopilot.run index dfc8e587e1..172d4fd3a1 100644 --- a/repos/gems/run/depot_autopilot.run +++ b/repos/gems/run/depot_autopilot.run @@ -148,7 +148,7 @@ proc autopilot_run_genode_until {{wait_for_re forever} {timeout_value 0} {runnin # Whether the run script is used interactively # proc interactive {} { - return [expr ![get_cmd_switch --autopilot]] + return [expr ![have_cmd_switch --autopilot]] } @@ -622,15 +622,11 @@ proc exit {{status 0}} { # # Check platform support # -if {[expr ![have_spec x86] && \ - ![have_spec arm_v6] && \ - ![have_spec arm_v7a] && \ - ![have_spec arm_v8a] && \ - ![have_spec riscv]]} \ -{ - puts "\n Run script is not supported on this platform. \n"; - exit 0 -} +assert {[have_spec x86] || + [have_spec arm_v6] || + [have_spec arm_v7a] || + [have_spec arm_v8a] || + [have_spec riscv]} # # Default list of test package-archives diff --git a/repos/gems/run/depot_download.run b/repos/gems/run/depot_download.run index f970050c5f..32161543d9 100644 --- a/repos/gems/run/depot_download.run +++ b/repos/gems/run/depot_download.run @@ -1,15 +1,14 @@ +assert {![have_board linux] && + ![have_board rpi3] && + ![have_board imx53_qsb_tz]} + +if {[have_cmd_switch --autopilot]} { + assert {![have_board virt_qemu_riscv]} \ + "Autopilot mode is not supported on this platform." +} + create_boot_directory -if {[have_board linux] || [have_board rpi3] || [have_board imx53_qsb_tz]} { - puts "Run script does not support this platform." - exit 0 -} - -if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} { - puts "Autopilot mode is not supported on this platform." - exit 0 -} - import_from_depot [depot_user]/src/[base_src] \ [depot_user]/pkg/[drivers_nic_pkg] \ [depot_user]/src/report_rom \ diff --git a/repos/gems/run/depot_remove.run b/repos/gems/run/depot_remove.run index da0f55f01a..ccf7f24e5f 100644 --- a/repos/gems/run/depot_remove.run +++ b/repos/gems/run/depot_remove.run @@ -1,4 +1,4 @@ -assert_spec linux +assert {[have_spec linux]} create_boot_directory @@ -20,7 +20,7 @@ create_tar_from_depot_binaries [run_dir]/genode/depot.tar \ [depot_user]/pkg/themed_decorator \ [depot_user]/pkg/sticks_blue_backdrop -if { [get_cmd_switch --autopilot] } { +if { [have_cmd_switch --autopilot] } { import_from_depot [depot_user]/src/depot_remove } else { build { app/depot_remove } @@ -74,7 +74,7 @@ exec mkdir [run_dir]/genode/depot exec tar xvf [run_dir]/genode/depot.tar -C [run_dir]/genode/depot exec chmod -R +r [run_dir]/genode/depot -if { [get_cmd_switch --autopilot] } { +if { [have_cmd_switch --autopilot] } { build_boot_image {} } else { build_boot_image [build_artifacts] diff --git a/repos/gems/run/file_vault_client.run b/repos/gems/run/file_vault_client.run index 3ba633d63a..9c40892d93 100644 --- a/repos/gems/run/file_vault_client.run +++ b/repos/gems/run/file_vault_client.run @@ -1,7 +1,4 @@ -if {[have_spec riscv]} { - puts "\n Run script is not supported on this platform. \n"; - exit 0 -} +assert {![have_spec riscv]} proc jent_avail { } { if {[have_board pbxa9]} { return 0 } @@ -454,4 +451,4 @@ if {[container_initialized]} { } } -if {[get_cmd_switch --autopilot] && [have_board linux]} { exec rm -rf [lx_fs_dir] } +if {[have_cmd_switch --autopilot] && [have_board linux]} { exec rm -rf [lx_fs_dir] } diff --git a/repos/gems/run/fs_query.run b/repos/gems/run/fs_query.run index 8cf48b954f..843ceafcb4 100644 --- a/repos/gems/run/fs_query.run +++ b/repos/gems/run/fs_query.run @@ -1,8 +1,8 @@ create_boot_directory -if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} { - puts "Autopilot mode is not supported on this platform." - exit 0 +if {[have_cmd_switch --autopilot]} { + assert {![have_board virt_qemu_riscv]} \ + "Autopilot mode is not supported on this platform." } import_from_depot \ diff --git a/repos/gems/run/gpt_write.run b/repos/gems/run/gpt_write.run index 8b7e8755d9..39c73f5480 100644 --- a/repos/gems/run/gpt_write.run +++ b/repos/gems/run/gpt_write.run @@ -1,7 +1,7 @@ # # Test runs only on Linux # -assert_spec linux +assert {[have_spec linux]} # # Build diff --git a/repos/gems/run/sculpt.run b/repos/gems/run/sculpt.run index a475961278..558388baff 100644 --- a/repos/gems/run/sculpt.run +++ b/repos/gems/run/sculpt.run @@ -10,21 +10,13 @@ proc sculpt_version { } { return "24.10" } -proc assert_platform_supported { } { - - if {[have_board pc]} return - if {[have_board imx8q_evk]} return - if {[have_board mnt_reform2]} return - if {[have_board mnt_pocket]} return - if {[have_board linux]} return - if {[have_board pinephone]} return - if {[have_board imx8mp_armstone]} return - - puts "Platform is unsupported."; - exit 0; -} - -assert_platform_supported +assert {[have_board pc] || + [have_board imx8q_evk] || + [have_board mnt_reform2] || + [have_board mnt_pocket] || + [have_board linux] || + [have_board pinephone] || + [have_board imx8mp_armstone]} proc log_core { } { diff --git a/repos/gems/run/sculpt_image.run b/repos/gems/run/sculpt_image.run index 8f9e9b60aa..07a0c9ac05 100644 --- a/repos/gems/run/sculpt_image.run +++ b/repos/gems/run/sculpt_image.run @@ -2,19 +2,11 @@ # Generates publishable Sculpt system image # -proc board_supported { } { - if {[have_board pinephone]} { return true } - if {[have_board pc]} { return true } - if {[have_board mnt_reform2]} { return true } - if {[have_board mnt_pocket]} { return true } - if {[have_board imx8mp_armstone]} { return true } - return false -} - -if {![board_supported]} { - puts stderr "board is not supported by the run script" - exit 1 -} +assert {[have_board pinephone] || + [have_board pc] || + [have_board mnt_reform2] || + [have_board mnt_pocket] || + [have_board imx8mp_armstone]} proc assert_include { include } { if {![have_include $include]} { diff --git a/repos/gems/run/tcp_terminal.run b/repos/gems/run/tcp_terminal.run index 0988209cf9..065e80d869 100644 --- a/repos/gems/run/tcp_terminal.run +++ b/repos/gems/run/tcp_terminal.run @@ -8,8 +8,7 @@ # TODO: Add support for Linux via user-level networking (using the # tun/tap proxy driver at os/src/driver/nic/linux) # -if {[have_spec linux]} { - puts "Run script does not support Linux."; exit 0 } +assert {![have_spec linux]} create_boot_directory diff --git a/repos/gems/run/trace_recorder.run b/repos/gems/run/trace_recorder.run index fcb8a6c589..6eeddc1267 100644 --- a/repos/gems/run/trace_recorder.run +++ b/repos/gems/run/trace_recorder.run @@ -1,4 +1,4 @@ -assert_spec linux +assert {[have_spec linux]} # check that babeltrace2 is present set babeltrace_missing [catch { diff --git a/repos/gems/run/trace_recorder_ctf.run b/repos/gems/run/trace_recorder_ctf.run index 5d0225a942..ae7d5163ed 100644 --- a/repos/gems/run/trace_recorder_ctf.run +++ b/repos/gems/run/trace_recorder_ctf.run @@ -1,4 +1,4 @@ -assert_spec linux +assert {[have_spec linux]} # check that babeltrace2 is present set babeltrace_missing [catch { diff --git a/repos/gems/run/trace_recorder_pcapng.run b/repos/gems/run/trace_recorder_pcapng.run index 17412a87bd..a7e1377fc2 100644 --- a/repos/gems/run/trace_recorder_pcapng.run +++ b/repos/gems/run/trace_recorder_pcapng.run @@ -1,4 +1,4 @@ -assert_spec linux +assert {[have_spec linux]} # check that python-pcapng is present set python_pcapng_missing [catch { diff --git a/repos/gems/run/tresor_tester.run b/repos/gems/run/tresor_tester.run index 5d11a8f405..d1702c4743 100644 --- a/repos/gems/run/tresor_tester.run +++ b/repos/gems/run/tresor_tester.run @@ -1,7 +1,7 @@ # riscv lacks jitterentropy support currently -if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} { - puts "Autopilot mode is not supported on this platform." - exit 0 +if {[have_cmd_switch --autopilot]} { + assert {![have_board virt_qemu_riscv]} \ + "Autopilot mode is not supported on this platform." } set dd [installed_command dd] @@ -917,7 +917,7 @@ install_config $config if {[have_board linux]} { exec rm -rf [lx_local_tresor_image] - if { [get_cmd_switch --autopilot] } { + if { [have_cmd_switch --autopilot] } { exec rm -rf [lx_autopilot_tresor_image] catch { exec $dd if=/dev/urandom of=[lx_autopilot_tresor_image] bs=1M count=[lx_tresor_image_size_mb] } @@ -945,7 +945,7 @@ run_genode_until "child \"test\" exited with exit value.*\n" $test_timeout if {[have_board linux]} { - if { [get_cmd_switch --autopilot] } { + if { [have_cmd_switch --autopilot] } { exec rm -rf [lx_local_tresor_image] exec rm -rf [lx_autopilot_tresor_image] diff --git a/repos/gems/run/tresor_utils.run b/repos/gems/run/tresor_utils.run index 27a0e0c4d9..1a4cce3392 100644 --- a/repos/gems/run/tresor_utils.run +++ b/repos/gems/run/tresor_utils.run @@ -1,4 +1,4 @@ -assert_spec linux +assert {[have_spec linux]} append build_components { core init timer lib/ld lib/vfs server/lx_block server/lx_fs server/vfs app/sequence diff --git a/repos/gems/run/vfs_import.run b/repos/gems/run/vfs_import.run index 54693f9047..c9a12f9a90 100644 --- a/repos/gems/run/vfs_import.run +++ b/repos/gems/run/vfs_import.run @@ -1,6 +1,6 @@ -if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} { - puts "Autopilot mode is not supported on this platform." - exit 0 +if {[have_cmd_switch --autopilot]} { + assert {![have_board virt_qemu_riscv]} \ + "Autopilot mode is not supported on this platform." } build { app/sequence server/vfs lib/libc lib/vfs lib/vfs_import test/libc } diff --git a/repos/gems/run/vfs_tresor.run b/repos/gems/run/vfs_tresor.run index 9463a1f4b2..f0a5314e60 100644 --- a/repos/gems/run/vfs_tresor.run +++ b/repos/gems/run/vfs_tresor.run @@ -1,4 +1,4 @@ -assert_spec linux +assert {[have_spec linux]} set dd [installed_command dd] @@ -266,7 +266,7 @@ set repo "[repository_contains $shell_script]" exec cp $repo/$shell_script bin/ exec rm -rf [local_tresor_image] -if { [get_cmd_switch --autopilot] } { +if { [have_cmd_switch --autopilot] } { exec rm -rf [autopilot_tresor_image] catch { exec $dd if=/dev/urandom of=[autopilot_tresor_image] bs=1M count=[tresor_image_size_mb] } @@ -285,7 +285,7 @@ build_boot_image $boot_modules run_genode_until {.*"/bin/bash".* exited with exit value 0.*\n} 120 -if { [get_cmd_switch --autopilot] } { +if { [have_cmd_switch --autopilot] } { exec rm -rf [local_tresor_image] exec rm -rf [autopilot_tresor_image]