From: Otto Moerbeek Date: Fri, 17 Nov 2023 11:42:00 +0000 (+0100) Subject: pass "recurse" to sdig if needed X-Git-Tag: rec-5.0.0-rc1~2^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d8ee5159a12535ea07ebcafac6b634d44d42f51;p=thirdparty%2Fpdns.git pass "recurse" to sdig if needed --- diff --git a/regression-tests.api/runtests.py b/regression-tests.api/runtests.py index ea2b230b6e..0a3e8f1d57 100755 --- a/regression-tests.api/runtests.py +++ b/regression-tests.api/runtests.py @@ -284,7 +284,10 @@ if not available: sys.exit(2) print("Query for example.com/A to create statistic data...") -run_check_call([sdig, "127.0.0.1", str(DNSPORT), "example.com", "A"]) +if daemon == 'authoritative': + run_check_call([sdig, "127.0.0.1", str(DNSPORT), "example.com", "A"]) +else: + run_check_call([sdig, "127.0.0.1", str(DNSPORT), "example.com", "A", "recurse"]) print("Running tests...") returncode = 0 diff --git a/regression-tests.api/test_Cache.py b/regression-tests.api/test_Cache.py index 281dd93544..86b1c2f389 100644 --- a/regression-tests.api/test_Cache.py +++ b/regression-tests.api/test_Cache.py @@ -17,7 +17,7 @@ class Servers(ApiTestCase): self.assert_success_json(r) data = r.json() self.assertIn('count', data) - self.assertEqual(1, data['count']) + self.assertEqual(2, data['count']) @unittest.skipIf(not is_recursor(), "Not applicable") def test_flush_subtree(self): @@ -27,12 +27,12 @@ class Servers(ApiTestCase): self.assert_success_json(r) data = r.json() self.assertIn('count', data) - self.assertEqual(1, data['count']) + self.assertEqual(3, data['count']) r = self.session.put(self.url("/api/v1/servers/localhost/cache/flush?domain=example.com.&subtree=true")) self.assert_success_json(r) data = r.json() self.assertIn('count', data) - self.assertEqual(2, data['count']) + self.assertEqual(4, data['count']) def test_flush_root(self): r = self.session.put(self.url("/api/v1/servers/localhost/cache/flush?domain=.")) diff --git a/regression-tests.api/test_helper.py b/regression-tests.api/test_helper.py index 2e2618f231..54d7012628 100644 --- a/regression-tests.api/test_helper.py +++ b/regression-tests.api/test_helper.py @@ -116,7 +116,10 @@ def pdnsutil_rectify(zonename): pdnsutil('rectify-zone', zonename) def sdig(*args): - sdig_command_line = [SDIG, '127.0.0.1', str(DNSPORT)] + list(args) + if is_auth(): + sdig_command_line = [SDIG, '127.0.0.1', str(DNSPORT)] + list(args) + else: + sdig_command_line = [SDIG, '127.0.0.1', str(DNSPORT)] + list(args) + ["recurse"] try: return subprocess.check_output(sdig_command_line).decode('utf-8') except subprocess.CalledProcessError as except_inst: