summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--meta/classes/testimage.bbclass11
-rw-r--r--meta/lib/oeqa/core/utils/misc.py7
2 files changed, 14 insertions, 4 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 73a5c1a3be..47bccbca37 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -80,12 +80,13 @@ TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-na
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}"
TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python-smartpm-native:do_populate_sysroot', '', d)}"
-
TESTIMAGELOCK = "${TMPDIR}/testimage.lock"
TESTIMAGELOCK_qemuall = ""
TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/"
+TESTIMAGE_UPDATE_VARS ?= "WORKDIR DEPLOY_DIR"
+
testimage_dump_target () {
top -bn1
ps
@@ -138,13 +139,12 @@ def testimage_sanity(d):
def testimage_main(d):
import os
- import signal
import json
- import sys
+ import signal
import logging
- import time
from bb.utils import export_proxies
+ from oeqa.core.utils.misc import updateTestData
from oeqa.runtime.context import OERuntimeTestContext
from oeqa.runtime.context import OERuntimeTestContextExecutor
from oeqa.core.target.qemu import supported_fstypes
@@ -166,6 +166,9 @@ def testimage_main(d):
tdname = "%s.testdata.json" % image_name
td = json.load(open(tdname, "r"))
+ # Some variables need to be updates (mostly paths) with the
+ # ones of the current environment because some tests require them.
+ updateTestData(d, td, d.getVar('TESTIMAGE_UPDATE_VARS').split())
image_manifest = "%s.manifest" % image_name
image_packages = OERuntimeTestContextExecutor.readPackagesManifest(image_manifest)
diff --git a/meta/lib/oeqa/core/utils/misc.py b/meta/lib/oeqa/core/utils/misc.py
index 6ae58ad6c4..d1eec13aa6 100644
--- a/meta/lib/oeqa/core/utils/misc.py
+++ b/meta/lib/oeqa/core/utils/misc.py
@@ -35,3 +35,10 @@ def dataStoteToDict(d, variables):
data[v] = d.getVar(v, True)
return data
+
+def updateTestData(d, td, variables):
+ """
+ Updates variables with values of data store to test data.
+ """
+ for var in variables:
+ td[var] = d.getVar(var)