summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2022-06-17 10:25:49 +0100
committerJeremy Allison <jra@samba.org>2022-06-17 16:20:35 +0000
commitdb1b4df0ab3b18821da3c2dbe6d6058f0c3019b8 (patch)
tree387e57991c7e531a1495ba8b91759a2d77c235e1
parent39672a9676bff53d3ccc0ad7c1fa65a95cbceaab (diff)
downloadsamba-db1b4df0ab3b18821da3c2dbe6d6058f0c3019b8.tar.gz
Add test smbclient 'del' of file (on DFS share)
del of a file on a DFS share results in NT_STATUS_OBJECT_PATH_NOT_FOUND Addionally add a knownfail (will be removed in following patch to fix the bug) We also need to add a knownfail (which will not be removed) for the new test which will fail in smb1 envs BUG: https://bugzilla.samba.org/show_bug.cgi?id=15100 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--selftest/knownfail.d/smb1-tests1
-rw-r--r--selftest/knownfail.d/smbclient-smb31
-rwxr-xr-xsource3/script/tests/test_smbclient_s3.sh45
3 files changed, 47 insertions, 0 deletions
diff --git a/selftest/knownfail.d/smb1-tests b/selftest/knownfail.d/smb1-tests
index 03d299ad7c7..9437da57159 100644
--- a/selftest/knownfail.d/smb1-tests
+++ b/selftest/knownfail.d/smb1-tests
@@ -10,6 +10,7 @@
^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.interactive smbclient -l prompts on stdout\((ad_member|nt4_member)\)
^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.creating a bad symlink and deleting it\((ad_member|nt4_member)\)
^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.Accessing an MS-DFS link\((ad_member|nt4_member)\)
+^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.del on MS-DFS share\((ad_member|nt4_member)\)
^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.Ensure archive bit is set correctly on file/dir rename\((ad_member|nt4_member)\)
^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.ccache access works for smbclient\((ad_member|nt4_member)\)
^samba3.blackbox.smbclient_s3.NT1.(plain|sign).member_creds.using an authentication file\((ad_member|nt4_member)\)
diff --git a/selftest/knownfail.d/smbclient-smb3 b/selftest/knownfail.d/smbclient-smb3
index 119e93e479a..91bed158bfa 100644
--- a/selftest/knownfail.d/smbclient-smb3
+++ b/selftest/knownfail.d/smbclient-smb3
@@ -1,4 +1,5 @@
^samba3.blackbox.smbclient_s3.SMB3.*.creating.a.bad.symlink.and.deleting.it
+^samba3.blackbox.smbclient_s3.SMB3.*.del on MS-DFS share
^samba3.blackbox.acl_xattr.SMB3.nt_affects_posix
^samba3.blackbox.acl_xattr.SMB3.nt_affects_chown
^samba3.blackbox.acl_xattr.SMB3.nt_affects_chgrp
diff --git a/source3/script/tests/test_smbclient_s3.sh b/source3/script/tests/test_smbclient_s3.sh
index da4fa62a144..e3c7b134b04 100755
--- a/source3/script/tests/test_smbclient_s3.sh
+++ b/source3/script/tests/test_smbclient_s3.sh
@@ -527,6 +527,47 @@ EOF
return 0
}
+test_msdfs_del()
+{
+ tmpfile="$PREFIX/smbclient.in.$$"
+ filename_src="src.$$"
+ filename_src_path="$PREFIX/$filename_src"
+ rm -f "$filename_src_path"
+ touch "$filename_src_path"
+
+ cat > $tmpfile <<EOF
+lcd $PREFIX
+cd dfshop1
+cd dfshop2
+put $filename_src
+del $filename_src
+quit
+EOF
+
+ cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share -I $SERVER_IP $ADDARGS < $tmpfile 2>&1'
+ eval echo "$cmd"
+ out=`eval $cmd`
+ ret=$?
+ rm -f "$tmpfile"
+ rm -f "$filename_src_path"
+
+ if [ $ret != 0 ] ; then
+ echo "$out"
+ echo "failed deleteing $filename_src with error $ret"
+ return 1
+ fi
+
+ echo "$out" | grep "NT_STATUS" >/dev/null 2>&1
+
+ ret="$?"
+ if [ "$ret" -eq 0 ] ; then
+ echo "$out"
+ echo "del $filename_src NT_STATUS_ error"
+ return 1
+ fi
+ return 0
+}
+
# Archive bits are correctly set on file/dir creation and rename.
test_rename_archive_bit()
{
@@ -2167,6 +2208,10 @@ testit "Hardlink on MS-DFS share" \
test_msdfs_hardlink ||
failed=$(expr $failed + 1)
+testit "del on MS-DFS share" \
+ test_msdfs_del || \
+ failed=`expr $failed + 1`
+
testit "Ensure archive bit is set correctly on file/dir rename" \
test_rename_archive_bit ||
failed=$(expr $failed + 1)