]> git.sur5r.net Git - openldap/blobdiff - tests/scripts/test056-monitor
connid is unsigned; offset real conns by maxrid + 1
[openldap] / tests / scripts / test056-monitor
index 35ae2077a7cffd5bd92647c2357183e7b215dfe8..29a5427eee8f4baff3cdfb30a73eac38253e0576 100755 (executable)
 echo "running defines.sh"
 . $SRCDIR/scripts/defines.sh
 
+if test $MONITORDB = "no" ; then 
+       echo "Monitor backend not available, test skipped"
+       exit 0
+fi 
+
 mkdir -p $TESTDIR $DBDIR1
 
 echo "Starting slapd on TCP/IP port $PORT..."
@@ -61,11 +66,14 @@ if test $RC != 0 ; then
         exit $RC
 fi
 
+# Compare results, ignoring possible difference of IPv4/IPv6 localhost address
+localrewrite='s/=127\.0\.0\.1:/=LOCAL:/; s/=\[::1\]:/=LOCAL:/'
 echo "Filtering ldapsearch results..."
-. $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
-
+sed -e "$localrewrite" < $SEARCHOUT   | . $LDIFFILTER > $SEARCHFLT
+echo "Filtering expected data..."
+. $CONFFILTER < $MONITOROUT1 | sed -e "$localrewrite" | . $LDIFFILTER > $LDIFFLT
 echo "Comparing filter output..."
-$CMP $SEARCHFLT $MONITOROUT1 > $CMPOUT
+$CMP $SEARCHFLT $LDIFFLT > $CMPOUT
 
 if test $? != 0 ; then
         echo "comparison failed - connection monitor output is not correct"
@@ -91,8 +99,18 @@ fi
 echo "Filtering ldapsearch results..."
 . $LDIFFILTER < $SEARCHOUT > $SEARCHFLT
 
+TMPMONITOROUT2=$MONITOROUT2
+case $BACKEND in
+bdb|hdb)
+       ;;
+*)
+       TMPMONITOROUT2=$TESTDIR/monitor2.out
+       grep -v "olmBDB" $MONITOROUT2 > $TMPMONITOROUT2
+       ;;
+esac
+
 echo "Comparing filter output..."
-$CMP $SEARCHFLT $MONITOROUT2 > $CMPOUT
+$CMP $SEARCHFLT $TMPMONITOROUT2 > $CMPOUT
 
 if test $? != 0 ; then
         echo "comparison failed - database monitor output is not correct"