Skip to contentSkip to conversation

xfstests: shared/051: add filter to match the golden output for large acls

PATCH Superseded Jeff Liu 2 participants 3 messages Mar 12, 2014

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jeff Liu

author
#0 lore raw

PATCH v2 1/1 xfstests: shared/051: add filter to match the golden output for large acls

From: Jie Liu <[email protected]>

On old kernel we return EINVAL if hit the limits of maximum number of ACLs but return E2BIG on new kernel, which cause the current test fails on new kernel as the output is mismatch to the goldens. In order to make the current golden output works for both old and new kernels, this patch filter the new error message out to match the olds.

---
V2: make the filter as a local function as per Dave's comments

 tests/shared/051 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
tests/shared/051 +9 -1
index e957f86..adbe427 100755
@@ -318,6 +318,14 @@ chacl m:user1:rwx file1
 chacl a::rwx file1
 set +x
 
+# we return E2BIG if hit the max acl limits on new kernel, but EINVAL
+# on old kernel. So we need to filter the error message out in order
+# to make the current golden output works for both old and new kernels.
+_filter_largeacl()
+{
+	sed -e "s/Argument list too long/Invalid argument/"
+}
+
 #-------------------------------------------------------
 
 echo ""
@@ -342,7 +350,7 @@ chacl $acl2 largeaclfile
 getfacl --numeric largeaclfile | _filter_aces
 
 echo "1 above xfs acl max"
-chacl $acl3 largeaclfile
+chacl $acl3 largeaclfile 2>&1 | _filter_largeacl
 getfacl --numeric largeaclfile | _filter_aces
 
 echo "use 16 aces"
Signature · 6 lines
1.8.3.2

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw

tests/shared/051 chacl m:user1:rwx file1 · line 323

Quoted 3 lines
tests/shared/051 +3 -0
+# we return E2BIG if hit the max acl limits on new kernel, but EINVAL
+# on old kernel. So we need to filter the error message out in order
+# to make the current golden output works for both old and new kernels.

Hate to nitpick, but shouldn't the new one be in the golden output and the old one fixed up?

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

author
#2 lore raw
Quoted 6 lines · Christoph Hellwig

tests/shared/051 chacl m:user1:rwx file1 · line 323

Quoted 3 lines
tests/shared/051 +3 -0
+# we return E2BIG if hit the max acl limits on new kernel, but EINVAL
+# on old kernel. So we need to filter the error message out in order
+# to make the current golden output works for both old and new kernels.

Hate to nitpick, but shouldn't the new one be in the golden output and the old one fixed up?

Exactly, I'll post a fix.

Thanks,
-Jeff

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs