On Thu, Apr 18, 2013 at 11:53:12AM -0700, Justin Pettit wrote: > On Apr 3, 2013, at 12:02 PM, Ben Pfaff <b...@nicira.com> wrote: > > > diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at > > index 06ebf23..857e6ab 100644 > > --- a/tests/ofproto-dpif.at > > +++ b/tests/ofproto-dpif.at > > @@ -1208,10 +1208,12 @@ AT_CLEANUP > > > > dnl Test that sFlow samples packets correctly. > > AT_SETUP([ofproto-dpif - sFlow packet sampling]) > > -AT_CHECK([perl $srcdir/choose-port.pl], [0], [stdout]) > > -SFLOW_PORT=`cat stdout` > > OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone]) > > > > +AT_CHECK([test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > > > sflow.log], [0], [], [ignore]) > > +AT_CAPTURE_FILE([sflow.log]) > > +SFLOW_PORT=`parse_listening_port < test-sflow.log` > > + > > ovs-appctl time/stop > > > > ADD_OF_PORTS([br0], 1, 2) > > @@ -1223,8 +1225,6 @@ ovs-vsctl \ > > --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \ > > header=128 sampling=1 polling=1 > > ON_EXIT([kill `cat test-sflow.pid`]) > > Should this ON_EXIT be moved before the test-sflow invocation?
Thanks, you're right. I've moved it now. > > +# parse_listening_port [SERVER] > > +# > > +# Parses the TCP or SSL port on which a server is listening from the log, > > +# given that the server was told to listen on a kernel-chosen port, > > +# file provided on stdin, and prints the port number on stdout. > > +# > > +# Here's an example of how to use this with ovsdb-server: > > +# > > +# OVS_LOGDIR=`pwd`; export OVS_LOGDIR > > +# ovsdb-server --log-file --remote=ptcp:0:127.0.0.1 ... > > +# TCP_PORT=`parse_listening_port < ovsdb-server.log` > > +# > > +# (Also works with pssl: in place of ptcp:.) > > Maybe it's obvious, but it might be nice to indicate that the user > must use "0:127.0.0.1". I hadn't realized it until I'd read the sed > input. I changed the comment to: # parse_listening_port [SERVER] # # Parses the TCP or SSL port on which a server is listening from the # log, given that the server was told to listen on a kernel-chosen # port, file provided on stdin, and prints the port number on stdout. # You should specify the listening remote as ptcp:0:127.0.0.1 or # pssl:0:127.0.0.1. # # Here's an example of how to use this with ovsdb-server: # # OVS_LOGDIR=`pwd`; export OVS_LOGDIR # ovsdb-server --log-file --remote=ptcp:0:127.0.0.1 ... # TCP_PORT=`parse_listening_port < ovsdb-server.log` > Otherwise, looks like a great improvement. Thanks! Thanks, I pushed this to master. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev