2020-11-04 15:34:22 +00:00
|
|
|
if {![have_include power_on/qemu] || [have_spec foc] || [have_spec linux] ||
|
2021-01-13 09:15:10 +00:00
|
|
|
[have_board rpi3] || [have_board imx53_qsb_tz]} {
|
2020-11-04 15:34:22 +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-02-18 08:04:39 +00:00
|
|
|
puts "Autopilot mode is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
2020-11-04 15:34:22 +00:00
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
import_from_depot [depot_user]/src/[base_src] \
|
|
|
|
[depot_user]/pkg/[drivers_nic_pkg]
|
|
|
|
|
|
|
|
build { app/ping server/nic_router init }
|
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
install_config {
|
2020-11-04 15:34:22 +00:00
|
|
|
<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="200"/>
|
|
|
|
|
|
|
|
<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>
|
2021-01-08 16:27:24 +00:00
|
|
|
<service name="Uplink"> <child name="nic_router"/> </service>
|
2020-11-04 15:34:22 +00:00
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="nic_router">
|
|
|
|
<resource name="RAM" quantum="10M"/>
|
2020-12-07 15:46:15 +00:00
|
|
|
<provides>
|
|
|
|
<service name="Nic"/>
|
|
|
|
<service name="Uplink"/>
|
|
|
|
</provides>
|
2020-11-04 15:34:22 +00:00
|
|
|
<config>
|
|
|
|
|
2021-01-08 16:27:24 +00:00
|
|
|
<policy label_prefix="ping" domain="downlink"/>
|
|
|
|
<policy label_prefix="drivers" domain="uplink"/>
|
2020-11-04 15:34:22 +00:00
|
|
|
|
|
|
|
<domain name="uplink" use_arp="no" verbose_packets="yes">
|
|
|
|
<nat domain="downlink" icmp-ids="100"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
<domain name="downlink" interface="10.0.3.1/24">
|
|
|
|
<icmp dst="10.0.2.2/24" domain="uplink"/>
|
|
|
|
</domain>
|
|
|
|
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
<start name="ping">
|
|
|
|
<resource name="RAM" quantum="8M"/>
|
|
|
|
<config interface="10.0.3.2/24"
|
|
|
|
gateway="10.0.3.1"
|
|
|
|
dst_ip="10.0.2.2"
|
|
|
|
period_sec="1"
|
|
|
|
count="2"/>
|
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="nic_router"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
</config>}
|
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
build_boot_image [build_artifacts]
|
2020-11-04 15:34:22 +00:00
|
|
|
|
|
|
|
append qemu_args " -nographic "
|
|
|
|
append_qemu_nic_args
|
|
|
|
|
|
|
|
set done_string ".*child \"ping\" exited with exit value 0.*\n"
|
|
|
|
|
2023-06-13 12:06:13 +00:00
|
|
|
run_genode_until $done_string 60
|
2020-11-04 15:34:22 +00:00
|
|
|
|
|
|
|
grep_output { ARP }
|
|
|
|
compare_output_to {}
|