]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
pass "recurse" to sdig if needed
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 17 Nov 2023 11:42:00 +0000 (12:42 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Fri, 17 Nov 2023 13:18:15 +0000 (14:18 +0100)
regression-tests.api/runtests.py
regression-tests.api/test_Cache.py
regression-tests.api/test_helper.py

index ea2b230b6eaab2a5dac5fc17a12f1177eb06bb33..0a3e8f1d578edf679f17b3ecdc754e858a010f90 100755 (executable)
@@ -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
index 281dd93544e0bf57c8ec6dad6b4e954eb33e2ba3..86b1c2f3897c747baded252ea23d38a6adf9f05f 100644 (file)
@@ -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=."))
index 2e2618f23175609bd9b277ea6d855fc24ad576ba..54d70126287ef208d58e0a867639c64e22cb7268 100644 (file)
@@ -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: