From c213ead8c4c1b5287294a67e65f271fbb0b922b2 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 16 Nov 2022 11:23:44 +0100 Subject: [PATCH] s3:tests: Add substitution test for listing shares BUG: https://bugzilla.samba.org/show_bug.cgi?id=15243 Signed-off-by: Andreas Schneider Reviewed-by: Volker Lendecke --- selftest/knownfail.d/sustitutions | 1 + source3/script/tests/test_substitutions.sh | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 selftest/knownfail.d/sustitutions diff --git a/selftest/knownfail.d/sustitutions b/selftest/knownfail.d/sustitutions new file mode 100644 index 00000000000..800b8e03170 --- /dev/null +++ b/selftest/knownfail.d/sustitutions @@ -0,0 +1 @@ +samba3.substitutions.Test.for.share.enum.with.include.substitution diff --git a/source3/script/tests/test_substitutions.sh b/source3/script/tests/test_substitutions.sh index 0ccd45aa55e..aa0b38d1b64 100755 --- a/source3/script/tests/test_substitutions.sh +++ b/source3/script/tests/test_substitutions.sh @@ -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 -- 2.11.4.GIT