diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-08-16 08:55:43 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-08-16 02:55:19 +0200 |
commit | 97e7c3b8bd84edd69f6344249b24ae64e2a8b0fe (patch) | |
tree | fe58b6fb3578520a077ad477b8b3f595896c015e /source3 | |
parent | 748d8f5310501bb585c9be1b261554ec690a3132 (diff) | |
download | samba-97e7c3b8bd84edd69f6344249b24ae64e2a8b0fe.tar.gz samba-97e7c3b8bd84edd69f6344249b24ae64e2a8b0fe.tar.bz2 samba-97e7c3b8bd84edd69f6344249b24ae64e2a8b0fe.zip |
s3-selftest: convert xattr-tdb-1 vfstest driver into a subunit test
We don't use the simple smb.conf because we need to override all the
paths for this to work as non-root without a panic, so we use the s3dc
environment, which already loads this module.
Andrew Bartlett
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug 16 02:55:19 CEST 2012 on sn-devel-104
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/script/tests/xattr-tdb-1/run.sh | 55 | ||||
-rw-r--r-- | source3/script/tests/xattr-tdb-1/smb.conf | 5 | ||||
-rwxr-xr-x | source3/selftest/tests.py | 2 |
3 files changed, 52 insertions, 10 deletions
diff --git a/source3/script/tests/xattr-tdb-1/run.sh b/source3/script/tests/xattr-tdb-1/run.sh index 2a1b6afd63..ea7a4cbb28 100755 --- a/source3/script/tests/xattr-tdb-1/run.sh +++ b/source3/script/tests/xattr-tdb-1/run.sh @@ -1,7 +1,52 @@ #!/bin/sh -if ../../../bin/vfstest -s smb.conf -f vfstest.cmd | - grep "NT_STATUS_ACCESS_DENIED" > /dev/null 2>&1 -then - exit 1 +if [ $# -lt 2 ]; then +cat <<EOF +Usage: run.sh VFSTEST PREFIX +EOF +exit 1; fi -exit 0 + +TESTBASE=`dirname $0` +VFSTEST=$1 +PREFIX=$2 +shift 2 +ADDARGS="$*" + +VFSTEST_PREFIX=vfstest +VFSTEST_TMPDIR=$(mktemp -d ${PREFIX}/${VFSTEST_PREFIX}_XXXXXX) + +incdir=`dirname $0`/../../../../testprogs/blackbox +. $incdir/subunit.sh + +failed=0 + +cd $VFSTEST_TMPDIR || exit 1 + +test_vfstest() +{ + cmd='$VFSTEST -f $TESTBASE/vfstest.cmd $ADDARGS ' + out=`eval $cmd` + ret=$? + rm -f $tmpfile + + if [ $ret != 0 ] ; then + echo "$out" + echo "command failed" + false + return + fi + + echo "$out" | grep "NT_STATUS_ACCESS_DENIED" >/dev/null 2>&1 + + if [ $? = 0 ] ; then + # got ACCESS_DENIED .. fail + echo vfstest got NT_STATUS_ACCESS_DENIED + false + else + true + fi +} + +testit "vfstest" test_vfstest || failed=`expr $failed + 1` + +exit $failed diff --git a/source3/script/tests/xattr-tdb-1/smb.conf b/source3/script/tests/xattr-tdb-1/smb.conf deleted file mode 100644 index 259b630c5e..0000000000 --- a/source3/script/tests/xattr-tdb-1/smb.conf +++ /dev/null @@ -1,5 +0,0 @@ -[tmp] -# "path" is ignored by vfstest, it's always set to $(pwd) -path = /tmp -writable = yes -vfs objects = xattr_tdb diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index d892b16042..84e8d1e93d 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -157,6 +157,8 @@ tests=["--ping", "--separator", plantestsuite("samba.vfstest.stream_depot", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/stream-depot/run.sh"), binpath("vfstest"), "$PREFIX", configuration]) +plantestsuite("samba.vfstest.xattr-tdb-1", "s3dc:local", [os.path.join(samba3srcdir, "script/tests/xattr-tdb-1/run.sh"), binpath("vfstest"), "$PREFIX", configuration]) + for options in ["--option=clientusespnego=no", " --option=clientntlmv2auth=no --option=clientlanmanauth=yes --max-protocol=LANMAN2", ""]: env = "s3dc" plantestsuite("samba3.blackbox.smbclient_auth.plain (%s) %s" % (env, options), env, [os.path.join(samba3srcdir, "script/tests/test_smbclient_auth.sh"), '$SERVER', '$SERVER_IP', '$DC_USERNAME', '$DC_PASSWORD', smbclient, configuration, options]) |