sefltest: Add new regression test dfs with widelinks = yes
authorNoel Power <noel.power@suse.com>
Fri, 28 Jul 2023 08:41:59 +0000 (09:41 +0100)
committerJule Anger <janger@samba.org>
Thu, 3 Aug 2023 07:42:17 +0000 (07:42 +0000)
Adds a new test trying to cd into dfs path on share with
widelinks enabled, should generate an error (see BUG:)

Add a knownfail so CI continues

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

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 3d2e9db8b95f9f45d486f8272e53584975f177fa)

selftest/knownfail.d/smbclient-bug15435 [new file with mode: 0644]
source3/script/tests/test_bug15435_widelink_dfs.sh [new file with mode: 0755]
source3/selftest/tests.py

diff --git a/selftest/knownfail.d/smbclient-bug15435 b/selftest/knownfail.d/smbclient-bug15435
new file mode 100644 (file)
index 0000000..c7d64a1
--- /dev/null
@@ -0,0 +1 @@
+^samba3.blackbox.smbclient-bug15435.smbclient
diff --git a/source3/script/tests/test_bug15435_widelink_dfs.sh b/source3/script/tests/test_bug15435_widelink_dfs.sh
new file mode 100755 (executable)
index 0000000..e239cd0
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# regression test for dfs access with wide links enabled on dfs share
+
+if [ $# -lt 5 ]; then
+       cat <<EOF
+Usage: test_smbclient_basic.sh SERVER SERVER_IP DOMAIN USERNAME PASSWORD SMBCLIENT <smbclient arguments>
+EOF
+       exit 1
+fi
+
+SERVER="$1"
+SERVER_IP="$2"
+USERNAME="$3"
+PASSWORD="$4"
+smbclient="$5"
+CONFIGURATION="$6"
+shift 6
+ADDARGS="$@"
+
+incdir=$(dirname $0)/../../../testprogs/blackbox
+. $incdir/subunit.sh
+. $incdir/common_test_fns.inc
+
+# TEST
+test_smbclient "smbclient as $DOMAIN\\$USERNAME" 'ls' "//$SERVER/msdfs-share-wl" -U$DOMAIN\\$USERNAME%$PASSWORD $ADDARGS -c 'cd msdfs-src1' || failed=$(expr $failed + 1)
+
+exit $failed
index afe408e0f643f805fc72354645680658f6ee9f75..83d72db003c288ff78eed0a617af85f550fd4d06 100755 (executable)
@@ -1673,6 +1673,16 @@ plantestsuite(
      "",
      "-b $PREFIX/clusteredmember/unclists/tmp.txt -N 5 -o 10"])
 
+plantestsuite("samba3.blackbox.smbclient-bug15435",
+              "fileserver",
+              [os.path.join(samba3srcdir, "script/tests/test_bug15435_widelink_dfs.sh"),
+               "$SERVER",
+               "$SERVER_IP",
+               "$USERNAME",
+               "$PASSWORD",
+               smbclient3,
+               configuration])
+
 plantestsuite(
     "samba3.net_machine_account",
     "clusteredmember",