iotests: Use configured python

Currently, QEMU's iotests rely on /usr/bin/env to start the correct
Python (that is, at least Python 2.4, but not 3). On systems where
Python 3 is the default, the user has no clean way of making the iotests
use the correct binary.

This commit makes the iotests use the Python selected by configure.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Max Reitz 2014-05-03 16:47:08 +02:00 committed by Stefan Hajnoczi
parent 65f33bc002
commit f915db07ef
10 changed files with 70 additions and 43 deletions

View file

@ -34,6 +34,13 @@ timestamp=${TIMESTAMP:=false}
# generic initialization
iam=check
# we need common.env
if ! . ./common.env
then
echo "$iam: failed to source common.env"
exit 1
fi
# we need common.config
if ! . ./common.config
then
@ -215,9 +222,16 @@ do
start=`_wallclock`
$timestamp && echo -n " ["`date "+%T"`"]"
[ ! -x $seq ] && chmod u+x $seq # ensure we can run it
if [ "$(head -n 1 $seq)" == "#!/usr/bin/env python" ]; then
run_command="$PYTHON $seq"
else
[ ! -x $seq ] && chmod u+x $seq # ensure we can run it
run_command="./$seq"
fi
MALLOC_PERTURB_=${MALLOC_PERTURB_:-$(($RANDOM % 255 + 1))} \
./$seq >$tmp.out 2>&1
$run_command >$tmp.out 2>&1
sts=$?
$timestamp && _timestamp
stop=`_wallclock`