selftest: Add test for 'net conf delshare' also removing share ACL
authorChristof Schmitt <cs@samba.org>
Tue, 26 Nov 2019 16:59:15 +0000 (09:59 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 26 Nov 2019 21:28:31 +0000 (21:28 +0000)
Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
selftest/knownfail.d/sharesec [new file with mode: 0644]
source3/script/tests/test_sharesec.sh

diff --git a/selftest/knownfail.d/sharesec b/selftest/knownfail.d/sharesec
new file mode 100644 (file)
index 0000000..100227c
--- /dev/null
@@ -0,0 +1 @@
+samba3\.blackbox\.sharesec\.Check\ for\ default\ ACL\(simpleserver:local\)
index 06df3774f639fe65a57db4495ab7839e8de1a09b..74a2e5f55c99ade5adfe11d3481fa3b2e074bb95 100755 (executable)
@@ -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