oeqa.buildperf: add test Test1P3

Re-implement "test1_p3" from build-perf-test.sh which measures
'bitbake core-image-sato' with rm_work enabled.

(From OE-Core rev: bfe48d343e8a281760da0b6744c08d47039f93e0)

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>
This commit is contained in:
Markus Lehtonen 2016-06-23 18:20:21 +03:00 committed by Richard Purdie
parent b5ca437714
commit 1701a34f14
1 changed files with 26 additions and 0 deletions

View File

@ -10,6 +10,8 @@
# more details.
#
"""Basic set of build performance tests"""
import os
from . import BuildPerfTest, perf_test_case
@ -43,3 +45,27 @@ class Test1P2(BuildPerfTest):
self.sync()
self.measure_cmd_resources(['bitbake', self.build_target], 'build',
'bitbake ' + self.build_target)
@perf_test_case
class Test1P3(BuildPerfTest):
name = "test13"
build_target = 'core-image-sato'
description = "Build {} with rm_work enabled".format(build_target)
def _run(self):
postfile = os.path.join(self.out_dir, 'postfile.conf')
with open(postfile, 'w') as fobj:
fobj.write('INHERIT += "rm_work"\n')
try:
self.rm_tmp()
self.rm_sstate()
self.rm_cache()
self.sync()
cmd = ['bitbake', '-R', postfile, self.build_target]
self.measure_cmd_resources(cmd, 'build',
'bitbake' + self.build_target)
self.measure_disk_usage(self.bb_vars['TMPDIR'], 'tmpdir', 'tmpdir')
finally:
os.unlink(postfile)
self.save_buildstats()