diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-05 01:18:15 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-12-17 16:07:13 +0300 |
commit | f86d0556ed6040140f3d635b0bb2eeb1c507f818 (patch) | |
tree | bbf8537d5de28d729402c6458d4f67360e3f531b /poky/meta/lib/oeqa/selftest/context.py | |
parent | 5a60ea963172683f7e8dab81bc77d92f12fbd18b (diff) | |
download | openbmc-f86d0556ed6040140f3d635b0bb2eeb1c507f818.tar.xz |
poky: sumo refresh a4c7d28688..78020fb639
Update poky to sumo HEAD.
Michael Halstead (1):
scripts/runqemu: Replace subprocess.run() for compatibilty
Richard Purdie (35):
scripts/runqemu: Tidy up lock handling code
scripts/runqemu: Improve lockfile handling for python with close_fd=True
oeqa/selftest/signing: Skip tests if gpg isn't found
oeqa/selftest/signing: Allow tests not to need gpg on the host
oeqa/selftest/signing: Use do_populate_lic target instead of do_package
oeqa/selftest/case: Use bb.utils.remove() instead of shutil.remove()
oeqa/selftest/buildoptions: Improve ccache test failure output
oeqa/utils/commands: Add extra qemu failure logging
oeqa/utils/qemurunner: Fix python ResourceWarning for unclosed file
oeqa/utils/commands: Avoid log message duplication
oeqa/qemurunner: Remove resource python warnings
oeqa/selftest/buildoptions: Improve ccache test
oeqa/selftest/buildoptions: Ensure diskmon tests run consistently
oeqa/selftest/runqemu: Improve testcase failure handling
oeqa/utils/qemurunner: Avoid tracebacks on closed files
oeqa/loader: Fix deprecation warning
oeqa/utils/commands: Avoid unclosed file warnings
oeqa/selftest/context: Replace deprecated imp module usage
oeqa/utils/qemurunner.py: Fix python regex warnings
oeqa/selftest/context: Improve log file handling
oeqa/core/runner: Improve test case comparision
oeqa/runner: Ensure we don't print misleading results output
oeqa/core/threaded: Remove in favour of using concurrenttests
oeqa/runner: Simplify code
oeqa: Remove xmlrunner
oeqa/runtime/ptest: Inject results+logs into stored json results file
oeqa/runner: Always show a summary of success/fail/error/skip counts
oeqa/runner: Sort the test result output by result class
oeqa/selftest: Improvements to the json logging
oeqa/utils/metadata: Allow to function without the git module
image-buildinfo,oeqa/selftest/containerimage: Ensure image-buildinfo doesn't break tests
oeqa/selftest/esdk: Ensure parent directory exists
oeqa/selftest/esdk: Fix typo causing test failure
testimage: Improvements to the json logging
testsdk: Improvements to the json logging
Ross Burton (3):
oeqa/oelib/path: don't leak temporary directories
oeqa: don't litter /tmp with temporary directories
oeqa/selftest/esdk: run selftest inside workdir not /tmp
Scott Rifenbark (1):
documentation: Prepared for 2.5.2 document release
Stefan Lendl (1):
default-versions.inc: Make PREFERRED_VERSION_openssl* overwritable
Yeoh Ee Peng (6):
oeqa/core/runner: refactor for OEQA to write json testresult
oeqa/core/runner: write testresult to json files
oeqa/selftest/context: write testresult to json files
testimage.bbclass: write testresult to json files
testsdk.bbclass: write testresult to json files
oeqa/selftest: Standardize json logging output directory
Change-Id: I3c8123930c8c3441126c1e81b3bbbde9f2b126f2
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'poky/meta/lib/oeqa/selftest/context.py')
-rw-r--r-- | poky/meta/lib/oeqa/selftest/context.py | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/poky/meta/lib/oeqa/selftest/context.py b/poky/meta/lib/oeqa/selftest/context.py index 9e90d3c25..9a56888c2 100644 --- a/poky/meta/lib/oeqa/selftest/context.py +++ b/poky/meta/lib/oeqa/selftest/context.py @@ -5,7 +5,7 @@ import os import time import glob import sys -import imp +import importlib import signal from shutil import copyfile from random import choice @@ -96,11 +96,17 @@ class OESelftestTestContextExecutor(OETestContextExecutor): return cases_paths def _process_args(self, logger, args): - args.output_log = '%s-results-%s.log' % (self.name, - time.strftime("%Y%m%d%H%M%S")) + + args.test_start_time = time.strftime("%Y%m%d%H%M%S") args.test_data_file = None args.CASES_PATHS = None + bbvars = get_bb_vars() + logdir = os.environ.get("BUILDDIR") + if 'LOG_DIR' in bbvars: + logdir = bbvars['LOG_DIR'] + args.output_log = logdir + '/%s-results-%s.log' % (self.name, args.test_start_time) + super(OESelftestTestContextExecutor, self)._process_args(logger, args) if args.list_modules: @@ -110,7 +116,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): elif args.list_tests: args.list_tests = 'name' - self.tc_kwargs['init']['td'] = get_bb_vars() + self.tc_kwargs['init']['td'] = bbvars self.tc_kwargs['init']['machines'] = self._get_available_machines() builddir = os.environ.get("BUILDDIR") @@ -174,7 +180,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): self.tc.logger.info("\t%s" % l) sys.path.extend(layer_libdirs) - imp.reload(oeqa.selftest) + importlib.reload(oeqa.selftest) _check_required_env_variables(["BUILDDIR"]) _check_presence_meta_selftest() @@ -196,6 +202,28 @@ class OESelftestTestContextExecutor(OETestContextExecutor): self.tc.logger.info("Running bitbake -p") runCmd("bitbake -p") + def get_json_result_dir(self, args): + json_result_dir = os.path.join(self.tc.td["LOG_DIR"], 'oeqa') + if "OEQA_JSON_RESULT_DIR" in self.tc.td: + json_result_dir = self.tc.td["OEQA_JSON_RESULT_DIR"] + + return json_result_dir + + def get_configuration(self, args): + import platform + from oeqa.utils.metadata import metadata_from_bb + metadata = metadata_from_bb() + configuration = {'TEST_TYPE': 'oeselftest', + 'STARTTIME': args.test_start_time, + 'MACHINE': self.tc.td["MACHINE"], + 'HOST_DISTRO': ('-'.join(platform.linux_distribution())).replace(' ', '-'), + 'HOST_NAME': metadata['hostname'], + 'LAYERS': metadata['layers']} + return configuration + + def get_result_id(self, configuration): + return '%s_%s_%s_%s' % (configuration['TEST_TYPE'], configuration['HOST_DISTRO'], configuration['MACHINE'], configuration['STARTTIME']) + def _internal_run(self, logger, args): self.module_paths = self._get_cases_paths( self.tc_kwargs['init']['td']['BBPATH'].split(':')) @@ -212,7 +240,10 @@ class OESelftestTestContextExecutor(OETestContextExecutor): else: self._pre_run() rc = self.tc.runTests(**self.tc_kwargs['run']) - rc.logDetails() + configuration = self.get_configuration(args) + rc.logDetails(self.get_json_result_dir(args), + configuration, + self.get_result_id(configuration)) rc.logSummary(self.name) return rc @@ -270,7 +301,7 @@ class OESelftestTestContextExecutor(OETestContextExecutor): output_link = os.path.join(os.path.dirname(args.output_log), "%s-results.log" % self.name) - if os.path.exists(output_link): + if os.path.lexists(output_link): os.remove(output_link) os.symlink(args.output_log, output_link) |