diff options
| author | brian avery <avery.brian@gmail.com> | 2017-04-20 10:38:18 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-04-21 08:22:09 +0100 |
| commit | 36db8f2b789cd674deb4b4e3ca408d62f837b214 (patch) | |
| tree | 7582079ae44c957542f7d9558f0cfddb04f1105b | |
| parent | a59bfd05d15085a3dc5669b47fd19867246c846b (diff) | |
| download | poky-36db8f2b789cd674deb4b4e3ca408d62f837b214.tar.gz | |
testimage.bbclass: add additional dependency
qemu-native-helper has an additional task that needs to be run in order
for testimage to work. This task is usually run by default in a full
build but there are use cases where it might be skipped. This commit
adds the dependency explicitly.
Also, this commit adds a try/catch error message to make it clearer what
you need to do if you try to run testimage before you have built or
downloaded the image artifacts.
[YOCTO #11375]
(From OE-Core rev: 6e019537b9eb3af482e474a8cb248fe7312f4b58)
Signed-off-by: brian avery <brian.avery@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/classes/testimage.bbclass | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index a259423c22..fb214604a9 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass | |||
| @@ -71,7 +71,7 @@ TEST_QEMUBOOT_TIMEOUT ?= "1000" | |||
| 71 | TEST_TARGET ?= "qemu" | 71 | TEST_TARGET ?= "qemu" |
| 72 | 72 | ||
| 73 | TESTIMAGEDEPENDS = "" | 73 | TESTIMAGEDEPENDS = "" |
| 74 | TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot" | 74 | TESTIMAGEDEPENDS_qemuall = "qemu-native:do_populate_sysroot qemu-helper-native:do_populate_sysroot qemu-helper-native:do_addto_recipe_sysroot" |
| 75 | TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}" | 75 | TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}" |
| 76 | TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}" | 76 | TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'cpio-native:do_populate_sysroot', '', d)}" |
| 77 | TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}" | 77 | TESTIMAGEDEPENDS_qemuall += "${@bb.utils.contains('IMAGE_PKGTYPE', 'rpm', 'createrepo-c-native:do_populate_sysroot', '', d)}" |
| @@ -166,7 +166,11 @@ def testimage_main(d): | |||
| 166 | d.getVar('IMAGE_LINK_NAME'))) | 166 | d.getVar('IMAGE_LINK_NAME'))) |
| 167 | 167 | ||
| 168 | tdname = "%s.testdata.json" % image_name | 168 | tdname = "%s.testdata.json" % image_name |
| 169 | td = json.load(open(tdname, "r")) | 169 | try: |
| 170 | td = json.load(open(tdname, "r")) | ||
| 171 | except (FileNotFoundError) as err: | ||
| 172 | bb.fatal('File %s Not Found. Have you built the image with INHERIT+="testimage" in the conf/local.conf?' % tdname) | ||
| 173 | |||
| 170 | # Some variables need to be updates (mostly paths) with the | 174 | # Some variables need to be updates (mostly paths) with the |
| 171 | # ones of the current environment because some tests require them. | 175 | # ones of the current environment because some tests require them. |
| 172 | updateTestData(d, td, d.getVar('TESTIMAGE_UPDATE_VARS').split()) | 176 | updateTestData(d, td, d.getVar('TESTIMAGE_UPDATE_VARS').split()) |
