tests: Fix trace-cmd output for host case
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 11 Mar 2014 15:04:33 +0000 (17:04 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 11 Mar 2014 15:04:33 +0000 (17:04 +0200)
Both the output file path and the current working directory included the
log directory and this failed if log directory was not absolute (e.g.,
when using the default logs/current in the case a VM is not used).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/run-tests.py

index 68ea439..b036a08 100755 (executable)
@@ -101,7 +101,7 @@ class DataCollector(object):
         self._dmesg = dmesg
     def __enter__(self):
         if self._tracing:
-            output = os.path.join(self._logdir, '%s.dat' % (self._testname, ))
+            output = os.path.abspath(os.path.join(self._logdir, '%s.dat' % (self._testname, )))
             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,