From b69134f1fee5ee0607d0fb2d291f20b1c7cdb37f Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Mon, 19 Mar 2018 18:31:23 +0100 Subject: [PATCH] nic_router.run: test DHCP server Very basic test of the DHCP server functionality. Ref #2670 --- repos/libports/run/nic_router.inc | 10 +++++++++- repos/libports/run/nic_router.run | 16 +++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/repos/libports/run/nic_router.inc b/repos/libports/run/nic_router.inc index 2213bb0361..6c2827f684 100644 --- a/repos/libports/run/nic_router.inc +++ b/repos/libports/run/nic_router.inc @@ -26,8 +26,16 @@ proc client_config { name prot ip_addr gateway netmask nic srv_port srv_ip } { + } + if {$ip_addr == "dhcp"} { + append result { + } + } else { + append result { + gateway="} $gateway {" netmask="} $netmask {"/>} + } + append result { } return $result diff --git a/repos/libports/run/nic_router.run b/repos/libports/run/nic_router.run index 44cb03a9e2..23b453d951 100644 --- a/repos/libports/run/nic_router.run +++ b/repos/libports/run/nic_router.run @@ -142,19 +142,25 @@ proc test_6_router_config { } { 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 ]" } + [client_config lan_2_client_1 http dhcp dhcp dhcp nic_router 2345 10.0.2.204] + [client_config lan_2_client_2 http dhcp dhcp dhcp nic_router 3456 10.0.2.240] + [client_config lan_2_client_3 http dhcp dhcp dhcp 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 ]" } } + proc test_7_router_config { } { if {[enable_test_7]} { return { + +