2018-06-08 15:44:19 +00:00
|
|
|
if {![have_include power_on/qemu] ||
|
2019-04-24 13:09:49 +00:00
|
|
|
[have_spec foc] ||
|
2021-01-13 09:15:10 +00:00
|
|
|
[have_board rpi3] ||
|
|
|
|
[have_board imx53_qsb_tz]} {
|
2018-06-08 15:44:19 +00:00
|
|
|
|
|
|
|
puts "Run script is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2022-08-09 11:32:38 +00:00
|
|
|
if {[get_cmd_switch --autopilot] && ([have_board virt_qemu_riscv] ||
|
2021-03-26 10:18:46 +00:00
|
|
|
[have_board zynq_qemu])} {
|
2023-07-05 10:02:11 +00:00
|
|
|
|
2021-02-18 08:04:39 +00:00
|
|
|
puts "Autopilot mode is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2023-06-13 12:21:50 +00:00
|
|
|
proc num_ping_rounds { } {
|
2019-05-21 12:14:32 +00:00
|
|
|
if {[have_spec sel4] && [have_spec x86]} {
|
2023-06-13 12:21:50 +00:00
|
|
|
return 10
|
2019-05-21 12:14:32 +00:00
|
|
|
}
|
|
|
|
if {[have_spec okl4] || [have_spec pistachio]} {
|
2023-06-13 12:21:50 +00:00
|
|
|
return 10
|
2019-05-21 12:14:32 +00:00
|
|
|
}
|
2023-06-13 12:21:50 +00:00
|
|
|
return 30
|
2019-05-21 12:14:32 +00:00
|
|
|
}
|
2019-05-08 14:10:40 +00:00
|
|
|
|
|
|
|
proc good_dst_ip { } { return "10.0.2.2" }
|
|
|
|
proc bad_dst_ip { } { return "10.0.0.123" }
|
2018-06-08 15:44:19 +00:00
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/pkg/[drivers_nic_pkg] \
|
2023-07-05 10:02:11 +00:00
|
|
|
[depot_user]/src/init \
|
|
|
|
[depot_user]/src/report_rom
|
2018-06-08 15:44:19 +00:00
|
|
|
|
2019-10-08 08:57:22 +00:00
|
|
|
build { app/ping test/net_flood server/nic_router server/dynamic_rom }
|
2019-04-24 13:09:49 +00:00
|
|
|
|
|
|
|
install_config {
|
2023-07-05 10:02:11 +00:00
|
|
|
|
|
|
|
<config prio_levels="4">
|
|
|
|
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
|
|
|
|
<start name="timer" caps="100" priority="0">
|
|
|
|
<resource name="CPU" quantum="10"/>
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
<route>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="IO_PORT"> <parent/> </service>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
|
|
|
<service name="IRQ"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="drivers" caps="1200" managing_system="yes" priority="0">
|
|
|
|
<binary name="init"/>
|
|
|
|
<resource name="CPU" quantum="10"/>
|
|
|
|
<resource name="RAM" quantum="32M"/>
|
|
|
|
<route>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
<service name="RM"> <parent/> </service>
|
|
|
|
<service name="IO_PORT"> <parent/> </service>
|
|
|
|
<service name="IO_MEM"> <parent/> </service>
|
|
|
|
<service name="IRQ"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nic_router" caps="200" priority="-1">
|
|
|
|
<resource name="CPU" quantum="10"/>
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
|
|
|
<config verbose="no"
|
|
|
|
verbose_packets="no"
|
|
|
|
verbose_packet_drop="yes"
|
|
|
|
verbose_domain_state="yes"
|
|
|
|
dhcp_discover_timeout_sec="1"
|
|
|
|
tcp_idle_timeout_sec="3600"
|
|
|
|
udp_idle_timeout_sec="3600"
|
|
|
|
icmp_idle_timeout_sec="3600">
|
|
|
|
|
|
|
|
<policy label_prefix="net_clients" domain="net_clients"/>
|
|
|
|
<policy label_prefix="drivers" domain="uplink"/>
|
|
|
|
|
|
|
|
<domain name="uplink" interface="10.0.2.15/24" gateway="10.0.2.2" verbose_packets="no">
|
|
|
|
<nat domain="net_clients" udp-ports="16384" tcp-ports="16384" icmp-ids="16384"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="net_clients" interface="10.0.1.1/24">
|
|
|
|
<dhcp-server ip_first="10.0.1.100" ip_last="10.0.1.200"/>
|
|
|
|
<icmp dst="0.0.0.0/0" domain="uplink"/>
|
|
|
|
<udp dst="0.0.0.0/0"><permit-any domain="uplink"/></udp>
|
|
|
|
<tcp dst="0.0.0.0/0"><permit-any domain="uplink"/></tcp>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="Report"> <child name="report_rom"/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="report_rom" caps="100" priority="-1">
|
|
|
|
<resource name="CPU" quantum="10"/>
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Report"/> <service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes"/>
|
|
|
|
<route>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="dynamic_rom" caps="100" priority="-1">
|
|
|
|
<resource name="CPU" quantum="10"/>
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/> </provides>
|
|
|
|
<config>
|
|
|
|
<rom name="net_clients.config">
|
|
|
|
|
|
|
|
<!-- give the drivers time to come up -->
|
|
|
|
<inline> <config/> </inline>
|
|
|
|
|
|
|
|
<sleep milliseconds="5000"/>
|
|
|
|
|
|
|
|
<inline>
|
|
|
|
|
|
|
|
<config>
|
|
|
|
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Timer"/>
|
|
|
|
</parent-provides>
|
|
|
|
|
|
|
|
<start name="tcp_flood" caps="100">
|
|
|
|
<binary name="test-net_flood"/>
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config dst_ip="} [bad_dst_ip] {" protocol="tcp" verbose="no"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <parent/> </service>
|
|
|
|
<service name="Timer"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="udp_flood" caps="100">
|
|
|
|
<binary name="test-net_flood"/>
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config dst_ip="} [bad_dst_ip] {" protocol="udp" verbose="no"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <parent/> </service>
|
|
|
|
<service name="Timer"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="icmp_flood" caps="100">
|
|
|
|
<binary name="test-net_flood"/>
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config dst_ip="} [bad_dst_ip] {" protocol="icmp" verbose="no"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <parent/> </service>
|
|
|
|
<service name="Timer"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="ping" caps="100">
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config dst_ip="} [good_dst_ip] {" period_sec="2" count="999"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <parent/> </service>
|
|
|
|
<service name="Timer"> <parent/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="3600000"/>
|
|
|
|
</rom>
|
|
|
|
</config>
|
|
|
|
<route>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="net_clients" caps="1000" priority="-2">
|
|
|
|
<binary name="init"/>
|
|
|
|
<resource name="CPU" quantum="0"/>
|
|
|
|
<resource name="RAM" quantum="200M"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <child name="dynamic_rom" label="net_clients.config"/> </service>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<service name="PD"> <parent/> </service>
|
|
|
|
<service name="ROM"> <parent/> </service>
|
|
|
|
<service name="LOG"> <parent/> </service>
|
|
|
|
<service name="CPU"> <parent/> </service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
}
|
2018-06-08 15:44:19 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
build_boot_image [build_artifacts]
|
2018-06-08 15:44:19 +00:00
|
|
|
|
2019-04-24 13:09:49 +00:00
|
|
|
append qemu_args " -nographic "
|
2020-04-02 19:20:50 +00:00
|
|
|
append_qemu_nic_args
|
2018-06-08 15:44:19 +00:00
|
|
|
|
2023-07-05 10:02:11 +00:00
|
|
|
run_genode_until ".*ping\] 64 bytes from 10\.0\.2\.2: icmp_seq=[num_ping_rounds] .*\n" 125
|