From: Jelte Jansen Date: Wed, 22 Aug 2012 08:44:09 +0000 (+0200) Subject: [2178] add another correct zone to the test X-Git-Tag: trac2351_base~118^2~1^2~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=33c57e4cefbd3948e5527d34f0a56a4f4a50a308;p=thirdparty%2Fkea.git [2178] add another correct zone to the test --- diff --git a/src/lib/datasrc/tests/client_list_unittest.cc b/src/lib/datasrc/tests/client_list_unittest.cc index 8b1d4746fe..fc571d9dfd 100644 --- a/src/lib/datasrc/tests/client_list_unittest.cc +++ b/src/lib/datasrc/tests/client_list_unittest.cc @@ -787,24 +787,28 @@ TEST_F(ListTest, masterFiles) { } TEST_F(ListTest, BadMasterFile) { - // Configure one zone correctly, and one with the wrong origin - // (resulting in out-of-zone data) - // Configuration should succeed, and the correct zone should - // be loaded. + // Configure two zone correctly, and one with the wrong origin + // (resulting in an out-of-zone data error) + // Configuration should succeed, and the correct zones should + // be loaded. Neither the 'bad' origin or the zone it used + // should be loaded const ConstElementPtr elem(Element::fromJSON("[" "{" " \"type\": \"MasterFiles\"," " \"cache-enable\": true," " \"params\": {" - " \"foo.bar.\": \"" TEST_DATA_DIR "/example.org\"," + " \"example.com.\": \"" TEST_DATA_DIR "/example.com.flattened\"," + " \"foo.bar.\": \"" TEST_DATA_DIR "/example.org.nsec3-signed\"," " \".\": \"" TEST_DATA_DIR "/root.zone\"" " }" "}]")); list_->configure(elem, true); - EXPECT_TRUE(negativeResult_ == list_->find(Name("example.org."), true)); - EXPECT_TRUE(negativeResult_ == list_->find(Name("foo.bar"), true)); - positiveResult(list_->find(Name(".")), ds_[0], Name("."), true, "com", + positiveResult(list_->find(Name("example.com."), true), ds_[0], + Name("example.com."), true, "example.com", true); + EXPECT_EQ(negativeResult_, list_->find(Name("example.org."), true)); + EXPECT_EQ(negativeResult_, list_->find(Name("foo.bar"), true)); + positiveResult(list_->find(Name(".")), ds_[0], Name("."), true, "root", true); } diff --git a/src/lib/datasrc/tests/testdata/example.com.flattened b/src/lib/datasrc/tests/testdata/example.com.flattened new file mode 100644 index 0000000000..92d1f45cd6 --- /dev/null +++ b/src/lib/datasrc/tests/testdata/example.com.flattened @@ -0,0 +1,3 @@ +example.com. 3600 IN SOA ns.example.com. admin.example.com. 1234 3600 1800 2419200 7200 +example.com. 3600 IN NS ns.example.com. +ns.example.com. 3600 IN A 192.0.2.1