diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-02-15 14:27:06 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-02-15 14:27:06 +1100 |
commit | 63c099c51a71afad67dce2d2df842b934412117b (patch) | |
tree | 0d8acf20dd16e14118cef50e27f04c99a932cdfc | |
parent | be8a09b13883eb6edd55dedd4dbb45906be20311 (diff) | |
download | samba-63c099c51a71afad67dce2d2df842b934412117b.tar.gz |
added blackbox testing for locktest
(This used to be commit af6484f78d273407dd9b264bc4adb33497eee48b)
-rwxr-xr-x | source4/selftest/samba4_tests.sh | 1 | ||||
-rw-r--r-- | source4/selftest/target/Samba4.pm | 16 | ||||
-rwxr-xr-x | testprogs/blackbox/test_locktest.sh | 40 |
3 files changed, 56 insertions, 1 deletions
diff --git a/source4/selftest/samba4_tests.sh b/source4/selftest/samba4_tests.sh index 2595d511773..8be55f78b06 100755 --- a/source4/selftest/samba4_tests.sh +++ b/source4/selftest/samba4_tests.sh @@ -253,6 +253,7 @@ plantest "blackbox.kinit" dc $bbdir/test_kinit.sh "\$SERVER" "\$USERNAME" "\$PAS plantest "blackbox.cifsdd" dc $bbdir/test_cifsdd.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" plantest "blackbox.nmblookup" dc $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" plantest "blackbox.nmblookup" member $samba4srcdir/utils/tests/test_nmblookup.sh "\$NETBIOSNAME" "\$NETBIOSALIAS" "\$SERVER" "\$SERVER_IP" +plantest "blackbox.locktest" dc $bbdir/test_locktest.sh "\$SERVER" "\$USERNAME" "\$PASSWORD" "\$DOMAIN" # Tests using the "Simple" NTVFS backend diff --git a/source4/selftest/target/Samba4.pm b/source4/selftest/target/Samba4.pm index fba0f6a6f85..563aca876e0 100644 --- a/source4/selftest/target/Samba4.pm +++ b/source4/selftest/target/Samba4.pm @@ -525,7 +525,7 @@ sub provision($$$$$$) (system("rm -rf $prefix/*") == 0) or die("Unable to clean up"); mkdir($_, 0777) foreach ($privatedir, $etcdir, $piddir, $ncalrpcdir, $lockdir, - $tmpdir); + $tmpdir, "$tmpdir/test1", "$tmpdir/test2"); my $localbasedn = $basedn; @@ -569,6 +569,20 @@ sub provision($$$$$$) posix:sharedelay = 100000 posix:eadb = $lockdir/eadb.tdb +[test1] + path = $tmpdir/test1 + read only = no + ntvfs handler = posix + posix:sharedelay = 100000 + posix:eadb = $lockdir/eadb.tdb + +[test2] + path = $tmpdir/test2 + read only = no + ntvfs handler = posix + posix:sharedelay = 100000 + posix:eadb = $lockdir/eadb.tdb + [cifs] read only = no ntvfs handler = cifs diff --git a/testprogs/blackbox/test_locktest.sh b/testprogs/blackbox/test_locktest.sh new file mode 100755 index 00000000000..60597ba83fe --- /dev/null +++ b/testprogs/blackbox/test_locktest.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# Blackbox tests for locktest +# Copyright (C) 2008 Andrew Tridgell +# based on test_smbclient.sh + +if [ $# -lt 4 ]; then +cat <<EOF +Usage: test_locktest.sh SERVER USERNAME PASSWORD DOMAIN +EOF +exit 1; +fi + +SERVER=$1 +USERNAME=$2 +PASSWORD=$3 +DOMAIN=$4 +shift 4 +failed=0 + +samba4bindir=`dirname $0`/../../source/bin +locktest=$samba4bindir/locktest + +testit() { + name="$1" + shift + cmdline="$*" + echo "test: $name" + $cmdline + status=$? + if [ x$status = x0 ]; then + echo "success: $name" + else + echo "failure: $name" + fi + return $status +} + +testit "locktest" $VALGRIND $locktest //$SERVER/test1 //$SERVER/test2 -o 100 -W "$DOMAIN" -U"$USERNAME%$PASSWORD" -U"$USERNAME%$PASSWORD" $@ || failed=`expr $failed + 1` + +exit $failed |