From: romeroalx Date: Fri, 1 Dec 2023 10:06:56 +0000 (+0100) Subject: build-and-test-all: Enable test bind-dnssec-pkcs11 X-Git-Tag: rec-5.0.0-rc1~10^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F13551%2Fhead;p=thirdparty%2Fpdns.git build-and-test-all: Enable test bind-dnssec-pkcs11 --- diff --git a/tasks.py b/tasks.py index 2d6a987ee0..3583d4d3d6 100644 --- a/tasks.py +++ b/tasks.py @@ -675,7 +675,7 @@ backend_regress_tests = dict( 'bind-dnssec-nsec3-both', 'bind-dnssec-nsec3-optout-both', 'bind-dnssec-nsec3-narrow', - # FIXME 'bind-dnssec-pkcs11' + 'bind-dnssec-pkcs11' ], geoip = [ 'geoip', @@ -784,6 +784,12 @@ def setup_ldap_client(c): c.sudo('DEBIAN_FRONTEND=noninteractive apt-get install -y ldap-utils') c.sudo(f'sh -c \'echo "{auth_backend_ip_addr} ldapserver" | tee -a /etc/hosts\'') +def setup_softhsm(c): + # Modify the location of the softhsm tokens and configuration directory. + # Enables token generation by non-root users (runner) + c.run('mkdir -p /opt/pdns-auth/softhsm/tokens') + c.run('echo "directories.tokendir = /opt/pdns-auth/softhsm/tokens" > /opt/pdns-auth/softhsm/softhsm2.conf') + @task def test_auth_backend(c, backend): pdns_auth_env_vars = f'PDNS=/opt/pdns-auth/sbin/pdns_server PDNS2=/opt/pdns-auth/sbin/pdns_server SDIG=/opt/pdns-auth/bin/sdig NOTIFY=/opt/pdns-auth/bin/pdns_notify NSEC3DIG=/opt/pdns-auth/bin/nsec3dig SAXFR=/opt/pdns-auth/bin/saxfr ZONE2SQL=/opt/pdns-auth/bin/zone2sql ZONE2LDAP=/opt/pdns-auth/bin/zone2ldap ZONE2JSON=/opt/pdns-auth/bin/zone2json PDNSUTIL=/opt/pdns-auth/bin/pdnsutil PDNSCONTROL=/opt/pdns-auth/bin/pdns_control PDNSSERVER=/opt/pdns-auth/sbin/pdns_server SDIG=/opt/pdns-auth/bin/sdig GMYSQLHOST={auth_backend_ip_addr} GMYSQL2HOST={auth_backend_ip_addr} MYSQL_HOST={auth_backend_ip_addr} PGHOST={auth_backend_ip_addr} PGPORT=5432' @@ -797,6 +803,13 @@ def test_auth_backend(c, backend): c.run(f'{pdns_auth_env_vars} WITHKERBEROS=YES ./runtests') return + if backend == 'bind': + setup_softhsm(c) + with c.cd('regression-tests'): + for variant in backend_regress_tests[backend]: + c.run(f'{pdns_auth_env_vars} SOFTHSM2_CONF=/opt/pdns-auth/softhsm/softhsm2.conf ./start-test-stop 5300 {variant}') + return + if backend == 'godbc_sqlite3': setup_godbc_sqlite3(c) with c.cd('regression-tests'):