diff --git a/repos/ports/run/gdb.inc b/repos/ports/run/gdb.inc index 120e7c0508..0dc8ac392d 100644 --- a/repos/ports/run/gdb.inc +++ b/repos/ports/run/gdb.inc @@ -9,10 +9,7 @@ proc platform_supported { } { return 0 } -if {![platform_supported]} { - puts "Run script is not supported on this platform" - exit 0 -} +assert {[platform_supported]} proc gdb_pkg_name { } { if {[have_spec arm_64]} { diff --git a/repos/ports/run/lighttpd_fetchurl.run b/repos/ports/run/lighttpd_fetchurl.run index d3647bbd0e..4dfef0829e 100644 --- a/repos/ports/run/lighttpd_fetchurl.run +++ b/repos/ports/run/lighttpd_fetchurl.run @@ -4,10 +4,8 @@ # \date 2022-12-03 # -if {[have_board virt_qemu_riscv]} { - puts "Run script is not supported on this platform (missing curl and libssh)." - exit 0 -} +assert {![have_board virt_qemu_riscv]} \ + "Run script is not supported on this platform (missing curl and libssh)." proc ip_stack { } { return lwip } proc download_size { } { return "1M" } diff --git a/repos/ports/run/microcode.run b/repos/ports/run/microcode.run index 8c7d53ab5e..b5b69b26ab 100644 --- a/repos/ports/run/microcode.run +++ b/repos/ports/run/microcode.run @@ -1,17 +1,15 @@ -assert_spec x86 +assert {[have_spec x86]} set path_microcode "[exec [genode_dir]/tool/ports/current --no-print-directory microcode_intel]/src/app/intel/intel-ucode" set microcode_files [glob -nocomplain -dir $path_microcode *-*-*] -if { [get_cmd_switch --autopilot] } { +if {[have_cmd_arg --autopilot]} { - if {[have_include "power_on/qemu"]} { - puts "\nRun script does not support Qemu.\n" - exit 0 - } + assert {![have_include power_on/qemu]} \ + "Autopilot mode is not supported on this platform." # platform_info data about CPUs on other kernels missing - assert_spec nova + assert {[have_spec nova]} if { [have_spec x86_64] } { copy_file $path_microcode/06-3c-03 bin/micro.code @@ -20,11 +18,10 @@ if { [get_cmd_switch --autopilot] } { } } -if {![file exists bin/micro.code]} { - puts "\nMissing bin/micro.code file for your target machine." - puts "Please select for your target CPU the microcode patch located in $path_microcode/xx-xx-xx." - puts "and copy it to bin/micro.code. xx-xx-xx stands for your target CPU, family-model-stepping\n" - exit 0 +assert {[file exists bin/micro.code]} { + Missing bin/micro.code file for your target machine. + Please select for your target CPU the microcode patch located in $path_microcode/xx-xx-xx. + and copy it to bin/micro.code. xx-xx-xx stands for your target CPU, family-model-stepping } proc apply_microcode { } { return true } @@ -64,7 +61,7 @@ append qemu_args "-smp 4 " run_genode_until "microcode check done" 30 # cleanup -if { [get_cmd_switch --autopilot] } { +if {[have_cmd_arg --autopilot]} { file delete -force bin/micro.code foreach file $microcode_files { file delete bin/$file diff --git a/repos/ports/run/netperf.inc b/repos/ports/run/netperf.inc index 75bba9b2dd..945c262c47 100644 --- a/repos/ports/run/netperf.inc +++ b/repos/ports/run/netperf.inc @@ -27,15 +27,9 @@ # ! sudo ip tuntap delete $TAP_DEV mode tap # -if {[have_include "power_on/qemu"]} { - puts "\nRun script does not support Qemu.\n" - exit 0 -} - -if {[have_board imx53_qsb_tz] || [have_board rpi]} { - puts "Run script is not supported on this platform." - exit 0 -} +assert {![have_include power_on/qemu]} +assert {![have_board imx53_qsb_tz]} +assert {![have_board rpi]} proc unique_byte_per_platform { } { diff --git a/repos/ports/run/netperf_lwip_usb.run b/repos/ports/run/netperf_lwip_usb.run index 0f8ddb6024..3e9f9a61a7 100644 --- a/repos/ports/run/netperf_lwip_usb.run +++ b/repos/ports/run/netperf_lwip_usb.run @@ -6,12 +6,10 @@ # # our nightly test infrastructure currently support usb 3.0 on our x86 64bit machine only -assert_spec x86_64 +assert {[have_spec x86_64]} -if {[have_include "power_on/qemu"] || [have_include "power_on/linux"]} { - puts stderr "\nNetperf USB3.0 running on Qemu/Linux is not supported.\n" - exit 0 -} +assert {![have_include power_on/qemu]} +assert {![have_include power_on/linux]} # network configuration set use_nic_bridge 0 diff --git a/repos/ports/run/netperf_lwip_wifi.run b/repos/ports/run/netperf_lwip_wifi.run index 99ba2a31ea..d236dc4580 100644 --- a/repos/ports/run/netperf_lwip_wifi.run +++ b/repos/ports/run/netperf_lwip_wifi.run @@ -4,17 +4,19 @@ # \date 2013-07-08 # -assert_spec x86 +assert {[have_spec x86]} -if {[have_include "power_on/qemu"] || [have_include "power_on/linux"]} { - puts stderr "\nNetperf WIFI running on Qemu/Linux is not supported.\n" - exit 0 -} +assert {![have_include power_on/qemu]} +assert {![have_include power_on/linux]} -if {[get_cmd_switch --autopilot] && [have_spec x86_32] && - ![expr [have_spec foc] || [have_spec nova]]} { - puts stderr "\nNetperf WIFI running with non-ACPI kernel on native x86_32 test machine is not supported because of wrong interrupt number in pci config space (should be 11 instead 10).\n" - exit +if {[have_cmd_arg --autopilot] && [have_spec x86_32]} { + assert {[have_spec foc] || [have_spec nova]} { + Autopilot mode is not supported on this platform. + + Netperf WIFI running with non-ACPI kernel on native x86_32 test + machine is not supported because of wrong interrupt number in + pci config space (should be 11 instead 10). + } } # network configuration diff --git a/repos/ports/run/netperf_lxip_usb.run b/repos/ports/run/netperf_lxip_usb.run index e289caf1bf..7aac8a9e0c 100644 --- a/repos/ports/run/netperf_lxip_usb.run +++ b/repos/ports/run/netperf_lxip_usb.run @@ -6,12 +6,10 @@ # # our nightly test infrastructure currently support usb 3.0 on our x86 64bit machine only -assert_spec x86_64 +assert {[have_spec x86_64]} -if {[have_include "power_on/qemu"] || [have_include "power_on/linux"]} { - puts stderr "\nNetperf USB3.0 running on Qemu/Linux is not supported.\n" - exit 0 -} +assert {![have_include power_on/qemu]} +assert {![have_include power_on/linux]} # network configuration set use_nic_bridge 0 diff --git a/repos/ports/run/netperf_lxip_wifi.run b/repos/ports/run/netperf_lxip_wifi.run index e6ab126dfa..9114826ed7 100644 --- a/repos/ports/run/netperf_lxip_wifi.run +++ b/repos/ports/run/netperf_lxip_wifi.run @@ -4,17 +4,19 @@ # \date 2013-07-08 # -assert_spec x86 +assert {[have_spec x86]} -if {[have_include "power_on/qemu"] || [have_include "power_on/linux"]} { - puts stderr "\nNetperf WIFI running on Qemu/Linux is not supported.\n" - exit 0 -} +assert {![have_include power_on/qemu]} +assert {![have_include power_on/linux]} -if {[get_cmd_switch --autopilot] && [have_spec x86_32] && - ![expr [have_spec foc] || [have_spec nova]]} { - puts stderr "\nNetperf WIFI running with non-ACPI kernel on native x86_32 test machine is not supported because of wrong interrupt number in pci config space (should be 11 instead 10).\n" - exit +if {[have_cmd_arg --autopilot] && [have_spec x86_32]} { + assert {[have_spec foc] || [have_spec nova]} { + Autopilot mode is not supported on this platform. + + Netperf WIFI running with non-ACPI kernel on native x86_32 test + machine is not supported because of wrong interrupt number in + pci config space (should be 11 instead 10). + } } # network configuration diff --git a/repos/ports/run/socat.run b/repos/ports/run/socat.run index c1d09119e4..fb8395ef63 100644 --- a/repos/ports/run/socat.run +++ b/repos/ports/run/socat.run @@ -1,16 +1,5 @@ -proc platform_supported { } { - if {[have_board pc]} { - return 1 - } elseif {[have_board rpi3] && [have_include power_on/qemu]} { - return 1 - } - return 0 -} - -if {![platform_supported]} { - puts "Run script is not supported on this platform" - exit 0 -} +assert {([have_board pc]) || + ([have_board rpi3] && [have_include power_on/qemu])} create_boot_directory diff --git a/repos/ports/run/tool_chain_auto.run b/repos/ports/run/tool_chain_auto.run index cecc183dba..499e2603c7 100644 --- a/repos/ports/run/tool_chain_auto.run +++ b/repos/ports/run/tool_chain_auto.run @@ -1,16 +1,14 @@ -if {[get_cmd_switch --autopilot] && [have_include "power_on/qemu"]} { - puts "\nRunning tool-chain auto test in autopilot on Qemu is not recommended." - exit 0 -} - -if {[have_spec pistachio] || [have_spec sel4] || - [have_board imx53_qsb_tz] || [have_board rpi] || - [expr [have_spec foc] && [have_board imx6q_sabrelite]] || - [expr [have_spec foc] && [have_board imx7d_sabre]] } { - puts "Platform is unsupported." - exit 0 +if {[have_cmd_arg --autopilot]} { + assert {![have_include power_on/qemu]} \ + "Running tool-chain auto test in autopilot on Qemu is not recommended." } +assert {![have_spec pistachio]} +assert {![have_spec sel4]} +assert {![have_board imx53_qsb_tz]} +assert {![have_board rpi]} +assert {!([have_spec foc] && [have_board imx6q_sabrelite])} +assert {!([have_spec foc] && [have_board imx7d_sabre])} create_boot_directory diff --git a/repos/ports/run/vbox5_ubuntu_16_04_32.run b/repos/ports/run/vbox5_ubuntu_16_04_32.run index 2a57e0da96..18821d5592 100644 --- a/repos/ports/run/vbox5_ubuntu_16_04_32.run +++ b/repos/ports/run/vbox5_ubuntu_16_04_32.run @@ -2,8 +2,8 @@ # Ubuntu 16.04 32bit in VBox 5 # -assert_spec x86 -assert_spec nova +assert {[have_spec x86]} +assert {[have_spec nova]} set flavor "ubuntu_16_04_32" set vm_ram "1280M" @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 1 set use_check_result 1 -set use_usb [expr ![get_cmd_switch --autopilot]] +set use_usb [expr ![have_cmd_arg --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_ubuntu_16_04_64.run b/repos/ports/run/vbox5_ubuntu_16_04_64.run index 7baa7e8e8a..93e070b434 100644 --- a/repos/ports/run/vbox5_ubuntu_16_04_64.run +++ b/repos/ports/run/vbox5_ubuntu_16_04_64.run @@ -2,8 +2,8 @@ # Ubuntu 16.04 64bit in VBox 5 # -assert_spec x86_64 -assert_spec nova +assert {[have_spec x86_64]} +assert {[have_spec nova]} set flavor "ubuntu_16_04_64" set vm_ram "9460M" @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 1 set use_check_result 1 -set use_usb [expr ![get_cmd_switch --autopilot]] +set use_usb [expr ![have_cmd_arg --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win10_64.run b/repos/ports/run/vbox5_win10_64.run index 7f406d41b4..7a5602ff0a 100644 --- a/repos/ports/run/vbox5_win10_64.run +++ b/repos/ports/run/vbox5_win10_64.run @@ -2,8 +2,8 @@ # Windows 10 in VirtualBox 5 # -assert_spec nova -assert_spec x86_64 +assert {[have_spec nova]} +assert {[have_spec x86_64]} set flavor "win10_64" set vm_ram "8280M" @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![get_cmd_switch --autopilot]] +set use_usb [expr ![have_cmd_arg --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win7_32.run b/repos/ports/run/vbox5_win7_32.run index d478f18a8c..6708051924 100644 --- a/repos/ports/run/vbox5_win7_32.run +++ b/repos/ports/run/vbox5_win7_32.run @@ -2,8 +2,8 @@ # Windows 7 in VirtualBox 5 # -assert_spec nova -assert_spec x86 +assert {[have_spec nova]} +assert {[have_spec x86]} set flavor "win7" set vm_ram "1280M" @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![get_cmd_switch --autopilot]] +set use_usb [expr ![have_cmd_arg --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win7_64.run b/repos/ports/run/vbox5_win7_64.run index e993df149a..4c33604b66 100644 --- a/repos/ports/run/vbox5_win7_64.run +++ b/repos/ports/run/vbox5_win7_64.run @@ -2,8 +2,8 @@ # Windows 7 64bit in VirtualBox # -assert_spec x86_64 -assert_spec nova +assert {[have_spec x86_64]} +assert {[have_spec nova]} set flavor "win7_64" set vm_ram "9480M" @@ -19,7 +19,7 @@ set use_overlay_from_disk 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![get_cmd_switch --autopilot]] +set use_usb [expr ![have_cmd_arg --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win7_64_multiple.run b/repos/ports/run/vbox5_win7_64_multiple.run index c03e276cb9..69b16aa263 100644 --- a/repos/ports/run/vbox5_win7_64_multiple.run +++ b/repos/ports/run/vbox5_win7_64_multiple.run @@ -12,8 +12,8 @@ # ... # lCPU 6-7: VM6 2 vCPUs -assert_spec x86_64 -assert_spec nova +assert {[have_spec x86_64]} +assert {[have_spec nova]} set flavor "win7_64" set flavor_extension "_multiple" @@ -30,7 +30,7 @@ set use_overlay_from_disk 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![get_cmd_switch --autopilot]] +set use_usb [expr ![have_cmd_arg --autopilot]] set use_ps2 1 set use_vms 6 diff --git a/repos/ports/run/vbox5_win7_64_raw.run b/repos/ports/run/vbox5_win7_64_raw.run index cc288b56ec..bae52ce5ef 100644 --- a/repos/ports/run/vbox5_win7_64_raw.run +++ b/repos/ports/run/vbox5_win7_64_raw.run @@ -2,8 +2,8 @@ # Windows 7 64bit in VirtualBox # -assert_spec x86_64 -assert_spec nova +assert {[have_spec x86_64]} +assert {[have_spec nova]} set flavor "win7_64_raw" set vm_ram "1280M" @@ -18,7 +18,7 @@ set use_overlay_from_disk 0 set use_serial 0 set use_check_result 1 -set use_usb [expr ![get_cmd_switch --autopilot]] +set use_usb [expr ![have_cmd_arg --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox5_win7_64_share.run b/repos/ports/run/vbox5_win7_64_share.run index 2c7a4a718a..3e0725bef8 100644 --- a/repos/ports/run/vbox5_win7_64_share.run +++ b/repos/ports/run/vbox5_win7_64_share.run @@ -1,5 +1,5 @@ -assert_spec x86_64 -assert_spec nova +assert {[have_spec x86_64]} +assert {[have_spec nova]} set flavor "win7_64" set vm_ram "1280M" @@ -16,7 +16,7 @@ set use_rumpfs 1 set use_serial 0 set use_check_result 1 -set use_usb [expr ![get_cmd_switch --autopilot]] +set use_usb [expr ![have_cmd_arg --autopilot]] set use_ps2 1 set use_vms 1 diff --git a/repos/ports/run/vbox6_genode_usb_hid_raw.run b/repos/ports/run/vbox6_genode_usb_hid_raw.run index 518b5f95a6..c5186b5855 100644 --- a/repos/ports/run/vbox6_genode_usb_hid_raw.run +++ b/repos/ports/run/vbox6_genode_usb_hid_raw.run @@ -8,10 +8,9 @@ # Note: the USB device(s) to be passed through must be included in the whitelist. # -if { [have_include "power_on/qemu"] || ![have_spec nova] || ![have_spec x86_64]} { - puts "Run script is only supported on 64-bit NOVA on real hardware" - exit 0 -} +assert {[have_spec x86_64]} +assert {[have_spec nova]} +assert {![have_include power_on/qemu]} create_boot_directory import_from_depot [depot_user]/src/[base_src] \ @@ -184,7 +183,7 @@ global specs global repositories set depot_auto_update "" -if {[get_cmd_switch --depot-auto-update]} { +if {[have_cmd_arg --depot-auto-update]} { set depot_auto_update "--depot-auto-update" } @@ -212,7 +211,7 @@ append boot_components { usb_hid_raw.iso vbox6_genode_usb_hid_raw.vbox } build_boot_image $boot_components -if { ![get_cmd_switch --autopilot] } { run_genode_until forever } +if { ![have_cmd_arg --autopilot] } { run_genode_until forever } # autopilot test diff --git a/repos/ports/run/vbox_share.inc b/repos/ports/run/vbox_share.inc index cde1b72ffd..17d0afe734 100644 --- a/repos/ports/run/vbox_share.inc +++ b/repos/ports/run/vbox_share.inc @@ -57,16 +57,10 @@ # beforehand. test.bat contains the actual instructions to be performed by # the VM - for this script to copy the test.bin file from D: to E:. -if {[have_include "power_on/qemu"]} { - puts "\nRun script does not support Qemu.\n" - exit 0 -} +assert {![have_include power_on/qemu]} # Tested for nova -if {![have_spec nova]} { - puts "Platform is unsupported." - exit 0 -} +assert {[have_spec nova]} set virtualbox_binary "virtualbox-rem" if {[have_spec nova]} { set virtualbox_binary "virtualbox-nova" } diff --git a/repos/ports/run/vbox_win.inc b/repos/ports/run/vbox_win.inc index 04a417684b..ea6c0917d0 100644 --- a/repos/ports/run/vbox_win.inc +++ b/repos/ports/run/vbox_win.inc @@ -1,14 +1,6 @@ -assert_spec x86 - -if {(![have_spec nova] && ![have_spec foc])} { - puts "Platform is unsupported." - exit 0 -} - -if {[have_include "power_on/qemu"]} { - puts "\nRun script does not support Qemu.\n" - exit 0 -} +assert {[have_spec x86]} +assert {[have_spec nova] || [have_spec foc]} +assert {![have_include power_on/qemu]} if {[expr !$use_rumpfs && $use_vms > 1] } { puts "\nConfiguration bug - have only one raw block partition.\n" diff --git a/repos/ports/run/verify.run b/repos/ports/run/verify.run index b92a6aaa36..93f565c839 100644 --- a/repos/ports/run/verify.run +++ b/repos/ports/run/verify.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_arg --autopilot]} { + assert {![have_board virt_qemu_riscv]} \ + "Autopilot mode is not supported on this platform." } create_boot_directory diff --git a/repos/ports/run/virtualbox.run b/repos/ports/run/virtualbox.run index e50037da7e..433362afc9 100644 --- a/repos/ports/run/virtualbox.run +++ b/repos/ports/run/virtualbox.run @@ -1,4 +1,4 @@ -assert_spec nova +assert {[have_spec nova]} set use_net 0 set use_usb_qemu 0 diff --git a/repos/ports/run/virtualbox6.run b/repos/ports/run/virtualbox6.run index f7be2deec6..d0b854c48b 100644 --- a/repos/ports/run/virtualbox6.run +++ b/repos/ports/run/virtualbox6.run @@ -1,4 +1,4 @@ -assert_spec x86_64 +assert {[have_spec x86_64]} set use_net 0 set use_overlay 0 diff --git a/repos/ports/run/virtualbox_auto.inc b/repos/ports/run/virtualbox_auto.inc index f76838ce84..25abfa63f8 100644 --- a/repos/ports/run/virtualbox_auto.inc +++ b/repos/ports/run/virtualbox_auto.inc @@ -1,18 +1,11 @@ -assert_spec x86 +assert {[have_spec x86]} +assert {[have_spec nova] || [have_spec foc]} -if {(![have_spec nova] && ![have_spec foc])} { - puts "Platform is unsupported." - exit 0 -} +assert {![have_include power_on/qemu]} -if {[have_include "power_on/qemu"]} { - puts "\nRun script does not support Qemu.\n" - exit -} - -if { [get_cmd_switch --autopilot] && [have_spec x86_32] } { - puts "Run script does not support autopilot mode on 32 bit" - exit 0 +if {[have_cmd_arg --autopilot]} { + assert {![have_spec x86_32]} \ + "Autopilot mode is not supported on this platform." } if {[have_spec nova]} { diff --git a/repos/ports/run/vm_stress_vbox5-debian32.run b/repos/ports/run/vm_stress_vbox5-debian32.run index ba41d5d9e1..908a58e4fd 100644 --- a/repos/ports/run/vm_stress_vbox5-debian32.run +++ b/repos/ports/run/vm_stress_vbox5-debian32.run @@ -2,8 +2,8 @@ # Debian 32bit VM cloning Genode git sources, preparing and building pieces # -assert_spec x86 -assert_spec nova +assert {[have_spec x86]} +assert {[have_spec nova]} set flavor "stress_32" set vm_ram "1280M" diff --git a/repos/ports/run/vm_stress_vbox5-debian64.run b/repos/ports/run/vm_stress_vbox5-debian64.run index 077c668cc2..30b739d443 100644 --- a/repos/ports/run/vm_stress_vbox5-debian64.run +++ b/repos/ports/run/vm_stress_vbox5-debian64.run @@ -2,8 +2,8 @@ # Debian 64bit VM cloning Genode git sources, preparing and building pieces # -assert_spec x86 -assert_spec nova +assert {[have_spec x86]} +assert {[have_spec nova]} set flavor "stress_64" set vm_ram "1280M" diff --git a/repos/ports/run/vmm_vm_stress.inc b/repos/ports/run/vmm_vm_stress.inc index c7d6ad162f..0b39f7d454 100644 --- a/repos/ports/run/vmm_vm_stress.inc +++ b/repos/ports/run/vmm_vm_stress.inc @@ -1,9 +1,10 @@ #!/usr/bin/expect -set current_date [clock format [clock seconds] -format %a] -if {[get_cmd_switch --autopilot] && $current_date != "Sat" && $current_date != "Sun" } { - puts "\n Run script is not supported on this platform today. \n"; - exit 0 +if {[have_cmd_arg --autopilot]} { + set current_date [clock format [clock seconds] -format %a] + assert {$current_date == "Sat" || $current_date == "Sun"} \ + "Autopilot mode is not supported on this platform today." + } } run_genode_until $match_boot_string 40