Improve SYSTEMTEST running on build time
Use parallel execution on test run. Support already configured interfaces without special permissions on build. It can either use already present addresses or configure it on build time. If it has no rights to configure it, just skip the test and continue.
This commit is contained in:
parent
63bb1cf127
commit
cba49a643a
33
bind.spec
33
bind.spec
@ -207,7 +207,9 @@ BuildRequires: softhsm
|
|||||||
%endif
|
%endif
|
||||||
%if %{with SYSTEMTEST}
|
%if %{with SYSTEMTEST}
|
||||||
# bin/tests/system dependencies
|
# bin/tests/system dependencies
|
||||||
BuildRequires: net-tools perl(Net::DNS) perl(Net::DNS::Nameserver)
|
BuildRequires: perl(Net::DNS) perl(Net::DNS::Nameserver) perl(Time::HiRes) perl(Getopt::Long)
|
||||||
|
# manual configuration requires this tool
|
||||||
|
BuildRequires: iproute
|
||||||
%endif
|
%endif
|
||||||
%if %{with GSSTSIG}
|
%if %{with GSSTSIG}
|
||||||
BuildRequires: krb5-devel
|
BuildRequires: krb5-devel
|
||||||
@ -843,25 +845,32 @@ sed -e "/^\s*include(/ d" -e 's/^-- use //' \
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if %{with SYSTEMTEST}
|
%if %{with SYSTEMTEST}
|
||||||
if [ "`whoami`" = 'root' ]; then
|
# Runs system test if ip addresses are already configured
|
||||||
|
# or it is able to configure them
|
||||||
|
if perl bin/tests/system/testsock.pl
|
||||||
|
then
|
||||||
|
CONFIGURED=already
|
||||||
|
else
|
||||||
|
CONFIGURED=
|
||||||
|
sh bin/tests/system/ifconfig.sh up
|
||||||
|
perl bin/tests/system/testsock.pl && CONFIGURED=build
|
||||||
|
fi
|
||||||
|
if [ -n "$CONFIGURED" ]
|
||||||
|
then
|
||||||
set -e
|
set -e
|
||||||
chmod -R a+rwX .
|
pushd build/bin/tests
|
||||||
pushd bin/tests
|
chown -R ${USER} . # Can be unknown user
|
||||||
pushd system
|
make test %{?_smp_mflags} 2>&1 | tee test.log
|
||||||
./ifconfig.sh up
|
|
||||||
popd
|
|
||||||
make test
|
|
||||||
e=$?
|
e=$?
|
||||||
pushd system
|
|
||||||
./ifconfig.sh down
|
|
||||||
popd
|
|
||||||
popd
|
popd
|
||||||
|
[ "$CONFIGURED" = build ] && sh bin/tests/system/ifconfig.sh down
|
||||||
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;
|
||||||
fi;
|
fi;
|
||||||
else
|
else
|
||||||
echo 'only root can run the tests (they require an ifconfig).'
|
echo 'SKIPPED: tests require root, CAP_NET_ADMIN or already configured test addresses.'
|
||||||
|
fi
|
||||||
%endif
|
%endif
|
||||||
:
|
:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user