test.sh: do not continue if http server failed to start

This commit is contained in:
Johannes 'josch' Schauer 2018-10-01 22:55:52 +02:00
parent 6da8791c11
commit 7deadcb988
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

10
test.sh
View file

@ -30,14 +30,20 @@ fi
./make_mirror.sh
trap 'kill $pid' INT QUIT TERM EXIT
cd mirror
python3 -m http.server 8000 2>/dev/null & pid=$!
cd -
# wait for the server to start
sleep 1
if ! kill -0 $pid; then
echo "failed to start http server"
exit 1
fi
trap 'kill $pid' INT QUIT TERM EXIT
echo "running http server with pid $pid"
export SOURCE_DATE_EPOCH=$(date +%s)