mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
btrfs: fix filtering of scratch device in test case 048
The recent commit 4529b20e1a ("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>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
+5
-5
@@ -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'
|
||||
|
||||
|
||||
+5
-5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user