Skip to content

Commit 0ba6dde

Browse files
committed
retry ldap setup a few times in CI
1 parent f03e7c8 commit 0ba6dde

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

azure/setup-slapd.sh

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,5 +165,21 @@ o: php ldap tests
165165
EOF
166166

167167
# Verify TLS connection
168-
169-
ldapsearch -d 255 -H ldaps://localhost -D cn=Manager,dc=my-domain,dc=com -w secret -s base -b dc=my-domain,dc=com 'objectclass=*'
168+
tries=0
169+
while : ; do
170+
ldapsearch -d 255 -H ldaps://localhost -D cn=Manager,dc=my-domain,dc=com -w secret -s base -b dc=my-domain,dc=com 'objectclass=*'
171+
rt=$?
172+
if [ $rt -eq 0 ]; then
173+
echo "OK"
174+
exit 0
175+
else
176+
tries=$((tries+1))
177+
if [ $((tries)) -gt 3 ]; then
178+
echo "exit failure $rt"
179+
exit $rt
180+
else
181+
echo "trying again"
182+
sleep 3
183+
fi
184+
fi
185+
done

0 commit comments

Comments
 (0)