xfs
[Top] [All Lists]

[PATCH 4/6] shared/051: CRC enabled filesystems handle more than 25 ACLs

To: xfs@xxxxxxxxxxx
Subject: [PATCH 4/6] shared/051: CRC enabled filesystems handle more than 25 ACLs
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Mon, 24 Feb 2014 14:06:13 +1100
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1393211175-30016-1-git-send-email-david@xxxxxxxxxxxxx>
References: <1393211175-30016-1-git-send-email-david@xxxxxxxxxxxxx>
From: Dave Chinner <dchinner@xxxxxxxxxx>

shared/051 fails on CRC enabled filesystems because it doesn't get
an erro on setting the 26th ACL on a file. CRC enabled filesystems
support more than 25, so there shoul dbe no error.

Allow the test to pass on both non-CRC and CRC enabled filesystems
by detecting the type of filesystem configuration and using that
information to fake the error message so that the golden output
match does not fail. We also need to filter the 26th ACL from the
output otherwise that will cause failures, too.

Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
---
 tests/shared/051 | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/tests/shared/051 b/tests/shared/051
index e957f86..1d4edfb 100755
--- a/tests/shared/051
+++ b/tests/shared/051
@@ -319,6 +319,14 @@ chacl a::rwx file1
 set +x
 
 #-------------------------------------------------------
+#
+# On CRC enabled filesystems, we can support many more than 25 ACLs, and
+# so we have to detect this case and "fake" the error if CRCs are enabled.
+if [ $FSTYP = "xfs" ]; then
+       xfs_info $TEST_DIR | _filter_mkfs >/dev/null 2> $tmp.info
+       cat $tmp.info >> $seqres.full
+       . $tmp.info
+fi
 
 echo ""
 echo "=== Test out large ACLs  ==="
@@ -343,7 +351,14 @@ getfacl --numeric largeaclfile | _filter_aces
 
 echo "1 above xfs acl max"
 chacl $acl3 largeaclfile
-getfacl --numeric largeaclfile | _filter_aces
+if [ $_fs_has_crcs = "1" ]; then
+       # fake the error message for CRC enabled filesystems. It should succeed,
+       # so if there was any error from the above command we are going to fail
+       # regardless of whether we emit this or not.
+       echo "chacl: cannot set access acl on \"largeaclfile\": Invalid 
argument"
+fi
+# and filter the extra ACL we might have added.
+getfacl --numeric largeaclfile | _filter_aces | sed -e "/^user:22:rwx/d"
 
 echo "use 16 aces"
 chacl $acl4 largeaclfile
-- 
1.8.4.rc3

<Prev in Thread] Current Thread [Next in Thread>