From: Tomek Mrugalski Date: Wed, 4 Oct 2017 21:22:36 +0000 (+0200) Subject: [5377] One unit-test added. X-Git-Tag: trac5297_base~15^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7ffa4c688202525ad7dabe3f84127320820feb19;p=thirdparty%2Fkea.git [5377] One unit-test added. --- diff --git a/src/bin/dhcp4/tests/parser_unittest.cc b/src/bin/dhcp4/tests/parser_unittest.cc index c121de51f6..d687c09ad6 100644 --- a/src/bin/dhcp4/tests/parser_unittest.cc +++ b/src/bin/dhcp4/tests/parser_unittest.cc @@ -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