diff options
author | Thomas Huth <thuth@redhat.com> | 2024-09-10 09:58:20 +0200 |
---|---|---|
committer | Thomas Huth <thuth@redhat.com> | 2024-09-11 09:49:12 +0200 |
commit | 59d100243d23451e66d2274d34edab7be6dab473 (patch) | |
tree | 47ac4118d848d625d4a9bc17c184815c3221dd45 /tests/functional/qemu_test/cmd.py | |
parent | 69e4fbd0ea22d8cc6421fe2e9f09dfa4be242ccf (diff) | |
download | qemu-59d100243d23451e66d2274d34edab7be6dab473.zip qemu-59d100243d23451e66d2274d34edab7be6dab473.tar.gz qemu-59d100243d23451e66d2274d34edab7be6dab473.tar.bz2 |
tests/functional: Fix bad usage of has_cmd
has_cmd returns a tuple, not a boolean value. This fixes a crash when
e.g. "tesseract" is not available in the test_m68k_nextcube test.
Reported-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240910075820.51346-1-thuth@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'tests/functional/qemu_test/cmd.py')
-rw-r--r-- | tests/functional/qemu_test/cmd.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/functional/qemu_test/cmd.py b/tests/functional/qemu_test/cmd.py index 3acd617..cbabb1c 100644 --- a/tests/functional/qemu_test/cmd.py +++ b/tests/functional/qemu_test/cmd.py @@ -187,7 +187,7 @@ def get_qemu_img(test): qemu_img = os.path.join(BUILD_DIR, 'qemu-img') if os.path.exists(qemu_img): return qemu_img - if has_cmd('qemu-img'): + (has_system_qemu_img, errmsg) = has_cmd('qemu-img') + if has_system_qemu_img: return 'qemu-img' - test.skipTest('Could not find "qemu-img", which is required to ' - 'create temporary images') + test.skipTest(errmsg) |