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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
From 0031b8ed342386960ab9d0cd1566196ba0e6ae42 Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Wed, 1 Jun 2022 04:36:24 -0500
Subject: [PATCH] Tests: Use ldapsearch(1) correctly in test079
Before this change, ldapsearch(1) was not being called with the correct
parameter syntax. This caused the test to fail on musl libc environments
where getopt(3) is more strict, with messages like:
Error: LDAP connection to remote LDAP server is not found (1)
The test.out file simply stated:
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
Indeed, strace showed that the `-H` param was missed and we were trying
to connect to port 389:
connect(3, {sa_family=AF_INET6, sin6_port=htons(389), sin6_flowinfo=htonl(0), inet_pton(AF_INET6, "::1", &sin6_addr), sin6_scope_id=0}, 28) = -1 ECONNREFUSED (Connection refused)
---
tests/scripts/test079-proxy-timeout | 40 ++++++++++++++---------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/tests/scripts/test079-proxy-timeout b/tests/scripts/test079-proxy-timeout
index 6a8e0c7a8..9ece4c1a1 100755
--- a/tests/scripts/test079-proxy-timeout
+++ b/tests/scripts/test079-proxy-timeout
@@ -139,10 +139,10 @@ fi
echo "Checking that proxy has created connections towards backend (time_t now=`date +%s`)"
-$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 0 ; then
echo "Error: LDAP connection to remote LDAP server is not found ($RC)"
@@ -150,10 +150,10 @@ if test $RC != 0 ; then
exit $RC
fi
-$LDAPSEARCH -b "cn=Connections,cn=database 3,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 3,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 0 ; then
echo "Error: LDAP connection to remote LDAP server is not found ($RC)"
@@ -171,10 +171,10 @@ sleep `expr $CONN_EXPIRES - $NOW + 2`
echo "Checking that proxy has closed expired connections towards the remote LDAP server (time_t now=`date +%s`)"
-$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 1 ; then
echo "Error: LDAP connection to remote LDAP server was not closed"
@@ -182,10 +182,10 @@ if test $RC != 1 ; then
exit $RC
fi
-$LDAPSEARCH -b "cn=Connections,cn=database 3,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 3,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 1 ; then
echo "Error: LDAP connection to remote LDAP server was not closed"
@@ -235,10 +235,10 @@ sleep 2
echo "Checking that proxy has created connections towards backend (time_t now=`date +%s`)"
-$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 0 ; then
echo "Error: LDAP connection to remote LDAP server is not found ($RC)"
@@ -246,10 +246,10 @@ if test $RC != 0 ; then
exit $RC
fi
-$LDAPSEARCH -b "cn=Connections,cn=database 3,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 3,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 0 ; then
echo "Error: LDAP connection to remote LDAP server is not found ($RC)"
@@ -267,10 +267,10 @@ sleep `expr $CONN_EXPIRES - $NOW + 2`
echo "Checking that proxy has closed expired connections towards the remote LDAP server (time_t now=`date +%s`)"
-$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 1 ; then
echo "Error: LDAP connection to remote LDAP server was not closed"
@@ -278,10 +278,10 @@ if test $RC != 1 ; then
exit $RC
fi
-$LDAPSEARCH -b "cn=Connections,cn=database 3,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 3,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 1 ; then
echo "Error: LDAP connection to remote LDAP server was not closed"
@@ -339,10 +339,10 @@ fi
NOW=`date +%s`
sleep `expr $CONN_EXPIRES - $NOW - 2`
echo "Check that connection is still alive due to idle-timeout reset (time_t now=`date +%s`)"
-$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 0 ; then
echo "Error: LDAP connection to remote LDAP server is not found ($RC)"
@@ -354,10 +354,10 @@ fi
NOW=`date +%s`
sleep `expr $CONN_EXPIRES - $NOW + 2`
echo "Check that connection is closed after extended idle-timeout has passed (time_t now=`date +%s`)"
-$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL olmDbConnURI \
+$LDAPSEARCH -b "cn=Connections,cn=database 2,cn=databases,cn=monitor" -s one -LLL \
-D "cn=Manager,dc=local,dc=com" \
-H $URI2 \
- -w $PASSWD 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
+ -w $PASSWD olmDbConnURI 2>&1 | tee -a $TESTOUT | grep ldap://${LOCALHOST}:$PORT1 >/dev/null
RC=$?
if test $RC != 1 ; then
echo "Error: LDAP connection to remote LDAP server was not closed"
--
2.32.0 (Apple Git-132)
|