From 9c67ff461d73305530ea257820215cf1ba97f703 Mon Sep 17 00:00:00 2001 From: Uri Simchoni Date: Mon, 29 Feb 2016 22:09:57 +0200 Subject: [PATCH] selftest: test access based share enum parameter BUG: https://bugzilla.samba.org/show_bug.cgi?id=8093 Signed-off-by: Uri Simchoni Reviewed-by: Andreas Schneider Autobuild-User(master): Uri Simchoni Autobuild-Date(master): Wed Mar 2 23:51:56 CET 2016 on sn-devel-144 --- selftest/selftesthelpers.py | 1 + selftest/target/Samba3.pm | 1 + source3/script/tests/test_shareenum.sh | 30 ++++++++++++++++++++++++++ source3/selftest/tests.py | 1 + 4 files changed, 33 insertions(+) create mode 100755 source3/script/tests/test_shareenum.sh diff --git a/selftest/selftesthelpers.py b/selftest/selftesthelpers.py index 42499b0dd78..f26484bf455 100644 --- a/selftest/selftesthelpers.py +++ b/selftest/selftesthelpers.py @@ -185,3 +185,4 @@ dbwrap_tool = binpath('dbwrap_tool') vfstest = binpath('vfstest') smbcquotas = binpath('smbcquotas') smbget = binpath('smbget') +rpcclient = binpath('rpcclient') diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm index 2dde4ca14a8..5dc4b177dfe 100755 --- a/selftest/target/Samba3.pm +++ b/selftest/target/Samba3.pm @@ -1512,6 +1512,7 @@ sub provision($$$$$$$$) [valid-users-tmp] path = $shrdir valid users = $unix_name + access based share enum = yes [msdfs-share] path = $msdfs_shrdir msdfs root = yes diff --git a/source3/script/tests/test_shareenum.sh b/source3/script/tests/test_shareenum.sh new file mode 100755 index 00000000000..3904b519d54 --- /dev/null +++ b/source3/script/tests/test_shareenum.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +# this tests share enumeration with "access based share enum" + +if [ $# -lt 4 ]; then +cat < /dev/null 2>&1 +} + +testit "$USERNAME sees tmp" user_see_share $USERNAME tmp +testit "$USERNAME sees valid-users-tmp" user_see_share $USERNAME valid-users-tmp +testit "force_user sees tmp" user_see_share force_user tmp +testit_expect_failure "force_user does not see valid-users-tmp" user_see_share force_user valid-users-tmp diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py index 48e082f8204..58511104240 100755 --- a/source3/selftest/tests.py +++ b/source3/selftest/tests.py @@ -183,6 +183,7 @@ for env in ["fileserver"]: plantestsuite("samba3.blackbox.shadow_copy2 (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shadow_copy.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH/shadow', smbclient3]) plantestsuite("samba3.blackbox.smbclient.forceuser_validusers (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_forceuser_validusers.sh"), '$SERVER', '$DOMAIN', '$USERNAME', '$PASSWORD', '$LOCAL_PATH', smbclient3]) plantestsuite("samba3.blackbox.smbget (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_smbget.sh"), '$SERVER', '$SERVER_IP', '$DOMAIN', 'smbget_user', '$PASSWORD', '$LOCAL_PATH/smbget', smbget]) + plantestsuite("samba3.blackbox.netshareenum (%s)" % env, env, [os.path.join(samba3srcdir, "script/tests/test_shareenum.sh"), '$SERVER', '$USERNAME', '$PASSWORD', rpcclient]) # # tar command tests