From: Christof Schmitt Date: Tue, 26 Nov 2019 16:59:15 +0000 (-0700) Subject: selftest: Add test for 'net conf delshare' also removing share ACL X-Git-Tag: ldb-2.1.0~603 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9dddb28a1719c753e84e2631ef1e1f12460cc3df;p=thirdparty%2Fsamba.git selftest: Add test for 'net conf delshare' also removing share ACL Signed-off-by: Christof Schmitt Reviewed-by: Jeremy Allison --- diff --git a/selftest/knownfail.d/sharesec b/selftest/knownfail.d/sharesec new file mode 100644 index 00000000000..100227cc10d --- /dev/null +++ b/selftest/knownfail.d/sharesec @@ -0,0 +1 @@ +samba3\.blackbox\.sharesec\.Check\ for\ default\ ACL\(simpleserver:local\) diff --git a/source3/script/tests/test_sharesec.sh b/source3/script/tests/test_sharesec.sh index 06df3774f63..74a2e5f55c9 100755 --- a/source3/script/tests/test_sharesec.sh +++ b/source3/script/tests/test_sharesec.sh @@ -7,7 +7,7 @@ # # The test uses well-known SIDs to not require looking up names and SIDs # -# Copyright (C) 2015 Christof Schmitt +# Copyright (C) 2015, 2019 Christof Schmitt if [ $# -lt 3 ]; then echo Usage: test_sharesec.sh SERVERCONFFILE SHARESEC NET SHARE @@ -124,4 +124,17 @@ ACL=$($CMD --view | grep ACL: | sed -e 's/^ACL://') testit "Verify standard ACL" test $ACL = S-1-1-0:ALLOWED/0x0/FULL || \ failed=$(expr $failed + 1) +testit "Create new share" $NET_CMD conf addshare tmp_share /tmp || \ + failed=$(expr $failed + 1) +testit "Change ACL" $SHARESEC $CONF --replace S-1-1-0:DENIED/0x0/FULL tmp_share || \ + failed=$(expr $failed + 1) +testit "Delete share" $NET_CMD conf delshare tmp_share || \ + failed=$(expr $failed + 1) +testit "Create share again" $NET_CMD conf addshare tmp_share /tmp || \ + failed=$(expr $failed + 1) +ACL=$($SHARESEC $CONF --view tmp_share | grep 'ACL:') +testit "Check for default ACL" \ + test "$ACL" = "ACL:S-1-1-0:ALLOWED/0x0/FULL" || \ + failed=$(expr $failed + 1) + testok $0 $failed