From: Otto Moerbeek Date: Wed, 10 Sep 2025 12:55:55 +0000 (+0200) Subject: Process comments from pieterlexis wrt tests X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=782e173c10ed3540b11f1d1748b83020e325c39f;p=thirdparty%2Fpdns.git Process comments from pieterlexis wrt tests Signed-off-by: Otto Moerbeek --- diff --git a/pdns/recursordist/docs/upgrade.rst b/pdns/recursordist/docs/upgrade.rst index fbe277bcf..a5eb34520 100644 --- a/pdns/recursordist/docs/upgrade.rst +++ b/pdns/recursordist/docs/upgrade.rst @@ -18,8 +18,8 @@ New Settings - The ``dump-cookies`` subcommand has been added to dump a table showing cookie support for each authoritative server contacted recently. -- The ``clear-cookies`` subcommand has been added to clear entries from the cookie support table -- The ``add-cookies-unsupported`` subcommand has been added to mark an authoritative server as not supporing cookies. +- The ``clear-cookies`` subcommand has been added to clear entries from the cookie support table. +- The ``add-cookies-unsupported`` subcommand has been added to mark an authoritative server as not supporting cookies. 5.2.0 to 5.3.0 -------------- diff --git a/regression-tests.recursor-dnssec/runtests b/regression-tests.recursor-dnssec/runtests index 376732398..d8a164782 100755 --- a/regression-tests.recursor-dnssec/runtests +++ b/regression-tests.recursor-dnssec/runtests @@ -32,8 +32,8 @@ export PDNS=${PDNS:-${PWD}/../pdns/pdns_server} export PDNSUTIL=${PDNSUTIL:-${PWD}/../pdns/pdnsutil} export PDNSMODULEDIR=${PDNSMODULEDIR:-${PWD}/../regression-tests/modules} -export PDNSRECURSOR=${PDNSRECURSOR:-${PWD}/../pdns/recursordist/pdns_recursor} -export RECCONTROL=${RECCONTROL:-${PWD}/../pdns/recursordist/rec_control} +export PDNSRECURSOR=${PDNSRECURSOR:-${PWD}/../pdns/recursordist/build/pdns_recursor} +export RECCONTROL=${RECCONTROL:-${PWD}/../pdns/recursordist/build/rec_control} LIBFAKETIME_DEFAULT=/usr/lib/$(arch)-linux-gnu/faketime/libfaketimeMT.so.1 # ubuntu default LIBAUTHBIND_DEFAULT=/usr/lib/authbind/libauthbind.so.1 diff --git a/regression-tests.recursor-dnssec/test_Cookies.py b/regression-tests.recursor-dnssec/test_Cookies.py index 63427ec17..3a2514363 100644 --- a/regression-tests.recursor-dnssec/test_Cookies.py +++ b/regression-tests.recursor-dnssec/test_Cookies.py @@ -22,6 +22,7 @@ recursor: forward_zones: - zone: cookies.example forwarders: [%s.25, %s.26] + devonly_regression_test_mode: true outgoing: cookies: true packetcache: @@ -95,12 +96,15 @@ packetcache: confdir = os.path.join('configs', self._confdir) # Case: rec gets a proper client and server cookie back self.recControl(confdir, 'clear-cookies', '*') + tcp1 = self.recControl(confdir, 'get tcp-outqueries') query = dns.message.make_query('supported.cookies.example.', 'A') expected = dns.rrset.from_text('supported.cookies.example.', 15, dns.rdataclass.IN, 'A', '127.0.0.1') res = self.sendUDPQuery(query) self.assertRcodeEqual(res, dns.rcode.NOERROR) self.assertRRsetInAnswer(res, expected) self.checkCookies('Supported') + tcp2 = self.recControl(confdir, 'get tcp-outqueries') + self.assertEqual(tcp1, tcp2) # Case: we get a an correct client and server cookie back # We do not clear the cookie tables, so the old server cookie gets re-used @@ -113,14 +117,17 @@ packetcache: def testAuthSendsIncorrectClientCookie(self): confdir = os.path.join('configs', self._confdir) - # Case: rec gets a an incorrect client cookie back, we ignore that over TCP + # Case: rec gets a an incorrect client cookie back, we ignore that and go to TCP self.recControl(confdir, 'clear-cookies', '*') + tcp1 = self.recControl(confdir, 'get tcp-outqueries') query = dns.message.make_query('wrongcc.cookies.example.', 'A') expected = dns.rrset.from_text('wrongcc.cookies.example.', 15, dns.rdataclass.IN, 'A', '127.0.0.1') res = self.sendUDPQuery(query) self.assertRcodeEqual(res, dns.rcode.NOERROR) self.assertRRsetInAnswer(res, expected) self.checkCookies('Probing') + tcp2 = int(self.recControl(confdir, 'get tcp-outqueries')) + self.assertEqual(int(tcp1) + 1, int(tcp2)) def testAuthSendsBADCOOKIEOverUDP(self): confdir = os.path.join('configs', self._confdir)