Re: [kvm-unit-tests PATCH] arch-run: Fix run_qemu return correct error code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 23, 2023 at 12:34:36PM +0800, 任敏敏(联通集团联通数字科技有限公司本部) wrote:
> From: rminmin <renmm6@xxxxxxxxxxxxxx>
> 
> run_qemu should return 0 if logs doesn't
> contain "warning" keyword.

Why? What are you trying to fix?

> 
> Fixes: b2a2aa5d ("arch-run: reduce return code ambiguity")
> Signed-off-by: rminmin <renmm6@xxxxxxxxxxxxxx>
> ---
>  scripts/arch-run.bash | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/arch-run.bash b/scripts/arch-run.bash
> index 51e4b97..9878d32 100644
> --- a/scripts/arch-run.bash
> +++ b/scripts/arch-run.bash
> @@ -61,7 +61,7 @@ run_qemu ()
>                 # Even when ret==1 (unittest success) if we also got stderr
>                 # logs, then we assume a QEMU failure. Otherwise we translate
>                 # status of 1 to 0 (SUCCESS)
> -               if [ -z "$(echo "$errors" | grep -vi warning)" ]; then
> +               if [ -z "$(echo "$errors" | grep -i warning)" ]; then

This will now filter out all the errors, leaving only warnings or nothing.
If you want the check to include warnings, then it should be

 if [ -z "$(echo "$errors")" ]

>                         ret=0
>                 fi
>         fi
> --
> 2.33.0
>

Thanks,
drew



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux