From 59d100243d23451e66d2274d34edab7be6dab473 Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Tue, 10 Sep 2024 09:58:20 +0200 Subject: tests/functional: Fix bad usage of has_cmd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Message-ID: <20240910075820.51346-1-thuth@redhat.com> Reviewed-by: Daniel P. Berrangé Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Thomas Huth --- tests/functional/qemu_test/tesseract.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/functional/qemu_test/tesseract.py') diff --git a/tests/functional/qemu_test/tesseract.py b/tests/functional/qemu_test/tesseract.py index c4087b7..db44102 100644 --- a/tests/functional/qemu_test/tesseract.py +++ b/tests/functional/qemu_test/tesseract.py @@ -11,7 +11,8 @@ import logging from . import has_cmd, run_cmd def tesseract_available(expected_version): - if not has_cmd('tesseract'): + (has_tesseract, _) = has_cmd('tesseract') + if not has_tesseract: return False (stdout, stderr, ret) = run_cmd([ 'tesseract', '--version']) if ret: -- cgit v1.1