aboutsummaryrefslogtreecommitdiff
path: root/tests/qemu-iotests/iotests.py
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2014-05-24 23:24:55 +0200
committerKevin Wolf <kwolf@redhat.com>2014-06-27 20:00:00 +0200
commite8f8624d3b920de968c56e76691f419b16d1ee4a (patch)
treed40969767d80552df97ef222ace32f3e1f1df5d5 /tests/qemu-iotests/iotests.py
parent6b8aeca574a15668c47296d8e0c4f96c72e63c36 (diff)
iotests: Allow out-of-tree run
As out-of-tree builds are preferred for qemu, running the qemu-iotests in that out-of-tree build should be supported as well. To do so, a symbolic link has to be created pointing to the check script in the source directory. That script will check whether it has been run through a symlink, and if so, will assume it is run in the build tree. All output and temporary operations performed by iotests are then redirected here and, unless specified otherwise by the user, QEMU_PROG etc. will be set to paths appropriate for the build tree. Also, drop making every test case executable if it is not yet, as this would modify the source tree which is not desired for out-of-tree runs and should be fixed in the repository anyway. Signed-off-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'tests/qemu-iotests/iotests.py')
-rw-r--r--tests/qemu-iotests/iotests.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index f6c437c0c3..39a4cfcf4d 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -37,6 +37,7 @@ qemu_args = os.environ.get('QEMU', 'qemu').strip().split(' ')
imgfmt = os.environ.get('IMGFMT', 'raw')
imgproto = os.environ.get('IMGPROTO', 'file')
test_dir = os.environ.get('TEST_DIR', '/var/tmp')
+output_dir = os.environ.get('OUTPUT_DIR', '.')
cachemode = os.environ.get('CACHEMODE')
socket_scm_helper = os.environ.get('SOCKET_SCM_HELPER', 'socket_scm_helper')
@@ -278,7 +279,7 @@ def notrun(reason):
# Each test in qemu-iotests has a number ("seq")
seq = os.path.basename(sys.argv[0])
- open('%s.notrun' % seq, 'wb').write(reason + '\n')
+ open('%s/%s.notrun' % (output_dir, seq), 'wb').write(reason + '\n')
print '%s not run: %s' % (seq, reason)
sys.exit(0)