diff --git a/repos/os/run/assert_nic.inc b/repos/os/run/assert_nic.inc new file mode 100644 index 0000000000..504335a7eb --- /dev/null +++ b/repos/os/run/assert_nic.inc @@ -0,0 +1,20 @@ +# +# there are no nic driver packages for these targets +# +if {[have_board rpi3] || + [have_board imx53_qsb_tz]} { + + puts "Run script is not supported on this platform." + exit 0 +} + +# +# these targets would require extra setup on the autopilot which is not desired +# +if {[get_cmd_switch --autopilot] && ([have_spec linux] || + [have_board zynq_qemu] || + [have_board virt_qemu_riscv])} { + + puts "Autopilot mode is not supported on this platform." + exit 0 +} diff --git a/repos/os/run/assert_qemu_nic.inc b/repos/os/run/assert_qemu_nic.inc new file mode 100644 index 0000000000..b369bd9ab0 --- /dev/null +++ b/repos/os/run/assert_qemu_nic.inc @@ -0,0 +1,10 @@ +source ${genode_dir}/repos/os/run/assert_nic.inc + +# +# the test should be run isolated as it would disturb normal network operation +# +if {![have_include power_on/qemu]} { + + puts "Run script is not supported on this platform." + exit 0 +} diff --git a/repos/os/run/nic_dump.run b/repos/os/run/nic_dump.run index ec056086c7..ea1ae5685c 100644 --- a/repos/os/run/nic_dump.run +++ b/repos/os/run/nic_dump.run @@ -1,13 +1,4 @@ -if {[have_spec foc] || [have_spec linux] || [have_board rpi3] || - [have_board imx53_qsb_tz]} { - puts "Run script is not supported on 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 -} +source ${genode_dir}/repos/os/run/assert_nic.inc create_boot_directory diff --git a/repos/os/run/nic_router_disable_arp.run b/repos/os/run/nic_router_disable_arp.run index 828485188a..8f026c6315 100644 --- a/repos/os/run/nic_router_disable_arp.run +++ b/repos/os/run/nic_router_disable_arp.run @@ -1,14 +1,4 @@ -if {![have_include power_on/qemu] || [have_spec foc] || [have_spec linux] || - [have_board rpi3] || [have_board imx53_qsb_tz]} { - - puts "Run script is not supported on 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 -} +source ${genode_dir}/repos/os/run/assert_qemu_nic.inc create_boot_directory diff --git a/repos/os/run/nic_router_flood.run b/repos/os/run/nic_router_flood.run index 2c8028ae33..899f00b427 100644 --- a/repos/os/run/nic_router_flood.run +++ b/repos/os/run/nic_router_flood.run @@ -1,18 +1,4 @@ -if {![have_include power_on/qemu] || - [have_spec foc] || - [have_board rpi3] || - [have_board imx53_qsb_tz]} { - - puts "Run script is not supported on this platform." - exit 0 -} - -if {[get_cmd_switch --autopilot] && ([have_board virt_qemu_riscv] || - [have_board zynq_qemu])} { - - puts "Autopilot mode is not supported on this platform." - exit 0 -} +source ${genode_dir}/repos/os/run/assert_qemu_nic.inc proc num_ping_rounds { } { if {[have_spec sel4] && [have_spec x86]} { diff --git a/repos/os/run/nic_uplink.run b/repos/os/run/nic_uplink.run index 8f23dd2251..05d7fdf188 100755 --- a/repos/os/run/nic_uplink.run +++ b/repos/os/run/nic_uplink.run @@ -1,20 +1,4 @@ -# -# there are no nic driver packages for rpi3 and imx53 tz -# -if {[have_board rpi3] || [have_board imx53_qsb_tz]} { - puts "Run script is not supported on this platform." - exit 0 -} - -# -# lx & riscv would require extra setup on the test machine which is not desired -# -if {[get_cmd_switch --autopilot] && ([have_spec linux] || - [have_board virt_qemu_riscv])} { - - puts "Autopilot mode is not supported on this platform." - exit 0 -} +source ${genode_dir}/repos/os/run/assert_nic.inc proc test_timeout { } { if {[have_spec sel4] && [have_board pc]} { return 60 } diff --git a/repos/os/run/ping.run b/repos/os/run/ping.run index 8274667e7b..07a2b9f27a 100644 --- a/repos/os/run/ping.run +++ b/repos/os/run/ping.run @@ -32,16 +32,7 @@ # ! sudo dhclient -v eth0 # -if {[have_spec foc] || [have_board rpi3] || [have_board imx53_qsb_tz]} { - puts "Run script is not supported on this platform." - exit 0 -} - -if {[get_cmd_switch --autopilot] && ([have_spec linux] || - [have_board virt_qemu_riscv])} { - puts "Autopilot mode is not supported on this platform." - exit 0 -} +source ${genode_dir}/repos/os/run/assert_nic.inc set on_linux_with_dst_ip "" catch {set on_linux_with_dst_ip $::env(ON_LINUX_WITH_DST_IP)} diff --git a/repos/os/run/ping_nic_router.run b/repos/os/run/ping_nic_router.run index 8c9b22e600..cfad0e4b00 100644 --- a/repos/os/run/ping_nic_router.run +++ b/repos/os/run/ping_nic_router.run @@ -1,13 +1,4 @@ -if {[have_spec foc] || [have_spec linux] || [have_board rpi3] || - [have_board imx53_qsb_tz]} { - puts "Run script is not supported on 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 -} +source ${genode_dir}/repos/os/run/assert_nic.inc set on_hardware [expr ![have_include power_on/qemu]]