test-common-acl.sh 724 B

12345678910111213141516171819202122232425
  1. # We test if the ACLs tests should be done or not
  2. if [ -z "$ACL_TESTS" ]; then
  3. # not yet checked
  4. ACL_TESTS=1
  5. echo 1 > test.x
  6. setfacl -m u:nobody:rwx test.x 2>/dev/null
  7. if [ $? != 0 ]; then
  8. ACL_TESTS=0
  9. echo "setfacl failed on this system. ACL tests will not be executed."
  10. fi
  11. rm -f test.x
  12. if [ $ACL_TESTS = 1 ]; then
  13. # It seems we can run the ACL tests, but was logrotate compiled WITH_ACL=yes ?
  14. # See the Makefile, "pretest" part, for more information
  15. import "test.ACL"
  16. if [ -f ./test.ACL ]; then
  17. ACL_TESTS=`cat ./test.ACL`
  18. if [ $ACL_TESTS = 0 ]; then
  19. echo "logrotate was NOT compiled with 'WITH_ACL=yes'. ACL tests will not be executed."
  20. fi
  21. fi
  22. fi
  23. fi