[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Require Python 3.5 or lat
From: |
Thomas Huth |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH] iotests: Require Python 3.5 or later |
Date: |
Wed, 18 Sep 2019 11:16:02 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 18/09/2019 10.55, Kevin Wolf wrote:
> Running iotests is not required to build QEMU, so we can have stricter
> version requirements for Python here and can make use of new features
> and drop compatibility code earlier.
>
> This makes qemu-iotests skip all Python tests if a Python version before
> 3.5 is used for the build.
>
> Suggested-by: Eduardo Habkost <address@hidden>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> tests/qemu-iotests/check | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)
>
> diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
> index 875399d79f..a68f414d6c 100755
> --- a/tests/qemu-iotests/check
> +++ b/tests/qemu-iotests/check
> @@ -633,6 +633,13 @@ then
> export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
> fi
>
> +# Note that if the Python conditional here evaluates True we will exit
> +# with status 1 which is a shell 'false' value.
> +python_usable=false
> +if ! $PYTHON -c 'import sys; sys.exit(sys.version_info >= (3,5))'; then
> + python_usable=true
> +fi
> +
> default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
> default_alias_machine=$($QEMU_PROG -machine help | \
> sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
> @@ -809,7 +816,12 @@ do
> start=$(_wallclock)
>
> if [ "$(head -n 1 "$source_iotests/$seq")" == "#!/usr/bin/env
> python" ]; then
> - run_command="$PYTHON $seq"
> + if $python_usable; then
> + run_command="$PYTHON $seq"
> + else
> + run_command="false"
> + echo "Unsupported Python version" > $seq.notrun
> + fi
> else
> run_command="./$seq"
> fi
>
Reviewed-by: Thomas Huth <address@hidden>