summaryrefslogtreecommitdiff
path: root/source3/script
diff options
context:
space:
mode:
Diffstat (limited to 'source3/script')
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh48
-rwxr-xr-xsource3/script/tests/tests_all.sh4
2 files changed, 47 insertions, 5 deletions
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index 1ee829e2fc..7896b2821f 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -2,9 +2,9 @@
# this runs the file serving tests that are expected to pass with samba3
-if [ $# -lt 5 ]; then
+if [ $# -lt 6 ]; then
cat <<EOF
-Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD USERID
+Usage: test_smbclient_s3.sh SERVER SERVER_IP USERNAME PASSWORD USERID LOCAL_PATH
EOF
exit 1;
fi
@@ -14,8 +14,9 @@ SERVER_IP="$2"
USERNAME="$3"
PASSWORD="$4"
USERID="$5"
+LOCAL_PATH="$6"
SMBCLIENT="$VALGRIND ${SMBCLIENT:-$BINDIR/smbclient} $CONFIGURATION"
-shift 5
+shift 6
ADDARGS="$*"
test x"$TEST_FUNCTIONS_SH" != x"INCLUDED" && {
@@ -127,6 +128,43 @@ EOF
fi
}
+# Test creating a good symlink and deleting it by path.
+test_good_symlink()
+{
+ tmpfile=/tmp/smbclient.in.$$
+
+ touch "$LOCAL_PATH/foo"
+ ln -s "$LOCAL_PATH/foo" "$LOCAL_PATH/bar"
+ cat > $tmpfile <<EOF
+del bar
+quit
+EOF
+
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT $CONFIGURATION "$@" -U$USERNAME%$PASSWORD //$SERVER/tmp -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ eval echo "$cmd"
+ out=`eval $cmd`
+ ret=$?
+ rm -f $tmpfile
+
+ if [ $ret != 0 ] ; then
+ echo "$out"
+ echo "failed delete good symlink with error $ret"
+ false
+ return
+ fi
+
+ if [ -e "$LOCAL_PATH/bar" ] ; then
+ echo "failed delete good symlink - symlink still exists"
+ rm "$LOCAL_PATH/bar"
+ rm "$LOCAL_PATH/foo"
+ false
+ else
+ # got the correct prompt .. succeed
+ rm "$LOCAL_PATH/foo"
+ true
+ fi
+}
+
# Test writing into a read-only directory (logon as guest) fails.
test_read_only_dir()
{
@@ -264,6 +302,10 @@ testit "creating a bad symlink and deleting it" \
test_bad_symlink || \
failed=`expr $failed + 1`
+testit "creating a good symlink and deleting it by path" \
+ test_good_symlink || \
+ failed=`expr $failed + 1`
+
testit "writing into a read-only directory fails" \
test_read_only_dir || \
failed=`expr $failed + 1`
diff --git a/source3/script/tests/tests_all.sh b/source3/script/tests/tests_all.sh
index 153f8ea0d5..cd0c6eb456 100755
--- a/source3/script/tests/tests_all.sh
+++ b/source3/script/tests/tests_all.sh
@@ -20,13 +20,13 @@ smbtorture_s3_encrypted() {
smbclient_s3() {
echo "RUNNING TESTS smbclient_s3"
- $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP $USERNAME $PASSWORD $USERID \
+ $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP $USERNAME $PASSWORD $USERID "$PREFIX_ABS"/tmp \
|| failed=`expr $failed + $?`
}
smbclient_s3_encrypted() {
echo "RUNNING TESTS smbclient_s3_encrypted"
- $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP $USERNAME $PASSWORD $USERID "-e" \
+ $SCRIPTDIR/test_smbclient_s3.sh $SERVER $SERVER_IP $USERNAME $PASSWORD $USERID "$PREFIX_ABS"/tmp "-e" \
|| failed=`expr $failed + $?`
}