Commit 49d6a081 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2421] Add unit tests for broken zones during configure()

parent 4bc7823d
......@@ -838,16 +838,24 @@ TEST_F(ListTest, BadMasterFile) {
" \"cache-enable\": true,"
" \"params\": {"
" \"example.com.\": \"" TEST_DATA_DIR "/example.com.flattened\","
" \"example.net.\": \"" TEST_DATA_DIR "/example.net-empty\","
" \"example.edu.\": \"" TEST_DATA_DIR "/example.edu-broken\","
" \"example.info.\": \"" TEST_DATA_DIR "/example.info-nonexist\","
" \"foo.bar.\": \"" TEST_DATA_DIR "/example.org.nsec3-signed\","
" \".\": \"" TEST_DATA_DIR "/root.zone\""
" }"
"}]"));
// this should not throw even if there are any zone loading errors.
list_->configure(elem, true);
positiveResult(list_->find(Name("example.com."), true), ds_[0],
Name("example.com."), true, "example.com", true);
EXPECT_TRUE(negative_result_ == list_->find(Name("example.org."), true));
EXPECT_TRUE(negative_result_ == list_->find(Name("foo.bar"), true));
EXPECT_TRUE(negative_result_ == list_->find(Name("example.net."), true));
EXPECT_TRUE(negative_result_ == list_->find(Name("example.edu."), true));
EXPECT_TRUE(negative_result_ == list_->find(Name("example.info."), true));
positiveResult(list_->find(Name(".")), ds_[0], Name("."), true, "root",
true);
}
......
example.edu. 3600 IN SOA ns1.example.edu. admin.example.edu. 1234 3600 1800 2419200 7200
example.edu. 3600 IN NS ns1.example.edu.
example.edu. 3600 IN NS ns2.example.edu.
example.edu. 3600 IN MX 10 mail.example.edu.
www.example.edu. 3600 IN A 192.0.2.1
ns1.example.edu. 3600 IN A 192.0.2.3
ns2.example.edu. 3600 IN A 192.0.2.4
;; DNAME + NS (non-apex) throws ZoneDataUpdater::AddError
ns1.example.edu. 3600 IN DNAME foo.example.edu.
ns1.example.edu. 3600 IN NS bar.example.edu.
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