test: initial refactor to support running in parallel in an unshare

The release suite fails with no permissions to dump loopback, so let's
run tests in an unshare, one per test, with and start as many syslogd as
needed for each test -- also easier to debug since all are then fully
stand-alone.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-11-22 04:59:23 +01:00
parent 81eee2185e
commit 523926a07d
8 changed files with 91 additions and 45 deletions

View File

@@ -4,6 +4,54 @@ if [ x"${srcdir}" = x ]; then
fi
. ${srcdir}/test.rc
# Print heading for test phases
print()
{
printf "\e[7m>> %-76s\e[0m\n" "$1"
}
dprint()
{
printf "\e[2m%-76s\e[0m\n" "$1"
}
SKIP()
{
print "TEST: SKIP"
[ $# -gt 0 ] && echo "$*"
exit 77
}
FAIL()
{
print "TEST: FAIL"
[ $# -gt 0 ] && echo "$*"
exit 99
}
OK()
{
print "TEST: OK"
[ $# -gt 0 ] && echo "$*"
exit 0
}
# shellcheck disable=SC2068
tenacious()
{
timeout=$1
shift
while [ $timeout -gt 0 ]; do
$@ && return
timeout=$((timeout - 1))
done
FAIL "Timeed out $*"
}
ip link set lo up
mkdir -p ${CONFD}
cat <<EOF > ${CONF}
# Nothing here yo