summaryrefslogtreecommitdiffstats
path: root/meta/classes/testimage.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/testimage.bbclass')
-rw-r--r--meta/classes/testimage.bbclass18
1 files changed, 18 insertions, 0 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index a2e13df710..a70d3a885e 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -30,6 +30,10 @@
30TEST_LOG_DIR ?= "${WORKDIR}/testimage" 30TEST_LOG_DIR ?= "${WORKDIR}/testimage"
31 31
32TEST_EXPORT_DIR ?= "${TMPDIR}/testimage/${PN}" 32TEST_EXPORT_DIR ?= "${TMPDIR}/testimage/${PN}"
33TEST_INSTALL_TMP_DIR ?= "${WORKDIR}/testimage/install_tmp"
34TEST_NEEDED_PACKAGES_DIR ?= "${WORKDIR}/testimage/packages"
35TEST_EXTRACTED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/extracted"
36TEST_PACKAGED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/packaged"
33 37
34RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}" 38RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}"
35MINTESTSUITE = "ping" 39MINTESTSUITE = "ping"
@@ -100,6 +104,7 @@ testimage_dump_host () {
100python do_testimage() { 104python do_testimage() {
101 testimage_main(d) 105 testimage_main(d)
102} 106}
107
103addtask testimage 108addtask testimage
104do_testimage[nostamp] = "1" 109do_testimage[nostamp] = "1"
105do_testimage[depends] += "${TESTIMAGEDEPENDS}" 110do_testimage[depends] += "${TESTIMAGEDEPENDS}"
@@ -117,6 +122,7 @@ def testimage_main(d):
117 122
118 pn = d.getVar("PN", True) 123 pn = d.getVar("PN", True)
119 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True)) 124 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
125 test_create_extract_dirs(d)
120 126
121 # we need the host dumper in test context 127 # we need the host dumper in test context
122 host_dumper = get_host_dumper(d) 128 host_dumper = get_host_dumper(d)
@@ -136,6 +142,7 @@ def testimage_main(d):
136 import traceback 142 import traceback
137 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc()) 143 bb.fatal("Loading tests failed:\n%s" % traceback.format_exc())
138 144
145 tc.extract_packages()
139 target.deploy() 146 target.deploy()
140 try: 147 try:
141 target.start() 148 target.start()
@@ -155,6 +162,17 @@ def testimage_main(d):
155 signal.signal(signal.SIGTERM, tc.origsigtermhandler) 162 signal.signal(signal.SIGTERM, tc.origsigtermhandler)
156 target.stop() 163 target.stop()
157 164
165def test_create_extract_dirs(d):
166 install_path = d.getVar("TEST_INSTALL_TMP_DIR", True)
167 package_path = d.getVar("TEST_PACKAGED_DIR", True)
168 extracted_path = d.getVar("TEST_EXTRACTED_DIR", True)
169 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR", True))
170 bb.utils.remove(package_path, recurse=True)
171 bb.utils.mkdirhier(install_path)
172 bb.utils.mkdirhier(package_path)
173 bb.utils.mkdirhier(extracted_path)
174
175
158testimage_main[vardepsexclude] =+ "BB_ORIGENV" 176testimage_main[vardepsexclude] =+ "BB_ORIGENV"
159 177
160inherit testsdk 178inherit testsdk