From ad57d1b855c67a72ddd8d0b0e82672091aa2350d Mon Sep 17 00:00:00 2001 From: Miod Vallat Date: Fri, 17 Jan 2025 09:02:43 +0100 Subject: [PATCH] Fix test setup now that sql insertion failures are reported as such. --- regression-tests.auth-py/test_GSSTSIG.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/regression-tests.auth-py/test_GSSTSIG.py b/regression-tests.auth-py/test_GSSTSIG.py index 2297f46c2a..d7da3f45dd 100644 --- a/regression-tests.auth-py/test_GSSTSIG.py +++ b/regression-tests.auth-py/test_GSSTSIG.py @@ -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() -- 2.47.2