diff options
author | Laurent Bonnans <laurent.bonnans@here.com> | 2019-07-05 17:41:29 +0200 |
---|---|---|
committer | Laurent Bonnans <laurent.bonnans@here.com> | 2019-07-15 15:28:26 +0200 |
commit | 69d8dc6ed1405a6a05faca12f482e79cb6e0471b (patch) | |
tree | 025ebacfe5a81e5eda40c9cb84250b983fa5b04a /lib/oeqa/selftest/cases/testutils.py | |
parent | f68e1d59f0a0ed4341dad3b16d4979b1b63336d7 (diff) | |
download | meta-updater-69d8dc6ed1405a6a05faca12f482e79cb6e0471b.tar.gz |
Fix aktualizr-native run in oe-selftest
It did not work when using an empty build dir with sstate-cache,
the proper working way is to bitbake build_sysroots.
Also change the way we fetches some of the akautalizr package files
which was broken too.
Signed-off-by: Laurent Bonnans <laurent.bonnans@here.com>
Diffstat (limited to 'lib/oeqa/selftest/cases/testutils.py')
-rw-r--r-- | lib/oeqa/selftest/cases/testutils.py | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/oeqa/selftest/cases/testutils.py b/lib/oeqa/selftest/cases/testutils.py index f8b1904..900d15c 100644 --- a/lib/oeqa/selftest/cases/testutils.py +++ b/lib/oeqa/selftest/cases/testutils.py | |||
@@ -1,4 +1,5 @@ | |||
1 | import os | 1 | import os |
2 | import oe.path | ||
2 | import logging | 3 | import logging |
3 | import re | 4 | import re |
4 | import subprocess | 5 | import subprocess |
@@ -72,20 +73,16 @@ def akt_native_run(testInst, cmd, **kwargs): | |||
72 | # run a command supplied by aktualizr-native and checks that: | 73 | # run a command supplied by aktualizr-native and checks that: |
73 | # - the executable exists | 74 | # - the executable exists |
74 | # - the command runs without error | 75 | # - the command runs without error |
75 | # NOTE: the base test class must have built aktualizr-native (in | 76 | # |
76 | # setUpClass, for example) | 77 | # Requirements in base test class (setUpClass for example): |
77 | bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'base_prefix', 'libdir', 'bindir'], | 78 | # bitbake aktualizr-native |
78 | 'aktualizr-native') | 79 | # bitbake build-sysroots -c build_native_sysroot |
79 | sysroot = bb_vars['SYSROOT_DESTDIR'] + bb_vars['base_prefix'] | 80 | # |
80 | sysrootbin = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] | 81 | # (technique found in poky/meta/lib/oeqa/selftest/cases/package.py) |
81 | libdir = bb_vars['libdir'] | 82 | bb_vars = get_bb_vars(['STAGING_DIR', 'BUILD_ARCH']) |
82 | 83 | sysroot = oe.path.join(bb_vars['STAGING_DIR'], bb_vars['BUILD_ARCH']) | |
83 | program, *_ = cmd.split(' ') | 84 | |
84 | p = '{}/{}'.format(sysrootbin, program) | 85 | result = runCmd(cmd, native_sysroot=sysroot, ignore_status=True, **kwargs) |
85 | testInst.assertTrue(os.path.isfile(p), msg="No {} found ({})".format(program, p)) | ||
86 | env = dict(os.environ) | ||
87 | env['LD_LIBRARY_PATH'] = libdir | ||
88 | result = runCmd(cmd, env=env, native_sysroot=sysroot, ignore_status=True, **kwargs) | ||
89 | testInst.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) | 86 | testInst.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) |
90 | 87 | ||
91 | 88 | ||