diff mbox series

[v2,1/3] fstests: change btrfs/197 and btrfs/198 golden output

Message ID 88b11129c00fb9b07e36569b4b5fe823c0a98c39.1712346845.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series fstests: various RAID56 related fixes for btrfs | expand

Commit Message

Josef Bacik April 5, 2024, 7:56 p.m. UTC
Both btrfs/197 and btrfs/198 check several raid types.  We may not have
support for raid5/6 for our available profiles, but we'd like to be able
to test the other profiles.  In order to enable this, update the golden
output to have no output, and simply have the test check for the device
we removed to see if it still exists in the device list output.  This
will allow us to add a check to skip unsupported raid configurations in
our config.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 tests/btrfs/197     |  7 +++++--
 tests/btrfs/197.out | 25 +------------------------
 tests/btrfs/198     |  7 +++++--
 tests/btrfs/198.out | 25 +------------------------
 4 files changed, 12 insertions(+), 52 deletions(-)

Comments

Anand Jain April 9, 2024, 1:02 a.m. UTC | #1
On 4/6/24 03:56, Josef Bacik wrote:
> Both btrfs/197 and btrfs/198 check several raid types.  We may not have
> support for raid5/6 for our available profiles, but we'd like to be able
> to test the other profiles.  In order to enable this, update the golden
> output to have no output, and simply have the test check for the device
> we removed to see if it still exists in the device list output.  This
> will allow us to add a check to skip unsupported raid configurations in
> our config.
> 
> Signed-off-by: Josef Bacik <josef@toxicpanda.com>

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

Thx, Anand


> ---
>   tests/btrfs/197     |  7 +++++--
>   tests/btrfs/197.out | 25 +------------------------
>   tests/btrfs/198     |  7 +++++--
>   tests/btrfs/198.out | 25 +------------------------
>   4 files changed, 12 insertions(+), 52 deletions(-)
> 
> diff --git a/tests/btrfs/197 b/tests/btrfs/197
> index d259fd99..2ce41b32 100755
> --- a/tests/btrfs/197
> +++ b/tests/btrfs/197
> @@ -38,7 +38,7 @@ workout()
>   	raid=$1
>   	device_nr=$2
>   
> -	echo $raid
> +	echo $raid >> $seqres.full
>   	_scratch_dev_pool_get $device_nr
>   	_spare_dev_get
>   
> @@ -62,7 +62,9 @@ workout()
>   	_mount -o degraded $device_2 $SCRATCH_MNT
>   	# Check if missing device is reported as in the .out
>   	$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \
> -						_filter_btrfs_filesystem_show
> +		_filter_btrfs_filesystem_show > $tmp.output 2>&1
> +	cat $tmp.output >> $seqres.full
> +	grep -q "$device_1" $tmp.output && _fail "found stale device"
>   
>   	$BTRFS_UTIL_PROG device remove "$device_1" "$TEST_DIR/$seq.mnt"
>   	$UMOUNT_PROG $TEST_DIR/$seq.mnt
> @@ -77,5 +79,6 @@ workout "raid6" "4"
>   workout "raid10" "4"
>   
>   # success, all done
> +echo "Silence is golden"
>   status=0
>   exit
> diff --git a/tests/btrfs/197.out b/tests/btrfs/197.out
> index 79237b85..3bbd3143 100644
> --- a/tests/btrfs/197.out
> +++ b/tests/btrfs/197.out
> @@ -1,25 +1,2 @@
>   QA output created by 197
> -raid1
> -Label: none  uuid: <UUID>
> -	Total devices <NUM> FS bytes used <SIZE>
> -	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> -	*** Some devices missing
> -
> -raid5
> -Label: none  uuid: <UUID>
> -	Total devices <NUM> FS bytes used <SIZE>
> -	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> -	*** Some devices missing
> -
> -raid6
> -Label: none  uuid: <UUID>
> -	Total devices <NUM> FS bytes used <SIZE>
> -	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> -	*** Some devices missing
> -
> -raid10
> -Label: none  uuid: <UUID>
> -	Total devices <NUM> FS bytes used <SIZE>
> -	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> -	*** Some devices missing
> -
> +Silence is golden
> diff --git a/tests/btrfs/198 b/tests/btrfs/198
> index 7d23ffce..a326a8ca 100755
> --- a/tests/btrfs/198
> +++ b/tests/btrfs/198
> @@ -28,7 +28,7 @@ workout()
>   	raid=$1
>   	device_nr=$2
>   
> -	echo $raid
> +	echo $raid >> $seqres.full
>   	_scratch_dev_pool_get $device_nr
>   
>   	_scratch_pool_mkfs "-d$raid -m$raid" >> $seqres.full 2>&1 || \
> @@ -46,7 +46,9 @@ workout()
>   	_mount -o degraded $device_2 $SCRATCH_MNT
>   	# Check if missing device is reported as in the 196.out
>   	$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \
> -						_filter_btrfs_filesystem_show
> +		_filter_btrfs_filesystem_show > $tmp.output 2>&1
> +	cat $tmp.output >> $seqres.full
> +	grep -q "$device_1" $tmp.output && _fail "found stale device"
>   
>   	_scratch_unmount
>   	_scratch_dev_pool_put
> @@ -58,5 +60,6 @@ workout "raid6" "4"
>   workout "raid10" "4"
>   
>   # success, all done
> +echo "Silence is golden"
>   status=0
>   exit
> diff --git a/tests/btrfs/198.out b/tests/btrfs/198.out
> index af904a39..cb4c7854 100644
> --- a/tests/btrfs/198.out
> +++ b/tests/btrfs/198.out
> @@ -1,25 +1,2 @@
>   QA output created by 198
> -raid1
> -Label: none  uuid: <UUID>
> -	Total devices <NUM> FS bytes used <SIZE>
> -	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> -	*** Some devices missing
> -
> -raid5
> -Label: none  uuid: <UUID>
> -	Total devices <NUM> FS bytes used <SIZE>
> -	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> -	*** Some devices missing
> -
> -raid6
> -Label: none  uuid: <UUID>
> -	Total devices <NUM> FS bytes used <SIZE>
> -	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> -	*** Some devices missing
> -
> -raid10
> -Label: none  uuid: <UUID>
> -	Total devices <NUM> FS bytes used <SIZE>
> -	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
> -	*** Some devices missing
> -
> +Silence is golden
diff mbox series

Patch

diff --git a/tests/btrfs/197 b/tests/btrfs/197
index d259fd99..2ce41b32 100755
--- a/tests/btrfs/197
+++ b/tests/btrfs/197
@@ -38,7 +38,7 @@  workout()
 	raid=$1
 	device_nr=$2
 
-	echo $raid
+	echo $raid >> $seqres.full
 	_scratch_dev_pool_get $device_nr
 	_spare_dev_get
 
@@ -62,7 +62,9 @@  workout()
 	_mount -o degraded $device_2 $SCRATCH_MNT
 	# Check if missing device is reported as in the .out
 	$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \
-						_filter_btrfs_filesystem_show
+		_filter_btrfs_filesystem_show > $tmp.output 2>&1
+	cat $tmp.output >> $seqres.full
+	grep -q "$device_1" $tmp.output && _fail "found stale device"
 
 	$BTRFS_UTIL_PROG device remove "$device_1" "$TEST_DIR/$seq.mnt"
 	$UMOUNT_PROG $TEST_DIR/$seq.mnt
@@ -77,5 +79,6 @@  workout "raid6" "4"
 workout "raid10" "4"
 
 # success, all done
+echo "Silence is golden"
 status=0
 exit
diff --git a/tests/btrfs/197.out b/tests/btrfs/197.out
index 79237b85..3bbd3143 100644
--- a/tests/btrfs/197.out
+++ b/tests/btrfs/197.out
@@ -1,25 +1,2 @@ 
 QA output created by 197
-raid1
-Label: none  uuid: <UUID>
-	Total devices <NUM> FS bytes used <SIZE>
-	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-	*** Some devices missing
-
-raid5
-Label: none  uuid: <UUID>
-	Total devices <NUM> FS bytes used <SIZE>
-	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-	*** Some devices missing
-
-raid6
-Label: none  uuid: <UUID>
-	Total devices <NUM> FS bytes used <SIZE>
-	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-	*** Some devices missing
-
-raid10
-Label: none  uuid: <UUID>
-	Total devices <NUM> FS bytes used <SIZE>
-	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-	*** Some devices missing
-
+Silence is golden
diff --git a/tests/btrfs/198 b/tests/btrfs/198
index 7d23ffce..a326a8ca 100755
--- a/tests/btrfs/198
+++ b/tests/btrfs/198
@@ -28,7 +28,7 @@  workout()
 	raid=$1
 	device_nr=$2
 
-	echo $raid
+	echo $raid >> $seqres.full
 	_scratch_dev_pool_get $device_nr
 
 	_scratch_pool_mkfs "-d$raid -m$raid" >> $seqres.full 2>&1 || \
@@ -46,7 +46,9 @@  workout()
 	_mount -o degraded $device_2 $SCRATCH_MNT
 	# Check if missing device is reported as in the 196.out
 	$BTRFS_UTIL_PROG filesystem show -m $SCRATCH_MNT | \
-						_filter_btrfs_filesystem_show
+		_filter_btrfs_filesystem_show > $tmp.output 2>&1
+	cat $tmp.output >> $seqres.full
+	grep -q "$device_1" $tmp.output && _fail "found stale device"
 
 	_scratch_unmount
 	_scratch_dev_pool_put
@@ -58,5 +60,6 @@  workout "raid6" "4"
 workout "raid10" "4"
 
 # success, all done
+echo "Silence is golden"
 status=0
 exit
diff --git a/tests/btrfs/198.out b/tests/btrfs/198.out
index af904a39..cb4c7854 100644
--- a/tests/btrfs/198.out
+++ b/tests/btrfs/198.out
@@ -1,25 +1,2 @@ 
 QA output created by 198
-raid1
-Label: none  uuid: <UUID>
-	Total devices <NUM> FS bytes used <SIZE>
-	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-	*** Some devices missing
-
-raid5
-Label: none  uuid: <UUID>
-	Total devices <NUM> FS bytes used <SIZE>
-	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-	*** Some devices missing
-
-raid6
-Label: none  uuid: <UUID>
-	Total devices <NUM> FS bytes used <SIZE>
-	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-	*** Some devices missing
-
-raid10
-Label: none  uuid: <UUID>
-	Total devices <NUM> FS bytes used <SIZE>
-	devid <DEVID> size <SIZE> used <SIZE> path SCRATCH_DEV
-	*** Some devices missing
-
+Silence is golden