[PATCH 1/1] Fix trace parameter invocation

Eduardo Abinader eduardo.abinader at openbossa.org
Mon Feb 24 15:25:03 EST 2014


Summary:
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 | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index 68ea439..c85cc22 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -102,6 +102,11 @@ class DataCollector(object):
     def __enter__(self):
         if self._tracing:
             output = os.path.join(self._logdir, '%s.dat' % (self._testname, ))
+            if subprocess.call(["type trace-cmd"], shell=True, 
+                               stdout=subprocess.PIPE, 
+                               stderr=subprocess.PIPE):
+                print "failed: trace-cmd not found"
+                sys.exit(1)
             self._trace_cmd = subprocess.Popen(['sudo', 'trace-cmd', 'record', '-o', output, '-e', 'mac80211', '-e', 'cfg80211', 'sh', '-c', 'echo STARTED ; read l'],
                                                stdin=subprocess.PIPE,
                                                stdout=subprocess.PIPE,
-- 
1.8.1.2



More information about the HostAP mailing list