]> code.ossystems Code Review - openembedded-core.git/commitdiff
testimage: fail if no package manifest is found
authorStefan Stanacar <stefanx.stanacar@intel.com>
Sun, 9 Feb 2014 10:39:31 +0000 (12:39 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 11 Feb 2014 11:56:26 +0000 (11:56 +0000)
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.

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/testimage.bbclass

index 75ab716270876f8f007430eb9034f7854760a2fa..48e10323262e9951b315824b78f3d75fb8f76fa3 100644 (file)
@@ -185,8 +185,11 @@ def testimage_main(d):
             self.imagefeatures = d.getVar("IMAGE_FEATURES", True).split()
             self.distrofeatures = d.getVar("DISTRO_FEATURES", True).split()
             manifest = os.path.join(d.getVar("DEPLOY_DIR_IMAGE", True), d.getVar("IMAGE_LINK_NAME", True) + ".manifest")
-            with open(manifest) as f:
-                self.pkgmanifest = f.read()
+            try:
+                with open(manifest) as f:
+                    self.pkgmanifest = f.read()
+            except IOError as e:
+                bb.fatal("No package manifest file found. Did you build the image?\n%s" % e)
 
     # test context
     tc = TestContext()