Skip to contentSkip to conversation

fstests: fix btrfs/048 failure with newer btrfs-progs

PATCH In review David Sterba 2 participants 5 messages Mar 3, 2016 – Mar 4, 2016

lore
Share & tools
lore
#0 lore raw

cover fstests: fix btrfs/048 failure with newer btrfs-progs

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(-)
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH 1/2 filter.btrfs: new filter for property messages

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.

---
 common/filter.btrfs | 12 ++++++++++++
 1 file changed, 12 insertions(+)
common/filter.btrfs +12 -0
index 9bb64792f14f..380454399834 100644
@@ -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
Signature · 1 line
1.8.4.5
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] filter.btrfs: new filter for property messages

Quoted 6 lines · 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.

Quoted 33 lines
---
 common/filter.btrfs | 12 ++++++++++++
 1 file changed, 12 insertions(+)
common/filter.btrfs +12 -1
index 9bb64792f14f..380454399834 100644
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
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."
#3 lore raw

PATCH 2/2 btrfs/048: user filter for property error messages

In reply to David Sterba
---
 tests/btrfs/048 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/btrfs/048 +3 -1
index c2cb4a63b095..4a36303632eb 100755
@@ -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"
Signature · 1 line
1.8.4.5
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH 2/2] btrfs/048: user filter for property error messages

Quoted 1 line · David Sterba

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

Quoted 33 lines
---
 tests/btrfs/048 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
tests/btrfs/048 +3 -2
index c2cb4a63b095..4a36303632eb 100755
@@ -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 [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 5 lines
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."