diff options
-rw-r--r-- | meta/classes/testimage.bbclass | 11 | ||||
-rw-r--r-- | meta/lib/oeqa/core/utils/misc.py | 7 |
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 | |||
80 | TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}" | 80 | TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}" |
81 | TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python-smartpm-native:do_populate_sysroot', '', d)}" | 81 | TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python-smartpm-native:do_populate_sysroot', '', d)}" |
82 | 82 | ||
83 | |||
84 | TESTIMAGELOCK = "${TMPDIR}/testimage.lock" | 83 | TESTIMAGELOCK = "${TMPDIR}/testimage.lock" |
85 | TESTIMAGELOCK_qemuall = "" | 84 | TESTIMAGELOCK_qemuall = "" |
86 | 85 | ||
87 | TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/" | 86 | TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/" |
88 | 87 | ||
88 | TESTIMAGE_UPDATE_VARS ?= "WORKDIR DEPLOY_DIR" | ||
89 | |||
89 | testimage_dump_target () { | 90 | testimage_dump_target () { |
90 | top -bn1 | 91 | top -bn1 |
91 | ps | 92 | ps |
@@ -138,13 +139,12 @@ def testimage_sanity(d): | |||
138 | 139 | ||
139 | def testimage_main(d): | 140 | def testimage_main(d): |
140 | import os | 141 | import os |
141 | import signal | ||
142 | import json | 142 | import json |
143 | import sys | 143 | import signal |
144 | import logging | 144 | import logging |
145 | import time | ||
146 | 145 | ||
147 | from bb.utils import export_proxies | 146 | from bb.utils import export_proxies |
147 | from oeqa.core.utils.misc import updateTestData | ||
148 | from oeqa.runtime.context import OERuntimeTestContext | 148 | from oeqa.runtime.context import OERuntimeTestContext |
149 | from oeqa.runtime.context import OERuntimeTestContextExecutor | 149 | from oeqa.runtime.context import OERuntimeTestContextExecutor |
150 | from oeqa.core.target.qemu import supported_fstypes | 150 | from oeqa.core.target.qemu import supported_fstypes |
@@ -166,6 +166,9 @@ def testimage_main(d): | |||
166 | 166 | ||
167 | tdname = "%s.testdata.json" % image_name | 167 | tdname = "%s.testdata.json" % image_name |
168 | td = json.load(open(tdname, "r")) | 168 | td = json.load(open(tdname, "r")) |
169 | # Some variables need to be updates (mostly paths) with the | ||
170 | # ones of the current environment because some tests require them. | ||
171 | updateTestData(d, td, d.getVar('TESTIMAGE_UPDATE_VARS').split()) | ||
169 | 172 | ||
170 | image_manifest = "%s.manifest" % image_name | 173 | image_manifest = "%s.manifest" % image_name |
171 | image_packages = OERuntimeTestContextExecutor.readPackagesManifest(image_manifest) | 174 | 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): | |||
35 | data[v] = d.getVar(v, True) | 35 | data[v] = d.getVar(v, True) |
36 | 36 | ||
37 | return data | 37 | return data |
38 | |||
39 | def updateTestData(d, td, variables): | ||
40 | """ | ||
41 | Updates variables with values of data store to test data. | ||
42 | """ | ||
43 | for var in variables: | ||
44 | td[var] = d.getVar(var) | ||