tests: Fix trace-cmd output for host case

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>
This commit is contained in:
Jouni Malinen 2014-03-11 17:04:33 +02:00 committed by Jouni Malinen
parent 09eef142ea
commit 2ca47da4f7

View file

@ -101,7 +101,7 @@ class DataCollector(object):
self._dmesg = dmesg self._dmesg = dmesg
def __enter__(self): def __enter__(self):
if self._tracing: 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'], self._trace_cmd = subprocess.Popen(['sudo', 'trace-cmd', 'record', '-o', output, '-e', 'mac80211', '-e', 'cfg80211', 'sh', '-c', 'echo STARTED ; read l'],
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,