harbor/tests/notarytest.sh

20 lines
352 B
Bash
Raw Normal View History

2017-03-22 12:30:20 +01:00
#!/bin/sh
set -e
TIMEOUT=10
while [ $TIMEOUT -gt 0 ]; do
2017-03-24 06:16:48 +01:00
STATUS=$(curl -s -o /dev/null -w '%{http_code}' https://127.0.0.1:4443/v2/ -kv)
2017-03-22 12:30:20 +01:00
if [ $STATUS -eq 401 ]; then
echo "Notary is running success."
break
fi
TIMEOUT=$(($TIMEOUT - 1))
sleep 5
done
if [ $TIMEOUT -eq 0 ]; then
echo "Notary is running fail."
exit 1
2017-03-24 06:16:48 +01:00
fi