Add a basic e2e test for CI
Signed-off-by: Wang Yan <wangyan@vmware.com>
This commit is contained in:
parent
e2ee31405d
commit
9886800868
3 changed files with 67 additions and 2 deletions
26
tests/push.sh
Normal file
26
tests/push.sh
Normal file
|
@ -0,0 +1,26 @@
|
|||
#!/bin/sh
|
||||
|
||||
set +e
|
||||
|
||||
TIMEOUT=5
|
||||
while [ $TIMEOUT -gt 0 ]; do
|
||||
STATUS=$(curl --insecure -s -o /dev/null -w '%{http_code}' http://localhost:5001/debug/health)
|
||||
echo $STATUS
|
||||
if [ $STATUS -eq 200 ]; then
|
||||
break
|
||||
fi
|
||||
TIMEOUT=$(($TIMEOUT - 1))
|
||||
sleep 5
|
||||
done
|
||||
|
||||
if [ $TIMEOUT -eq 0 ]; then
|
||||
echo "Distribution cannot be available within one minute."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
docker pull hello-world:latest
|
||||
docker tag hello-world:latest $1:5000/distribution/hello-world:latest
|
||||
docker push $1:5000/distribution/hello-world:latest
|
||||
docker pull $1:5000/distribution/hello-world:latest
|
Loading…
Add table
Add a link
Reference in a new issue