diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2017-02-21 14:33:08 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-01 23:27:10 +0000 |
commit | 19d23814e449101f57c8f149c77ee8697c636f43 (patch) | |
tree | d6e79252c334f3f71caff686423cfa52ff2327a5 /meta/lib/oeqa/selftest/signing.py | |
parent | ef010c1a1d823870aba80152fc13c32c62e95146 (diff) | |
download | poky-19d23814e449101f57c8f149c77ee8697c636f43.tar.gz |
selftest: Optimize get_bb_var use
get_bb_var calls bitbake every time it is used and every call
would take about 7 seconds. There are tests that calls get_bb_var
several times when they can use get_bb_vars. Also there are tests
that calls it to fetch the same variable over and over again.
This will optimize the use of get_bb_var and get_bb_vars for a
little speed up in the tests.
[YOCTO #11037]
(From OE-Core rev: e53f86ba8aeb6d2e9eb259329001d27d62401072)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest/signing.py')
-rw-r--r-- | meta/lib/oeqa/selftest/signing.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/signing.py b/meta/lib/oeqa/selftest/signing.py index 35c2dc12ab..006afbef15 100644 --- a/meta/lib/oeqa/selftest/signing.py +++ b/meta/lib/oeqa/selftest/signing.py | |||
@@ -1,5 +1,5 @@ | |||
1 | from oeqa.selftest.base import oeSelfTest | 1 | from oeqa.selftest.base import oeSelfTest |
2 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var | 2 | from oeqa.utils.commands import runCmd, bitbake, get_bb_var, get_bb_vars |
3 | import os | 3 | import os |
4 | import glob | 4 | import glob |
5 | import re | 5 | import re |
@@ -59,15 +59,17 @@ class Signing(oeSelfTest): | |||
59 | 59 | ||
60 | self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) | 60 | self.add_command_to_tearDown('bitbake -c clean %s' % test_recipe) |
61 | 61 | ||
62 | pkgdatadir = get_bb_var('PKGDATA_DIR', test_recipe) | 62 | needed_vars = ['PKGDATA_DIR', 'DEPLOY_DIR_RPM', 'PACKAGE_ARCH', 'STAGING_BINDIR_NATIVE'] |
63 | bb_vars = get_bb_vars(needed_vars, test_recipe) | ||
64 | pkgdatadir = bb_vars['PKGDATA_DIR'] | ||
63 | pkgdata = oe.packagedata.read_pkgdatafile(pkgdatadir + "/runtime/ed") | 65 | pkgdata = oe.packagedata.read_pkgdatafile(pkgdatadir + "/runtime/ed") |
64 | if 'PKGE' in pkgdata: | 66 | if 'PKGE' in pkgdata: |
65 | pf = pkgdata['PN'] + "-" + pkgdata['PKGE'] + pkgdata['PKGV'] + '-' + pkgdata['PKGR'] | 67 | pf = pkgdata['PN'] + "-" + pkgdata['PKGE'] + pkgdata['PKGV'] + '-' + pkgdata['PKGR'] |
66 | else: | 68 | else: |
67 | pf = pkgdata['PN'] + "-" + pkgdata['PKGV'] + '-' + pkgdata['PKGR'] | 69 | pf = pkgdata['PN'] + "-" + pkgdata['PKGV'] + '-' + pkgdata['PKGR'] |
68 | deploy_dir_rpm = get_bb_var('DEPLOY_DIR_RPM', test_recipe) | 70 | deploy_dir_rpm = bb_vars['DEPLOY_DIR_RPM'] |
69 | package_arch = get_bb_var('PACKAGE_ARCH', test_recipe).replace('-', '_') | 71 | package_arch = bb_vars['PACKAGE_ARCH'].replace('-', '_') |
70 | staging_bindir_native = get_bb_var('STAGING_BINDIR_NATIVE', test_recipe) | 72 | staging_bindir_native = bb_vars['STAGING_BINDIR_NATIVE'] |
71 | 73 | ||
72 | pkg_deploy = os.path.join(deploy_dir_rpm, package_arch, '.'.join((pf, package_arch, 'rpm'))) | 74 | pkg_deploy = os.path.join(deploy_dir_rpm, package_arch, '.'.join((pf, package_arch, 'rpm'))) |
73 | 75 | ||