]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[master] Merge branch 'trac5366'
authorMarcin Siodelski <marcin@isc.org>
Wed, 11 Oct 2017 11:01:29 +0000 (13:01 +0200)
committerMarcin Siodelski <marcin@isc.org>
Wed, 11 Oct 2017 11:01:29 +0000 (13:01 +0200)
# Conflicts:
# src/bin/dhcp6/tests/shared_network_unittest.cc

1  2 
src/bin/dhcp6/tests/shared_network_unittest.cc

index ddb5be450a0ea9d2e7fdd2662750174d0dcc9c0f,abfb10a08d9b2363e8e9a151d0f76ce767b1c4f7..a3551462e7aa6740d9302403172b324777df274d
@@@ -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")));
  }
  
-     testRapidCommit(NETWORKS_CONFIG[16], true, "2001:db8:1::20", "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[17], 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[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