[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 3/4] iotests: Require Python 3.6 or later
From: |
Kevin Wolf |
Subject: |
[PULL v2 3/4] iotests: Require Python 3.6 or later |
Date: |
Wed, 2 Oct 2019 18:18:50 +0200 |
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 <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
Reviewed-by: Thomas Huth <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
tests/qemu-iotests/check | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 875399d79f..588c453a94 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -633,6 +633,12 @@ then
export SOCKET_SCM_HELPER="$build_iotests/socket_scm_helper"
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_alias_machine=$($QEMU_PROG -machine help | \
sed -n "/(alias of $default_machine)/ { s/ .*//p; q; }")
@@ -809,7 +815,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
--
2.20.1
- [PULL v2 0/4] Block layer patches, Kevin Wolf, 2019/10/02
- [PULL v2 1/4] block/snapshot: Restrict set of snapshot nodes, Kevin Wolf, 2019/10/02
- [PULL v2 3/4] iotests: Require Python 3.6 or later,
Kevin Wolf <=
- [PULL v2 4/4] iotests: Remove Python 2 compatibility code, Kevin Wolf, 2019/10/02
- [PULL v2 2/4] iotests: Test internal snapshots with -blockdev, Kevin Wolf, 2019/10/02
- Re: [PULL v2 0/4] Block layer patches, no-reply, 2019/10/02
- Re: [PULL v2 0/4] Block layer patches, Peter Maydell, 2019/10/03