mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2025-01-29 16:24:03 -05:00
tests: Fix trace parameter invocation
If trace-cmd command does not exist, run-tests.py could end up hanging in a loop waiting for input. Fix this simply by checking whether the trace-cmd command can be executed sucessfully and exiting the script if not. Signed-off-by: Eduardo Abinader <eduardo.abinader@openbossa.org>
This commit is contained in:
parent
1d91f504e4
commit
b5008c2c2d
@ -108,8 +108,12 @@ class DataCollector(object):
|
|||||||
stderr=open('/dev/null', 'w'),
|
stderr=open('/dev/null', 'w'),
|
||||||
cwd=self._logdir)
|
cwd=self._logdir)
|
||||||
l = self._trace_cmd.stdout.read(7)
|
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)
|
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):
|
def __exit__(self, type, value, traceback):
|
||||||
if self._tracing:
|
if self._tracing:
|
||||||
self._trace_cmd.stdin.write('DONE\n')
|
self._trace_cmd.stdin.write('DONE\n')
|
||||||
|
Loading…
Reference in New Issue
Block a user