Package: openldap / 2.4.44+dfsg-5+deb9u3

ITS-8644-wait-for-slapd-to-start-in-test064.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From b622163ecf14a179d932f779164af5e393311dd8 Mon Sep 17 00:00:00 2001
From: Ryan Tandy <ryan@nardis.ca>
Date: Tue, 25 Apr 2017 01:28:25 +0000
Subject: [PATCH] ITS#8644 wait for slapd to start in test064

---
 tests/scripts/test064-constraint | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tests/scripts/test064-constraint b/tests/scripts/test064-constraint
index 94f86be..2ac53ac 100755
--- a/tests/scripts/test064-constraint
+++ b/tests/scripts/test064-constraint
@@ -117,6 +117,23 @@ if test $WAIT != 0 ; then
 fi
 sleep 1
 
+echo "Using ldapsearch to check that slapd is running..."
+for i in 0 1 2 3 4 5; do
+	$LDAPSEARCH -s base -b "$MONITOR" -h $LOCALHOST -p $PORT1 \
+		'objectclass=*' > /dev/null 2>&1
+	RC=$?
+	if test $RC = 0 ; then
+		break
+	fi
+	echo "Waiting 5 seconds for slapd to start..."
+	sleep 5
+done
+if test $RC != 0 ; then
+	echo "ldapsearch failed ($RC)!"
+	test $KILLSERVERS != no && kill -HUP $KILLPIDS
+	exit $RC
+fi
+
 echo "Adding basic structure..."
 $LDAPADD -D "$MANAGERDN" -H $URI1 -w $PASSWD -f $ROOTLDIF &>/dev/null
 RC=$?
-- 
2.1.4