All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: fstests@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 1/2] filter.btrfs: new filter for property messages
Date: Thu,  3 Mar 2016 19:16:36 +0100	[thread overview]
Message-ID: <478b11f8a7ffe7d491227ab536418f214e7d346c.1457028701.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1457028701.git.dsterba@suse.com>

The error message in newer btrfs utilities contains name of the
property, we want to filter it out so it matches golden output. There's
an optional parameter with property name that is matched against the
command output.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 common/filter.btrfs | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/common/filter.btrfs b/common/filter.btrfs
index 9bb64792f14f..380454399834 100644
--- a/common/filter.btrfs
+++ b/common/filter.btrfs
@@ -68,5 +68,17 @@ _filter_btrfs_subvol_delete()
 
 }
 
+# filter name of the property from the output, optionally verify against $1
+# recognized message(s):
+#  "object is not compatible with property: label"
+_filter_btrfs_prop_error()
+{
+	if ! [ -z "$1" ]; then
+		sed -e "s/\(compatible with property\): $1/\1/"
+	else
+		sed -e "s/^\(.*compatible with property\).*/\1/"
+	fi
+}
+
 # make sure this script returns success
 /bin/true
-- 
1.8.4.5


  reply	other threads:[~2016-03-03 18:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-03 18:16 [PATCH 0/2] fstests: fix btrfs/048 failure with newer btrfs-progs David Sterba
2016-03-03 18:16 ` David Sterba [this message]
2016-03-04  9:31   ` [PATCH 1/2] filter.btrfs: new filter for property messages Filipe Manana
2016-03-03 18:16 ` [PATCH 2/2] btrfs/048: user filter for property error messages David Sterba
2016-03-04  9:31   ` Filipe Manana

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=478b11f8a7ffe7d491227ab536418f214e7d346c.1457028701.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --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.