diff mbox series

[ovs-dev,v3] tests: Test for ovs-ofctl snoop command

Message ID 1533596017-30635-1-git-send-email-ashishvarma.ovs@gmail.com
State Accepted
Headers show
Series [ovs-dev,v3] tests: Test for ovs-ofctl snoop command | expand

Commit Message

Ashish Varma Aug. 6, 2018, 10:53 p.m. UTC
Added test for snoop command to check for the initial handshake messages
when a bridge connects to a controller via 'unix' connection method.

Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
---
v2-v3:

Moved 'on_exit kill" command before the start of the command to avoid the race 
condition between start of the process and registering to have it killed on
interrupt.
Removed deletion of snoopbr0.txt to debug any failure.
Cleaner shell re-direct.

---
 tests/ovs-ofctl.at | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

Comments

Ben Pfaff Aug. 6, 2018, 11:45 p.m. UTC | #1
On Mon, Aug 06, 2018 at 03:53:37PM -0700, Ashish Varma wrote:
> Added test for snoop command to check for the initial handshake messages
> when a bridge connects to a controller via 'unix' connection method.
> 
> Signed-off-by: Ashish Varma <ashishvarma.ovs@gmail.com>
> ---
> v2-v3:
> 
> Moved 'on_exit kill" command before the start of the command to avoid the race 
> condition between start of the process and registering to have it killed on
> interrupt.
> Removed deletion of snoopbr0.txt to debug any failure.
> Cleaner shell re-direct.

Thanks, applied to master.
0-day Robot Aug. 7, 2018, 2:15 a.m. UTC | #2
Bleep bloop.  Greetings Ashish Varma, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


git-am:
Failed to merge in the changes.
Patch failed at 0001 tests: Test for ovs-ofctl snoop command
The copy of the patch that failed is found in:
   /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch
When you have resolved this problem, run "git am --resolved".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".


Please check this out.  If you feel there has been an error, please email aconole@bytheb.org

Thanks,
0-day Robot
Aaron Conole Aug. 7, 2018, 7:07 p.m. UTC | #3
Ashish Varma <ashishvarma.ovs@gmail.com> writes:

> Hi Aaron,
>
> My patch is already committed by Ben. Not sure what is wrong here.

Thanks for the heads up.

This happens - usually if the patch is committed before the bot has run
against it.  I have it on my list of TODOs, so as soon as my next 'work
on the bot' time comes, I'll fix it.

> Is there something that I need to do now? (or should have done correctly)

Without looking too deeply, most likely a false positive.  Feel free to
not worry about it :)  I'll ping if it's a real issue somewhere.

> Thanks,
> Ashish 
> VMware OVS team
>
> On Mon, Aug 6, 2018 at 7:15 PM, 0-day Robot <robot@bytheb.org> wrote:
>
>  Bleep bloop.  Greetings Ashish Varma, I am a robot and I have tried out your patch.
>  Thanks for your contribution.
>
>  I encountered some error that I wasn't expecting.  See the details below.
>
>  git-am:
>  Failed to merge in the changes.
>  Patch failed at 0001 tests: Test for ovs-ofctl snoop command
>  The copy of the patch that failed is found in:
>     /var/lib/jenkins/jobs/upstream_build_from_pw/workspace/.git/rebase-apply/patch
>  When you have resolved this problem, run "git am --resolved".
>  If you prefer to skip this patch, run "git am --skip" instead.
>  To restore the original branch and stop patching, run "git am --abort".
>
>  Please check this out.  If you feel there has been an error, please email aconole@bytheb.org
>
>  Thanks,
>  0-day Robot
Ashish Varma Aug. 7, 2018, 7:15 p.m. UTC | #4
Thanks for clarifying.

On Tue, Aug 7, 2018 at 12:07 PM, Aaron Conole <aconole@bytheb.org> wrote:

> Ashish Varma <ashishvarma.ovs@gmail.com> writes:
>
> > Hi Aaron,
> >
> > My patch is already committed by Ben. Not sure what is wrong here.
>
> Thanks for the heads up.
>
> This happens - usually if the patch is committed before the bot has run
> against it.  I have it on my list of TODOs, so as soon as my next 'work
> on the bot' time comes, I'll fix it.
>
> > Is there something that I need to do now? (or should have done correctly)
>
> Without looking too deeply, most likely a false positive.  Feel free to
> not worry about it :)  I'll ping if it's a real issue somewhere.
>
> > Thanks,
> > Ashish
> > VMware OVS team
> >
> > On Mon, Aug 6, 2018 at 7:15 PM, 0-day Robot <robot@bytheb.org> wrote:
> >
> >  Bleep bloop.  Greetings Ashish Varma, I am a robot and I have tried out
> your patch.
> >  Thanks for your contribution.
> >
> >  I encountered some error that I wasn't expecting.  See the details
> below.
> >
> >  git-am:
> >  Failed to merge in the changes.
> >  Patch failed at 0001 tests: Test for ovs-ofctl snoop command
> >  The copy of the patch that failed is found in:
> >     /var/lib/jenkins/jobs/upstream_build_from_pw/
> workspace/.git/rebase-apply/patch
> >  When you have resolved this problem, run "git am --resolved".
> >  If you prefer to skip this patch, run "git am --skip" instead.
> >  To restore the original branch and stop patching, run "git am --abort".
> >
> >  Please check this out.  If you feel there has been an error, please
> email aconole@bytheb.org
> >
> >  Thanks,
> >  0-day Robot
>
diff mbox series

Patch

diff --git a/tests/ovs-ofctl.at b/tests/ovs-ofctl.at
index 06597d7..21a576a 100644
--- a/tests/ovs-ofctl.at
+++ b/tests/ovs-ofctl.at
@@ -3184,3 +3184,30 @@  AT_CHECK([grep -q "ct_dpif|DBG|.*ct_flush: zone 123" ovs-vswitchd.log])
 
 OVS_VSWITCHD_STOP
 AT_CLEANUP
+
+
+AT_SETUP([ovs-ofctl snoop-unix-connection])
+OVS_VSWITCHD_START
+
+dnl setup controller for br0 before starting the controller
+AT_CHECK([ovs-vsctl -vsyslog:off set-controller br0 unix:testcontroller])
+
+dnl then start listening on the '.snoop' connection
+on_exit 'kill `cat ovs-ofctl-snoop.pid`'
+AT_CHECK([ovs-ofctl -vsyslog:off --detach --pidfile=ovs-ofctl-snoop.pid snoop br0 > snoopbr0.txt 2>&1])
+
+dnl finally start the controller
+on_exit 'kill `cat ovs-testcontroller.pid`'
+AT_CHECK([ovs-testcontroller -vsyslog:off --detach --pidfile punix:testcontroller], [0], [ignore])
+OVS_WAIT_UNTIL([test -e testcontroller])
+
+dnl check for some of the initial handshake messages
+OVS_WAIT_UNTIL([egrep "OFPT_FEATURES_REQUEST" snoopbr0.txt 1> /dev/null 2>&1])
+OVS_WAIT_UNTIL([egrep "OFPT_FEATURES_REPLY" snoopbr0.txt 1> /dev/null 2>&1])
+OVS_WAIT_UNTIL([egrep "OFPT_SET_CONFIG" snoopbr0.txt 1> /dev/null 2>&1])
+
+dnl need to suppress the 'connection failed' WARN message in ovs-vswitchd
+dnl because we need ovs-vswitchd to have the controller config before starting
+dnl the controller to 'snoop' the OpenFlow messages from beginning
+OVS_VSWITCHD_STOP(["/connection failed (No such file or directory)/d"])
+AT_CLEANUP