]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3400] Merge remote-tracking branch 'origin/trac3449' into trac3400
authorTomek Mrugalski <thomson@Tomeks-MacBook-Pro.local>
Thu, 15 May 2014 12:34:24 +0000 (14:34 +0200)
committerTomek Mrugalski <thomson@Tomeks-MacBook-Pro.local>
Thu, 15 May 2014 12:34:24 +0000 (14:34 +0200)
Conflicts:
ChangeLog

14 files changed:
1  2 
ChangeLog
configure.ac
doc/devel/mainpage.dox
doc/guide/bind10-guide.xml
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/tests/Makefile.am
src/bin/dhcp6/tests/config_parser_unittest.cc
src/bin/dhcp6/tests/d2_unittest.cc
src/bin/dhcp6/tests/dhcp6_test_utils.cc
src/lib/cc/data.cc
src/lib/cc/data.h
src/lib/cc/tests/data_unittests.cc
src/lib/dhcpsrv/Makefile.am
src/lib/dhcpsrv/tests/Makefile.am

diff --cc ChangeLog
index 53f502225f1ca12a9905a9ddc99919daa1e0ad7d,d70adcda7bc76f6388d9f429beb3e98b85757415..d1f5ec4a5d5161b6dd09e41d7ffd2c5343118484
+++ b/ChangeLog
@@@ -1,10 -1,15 +1,22 @@@
 +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
diff --cc configure.ac
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index 71a8a90f54d3d9ebb659e55330397a6b4e6afb3d,b77ecbfb19d0b5a640e51c14edf796966098a0f1..36f9a861a382fafac5c69b1bb1e8ed8716217cb1
@@@ -600,16 -591,9 +591,14 @@@ TEST_F(Dhcp6ParserTest, multipleSubnets
  
      ElementPtr json = Element::fromJSON(config);
  
 +    ofstream out("config.json");
 +    out << config;
 +    out.close();
 +    
 +
      do {
          EXPECT_NO_THROW(x = configureDhcp6Server(srv_, json));
-         ASSERT_TRUE(x);
-         comment_ = parseAnswer(rcode_, x);
-         ASSERT_EQ(0, rcode_);
+         checkResult(x, 0);
  
          const Subnet6Collection* subnets = CfgMgr::instance().getSubnets6();
          ASSERT_TRUE(subnets);
Simple merge
Simple merge
Simple merge
index 6a5e8399572c1b0a02ab0e6b29a3014c529ec114,8ddfae9bd84fa7c6d08e9184bd29418baedb342a..b7ec6a268474191648da162dbd0249991778363b
@@@ -930,61 -939,21 +939,75 @@@ TEST(Element, merge) 
  
  }
  
 +// 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.
Simple merge
Simple merge