]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
filter.btrfs: new filter for property messages
authorDavid Sterba <dsterba@suse.com>
Wed, 23 Mar 2016 03:35:14 +0000 (14:35 +1100)
committerDave Chinner <david@fromorbit.com>
Wed, 23 Mar 2016 03:35:14 +0000 (14:35 +1100)
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>
Signed-off-by: Dave Chinner <david@fromorbit.com>
common/filter.btrfs

index 9bb64792f14f2953bb680fd5cde60cfcd0ba293e..38045439983423d42dfad8948be060449767cf60 100644 (file)
@@ -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