From 9da4a314a0d0c4722a3e48db88a9f5f9fe1cffb9 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Fri, 29 Jan 2021 12:06:16 +0300 Subject: [PATCH 1/2] iotests/testrunner: fix recognition of python tests We should drop final '\n' before comparing with python3 shebang. Fixes: d74c754c924ca34e90b7c96ce2f5609d82c0e628 Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210129090616.84145-1-vsementsov@virtuozzo.com> Tested-by: Thomas Huth Signed-off-by: Kevin Wolf --- tests/qemu-iotests/testrunner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/qemu-iotests/testrunner.py b/tests/qemu-iotests/testrunner.py index a581be6a29..24b3fba115 100644 --- a/tests/qemu-iotests/testrunner.py +++ b/tests/qemu-iotests/testrunner.py @@ -248,7 +248,7 @@ class TestRunner(ContextManager['TestRunner']): with f_test.open(encoding="utf-8") as f: try: - if f.readline() == '#!/usr/bin/env python3': + if f.readline().rstrip() == '#!/usr/bin/env python3': args.insert(0, self.env.python) except UnicodeDecodeError: # binary test? for future. pass From 4cea90be62f4f15a63e1a8f7d5d0958f79fdf290 Mon Sep 17 00:00:00 2001 From: Vladimir Sementsov-Ogievskiy Date: Fri, 29 Jan 2021 08:13:46 +0300 Subject: [PATCH 2/2] tests/Makefile.include: export PYTHON for check-block.sh check-block.sh called by make check-block rely on PYTHON variable being set. Fixes: f203080bbd9f9e5b31041b1f2afcd6040c5aaec5 Signed-off-by: Vladimir Sementsov-Ogievskiy Message-Id: <20210129051346.56109-1-vsementsov@virtuozzo.com> Tested-by: Thomas Huth Signed-off-by: Kevin Wolf --- tests/Makefile.include | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Makefile.include b/tests/Makefile.include index 3a0524ce74..ceaf3f0d6e 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -138,6 +138,7 @@ check: ifeq ($(CONFIG_TOOLS)$(CONFIG_POSIX),yy) QEMU_IOTESTS_HELPERS-$(CONFIG_LINUX) = tests/qemu-iotests/socket_scm_helper$(EXESUF) check: check-block +export PYTHON check-block: $(SRC_PATH)/tests/check-block.sh qemu-img$(EXESUF) \ qemu-io$(EXESUF) qemu-nbd$(EXESUF) $(QEMU_IOTESTS_HELPERS-y) \ $(filter qemu-system-%, $(ninja-targets))