From 988addc752e331cbf8994a6532d18830dffdd378 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Fri, 25 Jan 2019 18:01:48 +0100 Subject: oe-selftest: Fix native binary execution. This fixes SotaToolsTests and AktualizrToolsTests. Signed-off-by: Patrick Vacek --- lib/oeqa/selftest/updater.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/oeqa/selftest/updater.py b/lib/oeqa/selftest/updater.py index d189323..a37c6e6 100644 --- a/lib/oeqa/selftest/updater.py +++ b/lib/oeqa/selftest/updater.py @@ -692,22 +692,16 @@ def akt_native_run(testInst, cmd, **kwargs): # - 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'] + bb_vars = get_bb_vars(['SYSROOT_DESTDIR', 'libdir', 'bindir'], 'aktualizr-native') sysrootbin = bb_vars['SYSROOT_DESTDIR'] + bb_vars['bindir'] libdir = bb_vars['libdir'] - program, *_ = cmd.split(' ') + program, args = cmd.split(' ', maxsplit=1) 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) - result = runCmd(cmd, env=env, ignore_status=True, **kwargs) + result = runCmd('LD_LIBRARY_PATH=%s %s %s' % (libdir, p, args), ignore_status=True) testInst.assertEqual(result.status, 0, "Status not equal to 0. output: %s" % result.output) - def verifyProvisioned(testInst, machine): # Verify that device HAS provisioned. ran_ok = False -- cgit v1.2.3-54-g00ecf