mirror of
https://github.com/linuxkit/linuxkit.git
synced 2026-01-06 12:50:26 +00:00
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>
28 lines
408 B
Bash
Executable File
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
|