public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] xfstests: shared/051: add filter to match the golden output for large acls
@ 2014-03-13  0:39 Jeff Liu
  2014-03-13  3:08 ` Dave Chinner
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Liu @ 2014-03-13  0:39 UTC (permalink / raw)
  To: xfs@oss.sgi.com

From: Jie Liu <jeff.liu@oracle.com>

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>
---

V3->V2: filter out the old error message to the new and update golden output to match it
V2->V1: filter out the new error message to the old

 tests/shared/051     | 10 +++++++++-
 tests/shared/051.out |  2 +-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/tests/shared/051 b/tests/shared/051
index e957f86..934f353 100755
--- a/tests/shared/051
+++ b/tests/shared/051
@@ -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 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 ""
@@ -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"
diff --git a/tests/shared/051.out b/tests/shared/051.out
index a871082..354ec6a 100644
--- a/tests/shared/051.out
+++ b/tests/shared/051.out
@@ -280,7 +280,7 @@ mask::rwx
 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
-- 
1.8.3.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v3] xfstests: shared/051: add filter to match the golden output for large acls
  2014-03-13  0:39 [PATCH v3] xfstests: shared/051: add filter to match the golden output for large acls Jeff Liu
@ 2014-03-13  3:08 ` Dave Chinner
  0 siblings, 0 replies; 2+ messages in thread
From: Dave Chinner @ 2014-03-13  3:08 UTC (permalink / raw)
  To: Jeff Liu; +Cc: xfs@oss.sgi.com

On Thu, Mar 13, 2014 at 08:39:32AM +0800, Jeff Liu wrote:
> From: Jie Liu <jeff.liu@oracle.com>
> 
> 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>
> ---
> 
> V3->V2: filter out the old error message to the new and update golden output to match it
> V2->V1: filter out the new error message to the old

Looks good

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-03-13  3:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-13  0:39 [PATCH v3] xfstests: shared/051: add filter to match the golden output for large acls Jeff Liu
2014-03-13  3:08 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox