auto test setup

This commit is contained in:
bunkerity 2020-11-08 21:59:19 +01:00
parent 44b016be93
commit ff02878dd8
No known key found for this signature in database
GPG Key ID: 654FFF51CEF7CC47
2 changed files with 14 additions and 0 deletions

3
auto.test.yml Normal file
View File

@ -0,0 +1,3 @@
sut:
build: .
command: test

View File

@ -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