diff mbox series

[3/3] generic/551: bail out test if aio-dio-write-verify failed

Message ID 5054cad7e003bfc51bcc3ecd7ba39e389375a6f5.1692688971.git.naohiro.aota@wdc.com (mailing list archive)
State New, archived
Headers show
Series generic/551: improve error reporting and handling | expand

Commit Message

Naohiro Aota Aug. 22, 2023, 7:28 a.m. UTC
When the AIO program failed, it is better to bail out the test to keep the
failed state intact.

Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 tests/generic/551 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Zorro Lang Aug. 29, 2023, 3:52 a.m. UTC | #1
On Tue, Aug 22, 2023 at 04:28:52PM +0900, Naohiro Aota wrote:
> When the AIO program failed, it is better to bail out the test to keep the
> failed state intact.
> 
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---

Good to me,
Reviewed-by: Zorro Lang <zlang@redhat.com>

>  tests/generic/551 | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/generic/551 b/tests/generic/551
> index 2689270aa3dd..58c7f9a516c7 100755
> --- a/tests/generic/551
> +++ b/tests/generic/551
> @@ -56,16 +56,18 @@ do_test()
>  	truncsize=$(((RANDOM * diosize + RANDOM % diosize) % max_io_size_b))
>  
>  	$AIO_TEST -t $truncsize $oper_list $localfile
> -	if [ $? -ne 0 ];then
> +	ret=$?
> +	if [ $ret -ne 0 ];then
>  		echo "$AIO_TEST -t $truncsize $oper_list $localfile"
>  		echo "==========^^ Fail ^^=========="
>  	fi
> +	return $ret
>  }
>  
>  testimes=$((LOAD_FACTOR * 100))
>  while [ $testimes -gt 0 ]; do
>  	echo > $localfile
> -	do_test
> +	do_test || break
>  	((testimes--))
>  done
>  
> -- 
> 2.41.0
>
diff mbox series

Patch

diff --git a/tests/generic/551 b/tests/generic/551
index 2689270aa3dd..58c7f9a516c7 100755
--- a/tests/generic/551
+++ b/tests/generic/551
@@ -56,16 +56,18 @@  do_test()
 	truncsize=$(((RANDOM * diosize + RANDOM % diosize) % max_io_size_b))
 
 	$AIO_TEST -t $truncsize $oper_list $localfile
-	if [ $? -ne 0 ];then
+	ret=$?
+	if [ $ret -ne 0 ];then
 		echo "$AIO_TEST -t $truncsize $oper_list $localfile"
 		echo "==========^^ Fail ^^=========="
 	fi
+	return $ret
 }
 
 testimes=$((LOAD_FACTOR * 100))
 while [ $testimes -gt 0 ]; do
 	echo > $localfile
-	do_test
+	do_test || break
 	((testimes--))
 done