summaryrefslogtreecommitdiff
path: root/poky/meta/lib/oeqa/runtime/cases
diff options
context:
space:
mode:
authorAndrew Geissler <geissonator@yahoo.com>2019-02-26 03:54:23 +0300
committerAndrew Geissler <geissonator@yahoo.com>2019-02-26 03:55:01 +0300
commit99467dab23c4af816958fdd98218ca613308b402 (patch)
treede31fa6e710794fb8435279b8cc7f48dbe241f26 /poky/meta/lib/oeqa/runtime/cases
parent0c13e4cf5913a901598c0c13ba172ce6e5a7b4f6 (diff)
downloadopenbmc-99467dab23c4af816958fdd98218ca613308b402.tar.xz
poky: refresh thud: b904775c2b..7c76c5d78b
Update poky to thud HEAD. Adam Trhon (1): icecc-env: don't raise error when icecc not installed Alexander Kanavin (1): openssl10: update to 1.0.2q Armin Kuster (1): perl: add testdepends for ssh Bruce Ashfield (2): linux-yocto/4.18: update to v4.18.26 linux-yocto/4.18: update to v4.18.27 Changqing Li (1): checklayer: generate locked-sigs.inc under builddir Dan Dedrick (2): devtool: remove duplicate overrides devtool: improve git repo checks before check_commits logic Daniel Ammann (1): ref-manual: Typo found and fixed. Douglas Royds (2): openssl ptest: Strip build host paths from configdata.pm openssl: Strip perl version from installed ptest configdata.pm file Dustin Bain (1): busybox: update to 1.29.3 Jan Kiszka (1): oe-git-proxy: Avoid resolving NO_PROXY against local files Jens Rehsack (1): avahi: avoid depending on skipped package Jonas Bonn (1): keymaps: tighten package write dependency Kai Kang (1): selftest/wic: update test case test_qemu Khem Raj (3): openssl10: Fix mutliple include assumptions for bn.h in opensslconf.h send-error-report: Use https instead of http protocol multilib_header_wrapper.h: Use #pragma once Leonardo Augusto (1): scripts/lib/wic/engine: Fix cp's target path for ext* filesystems Liu Haitao (1): iw: fix parsing of WEP keys Mingli Yu (1): logrotate.py: restore /etc/logrotate.d/wtmp Otavio Salvador (1): linux-firmware: Bump to 710963f revision Ovidiu Panait (1): ghostscript: Fix CVE-2019-6116 Peter Kjellerstedt (1): libaio: Extend to native Richard Purdie (23): package: Add pkg_postinst_ontarget to PACKAGEVARS oeqa/runtime/ptest: Avoid traceback for tests with no section oeqa/utils/logparser: Simplify ptest log parsing code oeqa/logparser: Further simplification/clarification oeqa/logparser: Reform the ptest results parser oeqa/utils/logparser: Add in support for duration, exitcode and logs by section oeqa/logparser: Improve results handling oeqa/logparser: Various misc cleanups oeqa/runtime/ptest: Ensure OOM errors are logged scripts/contrib/build-perf-test-wrapper.sh: Improve interaction with autobuilder automation scripts/contrib/build-perf-test.sh: Remove it oe-build-perf-report: Allow branch without hostname oe-build-perf-report: Allow commits from different branches oe-build-perf-report: Improve branch comparision handling oe-build-perf-report: Fix missing buildstats comparisions wic/engine: Fix missing parted autobuilder failures lib/buildstats: Improve error message scripts/oe-git-archive: Separate out functionality to library function oe-build-perf-report/gitarchive: Move common useful functions to library bitbake: runqueue: Fix dependency loop analysis 'hangs' bitbake: runqueue: Filter out multiconfig dependencies from BB_TASKDEPDATA bitbake: siggen: Fix multiconfig corner case bitbake: cooker: Tweak multiconfig dependency resolution Robert Yang (5): bluez5: Fix a race issue for tools yocto-check-layer-wrapper: Fix path for oe-init-build-env checklayer: Avoid adding the layer if it is already present runqemu: Let qemuparams override default settings runqemu: Make QB_MEM easier to set Ross Burton (3): e2fsprogs: fix file system generation with large files linux-firmware: recommend split up packages linux-firmware: split out liquidio firmware Scott Rifenbark (2): poky.ent: Updated "meta-intel" version to "10.1" overview-manual, mega-manual: Updated Package Feeds diagram Serhey Popovych (1): openssl: Skip assembler optimized code for powerpc64 with musl William Bourque (1): wic/engine.py: Load paths from PATH environment variable Xulin Sun (1): openssl: fix multilib file install conflicts Zheng Ruoqin (1): mdadm: add init and service scripts Change-Id: Ib14c2fb69d25d84aa3d4bf0a6715bba57d1eb900 Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Diffstat (limited to 'poky/meta/lib/oeqa/runtime/cases')
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/logrotate.py6
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/perl.py2
-rw-r--r--poky/meta/lib/oeqa/runtime/cases/ptest.py80
3 files changed, 32 insertions, 56 deletions
diff --git a/poky/meta/lib/oeqa/runtime/cases/logrotate.py b/poky/meta/lib/oeqa/runtime/cases/logrotate.py
index db6e695ee..d2666444e 100644
--- a/poky/meta/lib/oeqa/runtime/cases/logrotate.py
+++ b/poky/meta/lib/oeqa/runtime/cases/logrotate.py
@@ -9,8 +9,12 @@ from oeqa.runtime.decorator.package import OEHasPackage
class LogrotateTest(OERuntimeTestCase):
@classmethod
+ def setUpClass(cls):
+ cls.tc.target.run('cp /etc/logrotate.d/wtmp $HOME/wtmp.oeqabak')
+
+ @classmethod
def tearDownClass(cls):
- cls.tc.target.run('rm -rf $HOME/logrotate_dir')
+ cls.tc.target.run('mv -f $HOME/wtmp.oeqabak /etc/logrotate.d/wtmp && rm -rf $HOME/logrotate_dir')
@OETestID(1544)
@OETestDepends(['ssh.SSHTest.test_ssh'])
diff --git a/poky/meta/lib/oeqa/runtime/cases/perl.py b/poky/meta/lib/oeqa/runtime/cases/perl.py
index afeeb180e..be3287f22 100644
--- a/poky/meta/lib/oeqa/runtime/cases/perl.py
+++ b/poky/meta/lib/oeqa/runtime/cases/perl.py
@@ -1,11 +1,13 @@
import os
from oeqa.runtime.case import OERuntimeTestCase
+from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID
from oeqa.runtime.decorator.package import OEHasPackage
class PerlTest(OERuntimeTestCase):
@OETestID(208)
+ @OETestDepends(['ssh.SSHTest.test_ssh'])
@OEHasPackage(['perl'])
def test_perl_works(self):
status, output = self.target.run("perl -e '$_=\"Uryyb, jbeyq\"; tr/a-zA-Z/n-za-mN-ZA-M/;print'")
diff --git a/poky/meta/lib/oeqa/runtime/cases/ptest.py b/poky/meta/lib/oeqa/runtime/cases/ptest.py
index 0972a583e..2a28ca59a 100644
--- a/poky/meta/lib/oeqa/runtime/cases/ptest.py
+++ b/poky/meta/lib/oeqa/runtime/cases/ptest.py
@@ -1,55 +1,16 @@
import unittest
import pprint
+import datetime
from oeqa.runtime.case import OERuntimeTestCase
from oeqa.core.decorator.depends import OETestDepends
from oeqa.core.decorator.oeid import OETestID
from oeqa.core.decorator.data import skipIfNotFeature
from oeqa.runtime.decorator.package import OEHasPackage
-from oeqa.utils.logparser import Lparser, Result
+from oeqa.utils.logparser import PtestParser
class PtestRunnerTest(OERuntimeTestCase):
- # a ptest log parser
- def parse_ptest(self, logfile):
- parser = Lparser(test_0_pass_regex="^PASS:(.+)",
- test_0_fail_regex="^FAIL:(.+)",
- test_0_skip_regex="^SKIP:(.+)",
- section_0_begin_regex="^BEGIN: .*/(.+)/ptest",
- section_0_end_regex="^END: .*/(.+)/ptest")
- parser.init()
- result = Result()
-
- with open(logfile, errors='replace') as f:
- for line in f:
- result_tuple = parser.parse_line(line)
- if not result_tuple:
- continue
- result_tuple = line_type, category, status, name = parser.parse_line(line)
-
- if line_type == 'section' and status == 'begin':
- current_section = name
- continue
-
- if line_type == 'section' and status == 'end':
- current_section = None
- continue
-
- if line_type == 'test' and status == 'pass':
- result.store(current_section, name, status)
- continue
-
- if line_type == 'test' and status == 'fail':
- result.store(current_section, name, status)
- continue
-
- if line_type == 'test' and status == 'skip':
- result.store(current_section, name, status)
- continue
-
- result.sort_tests()
- return result
-
@OETestID(1600)
@skipIfNotFeature('ptest', 'Test requires ptest to be in DISTRO_FEATURES')
@OETestDepends(['ssh.SSHTest.test_ssh'])
@@ -60,8 +21,6 @@ class PtestRunnerTest(OERuntimeTestCase):
if status != 0:
self.skipTest("No -ptest packages are installed in the image")
- import datetime
-
test_log_dir = self.td.get('TEST_LOG_DIR', '')
# The TEST_LOG_DIR maybe NULL when testimage is added after
# testdata.json is generated.
@@ -69,9 +28,9 @@ class PtestRunnerTest(OERuntimeTestCase):
test_log_dir = os.path.join(self.td.get('WORKDIR', ''), 'testimage')
# Don't use self.td.get('DATETIME'), it's from testdata.json, not
# up-to-date, and may cause "File exists" when re-reun.
- datetime = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
+ timestamp = datetime.datetime.now().strftime('%Y%m%d%H%M%S')
ptest_log_dir_link = os.path.join(test_log_dir, 'ptest_log')
- ptest_log_dir = '%s.%s' % (ptest_log_dir_link, datetime)
+ ptest_log_dir = '%s.%s' % (ptest_log_dir_link, timestamp)
ptest_runner_log = os.path.join(ptest_log_dir, 'ptest-runner.log')
status, output = self.target.run('ptest-runner', 0)
@@ -88,25 +47,36 @@ class PtestRunnerTest(OERuntimeTestCase):
extras['ptestresult.rawlogs'] = {'log': output}
# Parse and save results
- parse_result = self.parse_ptest(ptest_runner_log)
- parse_result.log_as_files(ptest_log_dir, test_status = ['pass','fail', 'skip'])
+ parser = PtestParser()
+ results, sections = parser.parse(ptest_runner_log)
+ parser.results_as_files(ptest_log_dir)
if os.path.exists(ptest_log_dir_link):
# Remove the old link to create a new one
os.remove(ptest_log_dir_link)
os.symlink(os.path.basename(ptest_log_dir), ptest_log_dir_link)
+ extras['ptestresult.sections'] = sections
+
trans = str.maketrans("()", "__")
- resmap = {'pass': 'PASSED', 'skip': 'SKIPPED', 'fail': 'FAILED'}
- for section in parse_result.result_dict:
- for test, result in parse_result.result_dict[section]:
- testname = "ptestresult." + section + "." + "_".join(test.translate(trans).split())
- extras[testname] = {'status': resmap[result]}
+ for section in results:
+ for test in results[section]:
+ result = results[section][test]
+ testname = "ptestresult." + (section or "No-section") + "." + "_".join(test.translate(trans).split())
+ extras[testname] = {'status': result}
failed_tests = {}
- for section in parse_result.result_dict:
- failed_testcases = [ "_".join(test.translate(trans).split()) for test, result in parse_result.result_dict[section] if result == 'fail' ]
+ for section in results:
+ failed_testcases = [ "_".join(test.translate(trans).split()) for test in results[section] if results[section][test] == 'fail' ]
if failed_testcases:
failed_tests[section] = failed_testcases
+ failmsg = ""
+ status, output = self.target.run('dmesg | grep "Killed process"', 0)
+ if output:
+ failmsg = "ERROR: Processes were killed by the OOM Killer:\n%s\n" % output
+
if failed_tests:
- self.fail("Failed ptests:\n%s" % pprint.pformat(failed_tests))
+ failmsg = failmsg + "Failed ptests:\n%s" % pprint.pformat(failed_tests)
+
+ if failmsg:
+ self.fail(failmsg)