Commit 3487cf43 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[trac626] added a similar test case: there's CNAME at zone apex.

The fixed (even pre-fixed) code alrady handles this case correctly.
parent 527718a5
......@@ -1026,6 +1026,15 @@ TEST_F(DataSrcTest, noSOAZone) {
DataSourceError);
}
TEST_F(DataSrcTest, apexCNAMEZone) {
// The query name doesn't exist in the best matching zone,
// and there's a CNAME at the apex (which is bogus), so query handling
// will fail due to missing SOA.
EXPECT_THROW(createAndProcessQuery(Name("notexist.apexcname.example"),
RRClass::IN(), RRType::A()),
DataSourceError);
}
// currently fails
TEST_F(DataSrcTest, DISABLED_synthesizedCnameTooLong) {
// qname has the possible max length (255 octets). it matches a DNAME,
......
......@@ -272,6 +272,18 @@ const struct RRData nosoa_example_records[] = {
{NULL, NULL, NULL}
};
//
// zone data for apexcname.example.
//
const struct RRData apexcname_example_records[] = {
{"apexcname.example", "CNAME", "canonical.apexcname.example"},
{"canonical.apexcname.example", "SOA",
"master.apexcname.example "
"admin.apexcname.example. 1234 3600 1800 2419200 7200"},
{NULL, NULL, NULL}
};
//
// empty data set, for convenience.
//
......@@ -288,7 +300,8 @@ const struct ZoneData zone_data[] = {
{ "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 }
{ "nosoa.example", "IN", nosoa_example_records, empty_records },
{ "apexcname.example", "IN", nosoa_example_records, empty_records }
};
const size_t NUM_ZONES = sizeof(zone_data) / sizeof(zone_data[0]);
......
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