diff --git a/src/bin/dhcp4/tests/classify_unittest.cc b/src/bin/dhcp4/tests/classify_unittest.cc index f9a6c7467d..b8bf032497 100644 --- a/src/bin/dhcp4/tests/classify_unittest.cc +++ b/src/bin/dhcp4/tests/classify_unittest.cc @@ -943,7 +943,7 @@ TEST_F(ClassifyTest, server2computer) { } // This test checks the precedence order in required evaluation. -// This order is: shared-network > subnet > pools +// This order is: pools > subnet > shared-network TEST_F(ClassifyTest, precedenceNone) { std::string config = "{" @@ -953,12 +953,8 @@ TEST_F(ClassifyTest, precedenceNone) { "\"valid-lifetime\": 600," "\"client-classes\": [" " {" - " \"name\": \"all\"," - " \"test\": \"'' == ''\"" - " }," - " {" " \"name\": \"for-pool\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -967,7 +963,7 @@ TEST_F(ClassifyTest, precedenceNone) { " }," " {" " \"name\": \"for-subnet\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -976,7 +972,7 @@ TEST_F(ClassifyTest, precedenceNone) { " }," " {" " \"name\": \"for-network\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1015,7 +1011,7 @@ TEST_F(ClassifyTest, precedenceNone) { } // This test checks the precedence order in required evaluation. -// This order is: shared-network > subnet > pools +// This order is: pools > subnet > shared-network TEST_F(ClassifyTest, precedencePool) { std::string config = "{" @@ -1025,12 +1021,8 @@ TEST_F(ClassifyTest, precedencePool) { "\"valid-lifetime\": 600," "\"client-classes\": [" " {" - " \"name\": \"all\"," - " \"test\": \"'' == ''\"" - " }," - " {" " \"name\": \"for-pool\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1039,7 +1031,7 @@ TEST_F(ClassifyTest, precedencePool) { " }," " {" " \"name\": \"for-subnet\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1048,7 +1040,7 @@ TEST_F(ClassifyTest, precedencePool) { " }," " {" " \"name\": \"for-network\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1058,9 +1050,11 @@ TEST_F(ClassifyTest, precedencePool) { "]," "\"shared-networks\": [ {" " \"name\": \"frog\"," + " \"require-client-classes\": [ \"for-network\" ]," " \"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\"," " \"id\": 1," + " \"require-client-classes\": [ \"for-subnet\" ]," " \"pools\": [ { " " \"pool\": \"10.0.0.10-10.0.0.100\"," " \"require-client-classes\": [ \"for-pool\" ]" @@ -1094,7 +1088,7 @@ TEST_F(ClassifyTest, precedencePool) { } // This test checks the precedence order in required evaluation. -// This order is: shared-network > subnet > pools +// This order is: pools > subnet > shared-network TEST_F(ClassifyTest, precedenceSubnet) { std::string config = "{" @@ -1104,12 +1098,8 @@ TEST_F(ClassifyTest, precedenceSubnet) { "\"valid-lifetime\": 600," "\"client-classes\": [" " {" - " \"name\": \"all\"," - " \"test\": \"'' == ''\"" - " }," - " {" " \"name\": \"for-pool\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1118,7 +1108,7 @@ TEST_F(ClassifyTest, precedenceSubnet) { " }," " {" " \"name\": \"for-subnet\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1127,7 +1117,7 @@ TEST_F(ClassifyTest, precedenceSubnet) { " }," " {" " \"name\": \"for-network\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1137,13 +1127,13 @@ TEST_F(ClassifyTest, precedenceSubnet) { "]," "\"shared-networks\": [ {" " \"name\": \"frog\"," + " \"require-client-classes\": [ \"for-network\" ]," " \"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\"," " \"id\": 1," " \"require-client-classes\": [ \"for-subnet\" ]," " \"pools\": [ { " - " \"pool\": \"10.0.0.10-10.0.0.100\"," - " \"require-client-classes\": [ \"for-pool\" ]" + " \"pool\": \"10.0.0.10-10.0.0.100\"" " } ]" " } ]" "} ]" @@ -1174,7 +1164,7 @@ TEST_F(ClassifyTest, precedenceSubnet) { } // This test checks the precedence order in required evaluation. -// This order is: shared-network > subnet > pools +// This order is: pools > subnet > shared-network TEST_F(ClassifyTest, precedenceNetwork) { std::string config = "{" @@ -1184,12 +1174,8 @@ TEST_F(ClassifyTest, precedenceNetwork) { "\"valid-lifetime\": 600," "\"client-classes\": [" " {" - " \"name\": \"all\"," - " \"test\": \"'' == ''\"" - " }," - " {" " \"name\": \"for-pool\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1198,7 +1184,7 @@ TEST_F(ClassifyTest, precedenceNetwork) { " }," " {" " \"name\": \"for-subnet\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1207,7 +1193,7 @@ TEST_F(ClassifyTest, precedenceNetwork) { " }," " {" " \"name\": \"for-network\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"domain-name-servers\"," @@ -1221,10 +1207,8 @@ TEST_F(ClassifyTest, precedenceNetwork) { " \"subnet4\": [ { " " \"subnet\": \"10.0.0.0/24\"," " \"id\": 1," - " \"require-client-classes\": [ \"for-subnet\" ]," " \"pools\": [ { " - " \"pool\": \"10.0.0.10-10.0.0.100\"," - " \"require-client-classes\": [ \"for-pool\" ]" + " \"pool\": \"10.0.0.10-10.0.0.100\"" " } ]" " } ]" "} ]" diff --git a/src/bin/dhcp6/tests/Makefile.am b/src/bin/dhcp6/tests/Makefile.am index b8bcaf5a5e..4bafa819d7 100644 --- a/src/bin/dhcp6/tests/Makefile.am +++ b/src/bin/dhcp6/tests/Makefile.am @@ -87,7 +87,7 @@ PROGRAM_TESTS = dhcp6_unittests # This list is ordered alphabetically. When adding new files, please maintain # this order. dhcp6_unittests_SOURCES = -dhcp6_unittests_SOURCES += classify_unittests.cc +dhcp6_unittests_SOURCES += classify_unittest.cc dhcp6_unittests_SOURCES += client_handler_unittest.cc dhcp6_unittests_SOURCES += config_parser_unittest.cc dhcp6_unittests_SOURCES += config_backend_unittest.cc diff --git a/src/bin/dhcp6/tests/classify_unittests.cc b/src/bin/dhcp6/tests/classify_unittest.cc similarity index 98% rename from src/bin/dhcp6/tests/classify_unittests.cc rename to src/bin/dhcp6/tests/classify_unittest.cc index e7b14902aa..a9b3f2f053 100644 --- a/src/bin/dhcp6/tests/classify_unittests.cc +++ b/src/bin/dhcp6/tests/classify_unittest.cc @@ -1877,7 +1877,7 @@ TEST_F(ClassifyTest, member) { } // This test checks the precedence order in required evaluation. -// This order is: shared-network > subnet > pools +// This order is: pools > subnet > shared-network TEST_F(ClassifyTest, precedenceNone) { std::string config = "{" @@ -1889,12 +1889,8 @@ TEST_F(ClassifyTest, precedenceNone) { "\"renew-timer\": 1000," "\"client-classes\": [" " {" - " \"name\": \"all\"," - " \"test\": \"'' == ''\"" - " }," - " {" " \"name\": \"for-pool\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -1903,7 +1899,7 @@ TEST_F(ClassifyTest, precedenceNone) { " }," " {" " \"name\": \"for-subnet\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -1912,7 +1908,7 @@ TEST_F(ClassifyTest, precedenceNone) { " }," " {" " \"name\": \"for-network\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -1955,7 +1951,7 @@ TEST_F(ClassifyTest, precedenceNone) { } // This test checks the precedence order in required evaluation. -// This order is: shared-network > subnet > pools +// This order is: pools > subnet > shared-network TEST_F(ClassifyTest, precedencePool) { std::string config = "{" @@ -1964,12 +1960,8 @@ TEST_F(ClassifyTest, precedencePool) { "}," "\"client-classes\": [" " {" - " \"name\": \"all\"," - " \"test\": \"'' == ''\"" - " }," - " {" " \"name\": \"for-pool\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -1978,7 +1970,7 @@ TEST_F(ClassifyTest, precedencePool) { " }," " {" " \"name\": \"for-subnet\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -1987,7 +1979,7 @@ TEST_F(ClassifyTest, precedencePool) { " }," " {" " \"name\": \"for-network\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -1998,9 +1990,11 @@ TEST_F(ClassifyTest, precedencePool) { "\"shared-networks\": [ {" " \"name\": \"frog\"," " \"interface\": \"eth1\"," + " \"require-client-classes\": [ \"for-network\" ]," " \"subnet6\": [ { " " \"subnet\": \"2001:db8:1::/64\"," " \"id\": 1," + " \"require-client-classes\": [ \"for-subnet\" ]," " \"pools\": [ { " " \"pool\": \"2001:db8:1::1 - 2001:db8:1::64\"," " \"require-client-classes\": [ \"for-pool\" ]" @@ -2037,7 +2031,7 @@ TEST_F(ClassifyTest, precedencePool) { } // This test checks the precedence order in required evaluation. -// This order is: shared-network > subnet > pools +// This order is: pools > subnet > shared-network TEST_F(ClassifyTest, precedenceSubnet) { std::string config = "{" @@ -2046,12 +2040,8 @@ TEST_F(ClassifyTest, precedenceSubnet) { "}," "\"client-classes\": [" " {" - " \"name\": \"all\"," - " \"test\": \"'' == ''\"" - " }," - " {" " \"name\": \"for-pool\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -2060,7 +2050,7 @@ TEST_F(ClassifyTest, precedenceSubnet) { " }," " {" " \"name\": \"for-subnet\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -2069,7 +2059,7 @@ TEST_F(ClassifyTest, precedenceSubnet) { " }," " {" " \"name\": \"for-network\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -2080,13 +2070,13 @@ TEST_F(ClassifyTest, precedenceSubnet) { "\"shared-networks\": [ {" " \"name\": \"frog\"," " \"interface\": \"eth1\"," + " \"require-client-classes\": [ \"for-network\" ]," " \"subnet6\": [ { " " \"subnet\": \"2001:db8:1::/64\"," " \"id\": 1," " \"require-client-classes\": [ \"for-subnet\" ]," " \"pools\": [ { " - " \"pool\": \"2001:db8:1::1 - 2001:db8:1::64\"," - " \"require-client-classes\": [ \"for-pool\" ]" + " \"pool\": \"2001:db8:1::1 - 2001:db8:1::64\"" " } ]" " } ]" "} ]," @@ -2120,7 +2110,7 @@ TEST_F(ClassifyTest, precedenceSubnet) { } // This test checks the precedence order in required evaluation. -// This order is: shared-network > subnet > pools +// This order is: pools > subnet > shared-network TEST_F(ClassifyTest, precedenceNetwork) { std::string config = "{" @@ -2129,12 +2119,8 @@ TEST_F(ClassifyTest, precedenceNetwork) { "}," "\"client-classes\": [" " {" - " \"name\": \"all\"," - " \"test\": \"'' == ''\"" - " }," - " {" " \"name\": \"for-pool\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -2143,7 +2129,7 @@ TEST_F(ClassifyTest, precedenceNetwork) { " }," " {" " \"name\": \"for-subnet\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -2152,7 +2138,7 @@ TEST_F(ClassifyTest, precedenceNetwork) { " }," " {" " \"name\": \"for-network\"," - " \"test\": \"member('all')\"," + " \"test\": \"member('ALL')\"," " \"only-if-required\": true," " \"option-data\": [ {" " \"name\": \"dns-servers\"," @@ -2167,10 +2153,8 @@ TEST_F(ClassifyTest, precedenceNetwork) { " \"subnet6\": [ { " " \"subnet\": \"2001:db8:1::/64\"," " \"id\": 1," - " \"require-client-classes\": [ \"for-subnet\" ]," " \"pools\": [ { " - " \"pool\": \"2001:db8:1::1 - 2001:db8:1::64\"," - " \"require-client-classes\": [ \"for-pool\" ]" + " \"pool\": \"2001:db8:1::1 - 2001:db8:1::64\"" " } ]" " } ]" "} ],"