Merge pull request #1718 from wy65701436/dev

add notary test
This commit is contained in:
Daniel Jiang 2017-03-22 19:59:05 +08:00 committed by GitHub
commit 88ad24d99d
2 changed files with 20 additions and 0 deletions

View File

@ -100,6 +100,7 @@ script:
- sudo make install GOBUILDIMAGE=golang:1.7.3 COMPILETAG=compile_golangimage CLARITYIMAGE=danieljt/harbor-clarity-base:0.8.4 NOTARYFLAG=true
- docker ps
- ./tests/notarytest.sh
- go run tests/startuptest.go https://localhost/
- go run tests/userlogintest.go -name ${HARBOR_ADMIN} -passwd ${HARBOR_ADMIN_PASSWD}

19
tests/notarytest.sh Executable file
View File

@ -0,0 +1,19 @@
#!/bin/sh
set -e
TIMEOUT=10
while [ $TIMEOUT -gt 0 ]; do
STATUS=$(curl -s -o /dev/null -w '%{http_code}' https://127.0.0.1/notary/v2/ -kv)
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
fi