+7XX. [func]* tomek
+ b10-dhcp6: New parameter added to configure: --with-kea-config.
+ It allows selecting configuration backend and accepts one of two
+ values: BIND10, which uses BIND10 framework as Kea 0.8 did, or
+ JSON, which reads configuration from a JSON file.
+ (Trac #3400, git TBD)
+
+ 782. [func] tmark
+ Added sender-ip, sender-port, and max-queue-size parameters to
+ the dhcp-ddns configuration section of both b10-dhcp4 and b10-dhcp6.
+ (Trac #3328, git 8d8d0b5eedaab20bf1008dfb3a6913eb006a6e73)
+
+ 781. [func] marcin
+ libkea-dhcpsrv: the Memfile lease storage backend returns leases
+ of a specified type. Previously, it ignored the lease type parameter
+ and returned all leases for a particular client. Thanks to David
+ Carlier for helping to implement this ticket.
+ (Trac #3148, git d2f0edf473716cd747a21d6917e89ba55c148d8e)
+
780. [func] marcin
libkea-cc: JSON parser stores information about the position
of the data element values in the JSON string. The position
}
+// This test checks whether it is possible to ignore comments. It also checks
+// that the comments are ignored only when told to.
+TEST(Element, preprocessor) {
+
+ string no_comment = "{ \"a\": 1,\n"
+ " \"b\": 2}";
+
+ string head_comment = "# this is a comment, ignore me\n"
+ "{ \"a\": 1,\n"
+ " \"b\": 2}";
+
+ string mid_comment = "{ \"a\": 1,\n"
+ "# this is a comment, ignore me\n"
+ " \"b\": 2}";
+
+ string tail_comment = "{ \"a\": 1,\n"
+ " \"b\": 2}"
+ "# this is a comment, ignore me\n";
+
+ string dbl_head_comment = "# this is a comment, ignore me\n"
+ "# second line, still ignored\n"
+ "{ \"a\": 1,\n"
+ " \"b\": 2}";
+
+ string dbl_mid_comment = "{ \"a\": 1,\n"
+ "# this is a comment, ignore me\n"
+ "# second line, still ignored\n"
+ " \"b\": 2}";
+
+ string dbl_tail_comment = "{ \"a\": 1,\n"
+ " \"b\": 2}"
+ "# this is a comment, ignore me\n"
+ "# second line, still ignored\n";
+
+ // This is what we expect in all cases.
+ ElementPtr exp = Element::fromJSON(no_comment);
+
+ // Let's convert them all and see that the result it the same every time
+ EXPECT_TRUE(exp->equals(*Element::fromJSON(head_comment, true)));
+ EXPECT_TRUE(exp->equals(*Element::fromJSON(mid_comment, true)));
+ EXPECT_TRUE(exp->equals(*Element::fromJSON(tail_comment, true)));
+ EXPECT_TRUE(exp->equals(*Element::fromJSON(dbl_head_comment, true)));
+ EXPECT_TRUE(exp->equals(*Element::fromJSON(dbl_mid_comment, true)));
+ EXPECT_TRUE(exp->equals(*Element::fromJSON(dbl_tail_comment, true)));
+
+ // With preprocessing disabled, it should fail all around
+ EXPECT_THROW(Element::fromJSON(head_comment), JSONError);
+ EXPECT_THROW(Element::fromJSON(mid_comment), JSONError);
+ EXPECT_THROW(Element::fromJSON(tail_comment), JSONError);
+ EXPECT_THROW(Element::fromJSON(dbl_head_comment), JSONError);
+ EXPECT_THROW(Element::fromJSON(dbl_mid_comment), JSONError);
+ EXPECT_THROW(Element::fromJSON(dbl_tail_comment), JSONError);
+}
+
TEST(Element, getPosition) {
+ std::istringstream ss("{\n"
+ " \"a\": 2,\n"
+ " \"b\":true,\n"
+ " \"cy\": \"a string\",\n"
+ " \"dyz\": {\n"
+ "\n"
+ " \"e\": 3,\n"
+ " \"f\": null\n"
+ "\n"
+ " },\n"
+ " \"g\": [ 5, 6,\n"
+ " 7 ]\n"
+ "}\n");
+
// Create a JSON string holding different type of values. Some of the
// values in the config string are not aligned, so as we can check that
// the position is set correctly for the elements.