r21017: Actually run tests during test phase rather than when generating the recipe.
authorJelmer Vernooij <jelmer@samba.org>
Thu, 25 Jan 2007 12:39:13 +0000 (12:39 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:44:20 +0000 (14:44 -0500)
source/script/tests/test_ldap.sh
source/script/tests/test_local.sh
source/script/tests/tests_all.sh
testprogs/blackbox/test_cifsdd.sh
testprogs/blackbox/test_ldb.sh [new file with mode: 0755]

index 204ac00d5a13256745e7c6f5211e8580f76e0b34..caa3ae11bf74c57fabc3500673c4d66848a1e2fe 100755 (executable)
@@ -23,62 +23,10 @@ PASSWORD="$3"
 incdir=`dirname $0`
 . $incdir/test_functions.sh
 
+
 for p in $PROTOCOLS; do
  for options in "" "--option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD --option=socket:testnonblock=true" "-U$USERNAME%$PASSWORD"; do
-    echo "TESTING PROTOCOL $p with options $options"
-
-    testit "RootDSE" bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1`
-
-    echo "Getting defaultNamingContext"
-    BASEDN=`bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'`
-    echo "BASEDN is $BASEDN"
-
-    testit "Listing Users" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=user)' sAMAccountName || failed=`expr $failed + 1`
-
-    testit "Listing Groups" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1`
-
-    nentries=`bin/ldbsearch $options -H $p://$SERVER $CONFIGURATION '(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))' sAMAccountName | grep sAMAccountName | wc -l`
-    echo "Found $nentries entries"
-    if [ $nentries -lt 10 ]; then
-       echo "Should have found at least 10 entries"
-       failed=`expr $failed + 1`
-    fi
-
-    echo "Check rootDSE for Controls"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER -s base -b "" '(objectclass=*)' | grep -i supportedControl | wc -l`
-    if [ $nentries -lt 4 ]; then
-       echo "Should have found at least 4 entries"
-       failed=`expr $failed + 1`
-    fi
-
-    echo "Test Paged Results Control"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=paged_results:1:5 '(objectclass=user)' | grep sAMAccountName | wc -l`
-    if [ $nentries -lt 1 ]; then
-       echo "Paged Results Control test returned 0 items"
-       failed=`expr $failed + 1`
-    fi
-
-    echo "Test Server Sort Control"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=server_sort:1:0:sAMAccountName '(objectclass=user)' | grep sAMAccountName | wc -l`
-    if [ $nentries -lt 1 ]; then
-       echo "Server Sort Control test returned 0 items"
-       failed=`expr $failed + 1`
-    fi
-
-    echo "Test Extended DN Control"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:0 '(objectclass=user)' | grep sAMAccountName | wc -l`
-    if [ $nentries -lt 1 ]; then
-       echo "Extended DN Control test returned 0 items"
-       failed=`expr $failed + 1`
-    fi
-
-    echo "Test Attribute Scope Query Control"
-    nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l`
-   if [ $nentries -lt 1 ]; then
-       echo "Attribute Scope Query test returned 0 items"
-       failed=`expr $failed + 1`
-   fi
-
+        testit "TESTING PROTOCOL $p with options $options" ../testprogs/blackbox/test_ldb.sh $p $options
  done
 done
 
index adeec2abc0432914a6d5bb4db5ba8627fb6e5cca..8e5d5550c460d509dfc0573c45e2647e4e1868f5 100755 (executable)
@@ -26,7 +26,7 @@ fi
 incdir=`dirname $0`
 . $incdir/test_functions.sh
 
-# the local tests doesn't need smbd
+# the local tests don't need smbd
 SMBD_TEST_FIFO=""
 export SMBD_TEST_FIFO
 
index 623184ad029de04eff6395b6ff56fc3933395eb3..1c1303c4ab4307fae84a3766f525f118cad771b8 100755 (executable)
@@ -1,5 +1,4 @@
 #!/bin/sh
- $SRCDIR/script/tests/test_pidl.sh
  $SRCDIR/script/tests/test_ejs.sh $DOMAIN $USERNAME $PASSWORD
  $SRCDIR/script/tests/test_ldap.sh $SERVER $USERNAME $PASSWORD
  $SRCDIR/script/tests/test_nbt.sh $SERVER
@@ -11,5 +10,6 @@
  $SRCDIR/script/tests/test_echo.sh $SERVER $USERNAME $PASSWORD $DOMAIN
  $SRCDIR/script/tests/test_posix.sh //$SERVER/tmp $USERNAME $PASSWORD ""
  $SRCDIR/script/tests/test_local.sh
+ $SRCDIR/script/tests/test_pidl.sh
  $SRCDIR/script/tests/test_blackbox.sh $SERVER $USERNAME $PASSWORD $DOMAIN $PREFIX
  $SRCDIR/script/tests/test_simple.sh //$SERVER/simple $USERNAME $PASSWORD ""
index d216695821ea3feb50e3f0e156ead6d0a0827ba8..588c308f9c87520030941e23e93644e5eac25d2e 100755 (executable)
@@ -37,8 +37,6 @@ testit() {
        return $status
 }
 
-
-
 runcopy() {
        message="$1"
        shift
@@ -48,7 +46,7 @@ runcopy() {
 }
 
 compare() {
-    tesit "$1" cmp "$2" "$3"
+    testit "$1" cmp "$2" "$3"
 }
 
 sourcepath=tempfile.src.$$
diff --git a/testprogs/blackbox/test_ldb.sh b/testprogs/blackbox/test_ldb.sh
new file mode 100755 (executable)
index 0000000..d46f371
--- /dev/null
@@ -0,0 +1,76 @@
+#!/bin/sh
+
+p=$1
+shift 1
+options="$*"
+
+check() {
+       name="$1"
+       shift
+       cmdline="$*"
+       echo "test: $name"
+       $cmdline
+       status=$?
+       if [ x$status = x0 ]; then
+               echo "success: $name"
+       else
+               echo "failure: $name"
+               failed=`expr $failed + 1`
+       fi
+       return $status
+}
+
+
+
+check "RootDSE" bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x dnsHostName highestCommittedUSN || failed=`expr $failed + 1`
+
+echo "Getting defaultNamingContext"
+BASEDN=`bin/ldbsearch $CONFIGURATION $options --basedn='' -H $p://$SERVER -s base DUMMY=x defaultNamingContext | grep defaultNamingContext | awk '{print $2}'`
+echo "BASEDN is $BASEDN"
+
+check "Listing Users" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=user)' sAMAccountName || failed=`expr $failed + 1`
+
+check "Listing Groups" bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER '(objectclass=group)' sAMAccountName || failed=`expr $failed + 1`
+
+nentries=`bin/ldbsearch $options -H $p://$SERVER $CONFIGURATION '(|(|(&(!(groupType:1.2.840.113556.1.4.803:=1))(groupType:1.2.840.113556.1.4.803:=2147483648)(groupType:1.2.840.113556.1.4.804:=10))(samAccountType=805306368))(samAccountType=805306369))' sAMAccountName | grep sAMAccountName | wc -l`
+echo "Found $nentries entries"
+if [ $nentries -lt 10 ]; then
+echo "Should have found at least 10 entries"
+failed=`expr $failed + 1`
+fi
+
+echo "Check rootDSE for Controls"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER -s base -b "" '(objectclass=*)' | grep -i supportedControl | wc -l`
+if [ $nentries -lt 4 ]; then
+echo "Should have found at least 4 entries"
+failed=`expr $failed + 1`
+fi
+
+echo "Test Paged Results Control"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=paged_results:1:5 '(objectclass=user)' | grep sAMAccountName | wc -l`
+if [ $nentries -lt 1 ]; then
+echo "Paged Results Control test returned 0 items"
+failed=`expr $failed + 1`
+fi
+
+echo "Test Server Sort Control"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=server_sort:1:0:sAMAccountName '(objectclass=user)' | grep sAMAccountName | wc -l`
+if [ $nentries -lt 1 ]; then
+echo "Server Sort Control test returned 0 items"
+failed=`expr $failed + 1`
+fi
+
+echo "Test Extended DN Control"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=extended_dn:1:0 '(objectclass=user)' | grep sAMAccountName | wc -l`
+if [ $nentries -lt 1 ]; then
+echo "Extended DN Control test returned 0 items"
+failed=`expr $failed + 1`
+fi
+
+echo "Test Attribute Scope Query Control"
+nentries=`bin/ldbsearch $options $CONFIGURATION -H $p://$SERVER --controls=asq:1:member -s base -b "CN=Administrators,CN=Builtin,$BASEDN" | grep sAMAccountName | wc -l`
+if [ $nentries -lt 1 ]; then
+echo "Attribute Scope Query test returned 0 items"
+failed=`expr $failed + 1`
+fi
+exit $failed