diff options
author | Ben Pfaff <blp@ovn.org> | 2016-12-19 13:20:07 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-12-19 21:02:11 -0800 |
commit | 1ea9b847135eddca39ed95c0811edd605f6ca114 (patch) | |
tree | 0f3977c4b2cc4dd2d2a5bcbde85c889e9daecba9 /tests | |
parent | 9496f7eb7aa38ce492aa0b72c25b0f7400ff2970 (diff) | |
download | openvswitch-1ea9b847135eddca39ed95c0811edd605f6ca114.tar.gz |
ovn-controller: Handle only relevant ports and flows.
On a particular hypervisor, ovn-controller only needs to handle ports
and datapaths that have some relationship with it, that is, the
ports that actually reside on the hypervisor, plus all the other ports on
those ports' datapaths, plus all of the ports and datapaths that are
reachable from those via logical patch ports. Until now, ovn-controller
has done a poor job of limiting what it deals with to this set. This
commit improves the situation.
This commit gets rid of the concept of a "patched_datapath" which until now
was used to represent any datapath that contained a logical patch port.
Previously, the concept of a "local_datapath" meant a datapath with a VIF
that resides on the local hypervisor. This commit extends that concept to
include any other datapath that can be reached from a VIF on the local
hypervisor, which is a simplification that makes the code easier to
understand in a few places.
CC: Gurucharan Shetty <guru@ovn.org>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Mickey Spiegel <mickeys.dev@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ovn-controller.at | 19 | ||||
-rw-r--r-- | tests/ovn.at | 4 |
2 files changed, 20 insertions, 3 deletions
diff --git a/tests/ovn-controller.at b/tests/ovn-controller.at index 60a67601d..8ad8f67d9 100644 --- a/tests/ovn-controller.at +++ b/tests/ovn-controller.at @@ -86,17 +86,23 @@ check_patches \ 'br-int patch-br-int-to-localnet2 patch-localnet2-to-br-int' \ 'br-eth0 patch-localnet2-to-br-int patch-br-int-to-localnet2' -# Add logical patch ports. +# Add logical patch ports to connect new logical datapath. +# +# (Also add a vif on this hypervisor on one of the datapaths, +# otherwise the hypervisor will ignore both of them.) AT_CHECK([ovn-sbctl \ -- --id=@dp1 create Datapath_Binding tunnel_key=1 \ -- --id=@dp2 create Datapath_Binding tunnel_key=2 \ -- create Port_Binding datapath=@dp1 logical_port=foo tunnel_key=1 type=patch options:peer=bar \ -- create Port_Binding datapath=@dp2 logical_port=bar tunnel_key=2 type=patch options:peer=foo \ + -- create Port_Binding datapath=@dp1 logical_port=dp1vif tunnel_key=3 \ | ${PERL} $srcdir/uuidfilt.pl], [0], [<0> <1> <2> <3> +<4> ]) +ovs-vsctl add-port br-int dp1vif -- set Interface dp1vif external_ids:iface-id=dp1vif check_patches \ 'br-int patch-br-int-to-localnet2 patch-localnet2-to-br-int' \ 'br-eth0 patch-localnet2-to-br-int patch-br-int-to-localnet2' \ @@ -120,6 +126,17 @@ check_patches \ 'br-int patch-quux-to-baz patch-baz-to-quux' \ 'br-int patch-baz-to-quux patch-quux-to-baz' +# Drop the vif from the patched-together datapaths and verify that the patch +# ports disappear. +AT_CHECK([ovs-vsctl del-port dp1vif]) +check_patches + +# Put the vif back and the patch ports reappear. +AT_CHECK([ovs-vsctl add-port br-int dp1vif -- set Interface dp1vif external_ids:iface-id=dp1vif]) +check_patches \ + 'br-int patch-quux-to-baz patch-baz-to-quux' \ + 'br-int patch-baz-to-quux patch-quux-to-baz' + # Create an empty database, serve it and switch to it # and verify that the OVS patch ports disappear # then put it back and verify that they reappear diff --git a/tests/ovn.at b/tests/ovn.at index 628d3c871..37797412c 100644 --- a/tests/ovn.at +++ b/tests/ovn.at @@ -5403,9 +5403,9 @@ AT_CHECK([ovs-vsctl add-port br-int localvif1 -- set Interface localvif1 externa # On hv1, check that there are no flows outputting bcast to tunnel OVS_WAIT_UNTIL([test `ovs-ofctl dump-flows br-int table=32 | ofctl_strip | grep output | wc -l` -eq 0]) -# On hv2, check that there is 1 flow outputting bcast to tunnel to hv1. +# On hv2, check that no flow outputs bcast to tunnel to hv1. as hv2 -OVS_WAIT_UNTIL([test `ovs-ofctl dump-flows br-int table=32 | ofctl_strip | grep output | wc -l` -eq 1]) +OVS_WAIT_UNTIL([test `ovs-ofctl dump-flows br-int table=32 | ofctl_strip | grep output | wc -l` -eq 0]) # Now bind vif2 on hv2. AT_CHECK([ovs-vsctl add-port br-int localvif2 -- set Interface localvif2 external_ids:iface-id=localvif2]) |