BIND 10 trac553, updated. e26d533eb62f553fcbae616d82e84e3784f750c6 [trac553] Test with the foo.wild.. in the tree
BIND 10 source code commits
bind10-changes at lists.isc.org
Fri Feb 11 18:10:05 UTC 2011
The branch, trac553 has been updated
via e26d533eb62f553fcbae616d82e84e3784f750c6 (commit)
from d619eab67a0c2255f249dfabd7c9db0e5d14b833 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e26d533eb62f553fcbae616d82e84e3784f750c6
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Fri Feb 11 19:07:11 2011 +0100
[trac553] Test with the foo.wild.. in the tree
If there are two entries under the foo.wild.example.org, the
foo.wild.example.org exists in the tree and while the results should be
the same, the way it is handled internally is different (the
cancellation happens as a sideeffect). Therefore we test this situation
as well.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/tests/memory_datasrc_unittest.cc | 52 ++++++++++++++++------
1 files changed, 38 insertions(+), 14 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/tests/memory_datasrc_unittest.cc b/src/lib/datasrc/tests/memory_datasrc_unittest.cc
index b461dce..ef0886e 100644
--- a/src/lib/datasrc/tests/memory_datasrc_unittest.cc
+++ b/src/lib/datasrc/tests/memory_datasrc_unittest.cc
@@ -205,6 +205,8 @@ public:
&rr_dnamewild_},
{"*.child.example.org. 300 IN A 192.0.2.1", &rr_child_wild_},
{"bar.foo.wild.example.org. 300 IN A 192.0.2.2", &rr_not_wild_},
+ {"baz.foo.wild.example.org. 300 IN A 192.0.2.3",
+ &rr_not_wild_another_},
{NULL, NULL}
};
@@ -256,6 +258,7 @@ public:
RRsetPtr rr_nswild_, rr_dnamewild_;
RRsetPtr rr_child_wild_;
RRsetPtr rr_not_wild_;
+ RRsetPtr rr_not_wild_another_;
/**
* \brief Test one find query to the zone.
@@ -327,6 +330,8 @@ public:
}
});
}
+ // Internal part of the cancelWildcard test that is run twice
+ void doCancelWildcardTest();
};
/**
@@ -851,20 +856,10 @@ TEST_F(MemoryZoneTest, nestedEmptyWildcard) {
}
}
-/*
- * This tests that if there's a name between the wildcard domain and the
- * searched one, it will not trigger wildcard, for example, if we have
- * *.wild.example.org and bar.foo.example.org, then we know foo.example.org
- * exists and is not wildcard. Therefore, search for aaa.foo.example.org should
- * return NXDOMAIN.
- *
- * Tests few cases "around" the canceled wildcard match, to see something that
- * shouldn't be canceled isn't.
- */
-TEST_F(MemoryZoneTest, cancelWildcard) {
- EXPECT_EQ(SUCCESS, zone_.add(rr_wild_));
- EXPECT_EQ(SUCCESS, zone_.add(rr_not_wild_));
-
+// We run this part twice from the below test, in two slightly different
+// situations
+void
+MemoryZoneTest::doCancelWildcardTest() {
// These should be canceled
{
SCOPED_TRACE("Canceled under foo.example.org");
@@ -907,6 +902,35 @@ TEST_F(MemoryZoneTest, cancelWildcard) {
}
}
+/*
+ * This tests that if there's a name between the wildcard domain and the
+ * searched one, it will not trigger wildcard, for example, if we have
+ * *.wild.example.org and bar.foo.example.org, then we know foo.example.org
+ * exists and is not wildcard. Therefore, search for aaa.foo.example.org should
+ * return NXDOMAIN.
+ *
+ * Tests few cases "around" the canceled wildcard match, to see something that
+ * shouldn't be canceled isn't.
+ */
+TEST_F(MemoryZoneTest, cancelWildcard) {
+ EXPECT_EQ(SUCCESS, zone_.add(rr_wild_));
+ EXPECT_EQ(SUCCESS, zone_.add(rr_not_wild_));
+
+ {
+ SCOPED_TRACE("Runnig with single entry under foo.example.org");
+ doCancelWildcardTest();
+ }
+
+ // Try putting another one undef foo.wild....
+ // The result should be the same but it will be done in another way in the
+ // code, because the foo.wild.example.org will exist in the tree.
+ EXPECT_EQ(SUCCESS, zone_.add(rr_not_wild_another_));
+ {
+ SCOPED_TRACE("Runnig with two entries under foo.example.org");
+ doCancelWildcardTest();
+ }
+}
+
TEST_F(MemoryZoneTest, loadBadWildcard) {
// We reject loading the zone if it contains a wildcard name for
// NS or DNAME.
More information about the bind10-changes
mailing list