]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
selftest: Test for bug 15062 -- list "username" in netshareenum
authorVolker Lendecke <vl@samba.org>
Wed, 18 May 2022 14:40:49 +0000 (14:40 +0000)
committerJeremy Allison <jra@samba.org>
Wed, 18 May 2022 16:50:34 +0000 (16:50 +0000)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15062

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail.d/netshareenum_user [new file with mode: 0644]
source3/script/tests/test_user_in_sharelist.sh [new file with mode: 0755]
source3/selftest/tests.py

diff --git a/selftest/knownfail.d/netshareenum_user b/selftest/knownfail.d/netshareenum_user
new file mode 100644 (file)
index 0000000..5ad1a49
--- /dev/null
@@ -0,0 +1 @@
+.*samba3.blackbox.netshareenum_username.*
\ No newline at end of file
diff --git a/source3/script/tests/test_user_in_sharelist.sh b/source3/script/tests/test_user_in_sharelist.sh
new file mode 100755 (executable)
index 0000000..1abd554
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+if [ $# -lt 2 ]; then
+    echo Usage: $0 RPCCLIENT SERVER
+    exit 1
+fi
+
+incdir=$(dirname $0)/../../../testprogs/blackbox
+. $incdir/subunit.sh
+
+failed=0
+
+RPCCLIENT="$1"; shift 1
+SERVER="$1"; shift 1
+
+"${RPCCLIENT}" "${SERVER}" -U"${USER}"%"${PASSWORD}" -c netshareenum |
+    grep "^netname: $USER\$"
+RC=$?
+testit "Verify username is listed in netshareenum due to [homes]" \
+       test $RC = 0 || failed=$((failed+1))
+
+testok $0 $failed
index a43889b5964aeba3981dccd77d27085d64d7d15a..5502e4981248e3bd7760ae6f5d85d49dfd409315 100755 (executable)
@@ -1218,6 +1218,12 @@ plantestsuite("samba3.blackbox.netfileenum", "simpleserver:local",
                '$SERVER_IP',
                'tmp'])
 
+plantestsuite("samba3.blackbox.netshareenum_username", "fileserver",
+              [os.path.join(samba3srcdir,
+                            "script/tests/test_user_in_sharelist.sh"),
+               os.path.join(bindir(), "rpcclient"),
+               '$SERVER_IP'])
+
 plantestsuite("samba3.blackbox.net_tdb", "simpleserver:local",
               [os.path.join(samba3srcdir, "script/tests/test_net_tdb.sh"),
                smbclient3, '$SERVER', 'tmp', '$USERNAME', '$PASSWORD',