From: Josef Bacik <jbacik@fb.com>
To: <linux-btrfs@vger.kernel.org>, <xfs@oss.sgi.com>
Subject: [PATCH] xfstests: filter out selinux xattrs for generic/062
Date: Fri, 9 May 2014 15:44:28 -0400 [thread overview]
Message-ID: <1399664668-719-1-git-send-email-jbacik@fb.com> (raw)
If you have selinux enabled getfattr will show the selinux xattrs, which screws
with the golden output of generic/062. To make matters worse you can't just
greap it out because we'll still get the preamble and newline from getfattr when
the selinux attr is the only attr. So this is the voodoo I came up with after
way more time than I'm comfortable admitting to make this test pass if you have
selinux enabled. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
---
common/filter | 6 ++++++
tests/generic/062 | 3 ++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/common/filter b/common/filter
index 05dbae6..16a01ed 100644
--- a/common/filter
+++ b/common/filter
@@ -323,5 +323,11 @@ _filter_ro_mount() {
-e "s/mount: cannot mount block device/mount: cannot mount/g"
}
+# Filter out selinux xattrs from getfattr, and if selinux is the only xattr in
+# the file simply pretend like there were no xattrs
+_filter_selinux_xattr() {
+ grep -v selinux | sed -e "N; s/^\# file: .*\n$//; /^$/d"
+}
+
# make sure this script returns success
/bin/true
diff --git a/tests/generic/062 b/tests/generic/062
index 047c930..32f0bca 100755
--- a/tests/generic/062
+++ b/tests/generic/062
@@ -47,7 +47,8 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
getfattr()
{
- $GETFATTR_PROG --absolute-names -dh $@ 2>&1 | _filter_scratch
+ $GETFATTR_PROG --absolute-names -dh $@ 2>&1 | _filter_scratch | \
+ _filter_selinux_xattr
}
setfattr()
--
1.8.3.1
next reply other threads:[~2014-05-09 19:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-09 19:44 Josef Bacik [this message]
2014-05-09 20:17 ` [PATCH] xfstests: filter out selinux xattrs for generic/062 Eric Sandeen
2014-05-09 20:20 ` Josef Bacik
2014-05-09 20:22 ` Eric Sandeen
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=1399664668-719-1-git-send-email-jbacik@fb.com \
--to=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=xfs@oss.sgi.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).