]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5377] One unit-test added.
authorTomek Mrugalski <tomasz@isc.org>
Wed, 4 Oct 2017 21:22:36 +0000 (23:22 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Wed, 4 Oct 2017 21:22:36 +0000 (23:22 +0200)
src/bin/dhcp4/tests/parser_unittest.cc

index c121de51f626540060c04858cfe4b1c72142cff9..d687c09ad65e9a08acb6b8ec87ab677f4fef9683 100644 (file)
@@ -261,6 +261,25 @@ TEST(ParserTest, file) {
     }
 }
 
+// Basic test that checks if it's possible to specify outbound-interface.
+TEST(ParserTest, outboundIface) {
+    std::string fname = string(CFG_EXAMPLES) + "/" + "advanced.json";
+    Parser4Context ctx;
+    ConstElementPtr test_json = ctx.parseFile(fname, Parser4Context::PARSER_DHCP4);
+
+    ConstElementPtr tmp;
+    tmp = test_json->get("Dhcp4");
+    ASSERT_TRUE(tmp);
+
+    tmp = tmp->get("interfaces-config");
+    ASSERT_TRUE(tmp);
+
+    tmp = tmp->get("outbound-interface");
+    ASSERT_TRUE(tmp);
+    EXPECT_EQ(Element::string, tmp->getType());
+    EXPECT_EQ("use-routing", tmp->stringValue());
+}
+
 /// @brief Tests error conditions in Dhcp4Parser
 ///
 /// @param txt text to be parsed