diff options
Diffstat (limited to 'meta/classes/testimage.bbclass')
-rw-r--r-- | meta/classes/testimage.bbclass | 18 |
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 @@ | |||
30 | TEST_LOG_DIR ?= "${WORKDIR}/testimage" | 30 | TEST_LOG_DIR ?= "${WORKDIR}/testimage" |
31 | 31 | ||
32 | TEST_EXPORT_DIR ?= "${TMPDIR}/testimage/${PN}" | 32 | TEST_EXPORT_DIR ?= "${TMPDIR}/testimage/${PN}" |
33 | TEST_INSTALL_TMP_DIR ?= "${WORKDIR}/testimage/install_tmp" | ||
34 | TEST_NEEDED_PACKAGES_DIR ?= "${WORKDIR}/testimage/packages" | ||
35 | TEST_EXTRACTED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/extracted" | ||
36 | TEST_PACKAGED_DIR ?= "${TEST_NEEDED_PACKAGES_DIR}/packaged" | ||
33 | 37 | ||
34 | RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}" | 38 | RPMTESTSUITE = "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'smart rpm', '', d)}" |
35 | MINTESTSUITE = "ping" | 39 | MINTESTSUITE = "ping" |
@@ -100,6 +104,7 @@ testimage_dump_host () { | |||
100 | python do_testimage() { | 104 | python do_testimage() { |
101 | testimage_main(d) | 105 | testimage_main(d) |
102 | } | 106 | } |
107 | |||
103 | addtask testimage | 108 | addtask testimage |
104 | do_testimage[nostamp] = "1" | 109 | do_testimage[nostamp] = "1" |
105 | do_testimage[depends] += "${TESTIMAGEDEPENDS}" | 110 | do_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 | ||
165 | def 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 | |||
158 | testimage_main[vardepsexclude] =+ "BB_ORIGENV" | 176 | testimage_main[vardepsexclude] =+ "BB_ORIGENV" |
159 | 177 | ||
160 | inherit testsdk | 178 | inherit testsdk |