From 3e6087ecbce871955127112e1cee034320142244 Mon Sep 17 00:00:00 2001 From: Chris Hofstaedtler Date: Tue, 27 Aug 2024 20:37:11 +0200 Subject: [PATCH] regression-tests.auth-py: allow running with meson dynamic modules are untested --- regression-tests.auth-py/authtests.py | 7 +++++-- regression-tests.auth-py/runtests | 17 ++++++++++++++--- regression-tests.auth-py/test_GSSTSIG.py | 2 +- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/regression-tests.auth-py/authtests.py b/regression-tests.auth-py/authtests.py index ef2bbe8132..2b096d2efd 100644 --- a/regression-tests.auth-py/authtests.py +++ b/regression-tests.auth-py/authtests.py @@ -27,7 +27,7 @@ class AuthTest(AssertEqualDNSMessageMixin, unittest.TestCase): _config_params = [] _config_template_default = """ -module-dir=../regression-tests/modules +module-dir={PDNS_MODULE_DIR} daemon=no bind-config={confdir}/named.conf bind-dnssec-db={bind_dnssec_db} @@ -75,6 +75,7 @@ PrivateKey: Lt0v0Gol3pRUFM7fDdcy0IWN0O/MnEmVPA+VylL8Y4U= _auths = {} _PREFIX = os.environ['PREFIX'] + _PDNS_MODULE_DIR = os.environ['PDNS_MODULE_DIR'] @classmethod @@ -116,7 +117,9 @@ options { with open(os.path.join(confdir, 'pdns.conf'), 'w') as pdnsconf: pdnsconf.write(cls._config_template_default.format( confdir=confdir, prefix=cls._PREFIX, - bind_dnssec_db=bind_dnssec_db)) + bind_dnssec_db=bind_dnssec_db, + PDNS_MODULE_DIR=cls._PDNS_MODULE_DIR, + )) pdnsconf.write(cls._config_template % params) os.system("sqlite3 ./configs/auth/powerdns.sqlite < ../modules/gsqlite3backend/schema.sqlite3.sql") diff --git a/regression-tests.auth-py/runtests b/regression-tests.auth-py/runtests index 22f0b14639..eb47cb0bec 100755 --- a/regression-tests.auth-py/runtests +++ b/regression-tests.auth-py/runtests @@ -14,9 +14,20 @@ mkdir -p configs [ -f ./vars ] && . ./vars -export PDNS=${PDNS:-${PWD}/../pdns/pdns_server} -export PDNSUTIL=${PDNSUTIL:-${PWD}/../pdns/pdnsutil} -export PDNSCONTROL=${PDNSCONTROL:-${PWD}/../pdns/pdns_control} +if [ -z "$PDNS_BUILD_PATH" ]; then + # PDNS_BUILD_PATH is unset or empty. Assume an autotools build. + PDNS_BUILD_PATH=. + + export PDNS=${PDNS:-${PWD}/../pdns/pdns_server} + export PDNSUTIL=${PDNSUTIL:-${PWD}/../pdns/pdnsutil} + export PDNSCONTROL=${PDNSCONTROL:-${PWD}/../pdns/pdns_control} + export PDNS_MODULE_DIR=${PDNS_MODULE_DIR:-${PWD}/modules} +else + export PDNS=${PDNS:-$PDNS_BUILD_PATH/pdns-auth} + export PDNSUTIL=${PDNSUTIL:-$PDNS_BUILD_PATH/pdns-auth-util} + export PDNSCONTROL=${PDNSCONTROL:-$PDNS_BUILD_PATH/pdns-auth-control} + export PDNS_MODULE_DIR=${PDNS_MODULE_DIR:-$PDNS_BUILD_PATH/modules} +fi export PREFIX=127.0.0 diff --git a/regression-tests.auth-py/test_GSSTSIG.py b/regression-tests.auth-py/test_GSSTSIG.py index 8ef7c5b717..2297f46c2a 100644 --- a/regression-tests.auth-py/test_GSSTSIG.py +++ b/regression-tests.auth-py/test_GSSTSIG.py @@ -8,7 +8,7 @@ from authtests import AuthTest class GSSTSIGBase(AuthTest): _config_template_default = """ -module-dir=../regression-tests/modules +module-dir={PDNS_MODULE_DIR} daemon=no socket-dir={confdir} cache-ttl=0 -- 2.47.3