nic_router.run: test hub functionality

The new test 7 is by now deactivated by default as enabling all tests at a time
would trigger resource exhaustion on some platforms.

Issue #2609
This commit is contained in:
Martin Stein 2017-12-13 17:02:45 +01:00 committed by Christian Helmuth
parent 4927a6f679
commit 9e1d776da5

View File

@ -8,7 +8,8 @@ proc enable_test_3 { } { return 1 }
proc enable_test_4 { } { return 1 }
proc enable_test_5 { } { return 1 }
proc enable_test_6 { } { return 1 }
proc nr_of_clients { } { return 6 }
proc enable_test_7 { } { return 0 }
proc nr_of_clients { } { return 7 }
source ${genode_dir}/repos/libports/run/nic_router.inc
@ -19,7 +20,8 @@ create_boot_directory
proc test_1_config { } {
if {[enable_test_1]} { return "
[client_config udp_client_1 udp 10.0.98.55 10.0.98.33 255.255.255.0 nic_router 1337 10.0.98.33]
[server_config udp_server_1 udp 10.0.99.55 10.0.99.33 255.255.255.0 nic_router 1337 ]" }
[client_config lan_1_udp_client_1 udp 10.0.99.56 10.0.99.33 255.255.255.0 nic_router 1337 10.0.99.55]
[server_config lan_1_udp_server_1 udp 10.0.99.55 10.0.99.33 255.255.255.0 nic_router 1337 ]" }
}
proc test_2_config { } {
@ -52,6 +54,15 @@ proc test_6_config { } {
[server_config http_server_3 http 10.0.2.203 10.0.2.1 255.255.255.0 nic_bridge 2345 ]" }
}
proc test_7_config { } {
if {[enable_test_7]} { return "
[client_config lan_2_client_1 http 100.200.0.128 100.200.0.1 255.255.0.0 nic_router 2345 10.0.2.204]
[client_config lan_2_client_2 http 100.200.0.64 100.200.0.1 255.255.0.0 nic_router 3456 10.0.2.240]
[client_config lan_2_client_3 http 100.200.0.32 100.200.0.1 255.255.0.0 nic_router 3456 10.0.2.240]
[server_config lan_3_server_1 http 10.0.2.204 10.0.2.1 255.255.255.0 nic_router 2345 ]
[server_config lan_3_server_2 http 10.0.2.240 10.0.2.1 255.255.255.0 nic_router 3456 ]" }
}
append config {
<config prio_levels="2">
<parent-provides>
@ -98,7 +109,7 @@ append config {
<policy label_prefix="udp_client_3" domain="udp_client_3" />
<policy label_prefix="http_server_1" domain="http_server_1" />
<policy label_prefix="http_server_2" domain="http_server_2" />
<policy label_prefix="udp_server_1" domain="udp_server_1" />
<policy label_prefix="lan_1" domain="lan_1" />
<policy label_prefix="udp_server_2" domain="udp_server_2" />
<domain name="uplink" interface="10.0.2.55/24" gateway="10.0.2.1">
@ -110,7 +121,7 @@ append config {
</domain>
<domain name="udp_client_1" interface="10.0.98.33/24">
<udp-forward port="1337" domain="udp_server_1" to="10.0.99.55" />
<udp-forward port="1337" domain="lan_1" to="10.0.99.55" />
</domain>
<domain name="http_client_3" interface="100.200.0.1/24">
@ -125,9 +136,23 @@ append config {
<domain name="http_server_1" interface="192.168.1.1/24" />
<domain name="http_server_2" interface="192.168.2.1/24" />
<domain name="udp_server_1" interface="10.0.99.33/24" />
<domain name="lan_1" interface="10.0.99.33/24" />
<domain name="udp_server_2" interface="18.17.16.14/24" />
<policy label_prefix="lan_2" domain="lan_2" />
<policy label_prefix="lan_3" domain="lan_3" />
<domain name="lan_2" interface="100.200.0.1/24">
<tcp dst="10.0.0.0/16">
<permit port="2345" domain="lan_3" />
<permit port="3456" domain="lan_3" />
</tcp>
</domain>
<domain name="lan_3" interface="10.0.2.1/24">
<nat domain="lan_2" tcp-ports="18" />
</domain>
</config>
<route>
<service name="Nic"> <child name="nic_bridge"/> </service>
@ -158,6 +183,7 @@ append config {
} [test_4_config] {
} [test_5_config] {
} [test_6_config] {
} [test_7_config] {
</config> }