summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/testimage.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe/testimage.bbclass')
-rw-r--r--meta/classes-recipe/testimage.bbclass23
1 files changed, 12 insertions, 11 deletions
diff --git a/meta/classes-recipe/testimage.bbclass b/meta/classes-recipe/testimage.bbclass
index ed0d87b7a7..847a6f18a8 100644
--- a/meta/classes-recipe/testimage.bbclass
+++ b/meta/classes-recipe/testimage.bbclass
@@ -24,11 +24,14 @@ TESTIMAGE_AUTO ??= "0"
24 24
25TESTIMAGE_FAILED_QA_ARTIFACTS = "\ 25TESTIMAGE_FAILED_QA_ARTIFACTS = "\
26 ${localstatedir}/log \ 26 ${localstatedir}/log \
27 ${localstatedir}/volatile/log \
27 ${sysconfdir}/version \ 28 ${sysconfdir}/version \
28 ${sysconfdir}/os-release" 29 ${sysconfdir}/os-release \
30 ${nonarch_libdir}/os-release \
31"
29 32
30# If some ptests are run and fail, retrieve corresponding directories 33# If some ptests are run and fail, retrieve corresponding directories
31TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/${MCNAME}/ptest', '', d)}" 34TESTIMAGE_FAILED_QA_ARTIFACTS += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '${libdir}/*/ptest', '', d)}"
32 35
33# You can set (or append to) TEST_SUITES in local.conf to select the tests 36# You can set (or append to) TEST_SUITES in local.conf to select the tests
34# which you want to run for your target. 37# which you want to run for your target.
@@ -99,7 +102,6 @@ TESTIMAGE_BOOT_PATTERNS ?= ""
99 102
100TESTIMAGEDEPENDS = "" 103TESTIMAGEDEPENDS = ""
101TESTIMAGEDEPENDS:append:qemuall = " qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot" 104TESTIMAGEDEPENDS:append:qemuall = " qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot"
102TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}"
103TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf-native:do_populate_sysroot', '', d)}" 105TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'dnf-native:do_populate_sysroot', '', d)}"
104TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}" 106TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}"
105TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-native:do_populate_sysroot package-index:do_package_index', '', d)}" 107TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'ipk', 'opkg-utils-native:do_populate_sysroot package-index:do_package_index', '', d)}"
@@ -110,7 +112,7 @@ TESTIMAGELOCK:qemuall = ""
110 112
111TESTIMAGE_DUMP_DIR ?= "${LOG_DIR}/runtime-hostdump/" 113TESTIMAGE_DUMP_DIR ?= "${LOG_DIR}/runtime-hostdump/"
112 114
113TESTIMAGE_UPDATE_VARS ?= "DL_DIR WORKDIR DEPLOY_DIR_IMAGE IMAGE_LINK_NAME" 115TESTIMAGE_UPDATE_VARS ?= "DL_DIR WORKDIR DEPLOY_DIR_IMAGE IMAGE_LINK_NAME IMAGE_NAME"
114 116
115testimage_dump_monitor () { 117testimage_dump_monitor () {
116 query-status 118 query-status
@@ -208,7 +210,7 @@ def testimage_main(d):
208 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR")) 210 bb.utils.mkdirhier(d.getVar("TEST_LOG_DIR"))
209 211
210 image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'), 212 image_name = ("%s/%s" % (d.getVar('DEPLOY_DIR_IMAGE'),
211 d.getVar('IMAGE_LINK_NAME'))) 213 d.getVar('IMAGE_LINK_NAME') or d.getVar('IMAGE_NAME')))
212 214
213 tdname = "%s.testdata.json" % image_name 215 tdname = "%s.testdata.json" % image_name
214 try: 216 try:
@@ -239,6 +241,8 @@ def testimage_main(d):
239 bb.fatal('Unsupported image type built. Add a compatible image to ' 241 bb.fatal('Unsupported image type built. Add a compatible image to '
240 'IMAGE_FSTYPES. Supported types: %s' % 242 'IMAGE_FSTYPES. Supported types: %s' %
241 ', '.join(supported_fstypes)) 243 ', '.join(supported_fstypes))
244 elif d.getVar("TEST_TARGET") == "serial":
245 bb.fatal('Serial target is currently only supported in testexport.')
242 qfstype = fstypes[0] 246 qfstype = fstypes[0]
243 qdeffstype = d.getVar("QB_DEFAULT_FSTYPE") 247 qdeffstype = d.getVar("QB_DEFAULT_FSTYPE")
244 if qdeffstype: 248 if qdeffstype:
@@ -376,7 +380,6 @@ def testimage_main(d):
376 bb.error('runqemu failed, shutting down...') 380 bb.error('runqemu failed, shutting down...')
377 if results: 381 if results:
378 results.stop() 382 results.stop()
379 results = tc.results
380 finally: 383 finally:
381 signal.signal(signal.SIGTERM, orig_sigterm_handler) 384 signal.signal(signal.SIGTERM, orig_sigterm_handler)
382 tc.target.stop() 385 tc.target.stop()
@@ -397,9 +400,9 @@ def testimage_main(d):
397 os.symlink(d.getVar("BB_LOGFILE"), os.path.join(targetdir, os.path.basename(d.getVar("BB_LOGFILE") + "." + d.getVar('DATETIME')))) 400 os.symlink(d.getVar("BB_LOGFILE"), os.path.join(targetdir, os.path.basename(d.getVar("BB_LOGFILE") + "." + d.getVar('DATETIME'))))
398 401
399 if not results or not complete: 402 if not results or not complete:
400 bb.fatal('%s - FAILED - tests were interrupted during execution, check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True) 403 bb.error('%s - FAILED - tests were interrupted during execution, check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True)
401 if not results.wasSuccessful(): 404 if results and not results.wasSuccessful():
402 bb.fatal('%s - FAILED - also check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True) 405 bb.error('%s - FAILED - also check the logs in %s' % (pn, d.getVar("LOG_DIR")), forcelog=True)
403 406
404def get_runtime_paths(d): 407def get_runtime_paths(d):
405 """ 408 """
@@ -483,5 +486,3 @@ python () {
483 if oe.types.boolean(d.getVar("TESTIMAGE_AUTO") or "False"): 486 if oe.types.boolean(d.getVar("TESTIMAGE_AUTO") or "False"):
484 bb.build.addtask("testimage", "do_build", "do_image_complete", d) 487 bb.build.addtask("testimage", "do_build", "do_image_complete", d)
485} 488}
486
487inherit testsdk