All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] scripts/yocto-compat-layer.py: Return non-zero when layer test fail
@ 2017-06-05 22:06 Aníbal Limón
  2017-06-05 22:06 ` [PATCH 2/2] scripts/yocto-compat-layer-wrapper: Use realpath of output_log Aníbal Limón
  0 siblings, 1 reply; 2+ messages in thread
From: Aníbal Limón @ 2017-06-05 22:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: patrick.ohly, libertad.gonzalez.de.la.cruz

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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] scripts/yocto-compat-layer-wrapper: Use realpath of output_log
  2017-06-05 22:06 [PATCH 1/2] scripts/yocto-compat-layer.py: Return non-zero when layer test fail Aníbal Limón
@ 2017-06-05 22:06 ` Aníbal Limón
  0 siblings, 0 replies; 2+ messages in thread
From: Aníbal Limón @ 2017-06-05 22:06 UTC (permalink / raw)
  To: openembedded-core; +Cc: patrick.ohly, libertad.gonzalez.de.la.cruz

We are using a temp directory, use the realpath for output log
to store the results in the original BUILDDIR.

[YOCTO #11571]

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

diff --git a/scripts/yocto-compat-layer-wrapper b/scripts/yocto-compat-layer-wrapper
index db4b687..b6baeb4 100755
--- a/scripts/yocto-compat-layer-wrapper
+++ b/scripts/yocto-compat-layer-wrapper
@@ -13,13 +13,29 @@ if [ -z "$BUILDDIR" ]; then
 	exit 2
 fi
 
+# since we are using a temp directory, use the realpath for output
+# log option
+output_log=''
+while getopts o: name
+do
+	case $name in
+	o) output_log=$(realpath "$OPTARG")
+	esac
+done
+shift $(($OPTIND - 1))
+
+# generate a temp directory to run compat layer script
 base_dir=$(realpath $BUILDDIR/../)
 cd $base_dir
 
 build_dir=$(mktemp -p $base_dir -d -t build-XXXX)
 
 source oe-init-build-env $build_dir
-yocto-compat-layer.py "$@"
+if [[ $output_log != '' ]]; then
+	yocto-compat-layer.py -o "$output_log" "$*"
+else
+	yocto-compat-layer.py "$@"
+fi
 retcode=$?
 
 rm -rf $build_dir
-- 
2.1.4



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-05 22:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 22:06 [PATCH 1/2] scripts/yocto-compat-layer.py: Return non-zero when layer test fail Aníbal Limón
2017-06-05 22:06 ` [PATCH 2/2] scripts/yocto-compat-layer-wrapper: Use realpath of output_log Aníbal Limón

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.