[svn] commit: r2273 - in /branches/trac249/src/lib/datasrc/tests: datasrc_unittest.cc test_datasrc.cc
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Jun 25 00:04:30 UTC 2010
Author: jinmei
Date: Fri Jun 25 00:04:30 2010
New Revision: 2273
Log:
added tests for no-NS/no-SOA zones, which cause an internal SERVFAIL.
they currently fail.
Modified:
branches/trac249/src/lib/datasrc/tests/datasrc_unittest.cc
branches/trac249/src/lib/datasrc/tests/test_datasrc.cc
Modified: branches/trac249/src/lib/datasrc/tests/datasrc_unittest.cc
==============================================================================
--- branches/trac249/src/lib/datasrc/tests/datasrc_unittest.cc (original)
+++ branches/trac249/src/lib/datasrc/tests/datasrc_unittest.cc Fri Jun 25 00:04:30 2010
@@ -864,4 +864,22 @@
RRClass::IN(), RRType::A());
}
-}
+TEST_F(DataSrcTest, noNSZone) {
+ EXPECT_THROW(createAndProcessQuery(Name("www.nons.example"),
+ RRClass::IN(), RRType::A()),
+ DataSourceError);
+}
+
+TEST_F(DataSrcTest, noNSButDnameZone) {
+ EXPECT_THROW(createAndProcessQuery(Name("www.nons-dname.example"),
+ RRClass::IN(), RRType::A()),
+ DataSourceError);
+}
+
+TEST_F(DataSrcTest, noSOAZone) {
+ EXPECT_THROW(createAndProcessQuery(Name("notexist.nosoa.example"),
+ RRClass::IN(), RRType::A()),
+ DataSourceError);
+}
+
+}
Modified: branches/trac249/src/lib/datasrc/tests/test_datasrc.cc
==============================================================================
--- branches/trac249/src/lib/datasrc/tests/test_datasrc.cc (original)
+++ branches/trac249/src/lib/datasrc/tests/test_datasrc.cc Fri Jun 25 00:04:30 2010
@@ -236,6 +236,42 @@
{NULL, NULL, NULL}
};
+//
+// zone data for nons.example
+//
+const struct RRData nons_example_records[] = {
+ {"nons.example", "SOA", "master.nons.example admin.nons.example. "
+ "1234 3600 1800 2419200 7200"},
+ {"www.nons.example", "A", "192.0.2.1"},
+ {"ns.nons.example", "A", "192.0.2.2"},
+ {NULL, NULL, NULL}
+};
+
+//
+// zone data for nons-dname.example
+//
+const struct RRData nonsdname_example_records[] = {
+ {"nons-dname.example", "SOA", "master.nons-dname.example "
+ "admin.nons-dname.example. 1234 3600 1800 2419200 7200"},
+ {"nons-dname.example", "DNAME", "example.org"},
+ {"www.nons-dname.example", "A", "192.0.2.1"},
+ {"ns.nons-dname.example", "A", "192.0.2.2"},
+ {NULL, NULL, NULL}
+};
+
+//
+// zone data for nons-dname.example
+//
+const struct RRData nosoa_example_records[] = {
+ {"nosoa.example", "NS", "ns.nosoa.example"},
+ {"www.nosoa.example", "A", "192.0.2.1"},
+ {"ns.nosoa.example", "A", "192.0.2.2"},
+ {NULL, NULL, NULL}
+};
+
+//
+// empty data set, for convenience.
+//
const struct RRData empty_records[] = {
{NULL, NULL, NULL}
};
@@ -246,7 +282,10 @@
const struct ZoneData zone_data[] = {
{ "example.com", "IN", example_com_records, example_com_glue_records },
{ "sql1.example.com", "IN", sql1_example_com_records, empty_records },
- { "loop.example", "IN", loop_example_records, empty_records }
+ { "loop.example", "IN", loop_example_records, empty_records },
+ { "nons.example", "IN", nons_example_records, empty_records },
+ { "nons-dname.example", "IN", nonsdname_example_records, empty_records },
+ { "nosoa.example", "IN", nosoa_example_records, empty_records }
};
const size_t NUM_ZONES = sizeof(zone_data) / sizeof(zone_data[0]);
More information about the bind10-changes
mailing list