From 3ced146733f310aec5d97babbe3a212c06d77751 Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Wed, 13 Dec 2017 16:55:24 +0100 Subject: [PATCH] nic_router.run: more tailored router config Add to the router config only what is needed according to which tests are enabled. Issue #2609 --- repos/libports/run/nic_router.run | 154 ++++++++++++++++++++++-------- 1 file changed, 114 insertions(+), 40 deletions(-) diff --git a/repos/libports/run/nic_router.run b/repos/libports/run/nic_router.run index 800ae33f0..ec88aca2c 100644 --- a/repos/libports/run/nic_router.run +++ b/repos/libports/run/nic_router.run @@ -17,6 +17,11 @@ build $targets create_boot_directory + +# +# Test 1 utilities +# + 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] @@ -24,36 +29,116 @@ proc test_1_config { } { [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_1_router_config { } { + if {[enable_test_1]} { return { + + + + + + + + } } +} + + +# +# Test 2 utilities +# + proc test_2_config { } { if {[enable_test_2]} { return " [client_config udp_client_2 udp 10.0.2.212 10.0.2.1 255.255.255.0 nic_bridge 1 10.0.2.55] [server_config udp_server_2 udp 18.17.16.15 18.17.16.14 255.255.0.0 nic_router 1 ]" } } +proc test_2_router_config { } { + if {[enable_test_2]} { return { + + } } +} + + +# +# Test 3 utilities +# + proc test_3_config { } { if {[enable_test_3]} { return " [client_config udp_client_3 udp 217.13.192.2 217.13.192.1 255.255.192.0 nic_router 65535 10.0.2.213] [server_config udp_server_3 udp 10.0.2.213 10.0.2.55 255.255.255.0 nic_bridge 65535 ]" } } +proc test_3_router_config { } { + if {[enable_test_3]} { return { + + + + + } } +} + + +# +# Test 4 utilities +# + proc test_4_config { } { if {[enable_test_4]} { return " [client_config http_client_1 http 10.0.2.201 10.0.2.1 255.255.255.0 nic_bridge 80 10.0.2.55] [server_config http_server_1 http 192.168.1.18 192.168.1.1 255.255.255.0 nic_router 80 ]" } } +proc test_4_router_config { } { + if {[enable_test_4]} { return { + + } } +} + + +# +# Test 5 utilities +# + proc test_5_config { } { if {[enable_test_5]} { return " [client_config http_client_2 http 10.0.2.202 10.0.2.1 255.255.255.0 nic_bridge 8080 10.0.2.55] [server_config http_server_2 http 192.168.2.72 192.168.2.1 255.255.255.0 nic_router 8080 ]" } } +proc test_5_router_config { } { + if {[enable_test_5]} { return { + + } } +} + + +# +# Test 6 utilities +# + proc test_6_config { } { if {[enable_test_6]} { return " [client_config http_client_3 http 100.200.0.128 100.200.0.1 255.255.0.0 nic_router 2345 10.0.2.203] [server_config http_server_3 http 10.0.2.203 10.0.2.1 255.255.255.0 nic_bridge 2345 ]" } } +proc test_6_router_config { } { + if {[enable_test_6]} { return { + + + + + + + } } +} + + +# +# Test 7 utilities +# + 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] @@ -63,6 +148,28 @@ proc test_7_config { } { [server_config lan_3_server_2 http 10.0.2.240 10.0.2.1 255.255.255.0 nic_router 3456 ]" } } +proc test_7_router_config { } { + if {[enable_test_7]} { return { + + + + + + + + + + + + + } } +} + + +# +# Init config +# + append config { @@ -104,14 +211,6 @@ append config { tcp_idle_timeout_sec="30" tcp_max_segm_lifetime_sec="15"> - - - - - - - - @@ -120,38 +219,13 @@ append config { - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + } [test_1_router_config] { + } [test_2_router_config] { + } [test_3_router_config] { + } [test_4_router_config] { + } [test_5_router_config] { + } [test_6_router_config] { + } [test_7_router_config] {