Skip to content
Snippets Groups Projects
Commit 2b5185dc authored by Kamil Dudka's avatar Kamil Dudka
Browse files

test-common-acl.sh: check whether ACL tests should be skipped

Closes #132
parent 10b038ea
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -4,6 +4,7 @@ EXTRA_DIST = \
mailer \
test \
test-common.sh \
test-common-acl.sh \
$(top_srcdir)/test/test-config.*.in
 
DISTCLEANFILES = \
Loading
Loading
Loading
Loading
@@ -2,28 +2,6 @@
 
. ./test-common.sh
 
# -- ACL - BEGIN --------------------------------
# We test if the ACLs tests should be done or not
ACL_TESTS=1
echo 1 > test.x
setfacl -m u:nobody:rwx test.x 2>/dev/null
if [ $? != 0 ]; then
ACL_TESTS=0
echo "setfacl failed on this system. ACL tests will not be executed."
fi
rm -f test.x
if [ $ACL_TESTS = 1 ]; then
# It seems we can run the ACL tests, but was logrotate compiled WITH_ACL=yes ?
# See the Makefile, "pretest" part, for more information
if [ -f ./test.ACL ]; then
ACL_TESTS=`cat ./test.ACL`
if [ $ACL_TESTS = 0 ]; then
echo "logrotate was NOT compiled with 'WITH_ACL=yes'. ACL tests will not be executed."
fi
fi
fi
# -- ACL - END ----------------------------------
# -- SELINUX - BEGIN --------------------------------
# We test if the ACLs tests should be done or not
SELINUX_TESTS=0
Loading
Loading
@@ -680,6 +658,7 @@ test.log 0
test.log.1 0 zero
EOF
 
. ./test-common-acl.sh
if [ $ACL_TESTS = 0 ]; then
echo "Skipping test 32: no ACL support"
else
Loading
Loading
@@ -730,6 +709,7 @@ EOF
 
fi
 
. ./test-common-acl.sh
if [ $ACL_TESTS = 0 ]; then
echo "Skipping test 33: no ACL support"
else
Loading
Loading
@@ -782,6 +762,7 @@ checkoutput <<EOF
test.log 0 zero
EOF
 
. ./test-common-acl.sh
if [ $ACL_TESTS = 0 ]; then
echo "Skipping test 35: no ACL support"
else
Loading
Loading
@@ -1105,6 +1086,7 @@ fi
 
cleanup 48
 
. ./test-common-acl.sh
if [ $ACL_TESTS = 0 ]; then
echo "Skipping test 48: no ACL support"
else
Loading
Loading
# We test if the ACLs tests should be done or not
if [ -z "$ACL_TESTS" ]; then
# not yet checked
ACL_TESTS=1
echo 1 > test.x
setfacl -m u:nobody:rwx test.x 2>/dev/null
if [ $? != 0 ]; then
ACL_TESTS=0
echo "setfacl failed on this system. ACL tests will not be executed."
fi
rm -f test.x
if [ $ACL_TESTS = 1 ]; then
# It seems we can run the ACL tests, but was logrotate compiled WITH_ACL=yes ?
# See the Makefile, "pretest" part, for more information
if [ -f ./test.ACL ]; then
ACL_TESTS=`cat ./test.ACL`
if [ $ACL_TESTS = 0 ]; then
echo "logrotate was NOT compiled with 'WITH_ACL=yes'. ACL tests will not be executed."
fi
fi
fi
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment