]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5297] Addressed point 2
authorFrancis Dupont <fdupont@isc.org>
Sat, 14 Oct 2017 17:12:57 +0000 (19:12 +0200)
committerFrancis Dupont <fdupont@isc.org>
Sat, 14 Oct 2017 17:12:57 +0000 (19:12 +0200)
src/lib/dhcpsrv/tests/dbaccess_parser_unittest.cc

index 1ab6dbbbc1972ea111a87dd333b0282bc134b7e2..0fe421c90245b5746168203f05f631d20170b3a8 100644 (file)
@@ -248,6 +248,20 @@ TEST_F(DbAccessParserTest, validTypeMemfile) {
     checkAccessString("Valid memfile", parser.getDbAccessParameters(), config);
 }
 
+// Check that the parser works with a simple configuration for host database.
+TEST_F(DbAccessParserTest, hosts) {
+    const char* config[] = {"type", "memfile",
+                            NULL};
+
+    string json_config = toJson(config);
+    ConstElementPtr json_elements = Element::fromJSON(json_config);
+    EXPECT_TRUE(json_elements);
+
+    TestDbAccessParser parser(DbAccessParser::HOSTS_DB);
+    EXPECT_NO_THROW(parser.parse(json_elements));
+    checkAccessString("Valid memfile", parser.getDbAccessParameters(), config);
+}
+
 // Check that the parser works with a simple configuration that
 // includes empty elements.
 TEST_F(DbAccessParserTest, emptyKeyword) {