Blame SOURCES/openldap-cbinding-Fix-slaptest-in-test077.patch

4404fd
From e006994d83af9dcb7813a18253cf4e5beacee043 Mon Sep 17 00:00:00 2001
4404fd
From: Ryan Tandy <ryan@nardis.ca>
4404fd
Date: Sun, 26 Apr 2020 11:40:23 -0700
4404fd
Subject: [PATCH] Fix slaptest in test077
4404fd
4404fd
The libtool wrapper scripts lose argv[0] when exec'ing the real binary.
4404fd
4404fd
In the CI Docker container, where the build runs as root, this was
4404fd
actually starting a real slapd on the default port.
4404fd
4404fd
Outside Docker, running as a non-root user, this slapd would just fail
4404fd
to start, and wouldn't convert the config either.
4404fd
4404fd
Using "slapd -Tt" fixes the issue but also prints a warning from
4404fd
slaptest since the database hasn't been initialized yet.
4404fd
4404fd
Dynamic config isn't actually used in this test script, so let's just
4404fd
run slapd off the config file directly.
4404fd
---
4404fd
 tests/scripts/test077-sasl-gssapi | 11 ++---------
4404fd
 1 file changed, 2 insertions(+), 9 deletions(-)
4404fd
4404fd
diff --git a/tests/scripts/test077-sasl-gssapi b/tests/scripts/test077-sasl-gssapi
4404fd
index 19f665622..20c414600 100755
4404fd
--- a/tests/scripts/test077-sasl-gssapi
4404fd
+++ b/tests/scripts/test077-sasl-gssapi
4404fd
@@ -21,22 +21,15 @@ if test $WITH_SASL = no ; then
4404fd
         exit 0
4404fd
 fi
4404fd
 
4404fd
-SLAPTEST="$TESTWD/../servers/slapd/slaptest"
4404fd
-CONFDIR=$TESTDIR/slapd.d
4404fd
-
4404fd
 mkdir -p $TESTDIR $DBDIR1 $CONFDIR
4404fd
 cp -r $DATADIR/tls $TESTDIR
4404fd
 
4404fd
-cd $TESTWD
4404fd
-
4404fd
-
4404fd
 echo "Starting KDC for SASL/GSSAPI tests..."
4404fd
 . $SRCDIR/scripts/setup_kdc.sh
4404fd
 
4404fd
 echo "Running slapadd to build slapd database..."
4404fd
 . $CONFFILTER $BACKEND $MONITORDB < $SASLGSSAPICONF > $CONF1
4404fd
-$SLAPTEST -f $CONF1 -F $CONFDIR
4404fd
-$SLAPADD -F $CONFDIR -l $LDIFORDERED
4404fd
+$SLAPADD -f $CONF1 -l $LDIFORDERED
4404fd
 RC=$?
4404fd
 if test $RC != 0 ; then
4404fd
 	echo "slapadd failed ($RC)!"
4404fd
@@ -45,7 +38,7 @@ if test $RC != 0 ; then
4404fd
 fi
4404fd
 
4404fd
 echo "Starting ldap:/// slapd on TCP/IP port $PORT1 and ldaps:/// slapd on $PORT2..."
4404fd
-$SLAPD -F $CONFDIR -h "$URI1 $SURI2" -d $LVL $TIMING > $LOG1 2>&1 &
4404fd
+$SLAPD -f $CONF1 -h "$URI1 $SURI2" -d $LVL $TIMING > $LOG1 2>&1 &
4404fd
 PID=$!
4404fd
 if test $WAIT != 0 ; then
4404fd
     echo PID $PID
4404fd
-- 
4404fd
2.26.2
4404fd