summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-04-30 07:46:59 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-05-12 09:04:26 +0100
commit5a16dee75f4c73eef052464d588ead1c831672fe (patch)
tree5734d9a0d135a97ff720b3e6de6ab69636bd7c75
parentf3b8bea862a7701529899e868eed3c6d4fbc8ca6 (diff)
downloadpoky-5a16dee75f4c73eef052464d588ead1c831672fe.tar.gz
oeqa/selftest: Automate manual pybootchart tests
Automate the current manual pybootchart tests. This includes a check for the cairo dependency, skipping the test if appropriate. Based on original patch from Armin Kuster <akuster808@gmail.com> (From OE-Core rev: ff5370a381a4996b7da56aaaa7055f7a1786c823) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/manual/oe-core.json26
-rw-r--r--meta/lib/oeqa/selftest/cases/oescripts.py34
2 files changed, 34 insertions, 26 deletions
diff --git a/meta/lib/oeqa/manual/oe-core.json b/meta/lib/oeqa/manual/oe-core.json
index d893d849fb..3ee0aa95f9 100644
--- a/meta/lib/oeqa/manual/oe-core.json
+++ b/meta/lib/oeqa/manual/oe-core.json
@@ -1,32 +1,6 @@
1[ 1[
2 { 2 {
3 "test": { 3 "test": {
4 "@alias": "oe-core.scripts.Use_scripts/pybootchartgui/pybootchartgui.py_to_generate_build_profiles",
5 "author": [
6 {
7 "email": "alexandru.c.georgescu@intel.com",
8 "name": "alexandru.c.georgescu@intel.com"
9 }
10 ],
11 "execution": {
12 "1": {
13 "action": "Run a build for a recipe (e.g. core-image-minimal)",
14 "expected_results": ""
15 },
16 "2": {
17 "action": "Run the profiling script, ../scripts/pybootchartgui/pybootchartgui.py tmp/buildstats/ \n\n",
18 "expected_results": ""
19 },
20 "3": {
21 "action": "Verify the results ",
22 "expected_results": "The scripts generates svg files with the profiling results . "
23 }
24 },
25 "summary": "Use_scripts/pybootchartgui/pybootchartgui.py_to_generate_build_profiles"
26 }
27 },
28 {
29 "test": {
30 "@alias": "oe-core.scripts.Crosstap_script_check", 4 "@alias": "oe-core.scripts.Crosstap_script_check",
31 "author": [ 5 "author": [
32 { 6 {
diff --git a/meta/lib/oeqa/selftest/cases/oescripts.py b/meta/lib/oeqa/selftest/cases/oescripts.py
index 56b35b59eb..217afe3775 100644
--- a/meta/lib/oeqa/selftest/cases/oescripts.py
+++ b/meta/lib/oeqa/selftest/cases/oescripts.py
@@ -2,6 +2,7 @@
2# SPDX-License-Identifier: MIT 2# SPDX-License-Identifier: MIT
3# 3#
4 4
5import os
5from oeqa.selftest.case import OESelftestTestCase 6from oeqa.selftest.case import OESelftestTestCase
6from oeqa.selftest.cases.buildhistory import BuildhistoryBase 7from oeqa.selftest.cases.buildhistory import BuildhistoryBase
7from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer 8from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer
@@ -28,3 +29,36 @@ class BuildhistoryDiffTests(BuildhistoryBase):
28 self.fail('Unexpected line:\n%s\nExpected line endings:\n %s' % (line, '\n '.join(expected_endlines))) 29 self.fail('Unexpected line:\n%s\nExpected line endings:\n %s' % (line, '\n '.join(expected_endlines)))
29 if expected_endlines: 30 if expected_endlines:
30 self.fail('Missing expected line endings:\n %s' % '\n '.join(expected_endlines)) 31 self.fail('Missing expected line endings:\n %s' % '\n '.join(expected_endlines))
32
33class OEScriptTests(OESelftestTestCase):
34
35 @classmethod
36 def setUpClass(cls):
37 super(OEScriptTests, cls).setUpClass()
38 try:
39 import cairo
40 except ImportError:
41 cls.skipTest('Python module cairo is not present')
42 bitbake("core-image-minimal -c rootfs -f")
43 cls.tmpdir = get_bb_var('TMPDIR')
44 cls.buildstats = cls.tmpdir + "/buildstats/" + sorted(os.listdir(cls.tmpdir + "/buildstats"))[-1]
45
46 scripts_dir = os.path.join(get_bb_var('COREBASE'), 'scripts')
47
48class OEPybootchartguyTests(OEScriptTests):
49
50 def test_pybootchartguy_help(self):
51 runCmd('%s/pybootchartgui/pybootchartgui.py --help' % self.scripts_dir)
52
53 def test_pybootchartguy_to_generate_build_png_output(self):
54 runCmd('%s/pybootchartgui/pybootchartgui.py %s -o %s/charts -f png' % (self.scripts_dir, self.buildstats, self.tmpdir))
55 self.assertTrue(os.path.exists(self.tmpdir + "/charts.png"))
56
57 def test_pybootchartguy_to_generate_build_svg_output(self):
58 runCmd('%s/pybootchartgui/pybootchartgui.py %s -o %s/charts -f svg' % (self.scripts_dir, self.buildstats, self.tmpdir))
59 self.assertTrue(os.path.exists(self.tmpdir + "/charts.svg"))
60
61 def test_pybootchartguy_to_generate_build_pdf_output(self):
62 runCmd('%s/pybootchartgui/pybootchartgui.py %s -o %s/charts -f pdf' % (self.scripts_dir, self.buildstats, self.tmpdir))
63 self.assertTrue(os.path.exists(self.tmpdir + "/charts.pdf"))
64