All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] btrfs: fix filtering of scratch device in test case 048
@ 2019-04-25  0:24 fdmanana
  2019-04-25  0:37 ` [PATCH v2] " fdmanana
  0 siblings, 1 reply; 4+ messages in thread
From: fdmanana @ 2019-04-25  0:24 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, Filipe Manana

From: Filipe Manana <fdmanana@suse.com>

The recent commit 4529b20e1aa8f9 ("btrfs/048: amend property validation
cases"), does not properly filter the scratch device because the error
messages are sent to stderr and not to stdout, and the pipe filter only
gets input from the stdout of the btrfs utility. We need to redirect the
stderr of the btrfs utility to its stdout.

Further, the golden output had the path "/mnt/scratch" hardcoded, instead
of using SCRATCH_MNT. Fix that as well.

The test was failing on any setup where the scratch device is not mounted
at "/mnt/scratch", like this:

$ ./check btrfs/048
FSTYP         -- btrfs
PLATFORM      -- Linux/x86_64 debian5 5.0.0-btrfs-next-46
MKFS_OPTIONS  -- /dev/sdc
MOUNT_OPTIONS -- /dev/sdc /home/fdmanana/btrfs-tests/scratch_1

btrfs/048 1s ... - output mismatch (see /home/fdmanana/git/hub/xfstests/results//btrfs/048.out.bad)
    --- tests/btrfs/048.out	2019-04-22 12:52:00.937610318 +0100
    +++ /home/fdmanana/git/hub/xfstests/results//btrfs/048.out.bad	2019-04-25 01:14:43.077297630 +0100
    @@ -78,17 +78,17 @@
     compression=lzo

     Testing argument validation, should fail
    -ERROR: failed to set compression for /mnt/scratch: Invalid argument
    +ERROR: failed to set compression for /home/fdmanana/btrfs-tests/scratch_1: Invalid argument
     ***
    -ERROR: failed to set compression for /mnt/scratch: Invalid argument
    ...
    (Run 'diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/048.out /home/fdmanana/git/hub/xfstests/results//btrfs/048.out.bad'  to see the entire diff)
Ran: btrfs/048
Failures: btrfs/048
Failed 1 of 1 tests

$ diff -u /home/fdmanana/git/hub/xfstests/tests/btrfs/048.out /home/fdmanana/git/hub/xfstests/results//btrfs/048.out.bad
--- /home/fdmanana/git/hub/xfstests/tests/btrfs/048.out	2019-04-22 12:52:00.937610318 +0100
+++ /home/fdmanana/git/hub/xfstests/results//btrfs/048.out.bad	2019-04-25 01:14:43.077297630 +0100
@@ -78,17 +78,17 @@
 compression=lzo

 Testing argument validation, should fail
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for /home/fdmanana/btrfs-tests/scratch_1: Invalid argument
 ***
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for /home/fdmanana/btrfs-tests/scratch_1: Invalid argument
 ***
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for /home/fdmanana/btrfs-tests/scratch_1: Invalid argument

 Testing if property is persistent across failed validation
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for /home/fdmanana/btrfs-tests/scratch_1: Invalid argument
 compression=lzo

 Testing generation is unchanged after failed validation
 generation		7
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for /home/fdmanana/btrfs-tests/scratch_1: Invalid argument
 generation		7

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 tests/btrfs/048     | 10 +++++-----
 tests/btrfs/048.out | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/btrfs/048 b/tests/btrfs/048
index f6de0b8c..8bb10a90 100755
--- a/tests/btrfs/048
+++ b/tests/btrfs/048
@@ -208,21 +208,21 @@ touch $SCRATCH_MNT/sv1/file2
 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression
 
 echo -e "\nTesting argument validation, should fail"
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' 2>&1 | _filter_scratch
 echo "***"
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' 2>&1 | _filter_scratch
 echo "***"
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' 2>&1 | _filter_scratch
 
 echo -e "\nTesting if property is persistent across failed validation"
 $BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo'
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' 2>&1 | _filter_scratch
 $BTRFS_UTIL_PROG property get $SCRATCH_MNT compression
 
 echo -e "\nTesting generation is unchanged after failed validation"
 $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
 $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation'
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' 2>&1 | _filter_scratch
 $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
 $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation'
 
diff --git a/tests/btrfs/048.out b/tests/btrfs/048.out
index 00f39bc0..16a785a6 100644
--- a/tests/btrfs/048.out
+++ b/tests/btrfs/048.out
@@ -78,17 +78,17 @@ compression=lzo
 compression=lzo
 
 Testing argument validation, should fail
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 ***
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 ***
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 
 Testing if property is persistent across failed validation
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 compression=lzo
 
 Testing generation is unchanged after failed validation
 generation		7
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 generation		7
-- 
2.11.0


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

* [PATCH v2] btrfs: fix filtering of scratch device in test case 048
  2019-04-25  0:24 [PATCH] btrfs: fix filtering of scratch device in test case 048 fdmanana
@ 2019-04-25  0:37 ` fdmanana
  2019-04-25  2:10   ` Anand Jain
  2019-04-26  3:11   ` Eryu Guan
  0 siblings, 2 replies; 4+ messages in thread
From: fdmanana @ 2019-04-25  0:37 UTC (permalink / raw)
  To: fstests; +Cc: linux-btrfs, Filipe Manana

From: Filipe Manana <fdmanana@suse.com>

The recent commit 4529b20e1aa8f9 ("btrfs/048: amend property validation
cases"), does not properly filter the scratch device because the error
messages are sent to stderr and not to stdout, and the pipe filter only
gets input from the stdout of the btrfs utility. We need to redirect the
stderr of the btrfs utility to its stdout.

Further, the golden output had the path "/mnt/scratch" hardcoded, instead
of using SCRATCH_MNT. Fix that as well.

The test was failing on any setup where the scratch device is not mounted
at "/mnt/scratch".

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

V2: Fix the formatting of the patch, which was causing git apply / path to fail.

 tests/btrfs/048     | 10 +++++-----
 tests/btrfs/048.out | 10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/btrfs/048 b/tests/btrfs/048
index f6de0b8c..8bb10a90 100755
--- a/tests/btrfs/048
+++ b/tests/btrfs/048
@@ -208,21 +208,21 @@ touch $SCRATCH_MNT/sv1/file2
 $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression
 
 echo -e "\nTesting argument validation, should fail"
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' 2>&1 | _filter_scratch
 echo "***"
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' 2>&1 | _filter_scratch
 echo "***"
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' 2>&1 | _filter_scratch
 
 echo -e "\nTesting if property is persistent across failed validation"
 $BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo'
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' 2>&1 | _filter_scratch
 $BTRFS_UTIL_PROG property get $SCRATCH_MNT compression
 
 echo -e "\nTesting generation is unchanged after failed validation"
 $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
 $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation'
-$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch
+$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' 2>&1 | _filter_scratch
 $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
 $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation'
 
diff --git a/tests/btrfs/048.out b/tests/btrfs/048.out
index 00f39bc0..16a785a6 100644
--- a/tests/btrfs/048.out
+++ b/tests/btrfs/048.out
@@ -78,17 +78,17 @@ compression=lzo
 compression=lzo
 
 Testing argument validation, should fail
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 ***
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 ***
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 
 Testing if property is persistent across failed validation
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 compression=lzo
 
 Testing generation is unchanged after failed validation
 generation		7
-ERROR: failed to set compression for /mnt/scratch: Invalid argument
+ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
 generation		7
-- 
2.11.0


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

* Re: [PATCH v2] btrfs: fix filtering of scratch device in test case 048
  2019-04-25  0:37 ` [PATCH v2] " fdmanana
@ 2019-04-25  2:10   ` Anand Jain
  2019-04-26  3:11   ` Eryu Guan
  1 sibling, 0 replies; 4+ messages in thread
From: Anand Jain @ 2019-04-25  2:10 UTC (permalink / raw)
  To: fdmanana; +Cc: fstests, linux-btrfs, Filipe Manana


> On 25 Apr 2019, at 8:37 AM, fdmanana@kernel.org wrote:
> 
> From: Filipe Manana <fdmanana@suse.com>
> 
> The recent commit 4529b20e1aa8f9 ("btrfs/048: amend property validation
> cases"), does not properly filter the scratch device because the error
> messages are sent to stderr and not to stdout, and the pipe filter only
> gets input from the stdout of the btrfs utility. We need to redirect the
> stderr of the btrfs utility to its stdout.
> 
> Further, the golden output had the path "/mnt/scratch" hardcoded, instead
> of using SCRATCH_MNT. Fix that as well.
> 
> The test was failing on any setup where the scratch device is not mounted
> at "/mnt/scratch".
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Thanks!

Reviewed-by: Anand Jain <anand.jain@oracle.com>


> ---
> 
> V2: Fix the formatting of the patch, which was causing git apply / path to fail.
> 
> tests/btrfs/048     | 10 +++++-----
> tests/btrfs/048.out | 10 +++++-----
> 2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/tests/btrfs/048 b/tests/btrfs/048
> index f6de0b8c..8bb10a90 100755
> --- a/tests/btrfs/048
> +++ b/tests/btrfs/048
> @@ -208,21 +208,21 @@ touch $SCRATCH_MNT/sv1/file2
> $BTRFS_UTIL_PROG property get $SCRATCH_MNT/sv1/file2 compression
> 
> echo -e "\nTesting argument validation, should fail"
> -$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch
> +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' 2>&1 | _filter_scratch
> echo "***"
> -$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch
> +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' 2>&1 | _filter_scratch
> echo "***"
> -$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' | _filter_scratch
> +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zst' 2>&1 | _filter_scratch
> 
> echo -e "\nTesting if property is persistent across failed validation"
> $BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lzo'
> -$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' | _filter_scratch
> +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'zli' 2>&1 | _filter_scratch
> $BTRFS_UTIL_PROG property get $SCRATCH_MNT compression
> 
> echo -e "\nTesting generation is unchanged after failed validation"
> $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
> $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation'
> -$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' | _filter_scratch
> +$BTRFS_UTIL_PROG property set $SCRATCH_MNT compression 'lz' 2>&1 | _filter_scratch
> $BTRFS_UTIL_PROG filesystem sync $SCRATCH_MNT
> $BTRFS_UTIL_PROG inspect-internal dump-super $SCRATCH_DEV | grep '^generation'
> 
> diff --git a/tests/btrfs/048.out b/tests/btrfs/048.out
> index 00f39bc0..16a785a6 100644
> --- a/tests/btrfs/048.out
> +++ b/tests/btrfs/048.out
> @@ -78,17 +78,17 @@ compression=lzo
> compression=lzo
> 
> Testing argument validation, should fail
> -ERROR: failed to set compression for /mnt/scratch: Invalid argument
> +ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
> ***
> -ERROR: failed to set compression for /mnt/scratch: Invalid argument
> +ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
> ***
> -ERROR: failed to set compression for /mnt/scratch: Invalid argument
> +ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
> 
> Testing if property is persistent across failed validation
> -ERROR: failed to set compression for /mnt/scratch: Invalid argument
> +ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
> compression=lzo
> 
> Testing generation is unchanged after failed validation
> generation		7
> -ERROR: failed to set compression for /mnt/scratch: Invalid argument
> +ERROR: failed to set compression for SCRATCH_MNT: Invalid argument
> generation		7
> -- 
> 2.11.0
> 


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

* Re: [PATCH v2] btrfs: fix filtering of scratch device in test case 048
  2019-04-25  0:37 ` [PATCH v2] " fdmanana
  2019-04-25  2:10   ` Anand Jain
@ 2019-04-26  3:11   ` Eryu Guan
  1 sibling, 0 replies; 4+ messages in thread
From: Eryu Guan @ 2019-04-26  3:11 UTC (permalink / raw)
  To: fdmanana; +Cc: fstests, linux-btrfs, Filipe Manana

On Thu, Apr 25, 2019 at 01:37:09AM +0100, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> The recent commit 4529b20e1aa8f9 ("btrfs/048: amend property validation
> cases"), does not properly filter the scratch device because the error
> messages are sent to stderr and not to stdout, and the pipe filter only
> gets input from the stdout of the btrfs utility. We need to redirect the
> stderr of the btrfs utility to its stdout.
> 
> Further, the golden output had the path "/mnt/scratch" hardcoded, instead
> of using SCRATCH_MNT. Fix that as well.
> 
> The test was failing on any setup where the scratch device is not mounted
> at "/mnt/scratch".
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Thanks for fixing it! Sorry that I missed the issues in review..

Eryu

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

end of thread, other threads:[~2019-04-26  3:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-25  0:24 [PATCH] btrfs: fix filtering of scratch device in test case 048 fdmanana
2019-04-25  0:37 ` [PATCH v2] " fdmanana
2019-04-25  2:10   ` Anand Jain
2019-04-26  3:11   ` Eryu Guan

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.