From: Marcin Siodelski Date: Wed, 11 Oct 2017 11:01:29 +0000 (+0200) Subject: [master] Merge branch 'trac5366' X-Git-Tag: trac5297_base~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=112addd4619509c464dc051f4885e00dc1f69d26;p=thirdparty%2Fkea.git [master] Merge branch 'trac5366' # Conflicts: # src/bin/dhcp6/tests/shared_network_unittest.cc --- 112addd4619509c464dc051f4885e00dc1f69d26 diff --cc src/bin/dhcp6/tests/shared_network_unittest.cc index ddb5be450a,abfb10a08d..a3551462e7 --- a/src/bin/dhcp6/tests/shared_network_unittest.cc +++ b/src/bin/dhcp6/tests/shared_network_unittest.cc @@@ -831,71 -889,62 +831,129 @@@ const char* NETWORKS_CONFIG[] = " ]" "}", - // Configuration #16 + // Configuration #16. + // - one shared network with three subnets, each with different option value + "{" + " \"shared-networks\": [" + " {" + " \"name\": \"frog\"," + " \"interface\": \"eth1\"," + " \"subnet6\": [" + " {" + " \"subnet\": \"2001:db8:1::/64\"," + " \"id\": 10," + " \"option-data\": [" + " {" + " \"name\": \"dns-servers\"," + " \"data\": \"4004::22\"" + " }" + " ]," + " \"pools\": [" + " {" + " \"pool\": \"2001:db8:1::20 - 2001:db8:1::20\"" + " }" + " ]" + " }," + " {" + " \"subnet\": \"2001:db8:2::/64\"," + " \"id\": 100," + " \"option-data\": [" + " {" + " \"name\": \"dns-servers\"," + " \"data\": \"5555::33\"" + " }" + " ]," + " \"pools\": [" + " {" + " \"pool\": \"2001:db8:2::20 - 2001:db8:2::20\"" + " }" + " ]" + " }," + " {" + " \"subnet\": \"2001:db8:3::/64\"," + " \"id\": 1000," + " \"option-data\": [" + " {" + " \"name\": \"dns-servers\"," + " \"data\": \"1234::23\"" + " }" + " ]," + " \"pools\": [" + " {" + " \"pool\": \"2001:db8:3::20 - 2001:db8:3::20\"" + " }" + " ]" + " }" + " ]" + " }" + " ]" ++ "}", ++ ++// Configuration #17. +// - one shared network with two subnets, both have rapid-commit enabled + "{" + " \"shared-networks\": [" + " {" + " \"name\": \"frog\"," + " \"interface\": \"eth1\"," + " \"subnet6\": [" + " {" + " \"subnet\": \"2001:db8:1::/64\"," + " \"id\": 10," + " \"rapid-commit\": true," + " \"pools\": [" + " {" + " \"pool\": \"2001:db8:1::20 - 2001:db8:1::20\"" + " }" + " ]" + " }," + " {" + " \"subnet\": \"2001:db8:2::/64\"," + " \"id\": 100," + " \"rapid-commit\": true," + " \"pools\": [" + " {" + " \"pool\": \"2001:db8:2::20 - 2001:db8:2::20\"" + " }" + " ]" + " }" + " ]" + " }" + " ]" + "}", + + - // Configuration #17: ++// Configuration #18. +// - one shared network with rapid-commit enabled +// - two subnets (which should derive the rapid-commit setting) + "{" + " \"shared-networks\": [" + " {" + " \"name\": \"frog\"," + " \"interface\": \"eth1\"," + " \"rapid-commit\": true," + " \"subnet6\": [" + " {" + " \"subnet\": \"2001:db8:1::/64\"," + " \"id\": 10," + " \"pools\": [" + " {" + " \"pool\": \"2001:db8:1::20 - 2001:db8:1::20\"" + " }" + " ]" + " }," + " {" + " \"subnet\": \"2001:db8:2::/64\"," + " \"id\": 100," + " \"pools\": [" + " {" + " \"pool\": \"2001:db8:2::20 - 2001:db8:2::20\"" + " }" + " ]" + " }" + " ]" + " }" + " ]" "}" }; @@@ -2024,22 -2036,4 +2143,22 @@@ TEST_F(Dhcpv6SharedNetworkTest, sharedN ASSERT_TRUE(hasLeaseForAddress(client2, IOAddress("2001:db8:2::20"))); } +// Check that the rapid-commit works with shared networks. Rapid-commit +// enabled on each subnet separately. +TEST_F(Dhcpv6SharedNetworkTest, sharedNetworkRapidCommit1) { - testRapidCommit(NETWORKS_CONFIG[16], true, "2001:db8:1::20", "2001:db8:2::20"); ++ testRapidCommit(NETWORKS_CONFIG[17], true, "2001:db8:1::20", "2001:db8:2::20"); +} + +// Check that the rapid-commit works with shared networks. Rapid-commit +// enabled for the whole shared network. This should be applied to both +// subnets. +TEST_F(Dhcpv6SharedNetworkTest, sharedNetworkRapidCommit2) { - testRapidCommit(NETWORKS_CONFIG[17], true, "2001:db8:1::20", "2001:db8:2::20"); ++ testRapidCommit(NETWORKS_CONFIG[18], true, "2001:db8:1::20", "2001:db8:2::20"); +} + +// Check that the rapid-commit is disabled by default. +TEST_F(Dhcpv6SharedNetworkTest, sharedNetworkRapidCommit3) { + testRapidCommit(NETWORKS_CONFIG[1], false, "", ""); +} + } // end of anonymous namespace