[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/29] tests: use tests/venv to run basevm.py-based scripts
From: |
Paolo Bonzini |
Subject: |
[PULL 24/29] tests: use tests/venv to run basevm.py-based scripts |
Date: |
Mon, 6 Jun 2022 16:36:39 +0200 |
From: John Snow <jsnow@redhat.com>
This patch co-opts the virtual environment being used by avocado tests
to also run the basevm.py tests. This is being done in preparation for
for the qemu.qmp package being removed from qemu.git.
As part of the change, remove any sys.path() hacks and treat "qemu" as a
normal third-party import.
Signed-off-by: John Snow <jsnow@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220526000921.1581503-8-jsnow@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
tests/vm/Makefile.include | 13 +++++++------
tests/vm/basevm.py | 6 +++---
2 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/tests/vm/Makefile.include b/tests/vm/Makefile.include
index ae91f5043e..588bc999cc 100644
--- a/tests/vm/Makefile.include
+++ b/tests/vm/Makefile.include
@@ -84,10 +84,11 @@ vm-clean-all:
$(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \
$(SRC_PATH)/tests/vm/basevm.py \
- $(SRC_PATH)/tests/vm/Makefile.include
+ $(SRC_PATH)/tests/vm/Makefile.include \
+ check-venv
@mkdir -p $(IMAGES_DIR)
$(call quiet-command, \
- $(PYTHON) $< \
+ $(TESTS_PYTHON) $< \
$(if $(V)$(DEBUG), --debug) \
$(if $(GENISOIMAGE),--genisoimage $(GENISOIMAGE)) \
$(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \
@@ -101,9 +102,9 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \
# Build in VM $(IMAGE)
-vm-build-%: $(IMAGES_DIR)/%.img
+vm-build-%: $(IMAGES_DIR)/%.img check-venv
$(call quiet-command, \
- $(PYTHON) $(SRC_PATH)/tests/vm/$* \
+ $(TESTS_PYTHON) $(SRC_PATH)/tests/vm/$* \
$(if $(V)$(DEBUG), --debug) \
$(if $(DEBUG), --interactive) \
$(if $(J),--jobs $(J)) \
@@ -127,9 +128,9 @@ vm-boot-serial-%: $(IMAGES_DIR)/%.img
-device virtio-net-pci,netdev=vnet \
|| true
-vm-boot-ssh-%: $(IMAGES_DIR)/%.img
+vm-boot-ssh-%: $(IMAGES_DIR)/%.img check-venv
$(call quiet-command, \
- $(PYTHON) $(SRC_PATH)/tests/vm/$* \
+ $(TESTS_PYTHON) $(SRC_PATH)/tests/vm/$* \
$(if $(J),--jobs $(J)) \
$(if $(V)$(DEBUG), --debug) \
$(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 254e11c932..d7d0413df3 100644
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -18,9 +18,6 @@
import logging
import time
import datetime
-sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
-from qemu.machine import QEMUMachine
-from qemu.utils import get_info_usernet_hostfwd_port, kvm_available
import subprocess
import hashlib
import argparse
@@ -31,6 +28,9 @@
import traceback
import shlex
+from qemu.machine import QEMUMachine
+from qemu.utils import get_info_usernet_hostfwd_port, kvm_available
+
SSH_KEY_FILE = os.path.join(os.path.dirname(__file__),
"..", "keys", "id_rsa")
SSH_PUB_KEY_FILE = os.path.join(os.path.dirname(__file__),
--
2.36.1
- [PULL 17/29] x86: cpu: fixup number of addressable IDs for logical processors sharing cache, (continued)
- [PULL 17/29] x86: cpu: fixup number of addressable IDs for logical processors sharing cache, Paolo Bonzini, 2022/06/06
- [PULL 18/29] python: update for mypy 0.950, Paolo Bonzini, 2022/06/06
- [PULL 01/29] target/i386/tcg: Fix masking of real-mode addresses with A20 bit, Paolo Bonzini, 2022/06/06
- [PULL 08/29] replay: rewrite async event handling, Paolo Bonzini, 2022/06/06
- [PULL 15/29] tests/Makefile.include: Fix 'make check-help' output, Paolo Bonzini, 2022/06/06
- [PULL 20/29] tests: use python3 as the python executable name, Paolo Bonzini, 2022/06/06
- [PULL 19/29] tests: add "TESTS_PYTHON" variable to Makefile, Paolo Bonzini, 2022/06/06
- [PULL 11/29] docs: move replay docs to docs/system/replay.rst, Paolo Bonzini, 2022/06/06
- [PULL 22/29] tests: add quiet-venv-pip macro, Paolo Bonzini, 2022/06/06
- [PULL 23/29] tests: install "qemu" namespace package into venv, Paolo Bonzini, 2022/06/06
- [PULL 24/29] tests: use tests/venv to run basevm.py-based scripts,
Paolo Bonzini <=
- [PULL 26/29] tests: run 'device-crash-test' from tests/venv, Paolo Bonzini, 2022/06/06
- [PULL 21/29] tests: silence pip upgrade warnings during venv creation, Paolo Bonzini, 2022/06/06
- [PULL 16/29] x86: cpu: make sure number of addressable IDs for processor cores meets the spec, Paolo Bonzini, 2022/06/06
- [PULL 25/29] tests: add python3-venv to debian10.docker, Paolo Bonzini, 2022/06/06
- [PULL 28/29] configure: remove reference to removed option, Paolo Bonzini, 2022/06/06
- [PULL 27/29] regenerate meson-buildoptions.sh, Paolo Bonzini, 2022/06/06
- [PULL 29/29] meson: qga: do not use deprecated meson.build_root(), Paolo Bonzini, 2022/06/06
- [PULL 12/29] tests/avocado: update replay_linux test, Paolo Bonzini, 2022/06/06
- Re: [PULL 00/29] Misc patches for 2022-06-06, Richard Henderson, 2022/06/06