xfstests: fix _require_acl

Skip ACL tests if we get EOPNOTUPP back from the acl calls.  This is
the error code we get on a kernel that does support the xattr system
calls, but does not support the attributes used to handle Posix ACLs.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Alex Elder <aelder@sgi.com>
This commit is contained in:
Christoph Hellwig
2010-10-21 05:55:11 +02:00
parent 506621696a
commit 15e17c9bac
2 changed files with 18 additions and 13 deletions
+1 -1
View File
@@ -54,9 +54,9 @@ _supported_os IRIX Linux
rm -f $seq.full
_require_scratch
_require_acls
_acl_setup_ids
_require_acls
umount $SCRATCH_DEV >/dev/null 2>&1
echo "*** MKFS ***" >>$seq.full
+17 -12
View File
@@ -115,25 +115,30 @@ _filter_aces_notypes()
sed -e 's/u:/user:/' -e 's/g:/group:/' -e 's/o:/other:/' -e 's/m:/mask:/'
}
# test if acl code will work
#
_require_acls()
{
xfsdir=$TEST_DIR
if [ ! -x /bin/chacl -a ! -x /usr/bin/chacl -a ! -x /sbin/chacl ]; then
_notrun "chacl command not found"
fi
# test if acl_get syscall is operational
# and hence the ACL config has been turned on
touch $xfsdir/syscalltest
if chacl -l $xfsdir/syscalltest 2>&1 | tee -a $here/$seq.full | grep 'Function not implemented' >/dev/null
then
cd $here
_notrun "requires kernel ACL support"
#
# Test if chacl is able to list ACLs on the target filesystems. On really
# old kernels the system calls might not be implemented at all, but the
# more common case is that the tested filesystem simply doesn't support
# ACLs.
#
touch $TEST_DIR/syscalltest
chacl -l $TEST_DIR/syscalltest > $TEST_DIR/syscalltest.out 2>&1
cat $TEST_DIR/syscalltest.out >> $here/$seq.full
if grep -q 'Function not implemented' $TEST_DIR/syscalltest.out; then
_notrun "kernel does not support ACLs"
fi
if grep -q 'Operation not supported' $TEST_DIR/syscalltest.out; then
_notrun "ACLs not supported by this filesystem type: $FSTYP"
fi
rm -f $TEST_DIR/syscalltest.out
}
_list_acl()