* [meta-virtualization][PATCH 5/4] xtf_minimal oeqa: improve the invocation of xtf-runner
@ 2021-09-01 1:22 Christopher Clark
0 siblings, 0 replies; only message in thread
From: Christopher Clark @ 2021-09-01 1:22 UTC (permalink / raw)
To: meta-virtualization
Cc: bruce.ashfield, cardoe, Bertrand.Marquis, andrew.cooper3,
dpsmith, persaur, scott.davis, adam.schwalm, jdmason
xtf-runner already contains logic to adjust CWD when run so remove the
unnecessary change of directory before running it.
Suggested-by: Andrew Cooper <andrew.cooper3@citrix.com>
Also remove the hardcoding of the path to the XTF directory - resolve it
the same way that the recipe does.
Signed-off-by: Christopher Clark <christopher.clark@starlab.io>
---
This patch applies on top of the related series of 4 XTF patches posted
earlier today.
lib/oeqa/runtime/cases/xtf_minimal.py | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/lib/oeqa/runtime/cases/xtf_minimal.py b/lib/oeqa/runtime/cases/xtf_minimal.py
index 6094cd9..8e2c441 100644
--- a/lib/oeqa/runtime/cases/xtf_minimal.py
+++ b/lib/oeqa/runtime/cases/xtf_minimal.py
@@ -52,14 +52,11 @@ def xtf_runner_exit_status(state):
6: "CRASH",
}[state]
-xtf_rundir = '/usr/libexec/xtf'
-
class XTFMinimalTest(OERuntimeTestCase):
- def query_xtf_cases(self, query_item):
- (status, output) = self.target.run(
- 'cd %s; ./xtf-runner --list %s' % \
- (xtf_rundir, query_item))
+ def query_xtf_cases(self, xtf_runner, query_item):
+ (status, output) = self.target.run('%s --list %s' % \
+ (xtf_runner, query_item))
self.assertTrue(status == 0, msg='XTF runner failed')
populate_case_lines = output.split('\n')
@@ -68,7 +65,7 @@ class XTFMinimalTest(OERuntimeTestCase):
return list(map(lambda x: x.lstrip().rstrip(), populate_case_lines))
- def get_xtf_case_list(self):
+ def get_xtf_case_list(self, xtf_runner):
xtf_cases = []
populate = self.tc.td.get('XTF_TEST_CASES_POPULATE')
@@ -79,7 +76,7 @@ class XTFMinimalTest(OERuntimeTestCase):
populate = DEFAULT_POPULATE
for query_item in populate.split('|'):
- xtf_cases.extend( self.query_xtf_cases(query_item) )
+ xtf_cases.extend( self.query_xtf_cases(xtf_runner, query_item) )
if skip is not None:
for skip_item in skip.split(' '):
@@ -96,9 +93,9 @@ class XTFMinimalTest(OERuntimeTestCase):
self.logger.info('XTF cases: %s' % str(xtf_cases))
return xtf_cases
- def run_xtf_case(self, xtf_case_name):
- (status, output) = self.target.run('cd %s; ./xtf-runner %s' % \
- (xtf_rundir, xtf_case_name))
+ def run_xtf_case(self, xtf_runner, xtf_case_name):
+ (status, output) = self.target.run('%s %s' %
+ (xtf_runner, xtf_case_name))
self.assertTrue(status == 0, msg='XTF test %s failed: %s' % \
(xtf_case_name, xtf_runner_exit_status(status)))
@@ -108,9 +105,12 @@ class XTFMinimalTest(OERuntimeTestCase):
@OEHasPackage(['xen-tools'])
def test_xtf_minimal(self):
- xtf_cases = self.get_xtf_case_list()
+ xtf_runner = os.path.join(self.tc.td.get('libexecdir'), 'xtf',
+ 'xtf-runner')
+
+ xtf_cases = self.get_xtf_case_list(xtf_runner)
for xtf_case_name in xtf_cases:
self.logger.debug('Running XTF case: %s' % xtf_case_name)
- self.run_xtf_case(xtf_case_name)
+ self.run_xtf_case(xtf_runner, xtf_case_name)
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-09-01 1:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-01 1:22 [meta-virtualization][PATCH 5/4] xtf_minimal oeqa: improve the invocation of xtf-runner Christopher Clark
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).