LDB:test-generic.sh - fix smaller/greater comparison tests master
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Tue, 4 Sep 2012 16:27:48 +0000 (18:27 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Mon, 18 Dec 2017 19:55:42 +0000 (20:55 +0100)
The comparison result has been ignored, which is not good. Also remove
the "ldbsearch" command in the error branch which has not much sense.

The scripts needs to be run through test-tdb.sh, test-ldap.sh or
test-sqlite3.sh which I didn't realise before. Hence less changes are needed
and this is a reduced version of the patch published on the mailing list.

Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/tests/test-generic.sh

index e1f8e79e2167124605f8d7083b8e3cc8053daeba..8177da5aceb96a6486e6045f6fe45c540a95f0f2 100755 (executable)
@@ -119,16 +119,20 @@ echo "*TODO* Testing UTF8 upper lower case searches !!"
 
 echo "Testing compare"
 count=`$VALGRIND ldbsearch '(cn>=t)' cn | grep '^dn' | wc -l`
-if [ $count != 2 ]; then
-    echo returned $count records - expected 2
-    echo "this fails on openLdap ..."
+if [ $count != 1 ]; then
+    # only "cn: test_multi_test_multi_test_multi" (comes after "t")
+    # upper-cased words come before "t" - hence excluded
+    echo returned $count records - expected 1
+    exit 1
 fi
 $VALGRIND ldbsearch '(cn>t)' cn && exit 1 # strictly greater should not work
 
 count=`$VALGRIND ldbsearch '(cn<=t)' cn | grep '^dn' | wc -l`
-if [ $count != 13 ]; then
-    echo returned $count records - expected 13
-    echo "this fails on openLdap ..."
+if [ $count != 18 ]; then
+    # everything except "cn: test_multi_test_multi_test_multi" (comes after "t")
+    # upper-cased letters come before "t" - hence included
+    echo returned $count records - expected 18
+    exit 1
 fi
 $VALGRIND ldbsearch '(cn<t)' cn && exit 1 # strictly less should not work
 
@@ -140,7 +144,6 @@ checkcount() {
     n=`$VALGRIND ldbsearch -s "$scope" -b "$basedn" "$expression" | grep '^dn' | wc -l`
     if [ $n != $count ]; then
        echo "Got $n but expected $count for $expression"
-       bin/ldbsearch "$expression"
        exit 1
     fi
     echo "OK: $count $expression"