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] ||
|
2019-06-24 09:03:34 +00:00
|
|
|
[have_spec rpi3] ||
|
2018-06-08 15:44:19 +00:00
|
|
|
[expr [have_spec imx53] && [have_spec trustzone]]} {
|
|
|
|
|
|
|
|
puts "Run script is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2019-05-21 12:14:32 +00:00
|
|
|
proc test_timeout { } {
|
|
|
|
if {[have_spec sel4] && [have_spec x86]} {
|
|
|
|
return 240
|
|
|
|
}
|
|
|
|
if {[have_spec okl4] || [have_spec pistachio]} {
|
|
|
|
return 240
|
|
|
|
}
|
|
|
|
return 120
|
|
|
|
}
|
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] \
|
2019-10-08 08:57:22 +00:00
|
|
|
[depot_user]/src/init
|
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 {
|
2018-06-08 15:44:19 +00:00
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
2018-09-30 15:27:14 +00:00
|
|
|
<service name="RAM"/>
|
2018-06-08 15:44:19 +00:00
|
|
|
<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>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2019-04-24 13:09:49 +00:00
|
|
|
<default caps="100"/>
|
2018-09-30 15:27:14 +00:00
|
|
|
|
2018-06-08 15:44:19 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
|
|
|
|
2020-07-10 11:04:12 +00:00
|
|
|
<start name="drivers" caps="1000" managing_system="yes">
|
|
|
|
<resource name="RAM" quantum="32M"/>
|
2019-04-24 13:09:49 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
<provides> <service name="Nic"/> </provides>
|
2018-06-08 15:44:19 +00:00
|
|
|
</start>
|
|
|
|
|
2019-10-08 08:57:22 +00:00
|
|
|
<start name="dynamic_rom">
|
|
|
|
<resource name="RAM" quantum="4M"/>
|
|
|
|
<provides><service name="ROM"/> </provides>
|
|
|
|
<config verbose="yes">
|
|
|
|
<rom name="nic_router.config">
|
|
|
|
<inline>
|
|
|
|
|
|
|
|
<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="flood_links" domain="flood_links"/>
|
|
|
|
<policy label_prefix="ping" domain="flood_links"/>
|
|
|
|
<uplink domain="uplink"/>
|
|
|
|
|
|
|
|
<domain name="uplink" interface="10.0.2.15/24" gateway="10.0.2.2" verbose_packets="no">
|
|
|
|
<nat domain="flood_links" udp-ports="16384"
|
|
|
|
tcp-ports="16384"
|
|
|
|
icmp-ids="16384"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="flood_links" 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>
|
|
|
|
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="10000"/>
|
|
|
|
<inline>
|
|
|
|
|
|
|
|
<config verbose="no"
|
|
|
|
verbose_packets="no"
|
|
|
|
verbose_packet_drop="no"
|
|
|
|
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="flood_links" domain="flood_links"/>
|
|
|
|
<policy label_prefix="ping" domain="flood_links"/>
|
|
|
|
<uplink domain="uplink"/>
|
|
|
|
|
|
|
|
<domain name="uplink" verbose_packets="no">
|
|
|
|
<nat domain="flood_links" udp-ports="16384"
|
|
|
|
tcp-ports="16384"
|
|
|
|
icmp-ids="16384"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="flood_links" 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>
|
|
|
|
|
|
|
|
</inline>
|
|
|
|
<sleep milliseconds="10000"/>
|
|
|
|
|
|
|
|
</rom>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
2018-06-08 15:44:19 +00:00
|
|
|
<start name="nic_router" caps="200">
|
2019-05-08 14:10:40 +00:00
|
|
|
<resource name="RAM" quantum="10M"/>
|
2018-06-08 15:44:19 +00:00
|
|
|
<provides><service name="Nic"/></provides>
|
|
|
|
<route>
|
2019-10-08 08:57:22 +00:00
|
|
|
<service name="ROM" label="config"> <child name="dynamic_rom" label="nic_router.config"/> </service>
|
2019-04-24 13:09:49 +00:00
|
|
|
<service name="Nic"> <child name="drivers"/> </service>
|
2018-06-08 15:44:19 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
2019-05-08 14:10:40 +00:00
|
|
|
<start name="flood_links_tcp">
|
|
|
|
<binary name="test-net_flood"/>
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config dst_ip="} [bad_dst_ip] {"
|
|
|
|
protocol="tcp"
|
|
|
|
verbose="no"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
<start name="flood_links_udp">
|
|
|
|
<binary name="test-net_flood"/>
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config dst_ip="} [bad_dst_ip] {"
|
|
|
|
protocol="udp"
|
|
|
|
verbose="no"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
<start name="flood_links_icmp">
|
|
|
|
<binary name="test-net_flood"/>
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config dst_ip="} [bad_dst_ip] {"
|
|
|
|
protocol="icmp"
|
|
|
|
verbose="no"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
2018-06-08 15:44:19 +00:00
|
|
|
</start>
|
|
|
|
|
2019-05-08 14:10:40 +00:00
|
|
|
|
|
|
|
<start name="ping">
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config dst_ip="} [good_dst_ip] {"
|
|
|
|
period_sec="2"
|
|
|
|
count="999"/>
|
2018-06-08 15:44:19 +00:00
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
</config>}
|
|
|
|
|
2019-10-08 08:57:22 +00:00
|
|
|
build_boot_image { test-net_flood ping nic_router dynamic_rom }
|
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
|
|
|
|
2019-05-21 12:14:32 +00:00
|
|
|
run_genode_until {.*ping\] 64 bytes from 10\.0\.2\.2: icmp_seq=30 .*\n} [test_timeout]
|