Commit b8e5414e authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

[master] Merge branch 'trac2480-2'

parents 60b979b7 aa32f38e
...@@ -1320,6 +1320,9 @@ AC_OUTPUT([doc/version.ent ...@@ -1320,6 +1320,9 @@ AC_OUTPUT([doc/version.ent
src/bin/msgq/run_msgq.sh src/bin/msgq/run_msgq.sh
src/bin/auth/auth.spec.pre src/bin/auth/auth.spec.pre
src/bin/auth/spec_config.h.pre src/bin/auth/spec_config.h.pre
src/bin/auth/tests/testdata/example.zone
src/bin/auth/tests/testdata/example-base.zone
src/bin/auth/tests/testdata/example-nsec3.zone
src/bin/dhcp4/spec_config.h.pre src/bin/dhcp4/spec_config.h.pre
src/bin/dhcp6/spec_config.h.pre src/bin/dhcp6/spec_config.h.pre
src/bin/tests/process_rename_test.py src/bin/tests/process_rename_test.py
......
/run_unittests /run_unittests
/example_base_inc.cc
/example_nsec3_inc.cc
...@@ -7,7 +7,8 @@ AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc ...@@ -7,7 +7,8 @@ AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
AM_CPPFLAGS += $(BOOST_INCLUDES) AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CPPFLAGS += -DAUTH_OBJ_DIR=\"$(abs_top_builddir)/src/bin/auth\" AM_CPPFLAGS += -DAUTH_OBJ_DIR=\"$(abs_top_builddir)/src/bin/auth\"
AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(abs_top_srcdir)/src/lib/testutils/testdata\" AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(abs_top_srcdir)/src/lib/testutils/testdata\"
AM_CPPFLAGS += -DTEST_OWN_DATA_DIR=\"$(abs_top_srcdir)/src/bin/auth/tests/testdata\" AM_CPPFLAGS += -DTEST_OWN_DATA_DIR=\"$(abs_srcdir)/testdata\"
AM_CPPFLAGS += -DTEST_OWN_DATA_BUILDDIR=\"$(abs_builddir)/testdata\"
AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/testutils/testdata\" AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/lib/testutils/testdata\"
AM_CPPFLAGS += -DDSRC_DIR=\"$(abs_top_builddir)/src/lib/datasrc\" AM_CPPFLAGS += -DDSRC_DIR=\"$(abs_top_builddir)/src/lib/datasrc\"
AM_CPPFLAGS += -DPLUGIN_DATA_PATH=\"$(abs_top_builddir)/src/bin/cfgmgr/plugins\" AM_CPPFLAGS += -DPLUGIN_DATA_PATH=\"$(abs_top_builddir)/src/bin/cfgmgr/plugins\"
...@@ -50,7 +51,6 @@ run_unittests_SOURCES += config_syntax_unittest.cc ...@@ -50,7 +51,6 @@ run_unittests_SOURCES += config_syntax_unittest.cc
run_unittests_SOURCES += command_unittest.cc run_unittests_SOURCES += command_unittest.cc
run_unittests_SOURCES += common_unittest.cc run_unittests_SOURCES += common_unittest.cc
run_unittests_SOURCES += query_unittest.cc run_unittests_SOURCES += query_unittest.cc
run_unittests_SOURCES += query_inmemory_unittest.cc
run_unittests_SOURCES += statistics_unittest.cc run_unittests_SOURCES += statistics_unittest.cc
run_unittests_SOURCES += test_datasrc_clients_mgr.h test_datasrc_clients_mgr.cc run_unittests_SOURCES += test_datasrc_clients_mgr.h test_datasrc_clients_mgr.cc
run_unittests_SOURCES += datasrc_clients_builder_unittest.cc run_unittests_SOURCES += datasrc_clients_builder_unittest.cc
...@@ -81,6 +81,40 @@ run_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libb10-threads.la ...@@ -81,6 +81,40 @@ run_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libb10-threads.la
run_unittests_LDADD += $(GTEST_LDADD) run_unittests_LDADD += $(GTEST_LDADD)
run_unittests_LDADD += $(SQLITE_LIBS) run_unittests_LDADD += $(SQLITE_LIBS)
# The following are definitions for auto-generating test data for query
# tests.
BUILT_SOURCES = example_base_inc.cc example_nsec3_inc.cc
BUILT_SOURCES += testdata/example-base.sqlite3
BUILT_SOURCES += testdata/example-nsec3.sqlite3
EXTRA_DIST = gen-query-testdata.py
CLEANFILES += example_base_inc.cc example_nsec3_inc.cc
example_base_inc.cc: $(srcdir)/testdata/example-base-inc.zone
$(PYTHON) $(srcdir)/gen-query-testdata.py \
$(srcdir)/testdata/example-base-inc.zone example_base_inc.cc
example_nsec3_inc.cc: $(srcdir)/testdata/example-nsec3-inc.zone
$(PYTHON) $(srcdir)/gen-query-testdata.py \
$(srcdir)/testdata/example-nsec3-inc.zone example_nsec3_inc.cc
testdata/example-base.sqlite3: testdata/example-base.zone
$(top_srcdir)/install-sh -c \
$(srcdir)/testdata/example-common-inc-template.zone \
testdata/example-common-inc.zone
$(SHELL) $(top_builddir)/src/bin/loadzone/run_loadzone.sh \
-c "{\"database_file\": \"$(builddir)/testdata/example-base.sqlite3\"}" \
example.com testdata/example-base.zone
testdata/example-nsec3.sqlite3: testdata/example-nsec3.zone
$(top_srcdir)/install-sh -c \
$(srcdir)/testdata/example-common-inc-template.zone \
testdata/example-common-inc.zone
$(SHELL) $(top_builddir)/src/bin/loadzone/run_loadzone.sh \
-c "{\"database_file\": \"$(builddir)/testdata/example-nsec3.sqlite3\"}" \
example.com testdata/example-nsec3.zone
check-local: check-local:
B10_FROM_BUILD=${abs_top_builddir} ./run_unittests B10_FROM_BUILD=${abs_top_builddir} ./run_unittests
......
#!/usr/bin/env python3
# Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
"""\
This is a supplemental script to auto generate test data in the form of
C++ source code from a DNS zone file.
Usage: python gen-query-testdata.py source_file output-cc-file
The usage doesn't matter much, though, because it's expected to be invoked
from Makefile, and that would be only use case of this script.
"""
import sys
import re
# Markup for variable definition
re_start_rr = re.compile('^;var=(.*)')
# Skip lines starting with ';' (comments) or empty lines. re_start_rr
# will also match this expression, so it should be checked first.
re_skip = re.compile('(^;)|(^\s*$)')
def parse_input(input_file):
'''Build an internal list of RR data from the input source file.
It generates a list of (variable_name, list of RR) tuples, where
variable_name is the expected C++ variable name for the subsequent RRs
if they are expected to be named. It can be an empty string if the RRs
are only expected to appear in the zone file.
The second element of the tuple is a list of strings, each of which
represents a single RR, e.g., "example.com 3600 IN A 192.0.2.1".
'''
result = []
rrs = None
with open(input_file) as f:
for line in f:
m = re_start_rr.match(line)
if m:
if rrs is not None:
result.append((rr_varname, rrs))
rrs = []
rr_varname = m.group(1)
elif re_skip.match(line):
continue
else:
rrs.append(line.rstrip('\n'))
# if needed, store the last RRs (they are not followed by 'var=' mark)
if rrs is not None:
result.append((rr_varname, rrs))
return result
def generate_variables(out_file, rrsets_data):
'''Generate a C++ source file containing a C-string variables for RRs.
This produces a definition of C-string for each RRset that is expected
to be named as follows:
const char* const var_name =
"example.com. 3600 IN A 192.0.2.1\n"
"example.com. 3600 IN A 192.0.2.2\n";
Escape character '\' in the string will be further escaped so it will
compile.
'''
with open(out_file, 'w') as out:
for (var_name, rrs) in rrsets_data:
if len(var_name) > 0:
out.write('const char* const ' + var_name + ' =\n')
# Combine all RRs, escaping '\' as a C-string
out.write('\n'.join([' \"%s\\n\"' %
(rr.replace('\\', '\\\\'))
for rr in rrs]))
out.write(';\n')
if __name__ == "__main__":
if len(sys.argv) < 3:
sys.stderr.write('gen-query-testdata.py require 2 args\n')
sys.exit(1)
rrsets_data = parse_input(sys.argv[1])
generate_variables(sys.argv[2], rrsets_data)
// Copyright (C) 2012 Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
// REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
// AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
// LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
// OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
// PERFORMANCE OF THIS SOFTWARE.
#include <dns/name.h>
#include <dns/message.h>
#include <dns/rcode.h>
#include <dns/opcode.h>
#include <cc/data.h>
#include <datasrc/client_list.h>
#include <auth/query.h>
#include <testutils/dnsmessage_test.h>
#include <gtest/gtest.h>
#include <string>
using namespace isc::dns;
using namespace isc::auth;
using namespace isc::testutils;
using isc::datasrc::ConfigurableClientList;
using std::string;
namespace {
// The DNAME to do tests against
const char* const dname_txt =
"dname.example.com. 3600 IN DNAME "
"somethinglong.dnametarget.example.com.\n";
// This is not inside the zone, this is created at runtime
const char* const synthetized_cname_txt =
"www.dname.example.com. 3600 IN CNAME "
"www.somethinglong.dnametarget.example.com.\n";
// This is a subset of QueryTest using (subset of) the same test data, but
// with the production in-memory data source. Both tests should be eventually
// unified to avoid duplicates.
class InMemoryQueryTest : public ::testing::Test {
protected:
InMemoryQueryTest() : list(RRClass::IN()), response(Message::RENDER) {
response.setRcode(Rcode::NOERROR());
response.setOpcode(Opcode::QUERY());
list.configure(isc::data::Element::fromJSON(
"[{\"type\": \"MasterFiles\","
" \"cache-enable\": true, "
" \"params\": {\"example.com\": \"" +
string(TEST_OWN_DATA_DIR "/example.zone") +
"\"}}]"), true);
}
ConfigurableClientList list;
Message response;
Query query;
};
// A wrapper to check resulting response message commonly used in
// tests below.
// check_origin needs to be specified only when the authority section has
// an SOA RR. The interface is not generic enough but should be okay
// for our test cases in practice.
void
responseCheck(Message& response, const isc::dns::Rcode& rcode,
unsigned int flags, const unsigned int ancount,
const unsigned int nscount, const unsigned int arcount,
const char* const expected_answer,
const char* const expected_authority,
const char* const expected_additional,
const Name& check_origin = Name::ROOT_NAME())
{
// In our test cases QID, Opcode, and QDCOUNT should be constant, so
// we don't bother the test cases specifying these values.
headerCheck(response, response.getQid(), rcode, Opcode::QUERY().getCode(),
flags, 0, ancount, nscount, arcount);
if (expected_answer != NULL) {
rrsetsCheck(expected_answer,
response.beginSection(Message::SECTION_ANSWER),
response.endSection(Message::SECTION_ANSWER),
check_origin);
}
if (expected_authority != NULL) {
rrsetsCheck(expected_authority,
response.beginSection(Message::SECTION_AUTHORITY),
response.endSection(Message::SECTION_AUTHORITY),
check_origin);
}
if (expected_additional != NULL) {
rrsetsCheck(expected_additional,
response.beginSection(Message::SECTION_ADDITIONAL),
response.endSection(Message::SECTION_ADDITIONAL));
}
}
/*
* Test a query under a domain with DNAME. We should get a synthetized CNAME
* as well as the DNAME.
*
* TODO: Once we have CNAME chaining, check it works with synthetized CNAMEs
* as well. This includes tests pointing inside the zone, outside the zone,
* pointing to NXRRSET and NXDOMAIN cases (similarly as with CNAME).
*/
TEST_F(InMemoryQueryTest, DNAME) {
query.process(list, Name("www.dname.example.com"), RRType::A(),
response);
responseCheck(response, Rcode::NOERROR(), AA_FLAG, 2, 0, 0,
(string(dname_txt) + synthetized_cname_txt).c_str(),
NULL, NULL);
}
}
This diff is collapsed.
...@@ -6,3 +6,8 @@ ...@@ -6,3 +6,8 @@
/shortanswer_fromWire.wire /shortanswer_fromWire.wire
/simplequery_fromWire.wire /simplequery_fromWire.wire
/simpleresponse_fromWire.wire /simpleresponse_fromWire.wire
/example-base.zone
/example-nsec3-inc.zone
/example-base.sqlite3
/example-nsec3.zone
/example-base.zone
CLEANFILES = *.wire CLEANFILES = *.wire *.copied
CLEANFILES += example-base.sqlite3 example-nsec3.sqlite3
CLEANFILES += example-common-inc.zone
BUILT_SOURCES = badExampleQuery_fromWire.wire examplequery_fromWire.wire BUILT_SOURCES = badExampleQuery_fromWire.wire examplequery_fromWire.wire
BUILT_SOURCES += iqueryresponse_fromWire.wire multiquestion_fromWire.wire BUILT_SOURCES += iqueryresponse_fromWire.wire multiquestion_fromWire.wire
...@@ -24,5 +26,7 @@ EXTRA_DIST += example.com ...@@ -24,5 +26,7 @@ EXTRA_DIST += example.com
EXTRA_DIST += example.zone EXTRA_DIST += example.zone
EXTRA_DIST += example.sqlite3 EXTRA_DIST += example.sqlite3
EXTRA_DIST += example-base-inc.zone example-nsec3-inc.zone
.spec.wire: .spec.wire:
$(PYTHON) $(top_builddir)/src/lib/util/python/gen_wiredata.py -o $@ $< $(PYTHON) $(top_builddir)/src/lib/util/python/gen_wiredata.py -o $@ $<
;; This file defines a set of RRs commonly used in query tests in the
;; form of standard master zone file.
;; ;;
;; This is a complete (but crafted and somewhat broken) zone file used ;; It's a sequence of the following pattern:
;; in query tests. ;; ;var=<var_name>
;; RR_1
;; RR_2
;; ..
;; RR_n
;; ;;
;; where var_name is a string that can be used as a variable name in a
;; C/C++ source file or an empty string. RR_x is a single-line
;; textual representation of an arbitrary DNS RR.
;;
;; If var_name is non empty, the generator script will define a C
;; variable of C-string type for that set of RRs so that it can be referred
;; to in the test source file.
;;
;; Note that lines beginning ';var=' is no different from other
;; comment lines as a zone file. It has special meaning only for the
;; generator script. Obviously, real comment lines cannot begin with
;; ';var=' (which should be less likely to happen in practice though).
;;
;; These RRs will be loaded into in-memory data source in that order.
;; Note that it may impose stricter restriction on the order of RRs.
;; In general, each RRset of the same name and type and its RRSIG (if
;; any) is expected to be grouped.
example.com. 3600 IN SOA . . 0 0 0 0 0 ;var=soa_txt
example.com. 3600 IN SOA . . 1 0 0 0 0
;var=zone_ns_txt
example.com. 3600 IN NS glue.delegation.example.com. example.com. 3600 IN NS glue.delegation.example.com.
example.com. 3600 IN NS noglue.example.com. example.com. 3600 IN NS noglue.example.com.
example.com. 3600 IN NS example.net. example.com. 3600 IN NS example.net.
example.com. 3600 IN DS 57855 5 1 B6DCD485719ADCA18E5F3D48A2331627FDD3 636B
;var=
example.com. 3600 IN RRSIG SOA 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
example.com. 3600 IN RRSIG NS 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;; Note: the position of the next RR is tricky. It's placed here to
;; be grouped with the subsequent A RR of the name. But we also want
;; to group the A RR with other RRs of a different owner name, so the RRSIG
;; cannot be placed after the A RR. The empty 'var=' specification is
;; not necessary here, but in case we want to reorganize the ordering
;; (in which case it's more likely to be needed), we keep it here.
;var=
noglue.example.com. 3600 IN RRSIG A 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=ns_addrs_txt
noglue.example.com. 3600 IN A 192.0.2.53
glue.delegation.example.com. 3600 IN A 192.0.2.153 glue.delegation.example.com. 3600 IN A 192.0.2.153
glue.delegation.example.com. 3600 IN AAAA 2001:db8::53 glue.delegation.example.com. 3600 IN AAAA 2001:db8::53
noglue.example.com. 3600 IN A 192.0.2.53
;var=
glue.delegation.example.com. 3600 IN RRSIG A 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
glue.delegation.example.com. 3600 IN RRSIG AAAA 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=delegation_txt
delegation.example.com. 3600 IN NS glue.delegation.example.com. delegation.example.com. 3600 IN NS glue.delegation.example.com.
delegation.example.com. 3600 IN NS noglue.example.com. delegation.example.com. 3600 IN NS noglue.example.com.
delegation.example.com. 3600 IN NS cname.example.com. delegation.example.com. 3600 IN NS cname.example.com.
delegation.example.com. 3600 IN NS example.org. delegation.example.com. 3600 IN NS example.org.
;var=
delegation.example.com. 3600 IN RRSIG DS 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;; Borrowed from the RFC4035 ;; Borrowed from the RFC4035
;var=delegation_ds_txt
delegation.example.com. 3600 IN DS 57855 5 1 B6DCD485719ADCA18E5F3D48A2331627FDD3 636B delegation.example.com. 3600 IN DS 57855 5 1 B6DCD485719ADCA18E5F3D48A2331627FDD3 636B
;var=mx_txt
mx.example.com. 3600 IN MX 10 www.example.com. mx.example.com. 3600 IN MX 10 www.example.com.
mx.example.com. 3600 IN MX 20 mailer.example.org. mx.example.com. 3600 IN MX 20 mailer.example.org.
mx.example.com. 3600 IN MX 30 mx.delegation.example.com. mx.example.com. 3600 IN MX 30 mx.delegation.example.com.
;var=www_a_txt
www.example.com. 3600 IN A 192.0.2.80 www.example.com. 3600 IN A 192.0.2.80
;var=
www.example.com. 3600 IN RRSIG A 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=cname_txt
cname.example.com. 3600 IN CNAME www.example.com. cname.example.com. 3600 IN CNAME www.example.com.
;var=cname_nxdom_txt
cnamenxdom.example.com. 3600 IN CNAME nxdomain.example.com. cnamenxdom.example.com. 3600 IN CNAME nxdomain.example.com.
;; CNAME Leading out of zone ;; CNAME Leading out of zone
;var=cname_out_txt
cnameout.example.com. 3600 IN CNAME www.example.org. cnameout.example.com. 3600 IN CNAME www.example.org.
;; The DNAME to do tests against ;; The DNAME to do tests against
;var=dname_txt
dname.example.com. 3600 IN DNAME somethinglong.dnametarget.example.com. dname.example.com. 3600 IN DNAME somethinglong.dnametarget.example.com.
;; Some data at the dname node (allowed by RFC 2672) ;; Some data at the dname node (allowed by RFC 2672)
;var=dname_a_txt
dname.example.com. 3600 IN A 192.0.2.5 dname.example.com. 3600 IN A 192.0.2.5
;; This is not inside the zone, this is created at runtime
;; www.dname.example.com. 3600 IN CNAME www.somethinglong.dnametarget.example.com.
;; The rest of data won't be referenced from the test cases. ;; The rest of data won't be referenced from the test cases.
;var=other_zone_rrs
cnamemailer.example.com. 3600 IN CNAME www.example.com. cnamemailer.example.com. 3600 IN CNAME www.example.com.
cnamemx.example.com. 3600 IN MX 10 cnamemailer.example.com. cnamemx.example.com. 3600 IN MX 10 cnamemailer.example.com.
mx.delegation.example.com. 3600 IN A 192.0.2.100 mx.delegation.example.com. 3600 IN A 192.0.2.100
;; Wildcards ;; Wildcards
;var=wild_txt
*.wild.example.com. 3600 IN A 192.0.2.7 *.wild.example.com. 3600 IN A 192.0.2.7
;var=nsec_wild_txt
*.wild.example.com. 3600 IN NSEC www.example.com. A NSEC RRSIG *.wild.example.com. 3600 IN NSEC www.example.com. A NSEC RRSIG
;var=
*.wild.example.com. 3600 IN RRSIG A 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
*.wild.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=cnamewild_txt
*.cnamewild.example.com. 3600 IN CNAME www.example.org. *.cnamewild.example.com. 3600 IN CNAME www.example.org.
;var=nsec_cnamewild_txt
*.cnamewild.example.com. 3600 IN NSEC delegation.example.com. CNAME NSEC RRSIG *.cnamewild.example.com. 3600 IN NSEC delegation.example.com. CNAME NSEC RRSIG
;var=
*.cnamewild.example.com. 3600 IN RRSIG CNAME 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
*.cnamewild.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;; Wildcard_nxrrset ;; Wildcard_nxrrset
;var=wild_txt_nxrrset
*.uwild.example.com. 3600 IN A 192.0.2.9 *.uwild.example.com. 3600 IN A 192.0.2.9
;var=nsec_wild_txt_nxrrset
*.uwild.example.com. 3600 IN NSEC www.uwild.example.com. A NSEC RRSIG *.uwild.example.com. 3600 IN NSEC www.uwild.example.com. A NSEC RRSIG
;var=
*.uwild.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=wild_txt_next
www.uwild.example.com. 3600 IN A 192.0.2.11 www.uwild.example.com. 3600 IN A 192.0.2.11
;var=
www.uwild.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=nsec_wild_txt_next
www.uwild.example.com. 3600 IN NSEC *.wild.example.com. A NSEC RRSIG www.uwild.example.com. 3600 IN NSEC *.wild.example.com. A NSEC RRSIG
;; Wildcard empty ;; Wildcard empty
;var=empty_txt
b.*.t.example.com. 3600 IN A 192.0.2.13 b.*.t.example.com. 3600 IN A 192.0.2.13
;var=nsec_empty_txt
b.*.t.example.com. 3600 IN NSEC *.uwild.example.com. A NSEC RRSIG b.*.t.example.com. 3600 IN NSEC *.uwild.example.com. A NSEC RRSIG
;var=
b.*.t.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=empty_prev_txt
t.example.com. 3600 IN A 192.0.2.15 t.example.com. 3600 IN A 192.0.2.15
;var=nsec_empty_prev_txt
t.example.com. 3600 IN NSEC b.*.t.example.com. A NSEC RRSIG t.example.com. 3600 IN NSEC b.*.t.example.com. A NSEC RRSIG
;var=
t.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;; Used in NXDOMAIN proof test. We are going to test some unusual case where ;; Used in NXDOMAIN proof test. We are going to test some unusual case where
;; the best possible wildcard is below the "next domain" of the NSEC RR that ;; the best possible wildcard is below the "next domain" of the NSEC RR that
;; proves the NXDOMAIN, i.e., ;; proves the NXDOMAIN, i.e.,
...@@ -55,11 +153,25 @@ t.example.com. 3600 IN NSEC b.*.t.example.com. A NSEC RRSIG ...@@ -55,11 +153,25 @@ t.example.com. 3600 IN NSEC b.*.t.example.com. A NSEC RRSIG
;; (.no.example.com. (qname, NXDOMAIN) ;; (.no.example.com. (qname, NXDOMAIN)
;; ).no.example.com. (exist) ;; ).no.example.com. (exist)
;; *.no.example.com. (best possible wildcard, not exist) ;; *.no.example.com. (best possible wildcard, not exist)
;var=no_txt
\).no.example.com. 3600 IN AAAA 2001:db8::53 \).no.example.com. 3600 IN AAAA 2001:db8::53
;; NSEC records. ;; NSEC records.
;var=nsec_apex_txt
example.com. 3600 IN NSEC cname.example.com. NS SOA NSEC RRSIG example.com. 3600 IN NSEC cname.example.com. NS SOA NSEC RRSIG
;var=
example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=nsec_mx_txt
mx.example.com. 3600 IN NSEC \).no.example.com. MX NSEC RRSIG mx.example.com. 3600 IN NSEC \).no.example.com. MX NSEC RRSIG
;var=
mx.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;var=nsec_no_txt
\).no.example.com. 3600 IN NSEC nz.no.example.com. AAAA NSEC RRSIG \).no.example.com. 3600 IN NSEC nz.no.example.com. AAAA NSEC RRSIG
;var=
\).no.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;; We'll also test the case where a single NSEC proves both NXDOMAIN and the ;; We'll also test the case where a single NSEC proves both NXDOMAIN and the
;; non existence of wildcard. The following records will be used for that ;; non existence of wildcard. The following records will be used for that
;; test. ;; test.
...@@ -67,55 +179,58 @@ mx.example.com. 3600 IN NSEC \).no.example.com. MX NSEC RRSIG ...@@ -67,55 +179,58 @@ mx.example.com. 3600 IN NSEC \).no.example.com. MX NSEC RRSIG
;; *.no.example.com. (best possible wildcard, not exist) ;; *.no.example.com. (best possible wildcard, not exist)
;; nx.no.example.com. (NXDOMAIN) ;; nx.no.example.com. (NXDOMAIN)
;; nz.no.example.com. (exist) ;; nz.no.example.com. (exist)
;var=nz_txt
nz.no.example.com. 3600 IN AAAA 2001:db8::5300 nz.no.example.com. 3600 IN AAAA 2001:db8::5300
;var=nsec_nz_txt
nz.no.example.com. 3600 IN NSEC noglue.example.com. AAAA NSEC RRSIG nz.no.example.com. 3600 IN NSEC noglue.example.com. AAAA NSEC RRSIG
;var=nsec_nxdomain_txt
noglue.example.com. 3600 IN NSEC nonsec.example.com. A noglue.example.com. 3600 IN NSEC nonsec.example.com. A
;var=
noglue.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;; NSEC for the normal NXRRSET case ;; NSEC for the normal NXRRSET case
;var=nsec_www_txt
www.example.com. 3600 IN NSEC example.com. A NSEC RRSIG www.example.com. 3600 IN NSEC example.com. A NSEC RRSIG
;var=
www.example.com. 3600 IN RRSIG NSEC 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;; Authoritative data without NSEC ;; Authoritative data without NSEC
;var=nonsec_a_txt
nonsec.example.com. 3600 IN A 192.0.2.0 nonsec.example.com. 3600 IN A 192.0.2.0
;; NSEC3 RRs. You may also need to add mapping to MockZoneFinder::hash_map_.
0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example.com. 3600 IN NSEC3 1 1 12 aabbccdd 2t7b4g4vsa5smi47k61mv5bv1a22bojr NS SOA NSEC3PARAM RRSIG
0p9mhaveqvm6t7vbl5lop2u3t2rp3tom.example.com. 3600 IN RRSIG NSEC3 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
q04jkcevqvmu85r014c7dkba38o0ji5r.example.com. 3600 IN NSEC3 1 1 12 aabbccdd r53bq7cc2uvmubfu5ocmm6pers9tk9en A RRSIG
q04jkcevqvmu85r014c7dkba38o0ji5r.example.com. 3600 IN RRSIG NSEC3 5 3 3600 20000101000000 20000201000000 12345 example.com. FAKEFAKEFAKE
;; NSEC3 for wild.example.com (used in wildcard tests, will be added on