[PATCH 1/1] Fix trace parameter invocation

Eduardo Abinader eduardo.abinader at openbossa.org
Mon Feb 24 16:34:36 EST 2014


Right, Jouni.

Gonna do that.


On Mon, Feb 24, 2014 at 5:23 PM, Jouni Malinen <j at w1.fi> wrote:

> On Mon, Feb 24, 2014 at 04:25:03PM -0400, Eduardo Abinader wrote:
> > This patch avoids run-tests to keep hanging in a loop,
> > by simply checking inexistence of trace-cmd command
> > and exiting the script.
>
> > diff --git 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,
>
> That looks pretty ugly.. Isn't there any convenient way of making the
> following loop break out in case the popen call exits? That would sound
> quite a bit cleaner and also free of (admittedly theoretical) race
> condition on trace-cmd disappearing between the two calls.
>
> --
> Jouni Malinen                                            PGP id EFC895FA
> _______________________________________________
> HostAP mailing list
> HostAP at lists.shmoo.com
> http://lists.shmoo.com/mailman/listinfo/hostap
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.shmoo.com/pipermail/hostap/attachments/20140224/2a4bc54a/attachment.htm>


More information about the HostAP mailing list