[PATCH 2/7] scripts/yocto-compat-layer.py: Return non-zero when layer test fail

Aníbal Limón
2017-06-08T16:32:06Z

If whatever layer tested fails returns 2 to indicate the
failure.

[YOCTO #11482]

Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
---
scripts/yocto-compat-layer.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/scripts/yocto-compat-layer.py b/scripts/yocto-compat-layer.py
index 0d5700b..30c55a9 100755
--- a/scripts/yocto-compat-layer.py
+++ b/scripts/yocto-compat-layer.py
@@ -178,16 +178,19 @@ def main():
results_status[layer['name']] = 'PASS' if results[layer['name']].wasSuccessful() else 'FAIL'
layers_tested = layers_tested + 1

+ ret = 0
if layers_tested:
logger.info('')
logger.info('Summary of results:')
logger.info('')
for layer_name in results_status:
logger.info('%s ... %s' % (layer_name, results_status[layer_name]))
+ if not results[layer_name].wasSuccessful():
+ ret = 2 # ret = 1 used for initialization errors

cleanup_bblayers(None, None)

- return 0
+ return ret

if __name__ == '__main__':
try:
--
2.1.4