All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: John Snow <jsnow@redhat.com>
Subject: [PULL 17/21] tests/vm: allow running tests in an unconfigured source tree
Date: Thu, 16 Jun 2022 10:32:05 +0200	[thread overview]
Message-ID: <20220616083209.117397-18-pbonzini@redhat.com> (raw)
In-Reply-To: <20220616083209.117397-1-pbonzini@redhat.com>

tests/vm/Makefile.include used to assume that it could run in an unconfigured
source tree, and Cirrus CI relies on that.  It was however broken by commit
f4c66f1705 ("tests: use tests/venv to run basevm.py-based scripts", 2022-06-06),
which co-opted the virtual environment being used by avocado tests
to also run the basevm.py tests.

For now, reintroduce the usage of qemu.qmp from the source directory, but
without the sys.path() hacks.  The CI configuration can be changed to
install the package via pip when qemu.qmp is removed from the source tree.

Cc: John Snow <jsnow@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/vm/Makefile.include | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index 588bc999cc..5f5b1fbfe6 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -1,8 +1,17 @@
 # Makefile for VM tests
 
-.PHONY: vm-build-all vm-clean-all
+# Hack to allow running in an unconfigured build tree
+ifeq ($(wildcard $(SRC_PATH)/config-host.mak),)
+VM_PYTHON = PYTHONPATH=$(SRC_PATH)/python /usr/bin/env python3
+VM_VENV =
+HOST_ARCH := $(shell uname -m)
+else
+VM_PYTHON = $(TESTS_PYTHON)
+VM_VENV = check-venv
+HOST_ARCH = $(ARCH)
+endif
 
-HOST_ARCH = $(if $(ARCH),$(ARCH),$(shell uname -m))
+.PHONY: vm-build-all vm-clean-all
 
 EFI_AARCH64 = $(wildcard $(BUILD_DIR)/pc-bios/edk2-aarch64-code.fd)
 
@@ -85,10 +94,10 @@ vm-clean-all:
 $(IMAGES_DIR)/%.img:	$(SRC_PATH)/tests/vm/% \
 			$(SRC_PATH)/tests/vm/basevm.py \
 			$(SRC_PATH)/tests/vm/Makefile.include \
-			check-venv
+			$(VM_VENV)
 	@mkdir -p $(IMAGES_DIR)
 	$(call quiet-command, \
-		$(TESTS_PYTHON) $< \
+		$(VM_PYTHON) $< \
 		$(if $(V)$(DEBUG), --debug) \
 		$(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \
 		$(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \
@@ -100,11 +109,10 @@ $(IMAGES_DIR)/%.img:	$(SRC_PATH)/tests/vm/% \
 		--build-image $@, \
 		"  VM-IMAGE $*")
 
-
 # Build in VM $(IMAGE)
-vm-build-%: $(IMAGES_DIR)/%.img check-venv
+vm-build-%: $(IMAGES_DIR)/%.img $(VM_VENV)
 	$(call quiet-command, \
-		$(TESTS_PYTHON) $(SRC_PATH)/tests/vm/$* \
+		$(VM_PYTHON) $(SRC_PATH)/tests/vm/$* \
 		$(if $(V)$(DEBUG), --debug) \
 		$(if $(DEBUG), --interactive) \
 		$(if $(J),--jobs $(J)) \
@@ -128,9 +136,9 @@ vm-boot-serial-%: $(IMAGES_DIR)/%.img
 		-device virtio-net-pci,netdev=vnet \
 	|| true
 
-vm-boot-ssh-%: $(IMAGES_DIR)/%.img check-venv
+vm-boot-ssh-%: $(IMAGES_DIR)/%.img $(VM_VENV)
 	$(call quiet-command, \
-		$(TESTS_PYTHON) $(SRC_PATH)/tests/vm/$* \
+		$(VM_PYTHON) $(SRC_PATH)/tests/vm/$* \
 		$(if $(J),--jobs $(J)) \
 		$(if $(V)$(DEBUG), --debug) \
 		$(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \
-- 
2.36.1




  parent reply	other threads:[~2022-06-16  8:58 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16  8:31 [PULL 00/21] Statistics, preconfig and cleanup patches for 2022-06-16 Paolo Bonzini
2022-06-16  8:31 ` [PULL 01/21] qmp: Support for querying stats Paolo Bonzini
2022-06-16  8:31 ` [PULL 02/21] kvm: Support for querying fd-based stats Paolo Bonzini
2022-06-16  8:31 ` [PULL 03/21] qmp: add filtering of statistics by target vCPU Paolo Bonzini
2022-06-16  8:31 ` [PULL 04/21] cutils: add functions for IEC and SI prefixes Paolo Bonzini
2022-06-16  8:31 ` [PULL 05/21] hmp: add basic "info stats" implementation Paolo Bonzini
2022-06-16  8:31 ` [PULL 06/21] qmp: add filtering of statistics by provider Paolo Bonzini
2022-06-16  8:31 ` [PULL 07/21] hmp: " Paolo Bonzini
2022-06-16  8:31 ` [PULL 08/21] qmp: add filtering of statistics by name Paolo Bonzini
2022-06-16  8:31 ` [PULL 09/21] hmp: " Paolo Bonzini
2022-06-16  8:31 ` [PULL 10/21] block: add more commands to preconfig mode Paolo Bonzini
2022-06-16  8:31 ` [PULL 11/21] s390x: simplify virtio_ccw_reset_virtio Paolo Bonzini
2022-06-16  8:32 ` [PULL 12/21] virtio-mmio: stop ioeventfd on legacy reset Paolo Bonzini
2022-06-16  8:32 ` [PULL 13/21] virtio: stop ioeventfd on reset Paolo Bonzini
2022-06-16  8:32 ` [PULL 14/21] virtio-mmio: cleanup reset Paolo Bonzini
2022-06-16  8:32 ` [PULL 15/21] configure: update list of preserved environment variables Paolo Bonzini
2022-06-16  8:32 ` [PULL 16/21] configure: cleanup -fno-pie detection Paolo Bonzini
2022-06-16  8:32 ` Paolo Bonzini [this message]
2022-06-16  8:32 ` [PULL 18/21] build: fix check for -fsanitize-coverage-allowlist Paolo Bonzini
2022-06-16  8:32 ` [PULL 19/21] q35:Enable TSEG only when G_SMRAME and TSEG_EN both enabled Paolo Bonzini
2022-06-16  8:32 ` [PULL 20/21] meson: put cross compiler info in a separate section Paolo Bonzini
2022-06-16  8:32 ` [PULL 21/21] build: include pc-bios/ part in the ROMS variable Paolo Bonzini
2022-06-16 16:14 ` [PULL 00/21] Statistics, preconfig and cleanup patches for 2022-06-16 Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220616083209.117397-18-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.