]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1304-default-acl.sh
t1304: improve setfacl prerequisite setup
[thirdparty/git.git] / t / t1304-default-acl.sh
index 2b962cfda70d998e9c2799cf8fc720b330cd118a..79045abb5171691246167a42eec6bf18fbeb0b76 100755 (executable)
@@ -14,16 +14,15 @@ umask 077
 # We need an arbitrary other user give permission to using ACLs. root
 # is a good candidate: exists on all unices, and it has permission
 # anyway, so we don't create a security hole running the testsuite.
-
-setfacl_out="$(setfacl -m u:root:rwx . 2>&1)"
-setfacl_ret=$?
-
-if test $setfacl_ret != 0
-then
-       say "Unable to use setfacl (output: '$setfacl_out'; return code: '$setfacl_ret')"
-else
-       test_set_prereq SETFACL
-fi
+test_expect_success 'checking for a working acl setup' '
+       if setfacl -m d:m:rwx -m u:root:rwx . &&
+          getfacl . | grep user:root:rwx &&
+          touch should-have-readable-acl &&
+          getfacl should-have-readable-acl | egrep "mask::?rw-"
+       then
+               test_set_prereq SETFACL
+       fi
+'
 
 if test -z "$LOGNAME"
 then