|
@@ -1102,9 +1102,9 @@ TEST_F(Dhcp4ParserTest, echoClientId) {
|
|
CfgMgr::instance().echoClientId(true);
|
|
CfgMgr::instance().echoClientId(true);
|
|
}
|
|
}
|
|
|
|
|
|
-// This test checks that the global ignore-client-id parameter is optional
|
|
|
|
|
|
+// This test checks that the global record-client-id parameter is optional
|
|
// and that values under the subnet are used.
|
|
// and that values under the subnet are used.
|
|
-TEST_F(Dhcp4ParserTest, ignoreClientIdNoGlobal) {
|
|
|
|
|
|
+TEST_F(Dhcp4ParserTest, recordClientIdNoGlobal) {
|
|
ConstElementPtr status;
|
|
ConstElementPtr status;
|
|
|
|
|
|
std::string config = "{ " + genIfaceConfig() + "," +
|
|
std::string config = "{ " + genIfaceConfig() + "," +
|
|
@@ -1112,12 +1112,12 @@ TEST_F(Dhcp4ParserTest, ignoreClientIdNoGlobal) {
|
|
"\"renew-timer\": 1000, "
|
|
"\"renew-timer\": 1000, "
|
|
"\"subnet4\": [ "
|
|
"\"subnet4\": [ "
|
|
"{"
|
|
"{"
|
|
- " \"ignore-client-id\": true,"
|
|
|
|
|
|
+ " \"record-client-id\": true,"
|
|
" \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
|
|
" \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
|
|
" \"subnet\": \"192.0.2.0/24\""
|
|
" \"subnet\": \"192.0.2.0/24\""
|
|
"},"
|
|
"},"
|
|
"{"
|
|
"{"
|
|
- " \"ignore-client-id\": false,"
|
|
|
|
|
|
+ " \"record-client-id\": false,"
|
|
" \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
|
|
" \"pools\": [ { \"pool\": \"192.0.3.1 - 192.0.3.100\" } ],"
|
|
" \"subnet\": \"192.0.3.0/24\""
|
|
" \"subnet\": \"192.0.3.0/24\""
|
|
"} ],"
|
|
"} ],"
|
|
@@ -1130,26 +1130,26 @@ TEST_F(Dhcp4ParserTest, ignoreClientIdNoGlobal) {
|
|
CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4();
|
|
CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4();
|
|
Subnet4Ptr subnet1 = cfg->selectSubnet(IOAddress("192.0.2.1"));
|
|
Subnet4Ptr subnet1 = cfg->selectSubnet(IOAddress("192.0.2.1"));
|
|
ASSERT_TRUE(subnet1);
|
|
ASSERT_TRUE(subnet1);
|
|
- EXPECT_TRUE(subnet1->getIgnoreClientId());
|
|
|
|
|
|
+ EXPECT_TRUE(subnet1->getRecordClientId());
|
|
|
|
|
|
Subnet4Ptr subnet2 = cfg->selectSubnet(IOAddress("192.0.3.1"));
|
|
Subnet4Ptr subnet2 = cfg->selectSubnet(IOAddress("192.0.3.1"));
|
|
ASSERT_TRUE(subnet2);
|
|
ASSERT_TRUE(subnet2);
|
|
- EXPECT_FALSE(subnet2->getIgnoreClientId());
|
|
|
|
|
|
+ EXPECT_FALSE(subnet2->getRecordClientId());
|
|
}
|
|
}
|
|
|
|
|
|
-// This test checks that the global ignore-client-id parameter is used
|
|
|
|
|
|
+// This test checks that the global record-client-id parameter is used
|
|
// when there is no such parameter under subnet and that the parameter
|
|
// when there is no such parameter under subnet and that the parameter
|
|
// specified for a subnet overrides the global setting.
|
|
// specified for a subnet overrides the global setting.
|
|
-TEST_F(Dhcp4ParserTest, ignoreClientIdGlobal) {
|
|
|
|
|
|
+TEST_F(Dhcp4ParserTest, recordClientIdGlobal) {
|
|
ConstElementPtr status;
|
|
ConstElementPtr status;
|
|
|
|
|
|
std::string config = "{ " + genIfaceConfig() + "," +
|
|
std::string config = "{ " + genIfaceConfig() + "," +
|
|
"\"rebind-timer\": 2000, "
|
|
"\"rebind-timer\": 2000, "
|
|
"\"renew-timer\": 1000, "
|
|
"\"renew-timer\": 1000, "
|
|
- "\"ignore-client-id\": true,"
|
|
|
|
|
|
+ "\"record-client-id\": true,"
|
|
"\"subnet4\": [ "
|
|
"\"subnet4\": [ "
|
|
"{"
|
|
"{"
|
|
- " \"ignore-client-id\": false,"
|
|
|
|
|
|
+ " \"record-client-id\": false,"
|
|
" \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
|
|
" \"pools\": [ { \"pool\": \"192.0.2.1 - 192.0.2.100\" } ],"
|
|
" \"subnet\": \"192.0.2.0/24\""
|
|
" \"subnet\": \"192.0.2.0/24\""
|
|
"},"
|
|
"},"
|
|
@@ -1166,11 +1166,11 @@ TEST_F(Dhcp4ParserTest, ignoreClientIdGlobal) {
|
|
CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4();
|
|
CfgSubnets4Ptr cfg = CfgMgr::instance().getStagingCfg()->getCfgSubnets4();
|
|
Subnet4Ptr subnet1 = cfg->selectSubnet(IOAddress("192.0.2.1"));
|
|
Subnet4Ptr subnet1 = cfg->selectSubnet(IOAddress("192.0.2.1"));
|
|
ASSERT_TRUE(subnet1);
|
|
ASSERT_TRUE(subnet1);
|
|
- EXPECT_FALSE(subnet1->getIgnoreClientId());
|
|
|
|
|
|
+ EXPECT_FALSE(subnet1->getRecordClientId());
|
|
|
|
|
|
Subnet4Ptr subnet2 = cfg->selectSubnet(IOAddress("192.0.3.1"));
|
|
Subnet4Ptr subnet2 = cfg->selectSubnet(IOAddress("192.0.3.1"));
|
|
ASSERT_TRUE(subnet2);
|
|
ASSERT_TRUE(subnet2);
|
|
- EXPECT_TRUE(subnet2->getIgnoreClientId());
|
|
|
|
|
|
+ EXPECT_TRUE(subnet2->getRecordClientId());
|
|
}
|
|
}
|
|
|
|
|
|
// This test checks if it is possible to override global values
|
|
// This test checks if it is possible to override global values
|