]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fix test setup now that sql insertion failures are reported as such. 15049/head
authorMiod Vallat <miod.vallat@open-xchange.com>
Fri, 17 Jan 2025 08:02:43 +0000 (09:02 +0100)
committerMiod Vallat <miod.vallat@open-xchange.com>
Mon, 20 Jan 2025 17:28:17 +0000 (18:28 +0100)
regression-tests.auth-py/test_GSSTSIG.py

index 2297f46c2a983ee5028f1c16f8617071cd40be97..d7da3f45dd38a60953c6ba4c2134dd1b449e5774 100644 (file)
@@ -33,6 +33,24 @@ dnsupdate-require-tsig=no
                  'KRB5_KTNAME' : './kerberos-client/kt.keytab'
                  }
 
+    @classmethod
+    def secureZone(cls, confdir, zonename, key=None):
+        # This particular test uses a sqlite-only configuration, unlike
+        # all the other tests in that directory. Because of this, we
+        # need to perform an explicit create-zone, otherwise import-zone-key
+        # would fail.
+        zone = '.' if zonename == 'ROOT' else zonename
+        pdnsutilCmd = [os.environ['PDNSUTIL'],
+                       '--config-dir=%s' % confdir,
+                       'create-zone',
+                       zone]
+        print(' '.join(pdnsutilCmd))
+        try:
+            subprocess.check_output(pdnsutilCmd, stderr=subprocess.STDOUT)
+        except subprocess.CalledProcessError as e:
+            raise AssertionError('%s failed (%d): %s' % (pdnsutilCmd, e.returncode, e.output))
+        super(GSSTSIGBase, cls).secureZone(confdir, zonename, key)
+
     @classmethod
     def setUpClass(cls):
         super(GSSTSIGBase, cls).setUpClass()