[PATCH 1/1] Fix trace parameter invocation

Eduardo Abinader eduardo.abinader
Tue Feb 25 13:27:03 PST 2014


Summary:
If trace-cmd command does not exist, this patch avoids
run-tests to keep hanging in a loop, by simply checking
inexistence of trace-cmd command and exiting the script.

Signed-off-by: Eduardo Abinader <eduardo.abinader at openbossa.org>
---
 tests/hwsim/run-tests.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index 68ea439..b7565b4 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -108,8 +108,12 @@ class DataCollector(object):
                                                stderr=open('/dev/null', 'w'),
                                                cwd=self._logdir)
             l = self._trace_cmd.stdout.read(7)
-            while not 'STARTED' in l:
+            while self._trace_cmd.poll() is None and not 'STARTED' in l:
                 l += self._trace_cmd.stdout.read(1)
+            res = self._trace_cmd.returncode
+            if res:
+                print "Failed calling trace-cmd: returned exit status %d" % res
+                sys.exit(1)
     def __exit__(self, type, value, traceback):
         if self._tracing:
             self._trace_cmd.stdin.write('DONE\n')
-- 
1.8.1.2




More information about the Hostap mailing list