Add a mechanism to run QA checks on a constructed image once it's
complete. All checks will be run with any one failure resulting in
a failed build.
QA checks should be bitbake functions which throw a
NotImplementedError when the check QA fails, with any error
messages passed to the exception.
Specify which checks to run by adding them to IMAGE_QA_COMMANDS.
i.e.
IMAGE_QA_COMMANDS += " \
image_check_everything_ok \
"
python image_check_everything_ok () {
raise NotImplementedError('This check always fails')
}
This code is based heavily on the configuration upgrade code in
sanity.bbclass.
[YOCTO #9448]
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Add a mechanism to run QA checks on a constructed image once it's
complete. All checks will be run with any one failure resulting in
a failed build.
QA checks should be bitbake functions which throw a
NotImplementedError when the check QA fails, with any error
messages passed to the exception.
Specify which checks to run by adding them to IMAGE_QA_COMMANDS.
i.e.
IMAGE_QA_COMMANDS += " \
image_check_everything_ok \
"
python image_check_everything_ok () {
raise NotImplementedError('This check always fails')
}
This code is based heavily on the configuration upgrade code in
sanity.bbclass.
[YOCTO #9448]
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>What's the behavior if your qa function fails with a different exception? What if a user writes a shell qa check function, what's the behavior? Also, this seems like overloading the purpose of NotImplementedError. IMO It'd be cleaner to either use a custom exception or re-use python unit testing bits / use assert rather than subverting this one to a different purpose.
What's the behavior if your qa function fails with a different exception? What if a user writes a shell qa check function, what's the behavior? Also, this seems like overloading the purpose of NotImplementedError. IMO It'd be cleaner to either use a custom exception or re-use python unit testing bits / use assert rather than subverting this one to a different purpose.