On old kernel we return EINVAL if hit the limits of maximum number of
ACLs but return E2BIG on new kernel, which cause the test failes on new
kernel as the output is mismatch to the goldens. This patch fix it by
updating the golden output with the new error message and replacing the
old error message with it via a filter.
Signed-off-by: Jie Liu <jeff.liu@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
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 out the error message in order
+# to make the updated golden output works for both old and new kernels.
+_filter_largeacl()
+{
+ sed -e "s/Invalid argument/Argument list too long/"
+}
+
#-------------------------------------------------------
echo ""
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"
other::rwx
1 above xfs acl max
-chacl: cannot set access acl on "largeaclfile": Invalid argument
+chacl: cannot set access acl on "largeaclfile": Argument list too long
# file: largeaclfile
# owner: 0
# group: 0