qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 6/8] Acceptance tests: add the build directory to the syst


From: Wainer dos Santos Moschetta
Subject: Re: [PATCH v7 6/8] Acceptance tests: add the build directory to the system PATH
Date: Thu, 7 Nov 2019 17:46:13 -0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0


On 11/4/19 1:13 PM, Cleber Rosa wrote:
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 17ce583c87..a4bb796a47 100644
--- a/tests/acceptance/avocado_qemu/__init__.py
+++ b/tests/acceptance/avocado_qemu/__init__.py
@@ -110,6 +110,12 @@ class Test(avocado.Test):
          return None
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

Because PATH is changed in a transparent way, wouldn't be better to also self.log.info() that fact?

+        # 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'])

I think PATH should be set only once at class initialization. Perhaps in setUpClass()?

- Wainer

          self._vms = {}
self.arch = self.params.get('arch',




reply via email to

[Prev in Thread] Current Thread [Next in Thread]