Re: [kvm-unit-tests PATCH v4 13/13] scripts/run: generalize check

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

 



On Wed, May 11, 2016 at 06:30:43PM +0200, Radim Krčmář wrote:
> config attribute "check" is currently unused and a simpler imlementation
> has better chances of being used.
> 
> Signed-off-by: Radim Krčmář <rkrcmar@xxxxxxxxxx>
> ---
>  v4: new
> 
>  scripts/runtime.bash | 16 +++++-----------
>  1 file changed, 5 insertions(+), 11 deletions(-)
> 
> diff --git a/scripts/runtime.bash b/scripts/runtime.bash
> index c9ab9ba47d81..7f9bf9a2de0e 100644
> --- a/scripts/runtime.bash
> +++ b/scripts/runtime.bash
> @@ -57,17 +57,11 @@ function run()
>          return 2
>      fi
>  
> -    # check a file for a particular value before running a test
> -    # the check line can contain multiple files to check separated by a space
> -    # but each check parameter needs to be of the form <path>=<value>
> -    for check_param in ${check[@]}; do
> -        path=${check_param%%=*}
> -        value=${check_param#*=}
> -        if [ "$path" ] && [ "$(cat $path)" != "$value" ]; then
> -            echo "`SKIP` $1 ($path not equal to $value)"
> -            return 2
> -        fi
> -    done
> +    eval $check || {
> +        echo "skipped $testname (\`$check\` returned $?)" | RUNTIME_log_stderr
> +        echo "`SKIP` $testname (check failed)"
> +        return 77
> +    }
>  
>      last_line=$(premature_failure) && {
>          echo "`SKIP` $1 ($last_line)"
> -- 

Good, except you need to update all the unittests.cfg headers where
check is documented. Maybe something like

 check = <bash-expr>	# check an expression is true before running the test

Thanks,
drew
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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