[ovs-dev] [PATCH v2] testsuite: ofproto-dpif: fix sockets dependencies

Flavio Leitner fbl at redhat.com
Thu Apr 2 19:13:14 UTC 2015


The ofproto-dpif creates dummies backed by sockets so depending
on the order of execution when bridge is reconfiguring, an active
socket may run first and not find the file.  That is usually not a
problem because it will try to reconnect one second later. However,
it breaks the testsuite.

This patch fixes the issue splitting active and passive sockets in
different ovs-vsctl commands that guarantees the proper ordering
between them.

Signed-off-by: Flavio Leitner <fbl at redhat.com>
---
 tests/ofproto-dpif.at | 155 +++++++++++++++++++++++++++++---------------------
 1 file changed, 91 insertions(+), 64 deletions(-)

Changelog:
V2:
  - Fixed a typo in the commit log.

diff --git a/tests/ofproto-dpif.at b/tests/ofproto-dpif.at
index 89ba112..dba3789 100644
--- a/tests/ofproto-dpif.at
+++ b/tests/ofproto-dpif.at
@@ -10,18 +10,25 @@ AT_SETUP([ofproto-dpif, active-backup bonding])
 # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
 #    and br1 with interfaces p3, p4 and p8.
 # toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
-OVS_VSWITCHD_START(
-  [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
-   set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
-   set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
-   add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
-   add-br br1 -- \
-   set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
-   set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
-                  fail-mode=secure -- \
-   add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
-   add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
-   add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
+OVS_VSWITCHD_START
+ovs-vsctl add-bond br0 bond0 p1 p2 bond_mode=active-backup -- \
+    set interface p1 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
+    set interface p2 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
+    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy
+ovs-vsctl add-br br1 -- \
+    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
+    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
+        fail-mode=secure -- \
+    add-port br1 p3 -- \
+    set interface p3 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
+    add-port br1 p4 -- \
+    set interface p4 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
+    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy
+
 WAIT_FOR_DUMMY_PORTS([p3], [p4])
 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
 
@@ -58,20 +65,27 @@ AT_SETUP([ofproto-dpif, balance-slb bonding])
 #    and br1 with interfaces p4, p5, p6 and p8.
 #    p1 <-> p4, p2 <-> p5, p3 <-> p6
 # Send some traffic, make sure the traffic are spread based on source mac.
-OVS_VSWITCHD_START(
-  [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
-   set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
-   set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
-   set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
-   add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
-   add-br br1 -- \
-   set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
-   set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
-                  fail-mode=secure -- \
-   add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
-   add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
-   add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
-   add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
+OVS_VSWITCHD_START
+ovs-vsctl add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb -- \
+    set interface p1 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
+    set interface p2 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
+    set interface p3 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
+    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy
+ovs-vsctl add-br br1 -- \
+    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
+    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
+        fail-mode=secure -- \
+    add-port br1 p4 -- set interface p4 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
+    add-port br1 p5 -- set interface p5 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
+    add-port br1 p6 -- set interface p6 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
+    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy
+
 WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
@@ -101,23 +115,30 @@ AT_SETUP([ofproto-dpif, balance-tcp bonding])
 #    and br1 with interfaces bond1(p4, p5, p6) and p8.
 #    bond0 <-> bond1
 # Send some traffic, make sure the traffic are spread based on L4 headers.
-OVS_VSWITCHD_START(
-  [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
-        other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
-   set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
-   set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
-   set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
-   add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
-   add-br br1 -- \
-   set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
-   set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
-                  fail-mode=secure -- \
-   add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
-        other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
-   set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
-   set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
-   set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
-   add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
+OVS_VSWITCHD_START
+ovs-vsctl add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
+    other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
+    set interface p1 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
+    set interface p2 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
+    set interface p3 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
+    add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy
+ovs-vsctl add-br br1 -- \
+    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
+    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
+        fail-mode=secure -- \
+    add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
+        other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
+    set interface p4 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
+    set interface p5 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
+    set interface p6 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
+    add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy
+
 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
 ])
 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
@@ -150,27 +171,33 @@ AT_CLEANUP
 
 # Makes sure recirculation does not change the way packet is handled.
 AT_SETUP([ofproto-dpif, balance-tcp bonding, different recirc flow ])
-OVS_VSWITCHD_START(
-  [add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \
-       other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
-   set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
-   set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
-   add-br br1 -- \
-   set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
-   set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
-       fail-mode=standalone -- \
-   add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \
-       other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
-   set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
-   set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
-   add-port br1 br1- -- set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \
-   add-br br-int -- \
-   set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \
-   set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \
-       fail-mode=secure -- \
-   add-port br-int br1+ -- set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \
-   add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy
-])
+OVS_VSWITCHD_START
+ovs-vsctl add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \
+    other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
+    set interface p1 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
+    set interface p2 type=dummy \
+        options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2
+ovs-vsctl add-br br1 -- \
+    set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
+    set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
+        fail-mode=standalone -- \
+    add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \
+        other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
+    set interface p3 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
+    set interface p4 type=dummy \
+        options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
+    add-port br1 br1- -- \
+    set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \
+    add-br br-int -- \
+    set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \
+    set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \
+        fail-mode=secure -- \
+    add-port br-int br1+ -- \
+    set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \
+    add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy
+
 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
 ])
 
-- 
2.1.0




More information about the dev mailing list