]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/torture: Add test for widelink case insensitivity on a MSDFS share.
authorJeremy Allison <jra@samba.org>
Mon, 10 Jun 2024 22:14:19 +0000 (15:14 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 11 Jun 2024 15:53:38 +0000 (15:53 +0000)
Add knownfail.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15662

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <noel.power@suse.com>
selftest/knownfail.d/widelinks_ci [new file with mode: 0644]
source3/script/tests/test_widelink_dfs_ci.sh [new file with mode: 0755]
source3/selftest/tests.py

diff --git a/selftest/knownfail.d/widelinks_ci b/selftest/knownfail.d/widelinks_ci
new file mode 100644 (file)
index 0000000..387ca44
--- /dev/null
@@ -0,0 +1 @@
+^samba3.blackbox.widelink_dfs_ci.creating\ a\ directory\ x\ and\ chdir\ into\ it\(fileserver\)
diff --git a/source3/script/tests/test_widelink_dfs_ci.sh b/source3/script/tests/test_widelink_dfs_ci.sh
new file mode 100755 (executable)
index 0000000..6ae5cf5
--- /dev/null
@@ -0,0 +1,72 @@
+#!/bin/sh
+
+# regression test for dfs access with wide links enabled on dfs share
+# Ensure we still maintain case insensitivity.
+
+if [ $# -lt 7 ]; then
+       cat <<EOF
+Usage: test_widelink_dfs_ci.sh SERVER SERVER_IP SHARE USERNAME PASSWORD PREFIX SMBCLIENT <smbclient arguments>
+EOF
+       exit 1
+fi
+
+SERVER="$1"
+SERVER_IP="$2"
+SHARE="$3"
+USERNAME="$4"
+PASSWORD="$5"
+PREFIX="$6"
+SMBCLIENT="$7"
+shift 7
+ADDARGS="$@"
+
+incdir=$(dirname "$0")"/../../../testprogs/blackbox"
+. "$incdir/subunit.sh"
+. "$incdir/common_test_fns.inc"
+
+failed=0
+
+# Do not let deprecated option warnings muck this up
+SAMBA_DEPRECATED_SUPPRESS=1
+export SAMBA_DEPRECATED_SUPPRESS
+
+# Test chdir'ing into a lowercase directory with upper case.
+test_ci()
+{
+        tmpfile="$PREFIX/smbclient_ci_commands"
+
+        cat >"$tmpfile" <<EOF
+mkdir x
+cd X
+cd ..
+rmdir x
+quit
+EOF
+
+        cmd='CLI_FORCE_INTERACTIVE=yes $SMBCLIENT "$@" -U$USERNAME%$PASSWORD //$SERVER/msdfs-share-wl -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 create x then chdir into X with error $ret"
+                return 1
+        fi
+
+       echo "$out" | grep 'NT_STATUS_'
+       ret="$?"
+       if [ "$ret" -eq 0 ]; then
+               echo "$out"
+               echo "Error create x then chdir into X"
+               return 1
+        fi
+       return 0
+}
+
+testit "creating a directory x and chdir into it" \
+        test_ci ||
+       failed=$((failed + 1))
+
+testok "$0" "$failed"
index f7b48dbad3888452ab0cf67fff8e0d90be2cd641..773c8598eb300c3514d4cb41b680f79b7e37f0d7 100755 (executable)
@@ -1811,6 +1811,17 @@ plantestsuite("samba3.blackbox.smbclient-bug15435",
                smbclient3,
                configuration])
 
+plantestsuite("samba3.blackbox.widelink_dfs_ci",
+              "fileserver",
+              [os.path.join(samba3srcdir, "script/tests/test_widelink_dfs_ci.sh"),
+               "$SERVER",
+               "$SERVER_IP",
+               "msdfs-share-wl",
+               "$USERNAME",
+               "$PASSWORD",
+               "$PREFIX",
+               smbclient3])
+
 
 if have_cluster_support:
     t = "readdir-timestamp"