[svn] commit: r3340 - in /branches/vorner-recursor-config/src/bin/recurse: recursor.cc tests/recursor_unittest.cc

BIND 10 source code commits bind10-changes at lists.isc.org
Sat Oct 23 21:40:23 UTC 2010


Author: vorner
Date: Sat Oct 23 21:40:23 2010
New Revision: 3340

Log:
Fix config item names

The names contain slashes.

Modified:
    branches/vorner-recursor-config/src/bin/recurse/recursor.cc
    branches/vorner-recursor-config/src/bin/recurse/tests/recursor_unittest.cc

Modified: branches/vorner-recursor-config/src/bin/recurse/recursor.cc
==============================================================================
--- branches/vorner-recursor-config/src/bin/recurse/recursor.cc (original)
+++ branches/vorner-recursor-config/src/bin/recurse/recursor.cc Sat Oct 23 21:40:23 2010
@@ -496,9 +496,9 @@
     }
     try {
         // Parse forward_addresses
-        ConstElementPtr forwardAddressesE(config->get("forward_addresses"));
+        ConstElementPtr forwardAddressesE(config->get("forward_addresses/"));
         vector<addr_t> forwardAddresses(parseAddresses(forwardAddressesE));
-        ConstElementPtr listenAddressesE(config->get("listen_addresses"));
+        ConstElementPtr listenAddressesE(config->get("listen_on/"));
         vector<addr_t> listenAddresses(parseAddresses(listenAddressesE));
         // Everything OK, so commit the changes
         // listenAddresses can fail to bind, so try them first

Modified: branches/vorner-recursor-config/src/bin/recurse/tests/recursor_unittest.cc
==============================================================================
--- branches/vorner-recursor-config/src/bin/recurse/tests/recursor_unittest.cc (original)
+++ branches/vorner-recursor-config/src/bin/recurse/tests/recursor_unittest.cc Sat Oct 23 21:40:23 2010
@@ -369,7 +369,7 @@
 TEST_F(RecursorConfig, forwardAddressConfig) {
     // Try putting there some address
     ElementPtr config(Element::fromJSON("{"
-        "\"forward_addresses\": ["
+        "\"forward_addresses/\": ["
         "   {"
         "       \"address\": \"192.0.2.1\","
         "       \"port\": 53"
@@ -385,7 +385,7 @@
 
     // And then remove all addresses
     config = Element::fromJSON("{"
-        "\"forward_addresses\": null"
+        "\"forward_addresses/\": null"
         "}");
     result = server.updateConfig(config);
     EXPECT_EQ(result->toWire(), isc::config::createAnswer()->toWire());
@@ -402,23 +402,23 @@
 TEST_F(RecursorConfig, invalidForwardAddresses) {
     // Try torturing it with some invalid inputs
     invalidTest("{"
-        "\"forward_addresses\": \"error\""
+        "\"forward_addresses/\": \"error\""
         "}");
     invalidTest("{"
-        "\"forward_addresses\": [{}]"
+        "\"forward_addresses/\": [{}]"
         "}");
     invalidTest("{"
-        "\"forward_addresses\": [{"
+        "\"forward_addresses/\": [{"
         "   \"port\": 1.5,"
         "   \"address\": \"192.0.2.1\""
         "}]}");
     invalidTest("{"
-        "\"forward_addresses\": [{"
+        "\"forward_addresses/\": [{"
         "   \"port\": -5,"
         "   \"address\": \"192.0.2.1\""
         "}]}");
     invalidTest("{"
-        "\"forward_addresses\": [{"
+        "\"forward_addresses/\": [{"
         "   \"port\": 53,"
         "   \"address\": \"bad_address\""
         "}]}");
@@ -448,7 +448,7 @@
 TEST_F(RecursorConfig, listenAddressConfig) {
     // Try putting there some address
     ElementPtr config(Element::fromJSON("{"
-        "\"listen_addresses\": ["
+        "\"listen_on/\": ["
         "   {"
         "       \"address\": \"127.0.0.1\","
         "       \"port\": 5300"
@@ -464,7 +464,7 @@
     // As this is example address, the machine should not have it on
     // any interface
     config = Element::fromJSON("{"
-        "\"listen_addresses\": ["
+        "\"listen_on/\": ["
         "   {"
         "       \"address\": \"192.0.2.0\","
         "       \"port\": 5300"
@@ -481,23 +481,23 @@
 TEST_F(RecursorConfig, invalidListenAddresses) {
     // Try torturing it with some invalid inputs
     invalidTest("{"
-        "\"listen_addresses\": \"error\""
+        "\"listen_on/\": \"error\""
         "}");
     invalidTest("{"
-        "\"listen_addresses\": [{}]"
+        "\"listen_on/\": [{}]"
         "}");
     invalidTest("{"
-        "\"listen_addresses\": [{"
+        "\"listen_on/\": [{"
         "   \"port\": 1.5,"
         "   \"address\": \"192.0.2.1\""
         "}]}");
     invalidTest("{"
-        "\"listen_addresses\": [{"
+        "\"listen_on/\": [{"
         "   \"port\": -5,"
         "   \"address\": \"192.0.2.1\""
         "}]}");
     invalidTest("{"
-        "\"listen_addresses\": [{"
+        "\"listen_on/\": [{"
         "   \"port\": 53,"
         "   \"address\": \"bad_address\""
         "}]}");




More information about the bind10-changes mailing list