summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2017-01-25 12:20:06 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-01-31 14:43:01 +0000
commit1e88c8fce4e60530a53388e0eac54e4a68a6f924 (patch)
treeb0a8487ab8fc313c27d3a8a428f199c00d2f7706 /meta
parente8935e20d6e80435d23fe0aa0b969087461e1a74 (diff)
downloadpoky-1e88c8fce4e60530a53388e0eac54e4a68a6f924.tar.gz
testimage.bbclass: Allow to run tests on autobuilder's images
With the change to the new framework data store dependecy was removed, instead a new file is generated and used in testimage. When testing builds from the autobuilders the test data values are from the autobuilder, including the paths. Some tests require paths to current environment in order to run, this commit will update such paths and fix the error of running images donwloaded from autobuilders. [YOCTO #10964] (From OE-Core rev: 26ad5105fc2ce03b7ee8ecc6911fd40a52bd573a) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-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
80TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}" 80TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do_populate_sysroot', '', d)}"
81TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python-smartpm-native:do_populate_sysroot', '', d)}" 81TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'python-smartpm-native:do_populate_sysroot', '', d)}"
82 82
83
84TESTIMAGELOCK = "${TMPDIR}/testimage.lock" 83TESTIMAGELOCK = "${TMPDIR}/testimage.lock"
85TESTIMAGELOCK_qemuall = "" 84TESTIMAGELOCK_qemuall = ""
86 85
87TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/" 86TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/"
88 87
88TESTIMAGE_UPDATE_VARS ?= "WORKDIR DEPLOY_DIR"
89
89testimage_dump_target () { 90testimage_dump_target () {
90 top -bn1 91 top -bn1
91 ps 92 ps
@@ -138,13 +139,12 @@ def testimage_sanity(d):
138 139
139def testimage_main(d): 140def 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
39def 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)