From 7ffa4c688202525ad7dabe3f84127320820feb19 Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Wed, 4 Oct 2017 23:22:36 +0200 Subject: [PATCH] [5377] One unit-test added. --- src/bin/dhcp4/tests/parser_unittest.cc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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 -- 2.47.2