mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
563f55e57b
This test was originally a copy of ping.run and therefore unnecessarily inherited all its complexity for testing ping component behavior. Additionally, ping.run was more actively maintained and evolved over time whereas nic_dump.run didn't receive the same care. Now, the test fails on certain platforms although NIC dump works just fine. Therefore, this commit reduces the test behavior to what is really necessary for testing nic_dump and by doing so, also fixes the failing targets. Fixes #4926
139 lines
3.3 KiB
Plaintext
139 lines
3.3 KiB
Plaintext
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
|
|
}
|
|
|
|
create_boot_directory
|
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
[depot_user]/pkg/[drivers_nic_pkg] \
|
|
[depot_user]/src/init \
|
|
[depot_user]/src/nic_bridge \
|
|
[depot_user]/src/nic_router \
|
|
|
|
build { app/ping server/nic_dump }
|
|
|
|
proc dst_ip { } {
|
|
if {![have_include power_on/qemu]} {
|
|
return "10.0.0.2"
|
|
} else {
|
|
return "10.0.2.2"
|
|
}
|
|
}
|
|
|
|
append config {
|
|
|
|
<config>
|
|
|
|
<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>
|
|
|
|
<default-route>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</default-route>
|
|
|
|
<default caps="100"/>
|
|
|
|
<start name="timer">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides><service name="Timer"/></provides>
|
|
</start>
|
|
|
|
<start name="drivers" caps="1000" managing_system="yes">
|
|
<resource name="RAM" quantum="32M"/>
|
|
<binary name="init"/>
|
|
<route>
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
|
<any-service> <parent/> </any-service>
|
|
</route>
|
|
<provides> <service name="Nic"/> </provides>
|
|
</start>
|
|
|
|
<start name="nic_router" caps="200">
|
|
<resource name="RAM" quantum="10M"/>
|
|
<provides>
|
|
<service name="Nic"/>
|
|
<service name="Uplink"/>
|
|
</provides>
|
|
<config dhcp_discover_timeout_sec="1">
|
|
|
|
<policy label_prefix="nic_dump" domain="downlink"/>
|
|
<policy label_prefix="drivers" domain="uplink"/>
|
|
|
|
<domain name="uplink">
|
|
|
|
<nat domain="downlink" icmp-ids="100" udp-ports="100"/>
|
|
|
|
</domain>
|
|
|
|
<domain name="downlink" interface="10.0.3.1/24">
|
|
|
|
<dhcp-server ip_first="10.0.3.2" ip_last="10.0.3.2"/>
|
|
<icmp dst="} [dst_ip] {/24" domain="uplink"/>
|
|
|
|
</domain>
|
|
|
|
</config>
|
|
</start>
|
|
|
|
<start name="nic_dump" caps="200">
|
|
<resource name="RAM" quantum="10M"/>
|
|
<provides><service name="Nic"/></provides>
|
|
<config uplink="uplink"
|
|
downlink="downlink"
|
|
time="yes"
|
|
default="name"
|
|
eth="name"
|
|
arp="all"
|
|
ipv4="default"
|
|
dhcp="no"
|
|
udp="no"
|
|
icmp="all"
|
|
tcp="default" />
|
|
<route>
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>
|
|
|
|
<start name="ping">
|
|
<resource name="RAM" quantum="8M"/>
|
|
<config interface="10.0.3.2/24"
|
|
gateway="10.0.3.1"
|
|
dst_ip="} [dst_ip] {"
|
|
period_sec="1"
|
|
verbose="no"/>
|
|
<route>
|
|
<service name="Nic"> <child name="nic_dump"/> </service>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>
|
|
|
|
</config>
|
|
}
|
|
|
|
install_config $config
|
|
|
|
build_boot_image [build_artifacts]
|
|
|
|
append qemu_args " -nographic "
|
|
append_qemu_nic_args
|
|
|
|
run_genode_until ".*child \"ping\" exited with exit value 0.*\n" 60
|