All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: fstests@vger.kernel.org
Subject: [PATCH] generic/377: filter out xattrs that don't start with 'user.'
Date: Wed,  1 Jul 2020 13:52:05 -0400	[thread overview]
Message-ID: <20200701175205.342650-1-jlayton@kernel.org> (raw)

Most hosts that I've been testing on seem to display security.selinux in
listxattr. 377.out doesn't account for that so it routinely fails for me
in testing.

When testing the output of listxattr in generic/377, filter out any xattr
names that don't start with 'user.'. That should help ensure consistent
output on SELinux-enabled hosts.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 tests/generic/377 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

I'm not sure why this doesn't fail for most people, unless most are
turning off SELinux. Is this the right approach?

diff --git a/tests/generic/377 b/tests/generic/377
index f7835ee8ff9e..f08abdca60a6 100755
--- a/tests/generic/377
+++ b/tests/generic/377
@@ -48,7 +48,7 @@ $SETFATTR_PROG -n user.ping -v pong $testfile
 $SETFATTR_PROG -n user.hello -v there $testfile
 
 # 1. Call listxattr without buffer length argument. This should succeed.
-$listxattr $testfile | sort
+$listxattr $testfile | grep '^xattr: user\.' | sort
 
 # 2. Calling listxattr on nonexistant file should fail with -ENOENT.
 $listxattr ""
@@ -66,7 +66,7 @@ $listxattr $testfile 9
 $listxattr $testfile 11
 
 # 6. Calling listxattr with buffersize bigger than needed should succeed.
-$listxattr $testfile 500 | sort
+$listxattr $testfile 500 | grep '^xattr: user\.' | sort
 
 status=0
 exit
-- 
2.26.2


             reply	other threads:[~2020-07-01 17:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-01 17:52 Jeff Layton [this message]
2020-07-05 11:41 ` [PATCH] generic/377: filter out xattrs that don't start with 'user.' Zorro Lang
2020-07-06 13:50   ` Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200701175205.342650-1-jlayton@kernel.org \
    --to=jlayton@kernel.org \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.