diff options
author | Stefan Stanacar <stefanx.stanacar@intel.com> | 2014-02-09 12:39:31 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-11 11:56:56 +0000 |
commit | 2882b132cc50af9fae13f0cbdbf6b690f8479287 (patch) | |
tree | 33a38177ba2226f80abe9e16b16dbc1701c147b9 /meta | |
parent | 6d0f1d30d45ed28291d124682bd71eaa92ea79a2 (diff) | |
download | poky-2882b132cc50af9fae13f0cbdbf6b690f8479287.tar.gz |
testimage: fail if no package manifest is found
Sometimes we may forget to actually build the image
we want to test (when testimage task is called manually).
Instead of an ugly traceback we should fail nicely.
The manifest is written after the rootfs so this ensures
the image was actually built.
(From OE-Core rev: 85c8dd4170a88a5d7f3d9ca181e75720302727c5)
Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/testimage.bbclass | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index 75ab716270..48e1032326 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass | |||
@@ -185,8 +185,11 @@ def testimage_main(d): | |||
185 | self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split() | 185 | self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split() |
186 | self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split() | 186 | self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split() |
187 | manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + ".manifest") | 187 | manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + ".manifest") |
188 | with open(manifest) as f: | 188 | try: |
189 | self.pkgmanifest = f.read() | 189 | with open(manifest) as f: |
190 | self.pkgmanifest = f.read() | ||
191 | except IOError as e: | ||
192 | bb.fatal("No package manifest file found. Did you build the image?\n%s" % e) | ||
190 | 193 | ||
191 | # test context | 194 | # test context |
192 | tc = TestContext() | 195 | tc = TestContext() |