]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2504] Add testcase that reproduces the problem
authorMukund Sivaraman <muks@isc.org>
Thu, 6 Dec 2012 06:54:38 +0000 (12:24 +0530)
committerMukund Sivaraman <muks@isc.org>
Thu, 6 Dec 2012 06:55:11 +0000 (12:25 +0530)
This test currently fails with an assertion.

src/lib/datasrc/tests/memory/testdata/2504-test.zone [new file with mode: 0644]
src/lib/datasrc/tests/memory/testdata/Makefile.am
src/lib/datasrc/tests/memory/zone_finder_unittest.cc

diff --git a/src/lib/datasrc/tests/memory/testdata/2504-test.zone b/src/lib/datasrc/tests/memory/testdata/2504-test.zone
new file mode 100644 (file)
index 0000000..e4cc661
--- /dev/null
@@ -0,0 +1,10 @@
+ok.ok.ok.ok.dnssec.tjeb.nl.    600     IN      SOA     ns2.tjeb.nl. tjeb.tjeb.nl. 2012120601 28800 7200 604800 18000
+ok.ok.ok.ok.dnssec.tjeb.nl.    600     IN      A       178.18.82.80
+ok.ok.ok.ok.dnssec.tjeb.nl.    3600    IN      DNSKEY  256 3 5 AwEAAag7J/qxkLI1keftNSKe0fqa2mU1GaeZGQoOSgVZvJAMh6LK9F1NMmWP2MeaeJvfTkmZs2UggGnFjkb7QQygrZnfxxCOVu5fG8x3Na5Z7jAdMgVfuJ1FTmsi2Bj4W/+b3fuvv/eVGqlEsFdth+sGA+BKH9mdBwmt+aXJf9gohXpx ;{id = 34791 (zsk), size = 1024b}
+ok.ok.ok.ok.dnssec.tjeb.nl.    600     IN      NS      ns2.tjeb.nl.
+ok.ok.ok.ok.dnssec.tjeb.nl.    18000   IN      NSEC    ok.ok.ok.ok.dnssec.tjeb.nl. A NS SOA RRSIG NSEC DNSKEY
+ok.ok.ok.ok.dnssec.tjeb.nl.    600     IN      RRSIG   SOA 5 7 600 20200101000000 20120627091929 34791 ok.ok.ok.ok.dnssec.tjeb.nl. Z+LjS0NtrUkOje1PZht8a3TylxEKabDltJSye3NO/n6tE9268S5EqQ6r0nZ0hO78c9r4lYxMlvnfyTAj/5rR/zdApCS0EnpQenVyvwagIAVdIcNqpZxr7i/tFmOvxyQK3NRhWqH83WhNwqRE1E4thUfNovtyscSLR+TOhuEBKlg=
+ok.ok.ok.ok.dnssec.tjeb.nl.    600     IN      RRSIG   A 5 7 600 20200101000000 20120627091929 34791 ok.ok.ok.ok.dnssec.tjeb.nl. oYbwX46pDyaTNIeZByyLnUVc4RNgFmGeUuJ4sn0aIqrX6UqfNJwJpZiCspcyBRBNIZye6ypVNFD9RUHesrELHjFOAustg86GFws1jeEoDbi4W6wmeNQqiUfnyaqME3rHD9WE7I99Nqiyp8ZEBseem/SIOCsEXxPLrhoAL+Fa1+s=
+ok.ok.ok.ok.dnssec.tjeb.nl.    600     IN      RRSIG   NS 5 7 600 20200101000000 20120627091929 34791 ok.ok.ok.ok.dnssec.tjeb.nl. KBRov1y79yN75feRo2Bv5B+UpmDAyEr/kTgWgL9dYtkuQXvT7Y1Lg5jhcFmyrAkpYud70i5Un2DEUtmnI2oUR7XUh1RDnMQZRgKkaDXNXj5D379hLxpD2jtN+A311ShReaM4laj44UiDzu0pjGtrDT7BY1c4Qb5XI0RLyI0VKSs=
+ok.ok.ok.ok.dnssec.tjeb.nl.    3600    IN      RRSIG   DNSKEY 5 7 3600 20200101000000 20120627091929 34791 ok.ok.ok.ok.dnssec.tjeb.nl. NriwgSl8QskWiQMlIPzn3WvWQwfQDy8pnJ4U2qlOjWFeJ4wH7DS/P5BDh9+JXjKamh5Bdy2umSf1uY1BeodSP+Ga4yKxNb1sigGbToYGDsbLP1NfPPq6uijl5nRhqBQAAzjCmyU9sm6GUr/CyOpSTTxtFjosXZQ1t1GFya6Tgho=
+ok.ok.ok.ok.dnssec.tjeb.nl.    18000   IN      RRSIG   NSEC 5 7 18000 20200101000000 20120627091929 34791 ok.ok.ok.ok.dnssec.tjeb.nl. ijT2etFxkmNLMdbugWsIrnPuJqxdPPO/ilWUb0ZapcuwtqV4mTZCalUlb3KSpcczHPfyClF7WvMEKdluLrX55TPKEBxx1AIdOduhwSTxCxgZpOp4LFIR3rg5hTH9bupEUvbFPWU8RX5oX0GLE0V/EpfNYpHOtvvG3rnegwynML4=
index dddbf0a3dd396f50e37aaf0cdabb3ecf1ae4b1d0..d99872cbd1f0e4253f9ecee33f08e27a712fe6f3 100644 (file)
@@ -29,3 +29,5 @@ EXTRA_DIST += example.org-rrsigs.zone
 EXTRA_DIST += example.org-wildcard-dname.zone
 EXTRA_DIST += example.org-wildcard-ns.zone
 EXTRA_DIST += example.org-wildcard-nsec3.zone
+
+EXTRA_DIST += 2504-test.zone
index f1121194ea1596b680d6c158118b821fd35f7473..c7ec501d1a2f7f0f68335900f3d2ef239f1628bb 100644 (file)
@@ -13,6 +13,7 @@
 // PERFORMANCE OF THIS SOFTWARE.
 
 #include "memory_segment_test.h"
+#include "zone_table_segment_test.h"
 
 // NOTE: this faked_nsec3 inclusion (and all related code below)
 // was ported during #2109 for the convenience of implementing #2218
 #include <datasrc/memory/zone_finder.h>
 #include <datasrc/memory/zone_data_updater.h>
 #include <datasrc/memory/rdata_serialization.h>
+#include <datasrc/memory/zone_table_segment.h>
+#include <datasrc/memory/memory_client.h>
 #include <datasrc/data_source.h>
+#include <datasrc/client.h>
 #include <testutils/dnsmessage_test.h>
 
 #include <boost/foreach.hpp>
@@ -1426,6 +1430,24 @@ TEST_F(InMemoryZoneFinderTest, findOrphanRRSIG) {
              ZoneFinder::DELEGATION, true, ns_rrset);
 }
 
+// \brief testcase for #2504 (Problem in inmem NSEC denial of existence
+// handling)
+TEST_F(InMemoryZoneFinderTest, NSECNonExistentTest) {
+    shared_ptr<ZoneTableSegment> ztable_segment(
+         new ZoneTableSegmentTest(class_, mem_sgmt_));
+    InMemoryClient client(ztable_segment, class_);
+    Name name("ok.ok.ok.ok.dnssec.tjeb.nl.");
+
+    client.load(name, TEST_DATA_DIR "/2504-test.zone");
+    DataSourceClient::FindResult result(client.findZone(name));
+
+    // Check for a non-existing name
+    Name search_name("nonexist.ok.ok.ok.ok.dnssec.tjeb.nl.");
+    ZoneFinderContextPtr find_result(
+        result.zone_finder->find(search_name,
+                                 RRType::A(), ZoneFinder::FIND_DNSSEC));
+}
+
 /// \brief NSEC3 specific tests fixture for the InMemoryZoneFinder class
 class InMemoryZoneFinderNSEC3Test : public InMemoryZoneFinderTest {
 public: