<div dir="ltr">Right, Jouni. <br><br>Gonna do that.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Feb 24, 2014 at 5:23 PM, Jouni Malinen <span dir="ltr"><<a href="mailto:j@w1.fi" target="_blank">j@w1.fi</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Mon, Feb 24, 2014 at 04:25:03PM -0400, Eduardo Abinader wrote:<br>
> This patch avoids run-tests to keep hanging in a loop,<br>
> by simply checking inexistence of trace-cmd command<br>
> and exiting the script.<br>
<br>
</div>> diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py<br>
<div class="">> @@ -102,6 +102,11 @@ class DataCollector(object):<br>
> def __enter__(self):<br>
> if self._tracing:<br>
> output = os.path.join(self._logdir, '%s.dat' % (self._testname, ))<br>
> + if subprocess.call(["type trace-cmd"], shell=True,<br>
> + stdout=subprocess.PIPE,<br>
> + stderr=subprocess.PIPE):<br>
> + print "failed: trace-cmd not found"<br>
> + sys.exit(1)<br>
> self._trace_cmd = subprocess.Popen(['sudo', 'trace-cmd', 'record', '-o', output, '-e', 'mac80211', '-e', 'cfg80211', 'sh', '-c', 'echo STARTED ; read l'],<br>
> stdin=subprocess.PIPE,<br>
> stdout=subprocess.PIPE,<br>
<br>
</div>That looks pretty ugly.. Isn't there any convenient way of making the<br>
following loop break out in case the popen call exits? That would sound<br>
quite a bit cleaner and also free of (admittedly theoretical) race<br>
condition on trace-cmd disappearing between the two calls.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Jouni Malinen PGP id EFC895FA<br>
_______________________________________________<br>
HostAP mailing list<br>
<a href="mailto:HostAP@lists.shmoo.com">HostAP@lists.shmoo.com</a><br>
<a href="http://lists.shmoo.com/mailman/listinfo/hostap" target="_blank">http://lists.shmoo.com/mailman/listinfo/hostap</a><br>
</font></span></blockquote></div><br></div>