]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:tests: Add substitution test for listing shares
authorAndreas Schneider <asn@samba.org>
Wed, 16 Nov 2022 10:23:44 +0000 (11:23 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 18 Nov 2022 18:17:28 +0000 (18:17 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15243

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
selftest/knownfail.d/sustitutions [new file with mode: 0644]
source3/script/tests/test_substitutions.sh

diff --git a/selftest/knownfail.d/sustitutions b/selftest/knownfail.d/sustitutions
new file mode 100644 (file)
index 0000000..800b8e0
--- /dev/null
@@ -0,0 +1 @@
+samba3.substitutions.Test.for.share.enum.with.include.substitution
index 0ccd45aa55ec18611aae85c19dd9483888c47a00..aa0b38d1b6458d112749ec9f295521c8a4522758 100755 (executable)
@@ -20,6 +20,7 @@ failed=0
 samba_bindir="$BINDIR"
 samba_srcdir="$SRCDIR"
 smbclient="$samba_bindir/smbclient"
+rpcclient="$samba_bindir/rpcclient"
 
 . $samba_srcdir/testprogs/blackbox/subunit.sh
 . $samba_srcdir/testprogs/blackbox/common_test_fns.inc
@@ -59,4 +60,20 @@ test_smbclient_expect_failure \
        "ls" "//${SERVER}/${USERNAME}_share" "-U$DC_USERNAME%$DC_PASSWORD" ||
        failed=$((failed + 1))
 
+testit_grep_count \
+       "Test for share enum with include substitution" \
+       "netname: ${USERNAME}_share" \
+       1 \
+       ${rpcclient} "ncacn_np:${SERVER}" "-U$USERNAME%$PASSWORD" \
+       -c netshareenum ||
+       failed=$((failed + 1))
+
+testit_grep_count \
+       "Negative test for share enum with include substitution" \
+       "netname: ${USERNAME}_share" \
+       0 \
+       ${rpcclient} "ncacn_np:${SERVER}" "-U$DC_USERNAME%$DC_PASSWORD" \
+       -c netshareenum ||
+       failed=$((failed + 1))
+
 exit $failed