1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
#!/bin/sh
#
# More on tests available from
# http://anonscm.debian.org/cgit/autopkgtest/autopkgtest.git/tree/doc/README.package-tests.rst
set -e
at_exit() {
echo "info: terminating script"
}
trap at_exit INT TERM EXIT
# Use predictable language setting.
LC_ALL=C
export LC_ALL
# Just in case a proxy is used in the test environment.
unset http_proxy
# Installing the binary packages should set up apache on localhost and
# the cgi script for the sitesummary collector. But some times the
# install does not do this, because the apt system is sorting the
# postinst invocations so that sitesummary is set up before apache2,
# causing the CGI script to not work. The reason is that sitesummary
# only recommend apache2, and postinst ordering only take dependencies
# into account. A fix using triggers to run what used to run in the
# sitesummary postinst is implemented, and to be sure this take effect
# for apache we restart apache here.
service apache2 restart
sitesummary-client
find /var/lib/sitesummary
for i in $(seq 0 10) ; do
if find /var/lib/sitesummary | grep ether- ; then
echo success: found entry
exit 0
fi
sleep 1
done
echo error: did not find entry after waiting for 10 seconds.
exit 1
|