[oe-commits] Stefan Stanacar : testimage: fail if no package manifest is found
git at git.openembedded.org
git at git.openembedded.org
Tue Feb 11 11:56:32 UTC 2014
Module: openembedded-core.git
Branch: master
Commit: 85c8dd4170a88a5d7f3d9ca181e75720302727c5
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=85c8dd4170a88a5d7f3d9ca181e75720302727c5
Author: Stefan Stanacar <stefanx.stanacar at intel.com>
Date: Sun Feb 9 12:39:31 2014 +0200
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.
Signed-off-by: Stefan Stanacar <stefanx.stanacar at intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/testimage.bbclass | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 75ab716..48e1032 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -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()
More information about the Openembedded-commits
mailing list