summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-06-06 07:15:44 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-06-07 15:22:38 +0100
commit120f7067c802a02856d44c2c241da6c0f7fd5126 (patch)
tree062b7daefd2318013f6e6f80d90754c07d008bc7 /meta/classes
parent7d18d9f9c5a9ce52610732cc1836b243a660eacb (diff)
downloadpoky-120f7067c802a02856d44c2c241da6c0f7fd5126.tar.gz
testexport.bbclass: Add support for testexport-tarball
Add support to export the SDK tarball needed when a test system doesn't have the required software to perform runtime tests. The support is when exporting the test and when running the test on a remote system. The user of this feature just need to set TEST_EXPORT_SDK_ENABLED to "1" and declare the sdk packages in TEST_EXPORT_SDK_PACKAGES. [YOCTO #7850] (From OE-Core rev: a6041f81b81baa7564e4c712fc88de2b997e52e4) (From OE-Core rev: 05e6c89f0f71311f8bd32cdb86a2deb789c58035) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/testexport.bbclass16
1 files changed, 16 insertions, 0 deletions
diff --git a/meta/classes/testexport.bbclass b/meta/classes/testexport.bbclass
index a3208806bc..6009349341 100644
--- a/meta/classes/testexport.bbclass
+++ b/meta/classes/testexport.bbclass
@@ -23,8 +23,14 @@ TEST_TARGET ?= "simpleremote"
23TEST_TARGET_IP ?= "" 23TEST_TARGET_IP ?= ""
24TEST_SERVER_IP ?= "" 24TEST_SERVER_IP ?= ""
25 25
26TEST_EXPORT_SDK_PACKAGES ?= ""
27TEST_EXPORT_SDK_ENABLED ?= "0"
28TEST_EXPORT_SDK_NAME ?= "testexport-tools-nativesdk"
29TEST_EXPORT_SDK_DIR ?= "sdk"
30
26TEST_EXPORT_DEPENDS = "" 31TEST_EXPORT_DEPENDS = ""
27TEST_EXPORT_DEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}" 32TEST_EXPORT_DEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
33TEST_EXPORT_DEPENDS += "${@bb.utils.contains('TEST_EXPORT_SDK_ENABLED', '1', 'testexport-tarball:do_populate_sdk', '', d)}"
28TEST_EXPORT_LOCK = "${TMPDIR}/testimage.lock" 34TEST_EXPORT_LOCK = "${TMPDIR}/testimage.lock"
29 35
30python do_testexport() { 36python do_testexport() {
@@ -136,6 +142,16 @@ def exportTests(d,tc):
136 dst_f = os.path.join(export_pkg_dir, root.replace(test_pkg_dir, "").lstrip("/"), f) 142 dst_f = os.path.join(export_pkg_dir, root.replace(test_pkg_dir, "").lstrip("/"), f)
137 shutil.copy2(src_f, dst_f) 143 shutil.copy2(src_f, dst_f)
138 144
145 # Copy SDK
146 if d.getVar("TEST_EXPORT_SDK_ENABLED", True) == "1":
147 sdk_deploy = d.getVar("SDK_DEPLOY", True)
148 tarball_name = "%s.sh" % d.getVar("TEST_EXPORT_SDK_NAME", True)
149 tarball_path = os.path.join(sdk_deploy, tarball_name)
150 export_sdk_dir = os.path.join(d.getVar("TEST_EXPORT_DIR", True),
151 d.getVar("TEST_EXPORT_SDK_DIR", True))
152 bb.utils.mkdirhier(export_sdk_dir)
153 shutil.copy2(tarball_path, export_sdk_dir)
154
139 bb.plain("Exported tests to: %s" % exportpath) 155 bb.plain("Exported tests to: %s" % exportpath)
140 156
141def testexport_main(d): 157def testexport_main(d):