diff --git a/auto.test.yml b/auto.test.yml new file mode 100644 index 000000000..fdd6f7dc8 --- /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 e85aca480..0f59a23f9 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