diff mbox series

[2/2] btrfs/192: use append operator to output log replay results to $seqres.full

Message ID 4569296ec5111e78e4507f3b4ac2d982ac452e83.1696333874.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series fstests: make some tests that use fsstress easier to debug | expand

Commit Message

Filipe Manana Oct. 3, 2023, 11:57 a.m. UTC
From: Filipe Manana <fdmanana@suse.com>

After doing log replay, btrfs/192 is overwriting the $seqres.full file
because it uses the plain ">" redirect operator, instead of an append
">>" redirect operator. As a consequence it is overriding the file and
eliminating any previous output that may be useful to debug a test
failure (such as the fsstress seed or mkfs results). So use >> instead
of >.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 tests/btrfs/192 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anand Jain Oct. 3, 2023, 2:06 p.m. UTC | #1
On 03/10/2023 19:57, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
> 
> After doing log replay, btrfs/192 is overwriting the $seqres.full file
> because it uses the plain ">" redirect operator, instead of an append
> ">>" redirect operator. As a consequence it is overriding the file and
> eliminating any previous output that may be useful to debug a test
> failure (such as the fsstress seed or mkfs results). So use >> instead
> of >.
> 
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

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

> ---
>   tests/btrfs/192 | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/btrfs/192 b/tests/btrfs/192
> index 80588a3c..00ea1478 100755
> --- a/tests/btrfs/192
> +++ b/tests/btrfs/192
> @@ -121,7 +121,7 @@ log_writes_fast_replay_check()
>   		--replay $blkdev --check $check_point --fsck "$fsck_command" \
>   		&> $tmp.full_fsck
>   	ret=$?
> -	tail -n 150 $tmp.full_fsck > $seqres.full
> +	tail -n 150 $tmp.full_fsck >> $seqres.full
>   	[ $ret -ne 0 ] && _fail "fsck failed during replay"
>   }
>
diff mbox series

Patch

diff --git a/tests/btrfs/192 b/tests/btrfs/192
index 80588a3c..00ea1478 100755
--- a/tests/btrfs/192
+++ b/tests/btrfs/192
@@ -121,7 +121,7 @@  log_writes_fast_replay_check()
 		--replay $blkdev --check $check_point --fsck "$fsck_command" \
 		&> $tmp.full_fsck
 	ret=$?
-	tail -n 150 $tmp.full_fsck > $seqres.full
+	tail -n 150 $tmp.full_fsck >> $seqres.full
 	[ $ret -ne 0 ] && _fail "fsck failed during replay"
 }