[PATCH] tests: run-tests: print more details about NameError

Johannes Berg johannes at sipsolutions.net
Fri Nov 27 10:54:58 PST 2015


From: Johannes Berg <johannes.berg at intel.com>

If encountering a NameError, print the entire traceback so that
it's actually debuggable.

Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
 tests/hwsim/run-tests.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index c55ed8323698..ec328127304e 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -453,6 +453,11 @@ def main():
             except HwsimSkip, e:
                 logger.info("Skip test case: %s" % e)
                 result = "SKIP"
+            except NameError, e:
+                import traceback
+                logger.info(e)
+                traceback.print_exc()
+                result = "FAIL"
             except Exception, e:
                 logger.info(e)
                 if args.loglevel == logging.WARNING:
-- 
2.6.2




More information about the Hostap mailing list