[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 3/7] Acceptance tests: add the build directory to
From: |
Cleber Rosa |
Subject: |
[Qemu-devel] [PATCH v6 3/7] Acceptance tests: add the build directory to the system PATH |
Date: |
Thu, 6 Jun 2019 17:14:10 -0400 |
So that when binaries such as qemu-img are searched for, those in the
build tree will be favored. As a clarification, SRC_ROOT_DIR is
dependent on the location from where tests are executed, so they are
equal to the build directory if one is being used.
The original motivation is that Avocado libraries such as
avocado.utils.vmimage.get() may use the matching binaries, but it may
also apply to any other binary that test code may eventually attempt
to execute.
Signed-off-by: Cleber Rosa <address@hidden>
---
tests/acceptance/avocado_qemu/__init__.py | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/tests/acceptance/avocado_qemu/__init__.py
b/tests/acceptance/avocado_qemu/__init__.py
index ac59d36a4c..47c57a9221 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -52,6 +52,12 @@ def pick_default_qemu_bin(arch=None):
class Test(avocado.Test):
def setUp(self):
+ # Some utility code uses binaries from the system's PATH. For
+ # instance, avocado.utils.vmimage.get() uses qemu-img, to
+ # create a snapshot image. This is a transparent way of
+ # making sure those utilities find and use binaries on the
+ # build tree by default.
+ os.environ['PATH'] = '%s:%s' % (SRC_ROOT_DIR, os.environ['PATH'])
self._vms = {}
arches = self.tags.get('arch', [])
if len(arches) == 1:
--
2.21.0
- [Qemu-devel] [PATCH v6 0/7] Add "boot_linux" acceptance test, Cleber Rosa, 2019/06/06
- [Qemu-devel] [PATCH v6 2/7] Acceptance tests: keep a stable reference to the QEMU build dir, Cleber Rosa, 2019/06/06
- [Qemu-devel] [PATCH v6 7/7] [RFC]: use Avocado data drainer for console logging, Cleber Rosa, 2019/06/06
- [Qemu-devel] [PATCH v6 1/7] Acceptance tests: use relative location for tests, Cleber Rosa, 2019/06/06
- [Qemu-devel] [PATCH v6 4/7] Acceptance tests: depend on qemu-img, Cleber Rosa, 2019/06/06
- [Qemu-devel] [PATCH v6 6/7] Add "boot_linux" test for aarch64 and virt machine type, Cleber Rosa, 2019/06/06
- [Qemu-devel] [PATCH v6 3/7] Acceptance tests: add the build directory to the system PATH,
Cleber Rosa <=
- [Qemu-devel] [PATCH v6 5/7] Add "boot_linux" test for x86_64 and pc and q35 machine types, Cleber Rosa, 2019/06/06
- Re: [Qemu-devel] [PATCH v6 0/7] Add "boot_linux" acceptance test, no-reply, 2019/06/07