mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 00:24:51 +00:00
run: remove NIC driver from nic_*.run tests
Instead of having a lot of platform specific quirks in the run test, and to also test it on platforms currently missing a NIC driver, this commit removes hardware drivers from the nic_router and nic_bridge run scripts, and uses the nic_loopback server instead.
This commit is contained in:
parent
4853d61c3b
commit
9d16169a65
@ -44,8 +44,6 @@ append config {
|
||||
|
||||
<default caps="100"/>
|
||||
|
||||
} [gpio_drv_config] {
|
||||
} [nic_drv_config] {
|
||||
} [platform_drv_config] {
|
||||
|
||||
<start name="timer" priority="0">
|
||||
@ -53,6 +51,11 @@ append config {
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="nic_loopback" priority="-1">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Nic"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="nic_dump" priority="-1">
|
||||
<resource name="RAM" quantum="6M"/>
|
||||
<provides><service name="Nic"/></provides>
|
||||
@ -122,7 +125,7 @@ append config {
|
||||
<policy label_prefix="udp_server_3" ip_addr="10.0.2.213" />
|
||||
</config>
|
||||
<route>
|
||||
<service name="Nic"> <child name="} [nic_drv] {"/> </service>
|
||||
<service name="Nic"> <child name="nic_loopback"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
@ -1,67 +1,9 @@
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
|
||||
proc nic_drv { } {
|
||||
if {[nic_drv_binary] == "usb_drv"} { return usb_drv }
|
||||
if {[nic_drv_binary] == ""} { return "" }
|
||||
return nic_drv
|
||||
}
|
||||
|
||||
proc gpio_drv { } {
|
||||
if {[have_spec rpi] && [have_spec hw]} { return hw_gpio_drv }
|
||||
if {[have_spec rpi] && [have_spec foc]} { return foc_gpio_drv }
|
||||
if {[have_spec gpio]} { return gpio_drv }
|
||||
}
|
||||
|
||||
if {[nic_drv] == ""} {
|
||||
puts "\n Run script is not supported on this platform. \n"; exit 0 }
|
||||
|
||||
proc nic_drv_build { } {
|
||||
if {[nic_drv] == "nic_drv"} { return drivers/nic }
|
||||
if {[nic_drv] == "usb_drv"} { return drivers/usb }
|
||||
}
|
||||
|
||||
proc gpio_drv_build { } { if {[gpio_drv] != ""} { return drivers/gpio } }
|
||||
|
||||
set targets "core init drivers/timer server/nic_router server/nic_bridge
|
||||
test/lwip/http_srv_static test/lwip/http_clnt test/lwip/udp
|
||||
[nic_drv_build] [gpio_drv_build] [platform_drv_build_components]"
|
||||
|
||||
proc gpio_drv_config { } {
|
||||
if {[have_spec gpio]} {
|
||||
append result {
|
||||
<start name="} [gpio_drv] {" caps="140" priority="-1">
|
||||
<resource name="RAM" quantum="4M"/>
|
||||
<provides><service name="Gpio"/></provides>
|
||||
</start>}
|
||||
return $result
|
||||
}
|
||||
}
|
||||
|
||||
proc nic_drv_config { } {
|
||||
if {[nic_drv] == "nic_drv"} {
|
||||
append result {
|
||||
<start name="nic_drv" priority="-1">
|
||||
<binary name="} [nic_drv_binary] {"/>
|
||||
<resource name="RAM" quantum="6M"/>
|
||||
<provides><service name="Nic"/></provides>
|
||||
</start>}
|
||||
return $result
|
||||
}
|
||||
if {[nic_drv] == "usb_drv"} {
|
||||
append result {
|
||||
<start name="usb_drv" caps="120" priority="-1">
|
||||
<resource name="RAM" quantum="14M"/>
|
||||
<provides>
|
||||
<service name="Nic"/>
|
||||
</provides>
|
||||
<config ehci="yes">
|
||||
<nic mac="02:00:00:00:01:01" />
|
||||
</config>
|
||||
</start>}
|
||||
return $result
|
||||
}
|
||||
}
|
||||
server/nic_loopback [platform_drv_build_components]"
|
||||
|
||||
proc client_bin { prot } {
|
||||
if {$prot == "udp"} { return "test-lwip-udp-client" }
|
||||
@ -110,13 +52,8 @@ proc server_config { name prot ip_addr gateway netmask nic port } {
|
||||
}
|
||||
|
||||
set boot_modules "
|
||||
core init timer nic_router nic_bridge ld.lib.so libc.lib.so libm.lib.so
|
||||
lwip.lib.so posix.lib.so [client_bin udp] [server_bin udp]
|
||||
[client_bin http] [server_bin http] [nic_drv_binary] [gpio_drv]
|
||||
[platform_drv_boot_modules]"
|
||||
core init timer nic_router nic_bridge nic_loopback ld.lib.so
|
||||
libc.lib.so lwip.lib.so [client_bin udp] [server_bin udp]
|
||||
[client_bin http] [server_bin http] [platform_drv_boot_modules]"
|
||||
|
||||
proc nic_qemu_args { } {
|
||||
if {[have_spec x86]} { return "-net nic,model=e1000" }
|
||||
if {[have_spec lan9118]} { return "-net nic,model=lan9118" } }
|
||||
|
||||
append qemu_args "-nographic -net user [nic_qemu_args]"
|
||||
append qemu_args "-nographic "
|
||||
|
@ -190,8 +190,6 @@ append config {
|
||||
|
||||
<default caps="100"/>
|
||||
|
||||
} [gpio_drv_config] {
|
||||
} [nic_drv_config] {
|
||||
} [platform_drv_config] {
|
||||
|
||||
<start name="timer" priority="0">
|
||||
@ -200,6 +198,11 @@ append config {
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
|
||||
<start name="nic_loopback" priority="-1">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides> <service name="Nic"/> </provides>
|
||||
</start>
|
||||
|
||||
<start name="nic_router" caps="200" priority="-1">
|
||||
<resource name="RAM" quantum="10M"/>
|
||||
<provides><service name="Nic"/></provides>
|
||||
@ -250,7 +253,7 @@ append config {
|
||||
<policy label_prefix="udp_server_3" ip_addr="10.0.2.213" />
|
||||
</config>
|
||||
<route>
|
||||
<service name="Nic"> <child name="} [nic_drv] {"/> </service>
|
||||
<service name="Nic"> <child name="nic_loopback"/> </service>
|
||||
<any-service> <parent/> <any-child/> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
Loading…
x
Reference in New Issue
Block a user