Files
linuxkit/test/cases/040_packages/023_wireguard/check.sh
Justin Cormack 2ed8b2997c Add a test for Wireguard
This is based on the example, but modified so that it can work as a test.

It is slightly less convenient running services as tests as the output is
sent to log files, so we have an `onshutdown` container that checks to see
if the test passed.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2017-08-22 13:23:27 +01:00

28 lines
408 B
Bash
Executable File

#!/bin/sh
function success {
printf "wireguard test suite PASSED\n" >&1
exit 0
}
function failed {
printf "wireguard test suite FAILED\n" >&1
exit 1
}
if [ "$1" = "shutdown" ]
then
[ -f /tmp/ok ] && success
failed
exit 0
fi
# Nginx may not be up immediately as service startup is async
for s in $(seq 1 10)
do
wget -O - http://192.168.2.1/ && echo "success" > /tmp/ok && halt
sleep 1
done
halt