public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] fstests: fix btrfs/048 failure with newer btrfs-progs
@ 2016-03-03 18:16 David Sterba
  2016-03-03 18:16 ` [PATCH 1/2] filter.btrfs: new filter for property messages David Sterba
  2016-03-03 18:16 ` [PATCH 2/2] btrfs/048: user filter for property error messages David Sterba
  0 siblings, 2 replies; 5+ messages in thread
From: David Sterba @ 2016-03-03 18:16 UTC (permalink / raw)
  To: fstests; +Cc: David Sterba

David Sterba (2):
  filter.btrfs: new filter for property messages
  btrfs/048: user filter for property error messages

 common/filter.btrfs | 12 ++++++++++++
 tests/btrfs/048     |  4 +++-
 2 files changed, 15 insertions(+), 1 deletion(-)

-- 
1.8.4.5


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

* [PATCH 1/2] filter.btrfs: new filter for property messages
  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
  2016-03-04  9:31   ` Filipe Manana
  2016-03-03 18:16 ` [PATCH 2/2] btrfs/048: user filter for property error messages David Sterba
  1 sibling, 1 reply; 5+ messages in thread
From: David Sterba @ 2016-03-03 18:16 UTC (permalink / raw)
  To: fstests; +Cc: David Sterba

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


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

* [PATCH 2/2] btrfs/048: user filter for property error messages
  2016-03-03 18:16 [PATCH 0/2] fstests: fix btrfs/048 failure with newer btrfs-progs David Sterba
  2016-03-03 18:16 ` [PATCH 1/2] filter.btrfs: new filter for property messages David Sterba
@ 2016-03-03 18:16 ` David Sterba
  2016-03-04  9:31   ` Filipe Manana
  1 sibling, 1 reply; 5+ messages in thread
From: David Sterba @ 2016-03-03 18:16 UTC (permalink / raw)
  To: fstests; +Cc: David Sterba

Signed-off-by: David Sterba <dsterba@suse.com>
---
 tests/btrfs/048 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/btrfs/048 b/tests/btrfs/048
index c2cb4a63b095..4a36303632eb 100755
--- a/tests/btrfs/048
+++ b/tests/btrfs/048
@@ -41,6 +41,7 @@ _cleanup()
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
+. ./common/filter.btrfs
 
 # real QA test starts here
 _supported_fs btrfs
@@ -70,7 +71,8 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT label ''
 $BTRFS_UTIL_PROG property get $SCRATCH_MNT label
 echo "***"
 mkdir $SCRATCH_MNT/testdir
-$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir label
+$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir label 2>&1 |
+	_filter_btrfs_prop_error label
 echo "***"
 
 echo -e "\nTesting subvolume ro property"
-- 
1.8.4.5


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

* Re: [PATCH 2/2] btrfs/048: user filter for property error messages
  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
  0 siblings, 0 replies; 5+ messages in thread
From: Filipe Manana @ 2016-03-04  9:31 UTC (permalink / raw)
  To: David Sterba; +Cc: fstests

On Thu, Mar 3, 2016 at 6:16 PM, David Sterba <dsterba@suse.com> wrote:
> Signed-off-by: David Sterba <dsterba@suse.com>

Reviewed-by: Filipe Manana <fdmanana@suse.com>

(btw it would be better to cc the btrfs list for btrfs specific
changes to xfstests)

> ---
>  tests/btrfs/048 | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/tests/btrfs/048 b/tests/btrfs/048
> index c2cb4a63b095..4a36303632eb 100755
> --- a/tests/btrfs/048
> +++ b/tests/btrfs/048
> @@ -41,6 +41,7 @@ _cleanup()
>  # get standard environment, filters and checks
>  . ./common/rc
>  . ./common/filter
> +. ./common/filter.btrfs
>
>  # real QA test starts here
>  _supported_fs btrfs
> @@ -70,7 +71,8 @@ $BTRFS_UTIL_PROG property set $SCRATCH_MNT label ''
>  $BTRFS_UTIL_PROG property get $SCRATCH_MNT label
>  echo "***"
>  mkdir $SCRATCH_MNT/testdir
> -$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir label
> +$BTRFS_UTIL_PROG property get $SCRATCH_MNT/testdir label 2>&1 |
> +       _filter_btrfs_prop_error label
>  echo "***"
>
>  echo -e "\nTesting subvolume ro property"
> --
> 1.8.4.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

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

* Re: [PATCH 1/2] filter.btrfs: new filter for property messages
  2016-03-03 18:16 ` [PATCH 1/2] filter.btrfs: new filter for property messages David Sterba
@ 2016-03-04  9:31   ` Filipe Manana
  0 siblings, 0 replies; 5+ messages in thread
From: Filipe Manana @ 2016-03-04  9:31 UTC (permalink / raw)
  To: David Sterba; +Cc: fstests

On Thu, Mar 3, 2016 at 6:16 PM, David Sterba <dsterba@suse.com> wrote:
> 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>
Reviewed-by: Filipe Manana <fdmanana@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
>
> --
> To unsubscribe from this list: send the line "unsubscribe fstests" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Filipe David Manana,

"Reasonable men adapt themselves to the world.
 Unreasonable men adapt the world to themselves.
 That's why all progress depends on unreasonable men."

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

end of thread, other threads:[~2016-03-04  9:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-03 18:16 [PATCH 0/2] fstests: fix btrfs/048 failure with newer btrfs-progs David Sterba
2016-03-03 18:16 ` [PATCH 1/2] filter.btrfs: new filter for property messages David Sterba
2016-03-04  9:31   ` 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

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