diff options
author | Joshua Lock <joshua.g.lock@intel.com> | 2016-07-14 14:36:32 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-20 10:28:52 +0100 |
commit | 45180589422cb49d480830ca373122b484b71494 (patch) | |
tree | e11e61f8253451ca63458c4aac4ad4cd42663492 /meta/lib | |
parent | d1fdd0ad55cbf8908730b1bb104908ded5213a38 (diff) | |
download | poky-45180589422cb49d480830ca373122b484b71494.tar.gz |
image: add do_image_qa task to run QA checks on the constructed image
This task runs all functions in IMAGE_QA_COMMANDS after the image
construction has completed in order to validate the resulting image.
Image sanity checks should either be Python functions which raise
bb.build.FuncFailed on failure or shell functions with return a
non-zero exit code.
Python functions may instead raise an oe.utils.ImageQAFailed
Exception which takes an extra argument, a description of the
failure.
python image_check_python_ok () {
if True:
raise bb.build.FuncFailed('This check always fails')
else:
bb.note("Nothing to see here")
}
image_check_shell_ok () {
if true
exit 1
else
exit 0
fi
}
[YOCTO #9448]
(From OE-Core rev: c9bef2ecf1a30159d11781184829f41844a58c13)
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/utils.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index cecddc657f..19db540779 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py | |||
@@ -304,3 +304,16 @@ def write_ld_so_conf(d): | |||
304 | with open(ldsoconf, "w") as f: | 304 | with open(ldsoconf, "w") as f: |
305 | f.write(d.getVar("base_libdir", True) + '\n') | 305 | f.write(d.getVar("base_libdir", True) + '\n') |
306 | f.write(d.getVar("libdir", True) + '\n') | 306 | f.write(d.getVar("libdir", True) + '\n') |
307 | |||
308 | class ImageQAFailed(bb.build.FuncFailed): | ||
309 | def __init__(self, description, name=None, logfile=None): | ||
310 | self.description = description | ||
311 | self.name = name | ||
312 | self.logfile=logfile | ||
313 | |||
314 | def __str__(self): | ||
315 | msg = 'Function failed: %s' % self.name | ||
316 | if self.description: | ||
317 | msg = msg + ' (%s)' % self.description | ||
318 | |||
319 | return msg | ||