From 991c7d570bf34462114b584a843134f599d270d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Men=C5=A1=C3=ADk?= Date: Fri, 14 Feb 2025 21:16:11 +0100 Subject: [PATCH] Improve a bit ability to run testsuite from mockbuild Intended to be run like: centpkg mockbuild --with SYSTEMTEST -N --enable-network Do fail when it does not pass. But allow running tests as root. Related: RHEL-77103 --- bind9.16.spec | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/bind9.16.spec b/bind9.16.spec index e5778fc..af88a58 100644 --- a/bind9.16.spec +++ b/bind9.16.spec @@ -6,6 +6,8 @@ # bcond_without is built by default, unless --without X is passed # bcond_with is built only when --with X is passed to build %bcond_with SYSTEMTEST +# enable RSA1 during SYSTEMTEST +%bcond_with CRYPTO_POLICY_RSA1 %bcond_without GSSTSIG # it is not possible to build the package without PKCS11 sub-package # due to extensive changes to Makefiles @@ -211,6 +213,7 @@ BuildRequires: softhsm %if %{with SYSTEMTEST} # bin/tests/system dependencies BuildRequires: perl(Net::DNS) perl(Net::DNS::Nameserver) perl(Time::HiRes) perl(Getopt::Long) +BuildRequires: perl(English) BuildRequires: python-dns # manual configuration requires this tool BuildRequires: iproute @@ -522,6 +525,10 @@ done %endif sed -e 's|"$TOP/config.guess"|"$TOP_SRCDIR/config.guess"|' -i bin/tests/system/ifconfig.sh +# allow running as root from mock or test machines +sed -e 's, "enable-developer",& \&\& systemctl is-system-running \&>/dev/null \&\& ! [ -e /mnt/tests ],' \ + -i bin/tests/system/run.sh + :; @@ -696,15 +703,29 @@ else sh bin/tests/system/ifconfig.sh up perl bin/tests/system/testsock.pl && CONFIGURED=build fi + if [ -n "$CONFIGURED" ] then set -e + %if %{with CRYPTO_POLICY_RSA1} + # Override crypto-policy to allow RSASHA1 key operations + OPENSSL_CONF="$(mktemp openssl-XXXXXX.cnf)" + cat > "$OPENSSL_CONF" << 'EOF' +.include = /etc/ssl/openssl.cnf +[evp_properties] +rh-allow-sha1-signatures = yes +EOF + export OPENSSL_CONF + %endif pushd build/bin/tests chown -R ${USER} . # Can be unknown user - %make_build test 2>&1 | tee test.log + %make_build test e=$? popd [ "$CONFIGURED" = build ] && sh bin/tests/system/ifconfig.sh down + %if %{with CRYPTO_POLICY_RSA1} + export -b OPENSSL_CONF + %endif if [ "$e" -ne 0 ]; then echo "ERROR: this build of BIND failed 'make test'. Aborting." exit $e;