From 7709db4c0363fe2d7b061bbed5022a8fbbf78e7c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 6 Oct 2009 17:18:15 -0700 Subject: Test creating and deleting a bad symlink using the POSIX calls. Ensure we don't regress on bug 6769. Jeremy. --- source3/script/tests/test_smbclient_s3.sh | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'source3/script/tests') diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index f60c7d7c0b..b0199a390b 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -86,6 +86,44 @@ EOF fi } +# Test creating a bad symlink and deleting it. +test_bad_symlink() +{ + prompt="posix_unlink deleted file /newname" + tmpfile=/tmp/smbclient.in.$$ + + cat > $tmpfile </dev/null 2>&1 + + if [ $? = 0 ] ; then + # got the correct prompt .. succeed + true + else + echo failed create then delete bad symlink + false + fi +} + + testit "smbclient -L $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER_IP -N -p 139 || failed=`expr $failed + 1` testit "smbclient -L $SERVER -I $SERVER_IP" $SMBCLIENT $CONFIGURATION -L $SERVER -I $SERVER_IP -N -p 139 || failed=`expr $failed + 1` @@ -105,4 +143,8 @@ testit "interactive smbclient -l prompts on stdout" \ test_interactive_prompt_stdout -l /tmp || \ failed=`expr $failed + 1` +testit "creating a bad symlink and deleting it" \ + test_bad_symlink || \ + failed=`expr $failed + 1` + testok $0 $failed -- cgit From 815b790c96c72cb995c983bbbc3cc95801aaacaa Mon Sep 17 00:00:00 2001 From: Matt Kraai Date: Thu, 17 Sep 2009 07:07:42 -0700 Subject: Use the method used by build_env.sh to discover the user name. so try USERNAME, then LOGNAME, then whoami, then id -un to find out who we are. --- source3/script/tests/selftest.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/script/tests') diff --git a/source3/script/tests/selftest.sh b/source3/script/tests/selftest.sh index ae856ca31e..43e7bf1731 100755 --- a/source3/script/tests/selftest.sh +++ b/source3/script/tests/selftest.sh @@ -57,7 +57,15 @@ export TORTURE_MAXTIME WORKGROUP=SAMBA-TEST SERVER=localhost2 SERVER_IP=127.0.0.2 -USERNAME=`PATH=/usr/ucb:$PATH whoami` +if [ ! "x$USER" = "x" ]; then + USERNAME=$USER +else + if [ ! "x$LOGNAME" = "x" ]; then + USERNAME=$LOGNAME + else + USERNAME=`PATH=/usr/ucb:$PATH whoami || id -un` + fi +fi USERID=`PATH=/usr/ucb:$PATH id | cut -d ' ' -f1 | sed -e 's/uid=\([0-9]*\).*/\1/g'` GROUPID=`PATH=/usr/ucb:$PATH id | cut -d ' ' -f2 | sed -e 's/gid=\([0-9]*\).*/\1/g'` PASSWORD=test -- cgit From 3f80b06d9ed9d1aabb56168ccee90d7d945de8ed Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 16 Oct 2009 01:58:49 +0200 Subject: s3-selftest: enable WINBIND-WBCLIENT against s3. Guenther --- source3/script/tests/test_posix_s3.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3/script/tests') diff --git a/source3/script/tests/test_posix_s3.sh b/source3/script/tests/test_posix_s3.sh index 48ea2f66cc..cfa6d5ad02 100755 --- a/source3/script/tests/test_posix_s3.sh +++ b/source3/script/tests/test_posix_s3.sh @@ -48,12 +48,14 @@ rpc="$rpc RPC-NETLOGON-S3 RPC-SCHANNEL RPC-SCHANNEL2 RPC-BENCH-SCHANNEL1 RPC-JOI local="LOCAL-NSS-WRAPPER" +winbind="WINBIND-WBCLIENT" + # NOTE: to enable the UNIX-WHOAMI test, we need to change the default share # config to allow guest access. I'm not sure whether this would break other # tests, so leaving it alone for now -- jpeach unix="UNIX-INFO2" -tests="$base $raw $rpc $unix $local" +tests="$base $raw $rpc $unix $local $winbind" if test "x$POSIX_SUBTESTS" != "x" ; then tests="$POSIX_SUBTESTS" -- cgit From 010dfbf1fd26718ad197e3428ed0b03111f6c9e5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 16 Oct 2009 16:37:20 -0700 Subject: Fix one missing STAT -> LSTAT with POSIX pathnames in vfs_xattr_tdb.c. Caught by the torture tester. I love unit tests :-). Jeremy. --- source3/script/tests/test_smbclient_s3.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source3/script/tests') diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh index b0199a390b..f10bfeac39 100755 --- a/source3/script/tests/test_smbclient_s3.sh +++ b/source3/script/tests/test_smbclient_s3.sh @@ -94,6 +94,7 @@ test_bad_symlink() cat > $tmpfile <