r24706: Move nmblookup tests to separate blackbox testsuite.
authorJelmer Vernooij <jelmer@samba.org>
Mon, 27 Aug 2007 14:36:22 +0000 (14:36 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:02:52 +0000 (15:02 -0500)
(This used to be commit aeb2e714f22abe68f89218967a55d7abd2d04ae1)

source4/selftest/test_blackbox.sh
source4/selftest/test_nbt.sh
testprogs/blackbox/test_nmblookup.sh [new file with mode: 0755]

index 0f5f87614adc758fed47f2e722b88f6bbcb0ec86..e8f01f2fae8efe9082f90a3e50301cea08fa1f53 100755 (executable)
@@ -16,6 +16,10 @@ ADDARGS="$*"
 incdir=`dirname $0`
 . $incdir/test_functions.sh
 
 incdir=`dirname $0`
 . $incdir/test_functions.sh
 
-plantest "blackbox.smbclient" dc $incdir/../../testprogs/blackbox/test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" "$ADDARGS"
-plantest "blackbox.kinit" dc $incdir/../../testprogs/blackbox/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" "$ADDARGS"
-plantest "blackbox.cifsdd" dc $incdir/../../testprogs/blackbox/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$ADDARGS"
+bbdir=$incdir/../../testprogs/blackbox
+
+plantest "blackbox.smbclient" dc $bbdir/test_smbclient.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$PREFIX" "$ADDARGS"
+plantest "blackbox.kinit" dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$REALM" "\$DOMAIN" "$PREFIX" "$ADDARGS"
+plantest "blackbox.cifsdd" dc $bbdir/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" "$ADDARGS"
+plantest "blackbox.nmblookup:dc" dc $bbdir/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" $ADDARGS
+plantest "blackbox.nmblookup:member" member $bbdir/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" $ADDARGS
index cfc1ee31cbeeaab087c677bb059628b799032237..1ff5ee641d64a111a5d7127cd3c652fc139f736e 100755 (executable)
@@ -12,13 +12,6 @@ if test x"$TEST_NBT_ENVNAME" = x"";then
        TEST_NBT_ENVNAME="dc"
 fi
 
        TEST_NBT_ENVNAME="dc"
 fi
 
-plantest "nmblookup -U \$SERVER_IP \$SERVER" $TEST_NBT_ENVNAME bin/nmblookup $TORTURE_OPTIONS -U \$SERVER_IP \$SERVER
-plantest "nmblookup -U \$SERVER_IP \$NETBIOSNAME" $TEST_NBT_ENVNAME bin/nmblookup $TORTURE_OPTIONS -U \$SERVER_IP \$NETBIOSNAME
-plantest "nmblookup -U \$SERVER_IP \$NETBIOSALIAS" $TEST_NBT_ENVNAME bin/nmblookup $TORTURE_OPTIONS -U \$SERVER_IP \$NETBIOSALIAS
-plantest "nmblookup \$SERVER" $TEST_NBT_ENVNAME bin/nmblookup $TORTURE_OPTIONS \$SERVER
-plantest "nmblookup \$NETBIOSNAME" $TEST_NBT_ENVNAME bin/nmblookup $TORTURE_OPTIONS \$NETBIOSNAME
-plantest "nmblookup \$NETBIOSALIAS" $TEST_NBT_ENVNAME bin/nmblookup $TORTURE_OPTIONS \$NETBIOSALIAS
-
 NBT_TESTS=`bin/smbtorture --list | grep "^NBT-" | xargs`
 
 if test x"$TEST_NBT_ENVNAME" = x"dc";then
 NBT_TESTS=`bin/smbtorture --list | grep "^NBT-" | xargs`
 
 if test x"$TEST_NBT_ENVNAME" = x"dc";then
diff --git a/testprogs/blackbox/test_nmblookup.sh b/testprogs/blackbox/test_nmblookup.sh
new file mode 100755 (executable)
index 0000000..ad9b3ba
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/sh
+# Blackbox tests for nmblookup
+
+NETBIOSNAME=$1
+NETBIOSALIAS=$2
+SERVER=$3
+SERVER_IP=$4
+shift 4
+TORTURE_OPTIONS=$*
+
+failed=0
+
+testit() {
+       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
+}
+
+testit "nmblookup -U \$SERVER_IP \$SERVER" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $SERVER
+testit "nmblookup -U \$SERVER_IP \$NETBIOSNAME" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSNAME
+testit "nmblookup -U \$SERVER_IP \$NETBIOSALIAS" bin/nmblookup $TORTURE_OPTIONS -U $SERVER_IP $NETBIOSALIAS
+testit "nmblookup \$SERVER" bin/nmblookup $TORTURE_OPTIONS $SERVER
+testit "nmblookup \$NETBIOSNAME" bin/nmblookup $TORTURE_OPTIONS $NETBIOSNAME
+testit "nmblookup \$NETBIOSALIAS" bin/nmblookup $TORTURE_OPTIONS $NETBIOSALIAS
+
+exit $failed