diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-06-28 10:12:24 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-08-17 10:35:44 +0100 |
commit | 979be848e2dbc6476914dea95e3a8f4e69255268 (patch) | |
tree | f1df4da797a51d3e05312f12db49556fb2a18d5c | |
parent | 09b9a4aeee454148a97ebe2a872b8c3f52adcb9a (diff) | |
download | poky-979be848e2dbc6476914dea95e3a8f4e69255268.tar.gz |
oeqa.buildperf: convert test cases to unittest
This commit converts the actual tests to be compatible with the new
Python unittest based framework.
(From OE-Core rev: 4e81967131863df7ee6c8356cb41be51f1b8c260)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/lib/oeqa/buildperf/test_basic.py | 50 |
1 files changed, 19 insertions, 31 deletions
diff --git a/meta/lib/oeqa/buildperf/test_basic.py b/meta/lib/oeqa/buildperf/test_basic.py index ada5aba053..b8bec6d6f2 100644 --- a/meta/lib/oeqa/buildperf/test_basic.py +++ b/meta/lib/oeqa/buildperf/test_basic.py | |||
@@ -13,17 +13,15 @@ | |||
13 | import os | 13 | import os |
14 | import shutil | 14 | import shutil |
15 | 15 | ||
16 | from . import BuildPerfTest, perf_test_case | 16 | from oeqa.buildperf import BuildPerfTestCase |
17 | from oeqa.utils.commands import get_bb_vars | 17 | from oeqa.utils.commands import get_bb_vars |
18 | 18 | ||
19 | 19 | ||
20 | @perf_test_case | 20 | class Test1P1(BuildPerfTestCase): |
21 | class Test1P1(BuildPerfTest): | ||
22 | name = "test1" | ||
23 | build_target = 'core-image-sato' | 21 | build_target = 'core-image-sato' |
24 | description = "Measure wall clock of bitbake {} and size of tmp dir".format(build_target) | ||
25 | 22 | ||
26 | def _run(self): | 23 | def test1(self): |
24 | """Measure wall clock of bitbake core-image-sato and size of tmp dir""" | ||
27 | self.log_cmd_output("bitbake {} -c fetchall".format(self.build_target)) | 25 | self.log_cmd_output("bitbake {} -c fetchall".format(self.build_target)) |
28 | self.rm_tmp() | 26 | self.rm_tmp() |
29 | self.rm_sstate() | 27 | self.rm_sstate() |
@@ -35,13 +33,11 @@ class Test1P1(BuildPerfTest): | |||
35 | self.save_buildstats() | 33 | self.save_buildstats() |
36 | 34 | ||
37 | 35 | ||
38 | @perf_test_case | 36 | class Test1P2(BuildPerfTestCase): |
39 | class Test1P2(BuildPerfTest): | ||
40 | name = "test12" | ||
41 | build_target = 'virtual/kernel' | 37 | build_target = 'virtual/kernel' |
42 | description = "Measure bitbake {}".format(build_target) | ||
43 | 38 | ||
44 | def _run(self): | 39 | def test12(self): |
40 | """Measure bitbake virtual/kernel""" | ||
45 | self.log_cmd_output("bitbake {} -c cleansstate".format( | 41 | self.log_cmd_output("bitbake {} -c cleansstate".format( |
46 | self.build_target)) | 42 | self.build_target)) |
47 | self.sync() | 43 | self.sync() |
@@ -49,13 +45,11 @@ class Test1P2(BuildPerfTest): | |||
49 | 'bitbake ' + self.build_target) | 45 | 'bitbake ' + self.build_target) |
50 | 46 | ||
51 | 47 | ||
52 | @perf_test_case | 48 | class Test1P3(BuildPerfTestCase): |
53 | class Test1P3(BuildPerfTest): | ||
54 | name = "test13" | ||
55 | build_target = 'core-image-sato' | 49 | build_target = 'core-image-sato' |
56 | description = "Build {} with rm_work enabled".format(build_target) | ||
57 | 50 | ||
58 | def _run(self): | 51 | def test13(self): |
52 | """Build core-image-sato with rm_work enabled""" | ||
59 | postfile = os.path.join(self.out_dir, 'postfile.conf') | 53 | postfile = os.path.join(self.out_dir, 'postfile.conf') |
60 | with open(postfile, 'w') as fobj: | 54 | with open(postfile, 'w') as fobj: |
61 | fobj.write('INHERIT += "rm_work"\n') | 55 | fobj.write('INHERIT += "rm_work"\n') |
@@ -73,13 +67,11 @@ class Test1P3(BuildPerfTest): | |||
73 | self.save_buildstats() | 67 | self.save_buildstats() |
74 | 68 | ||
75 | 69 | ||
76 | @perf_test_case | 70 | class Test2(BuildPerfTestCase): |
77 | class Test2(BuildPerfTest): | ||
78 | name = "test2" | ||
79 | build_target = 'core-image-sato' | 71 | build_target = 'core-image-sato' |
80 | description = "Measure bitbake {} -c rootfs with sstate".format(build_target) | ||
81 | 72 | ||
82 | def _run(self): | 73 | def test2(self): |
74 | """Measure bitbake core-image-sato -c rootfs with sstate""" | ||
83 | self.rm_tmp() | 75 | self.rm_tmp() |
84 | self.rm_cache() | 76 | self.rm_cache() |
85 | self.sync() | 77 | self.sync() |
@@ -87,12 +79,10 @@ class Test2(BuildPerfTest): | |||
87 | self.measure_cmd_resources(cmd, 'do_rootfs', 'bitbake do_rootfs') | 79 | self.measure_cmd_resources(cmd, 'do_rootfs', 'bitbake do_rootfs') |
88 | 80 | ||
89 | 81 | ||
90 | @perf_test_case | 82 | class Test3(BuildPerfTestCase): |
91 | class Test3(BuildPerfTest): | ||
92 | name = "test3" | ||
93 | description = "Parsing time metrics (bitbake -p)" | ||
94 | 83 | ||
95 | def _run(self): | 84 | def test3(self): |
85 | """Parsing time metrics (bitbake -p)""" | ||
96 | # Drop all caches and parse | 86 | # Drop all caches and parse |
97 | self.rm_cache() | 87 | self.rm_cache() |
98 | self.force_rm(os.path.join(self.bb_vars['TMPDIR'], 'cache')) | 88 | self.force_rm(os.path.join(self.bb_vars['TMPDIR'], 'cache')) |
@@ -107,13 +97,11 @@ class Test3(BuildPerfTest): | |||
107 | 'bitbake -p (cached)') | 97 | 'bitbake -p (cached)') |
108 | 98 | ||
109 | 99 | ||
110 | @perf_test_case | 100 | class Test4(BuildPerfTestCase): |
111 | class Test4(BuildPerfTest): | ||
112 | name = "test4" | ||
113 | build_target = 'core-image-sato' | 101 | build_target = 'core-image-sato' |
114 | description = "eSDK metrics" | ||
115 | 102 | ||
116 | def _run(self): | 103 | def test4(self): |
104 | """eSDK metrics""" | ||
117 | self.log_cmd_output("bitbake {} -c do_populate_sdk_ext".format( | 105 | self.log_cmd_output("bitbake {} -c do_populate_sdk_ext".format( |
118 | self.build_target)) | 106 | self.build_target)) |
119 | self.bb_vars = get_bb_vars(None, self.build_target) | 107 | self.bb_vars = get_bb_vars(None, self.build_target) |