Commit a57c6c2a authored by Michal Vaner's avatar Michal Vaner
Browse files

Fix config item names

The names contain slashes.

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/vorner-recursor-config@3340 e5f2f494-b856-4b98-b285-d166d9295462
parent 3fc3a584
......@@ -496,9 +496,9 @@ Recursor::updateConfig(ConstElementPtr config) {
}
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
......
......@@ -369,7 +369,7 @@ TEST_F(RecursorConfig, forwardAddresses) {
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 @@ TEST_F(RecursorConfig, forwardAddressConfig) {
// 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 @@ void RecursorConfig::invalidTest(const string &JOSN) {
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, listenAddresses) {
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 @@ TEST_F(RecursorConfig, listenAddressConfig) {
// 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, listenAddressConfig) {
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\""
"}]}");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment