Skip to content

Commit

Permalink
Retry when test ldap server load data fail
Browse files Browse the repository at this point in the history
  • Loading branch information
stonezdj committed Dec 14, 2017
1 parent 0abd30f commit 2c2f97a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/ldapprepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,15 @@ sleep 5
docker cp ldap_test.ldif ldap_server:/
docker exec ldap_server ldapadd -x -D "cn=admin,dc=example,dc=com" -w admin -f /ldap_test.ldif -ZZ

# failed and retry
for number in {1..10}
do
if [ ! $? -eq 0 ]; then
sleep 6
echo "retry in $number "
docker exec ldap_server ldapadd -x -D "cn=admin,dc=example,dc=com" -w admin -f /ldap_test.ldif -ZZ
else
exit 0
fi
done
exit 1

0 comments on commit 2c2f97a

Please sign in to comment.