From ff02878dd8b04a51655741dd029f285839da7df5 Mon Sep 17 00:00:00 2001 From: bunkerity Date: Sun, 8 Nov 2020 21:59:19 +0100 Subject: [PATCH] auto test setup --- auto.test.yml | 3 +++ entrypoint/entrypoint.sh | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 auto.test.yml diff --git a/auto.test.yml b/auto.test.yml new file mode 100644 index 0000000..fdd6f7d --- /dev/null +++ b/auto.test.yml @@ -0,0 +1,3 @@ +sut: + build: . + command: test diff --git a/entrypoint/entrypoint.sh b/entrypoint/entrypoint.sh index e85aca4..0f59a23 100644 --- a/entrypoint/entrypoint.sh +++ b/entrypoint/entrypoint.sh @@ -77,6 +77,17 @@ fi echo "[*] Running nginx ..." su -s "/usr/sbin/nginx" nginx +# autotest +if [ "$1" == "test" ] ; then + sleep 10 + echo -n "autotest" > /www/index.html + check=$(curl "http://localhost:${HTTP_PORT}" 2> /dev/null) + if [ "$check" == "autotest" ] ; then + exit 0 + fi + exit 1 +fi + # display logs LOGS="/var/log/access.log /var/log/error.log" if [ "$USE_FAIL2BAN" = "yes" ] ; then