Commit eccc4664 authored by Johan Bloemberg's avatar Johan Bloemberg

Make dockertest compatible with vanilla macos.

parent cd3ca135
Pipeline #26983870 failed with stage
in 23 minutes and 51 seconds
...@@ -12,8 +12,13 @@ else ...@@ -12,8 +12,13 @@ else
timeout="timeout ${TIMEOUT:-30}" timeout="timeout ${TIMEOUT:-30}"
fi fi
if test "$(uname -s)" == Darwin && ! command -v timeout;then
timeout() { perl -e 'alarm shift; exec @ARGV' "[email protected]"; }
fi
handle_exception(){ handle_exception(){
docker stop failmap-$$ & docker stop failmap-$$ >/dev/null 2>&1 &
} }
# start docker container # start docker container
...@@ -26,7 +31,7 @@ trap "handle_exception" EXIT ...@@ -26,7 +31,7 @@ trap "handle_exception" EXIT
# wait for server to be ready # wait for server to be ready
sleep 3 sleep 3
$timeout /bin/sh -c "while ! curl -sSIk http://$host:$port | grep 200\ OK;do sleep 1;done" $timeout /bin/sh -c "while ! curl -sSIk http://$host:$port | grep 200\\ OK;do sleep 1;done"
# index page # index page
curl -s "http://$host:$port" |grep MSPAINT.EXE curl -s "http://$host:$port" |grep MSPAINT.EXE
...@@ -37,6 +42,7 @@ curl -sI "http://$host:$port/static/$(curl -s "http://$host:$port/static/CACHE/m ...@@ -37,6 +42,7 @@ curl -sI "http://$host:$port/static/$(curl -s "http://$host:$port/static/CACHE/m
# admin login # admin login
curl -siv --cookie-jar cookie-$$ --cookie cookie-$$ "http://$host:$port/admin/login/"|grep 200\ OK curl -siv --cookie-jar cookie-$$ --cookie cookie-$$ "http://$host:$port/admin/login/"|grep 200\ OK
curl -siv --cookie-jar cookie-$$ --cookie cookie-$$ --data "csrfmiddlewaretoken=$(grep csrftoken cookie-$$ | cut -f 7)&username=admin&password=faalkaart" "http://$host:$port/admin/login/"|grep 302\ Found curl -siv --cookie-jar cookie-$$ --cookie cookie-$$ --data "csrfmiddlewaretoken=$(grep csrftoken cookie-$$ | cut -f 7)&username=admin&password=faalkaart" "http://$host:$port/admin/login/"|grep 302\ Found
rm -f cookie-$$
# cleanup # cleanup
docker stop failmap-$$ || true docker stop failmap-$$ || true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment