From fed5146b8e7d642c29b6136b81e1b9ac8b011af9 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Fri, 5 Jul 2019 17:41:29 +0200 Subject: 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 --- lib/oeqa/selftest/cases/testutils.py | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'lib/oeqa/selftest/cases/testutils.py') 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 @@ import os +import oe.path import logging import re import subprocess @@ -72,20 +73,16 @@ def akt_native_run(testInst, cmd, **kwargs): # run a command supplied by aktualizr-native and checks that: # - the executable exists # - the command runs without error - # NOTE: the base test class must have built aktualizr-native (in - # setUpClass, for example) - bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'base_prefix', 'libdir', 'bindir'], - 'aktualizr-native') - sysroot = bb_vars['SYSROOT_DESTDIR'] + bb_vars['base_prefix'] - sysrootbin = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] - libdir = bb_vars['libdir'] - - program, *_ = cmd.split(' ') - p = '{}/{}'.format(sysrootbin, program) - testInst.assertTrue(os.path.isfile(p), msg="No {} found ({})".format(program, p)) - env = dict(os.environ) - env['LD_LIBRARY_PATH'] = libdir - result = runCmd(cmd, env=env, native_sysroot=sysroot, ignore_status=True, **kwargs) + # + # Requirements in base test class (setUpClass for example): + # bitbake aktualizr-native + # bitbake build-sysroots -c build_native_sysroot + # + # (technique found in poky/meta/lib/oeqa/selftest/cases/package.py) + bb_vars = get_bb_vars(['STAGING_DIR', 'BUILD_ARCH']) + sysroot = oe.path.join(bb_vars['STAGING_DIR'], bb_vars['BUILD_ARCH']) + + result = runCmd(cmd, native_sysroot=sysroot, ignore_status=True, **kwargs) testInst.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) -- cgit v1.2.3-54-g00ecf