iotests: Require Python 3.6 or later
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.6 is used for the build. Suggested-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
This commit is contained in:
parent
92b22e7b17
commit
c69719fcad
|
@ -633,6 +633,12 @@ then
|
||||||
export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
|
export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
python_usable=false
|
||||||
|
if $PYTHON -c 'import sys; sys.exit(0 if sys.version_info >= (3,6) else 1)'
|
||||||
|
then
|
||||||
|
python_usable=true
|
||||||
|
fi
|
||||||
|
|
||||||
default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
|
default_machine=$($QEMU_PROG -machine help | sed -n '/(default)/ s/ .*//p')
|
||||||
default_alias_machine=$($QEMU_PROG -machine help | \
|
default_alias_machine=$($QEMU_PROG -machine help | \
|
||||||
sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
|
sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
|
||||||
|
@ -809,7 +815,12 @@ do
|
||||||
start=$(_wallclock)
|
start=$(_wallclock)
|
||||||
|
|
||||||
if [ "$(head -n 1 "$source_iotests/$seq")" == "#!/usr/bin/env python" ]; then
|
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
|
else
|
||||||
run_command="./$seq"
|
run_command="./$seq"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue