testprogs/blackbox: move 'ntacl get' out of test_changedomsid() in test_samba-tool_nt...
authorStefan Metzmacher <metze@samba.org>
Wed, 17 May 2023 09:26:48 +0000 (11:26 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 21 Jun 2023 23:24:37 +0000 (23:24 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
testprogs/blackbox/test_samba-tool_ntacl.sh

index b6ce4efe4cf03af04bfa38e2772a2e6d99743a22..769b2cebd69304d080e2999a5db0d9dfd4692d94 100755 (executable)
@@ -32,8 +32,9 @@ test_get_acl()
 {
        testfile="$1"
        exptextedacl="$2"
+       shift 2
 
-       retacl=$($PYTHON $samba_tool ntacl get "$testfile" --as-sddl) || return $?
+       retacl=$($PYTHON $samba_tool ntacl get "$testfile" --as-sddl "$@") || return $?
 
        test "$retacl" = "$exptextedacl"
 }
@@ -67,19 +68,12 @@ test_set_acl_ntvfs()
 test_changedomsid()
 {
        testfile="$1"
+       shift 1
 
        $PYTHON $samba_tool ntacl changedomsid \
                "$domain_sid" "$new_domain_sid" "$testfile" \
                --service=tmp \
-               $CONFIGURATION
-
-       retacl=$($PYTHON $samba_tool ntacl get \
-               "$testfile" \
-               --as-sddl \
-               --service=tmp \
-               $CONFIGURATION) || return $?
-
-       test "$retacl" = "$new_acl_without_padding"
+               $CONFIGURATION "$@"
 }
 
 test_changedomsid_ntvfs()
@@ -121,6 +115,11 @@ testit "set_ntacl" test_set_acl "$testfile" "$acl" || failed=$(expr $failed + 1)
 testit "get_ntacl" test_get_acl "$testfile" "$acl_without_padding" || failed=$(expr $failed + 1)
 
 testit "changedomsid" test_changedomsid "$testfile" || failed=$(expr $failed + 1)
+testit "get_ntacl_after_changedomsid" \
+       test_get_acl "$testfile" "$new_acl_without_padding" \
+               --service=tmp \
+               $CONFIGURATION \
+       || failed=$(expr $failed + 1)
 
 testit "set_ntacl_ntvfs" test_set_acl_ntvfs "$testfile" "$acl" || failed=$(expr $failed + 1)
 testit "get_ntacl_ntvfs" test_get_acl_ntvfs "$testfile" "$acl_without_padding" || \