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-76884
This commit is contained in:
parent
e092ec92b8
commit
469e799820
23
bind.spec
23
bind.spec
@ -6,6 +6,8 @@
|
|||||||
# bcond_without is built by default, unless --without X is passed
|
# 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 is built only when --with X is passed to build
|
||||||
%bcond_with SYSTEMTEST
|
%bcond_with SYSTEMTEST
|
||||||
|
# enable RSA1 during SYSTEMTEST
|
||||||
|
%bcond_with CRYPTO_POLICY_RSA1
|
||||||
%bcond_without GSSTSIG
|
%bcond_without GSSTSIG
|
||||||
# it is not possible to build the package without PKCS11 sub-package
|
# it is not possible to build the package without PKCS11 sub-package
|
||||||
# due to extensive changes to Makefiles
|
# due to extensive changes to Makefiles
|
||||||
@ -219,6 +221,7 @@ BuildRequires: softhsm
|
|||||||
%if %{with SYSTEMTEST}
|
%if %{with SYSTEMTEST}
|
||||||
# bin/tests/system dependencies
|
# bin/tests/system dependencies
|
||||||
BuildRequires: perl(Net::DNS) perl(Net::DNS::Nameserver) perl(Time::HiRes) perl(Getopt::Long)
|
BuildRequires: perl(Net::DNS) perl(Net::DNS::Nameserver) perl(Time::HiRes) perl(Getopt::Long)
|
||||||
|
BuildRequires: perl(English)
|
||||||
BuildRequires: python-dns
|
BuildRequires: python-dns
|
||||||
# manual configuration requires this tool
|
# manual configuration requires this tool
|
||||||
BuildRequires: iproute
|
BuildRequires: iproute
|
||||||
@ -493,6 +496,10 @@ done
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
sed -e 's|"$TOP/config.guess"|"$TOP_SRCDIR/config.guess"|' -i bin/tests/system/ifconfig.sh
|
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
|
||||||
|
|
||||||
:;
|
:;
|
||||||
|
|
||||||
|
|
||||||
@ -667,15 +674,29 @@ else
|
|||||||
sh bin/tests/system/ifconfig.sh up
|
sh bin/tests/system/ifconfig.sh up
|
||||||
perl bin/tests/system/testsock.pl && CONFIGURED=build
|
perl bin/tests/system/testsock.pl && CONFIGURED=build
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$CONFIGURED" ]
|
if [ -n "$CONFIGURED" ]
|
||||||
then
|
then
|
||||||
set -e
|
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
|
pushd build/bin/tests
|
||||||
chown -R ${USER} . # Can be unknown user
|
chown -R ${USER} . # Can be unknown user
|
||||||
%make_build test 2>&1 | tee test.log
|
%make_build test
|
||||||
e=$?
|
e=$?
|
||||||
popd
|
popd
|
||||||
[ "$CONFIGURED" = build ] && sh bin/tests/system/ifconfig.sh down
|
[ "$CONFIGURED" = build ] && sh bin/tests/system/ifconfig.sh down
|
||||||
|
%if %{with CRYPTO_POLICY_RSA1}
|
||||||
|
export -b OPENSSL_CONF
|
||||||
|
%endif
|
||||||
if [ "$e" -ne 0 ]; then
|
if [ "$e" -ne 0 ]; then
|
||||||
echo "ERROR: this build of BIND failed 'make test'. Aborting."
|
echo "ERROR: this build of BIND failed 'make test'. Aborting."
|
||||||
exit $e;
|
exit $e;
|
||||||
|
Loading…
Reference in New Issue
Block a user