diff options
author | Razvan Becheriu <razvan@isc.org> | 2022-01-21 17:53:33 +0100 |
---|---|---|
committer | Razvan Becheriu <razvan@isc.org> | 2022-01-21 19:59:09 +0100 |
commit | f66f201c1417f19b492acc54e0377d43c0cc9d61 (patch) | |
tree | 1b4f4fc8a6e048bdbc5c66857b2bb811cacea2e3 | |
parent | [#2279] add loggers to global parameters (diff) | |
download | kea-f66f201c1417f19b492acc54e0377d43c0cc9d61.tar.xz kea-f66f201c1417f19b492acc54e0377d43c0cc9d61.zip |
[#2279] added unittests
-rw-r--r-- | src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc | 8 | ||||
-rw-r--r-- | src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc | 8 |
2 files changed, 14 insertions, 2 deletions
diff --git a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc index 176dff5ed9..84ef848acf 100644 --- a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc @@ -168,7 +168,12 @@ public: std::string footer = "\" }," " \"lease-database\": {" - " \"type\": \"memfile\", \"persist\": false }" + " \"type\": \"memfile\", \"persist\": false }," + " \"loggers\": [ {" + " \"name\": \"kea-dhcp4\"," + " \"severity\": \"INFO\"," + " \"debuglevel\": 0" + " } ]" "}"; // Fill in the socket-name value with socket_path_ to @@ -892,6 +897,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configGet) { ASSERT_TRUE(cfg); ASSERT_EQ(Element::map, cfg->getType()); EXPECT_TRUE(cfg->get("Dhcp4")); + EXPECT_TRUE(cfg->get("Dhcp4")->get("loggers")); } // Verify that the "config-test" command will do what we expect. diff --git a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc index ca9f4c981a..9352387b04 100644 --- a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc @@ -195,7 +195,12 @@ public: std::string footer = "\" }," " \"lease-database\": {" - " \"type\": \"memfile\", \"persist\": false }" + " \"type\": \"memfile\", \"persist\": false }," + " \"loggers\": [ {" + " \"name\": \"kea-dhcp6\"," + " \"severity\": \"INFO\"," + " \"debuglevel\": 0" + " } ]" "}"; // Fill in the socket-name value with socket_path_ to @@ -805,6 +810,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configGet) { ASSERT_TRUE(cfg); ASSERT_EQ(Element::map, cfg->getType()); EXPECT_TRUE(cfg->get("Dhcp6")); + EXPECT_TRUE(cfg->get("Dhcp6")->get("loggers")); } // Verify that the "config-test" command will do what we expect. |