[ovs-dev] [PATCH 4/4] system-ovn.at: Add a OVN load-balancing unit test.

Guru Shetty guru at ovn.org
Wed Jul 13 16:50:06 UTC 2016


On 12 July 2016 at 17:57, Joe Stringer <joe at ovn.org> wrote:

> On 11 July 2016 at 23:35, Gurucharan Shetty <guru at ovn.org> wrote:
> > Signed-off-by: Gurucharan Shetty <guru at ovn.org>
> > ---
>
> Looks good, thanks. Only comment is if you add this file to
> check-system-userspace then it should also get a CHECK_CONNTRACK() at
> the start.
>
I will do that.


>
> Acked-by: Joe Stringer <joe at ovn.org>
>

Thank you. Since I am sending a v2 for NAT test anyway, I would like to
take that opportunity to enhance this test as well in v2 with the following
incremental:
diff --git a/tests/system-ovn.at b/tests/system-ovn.at
index 61aaa76..ff4b4b0 100644
--- a/tests/system-ovn.at
+++ b/tests/system-ovn.at
@@ -235,10 +235,13 @@ ADD_VETH(bar3, bar3, br-int, "172.16.1.4/24",
"f0:00:0f:01:02:05", \
 ovn-nbctl lsp-add bar bar3 \
 -- lsp-set-addresses bar3 "f0:00:0f:01:02:05 172.16.1.4"

-# Config OVN load-balancer.
+# Config OVN load-balancer with a VIP.
 uuid=`ovn-nbctl  create load_balancer
vips:30.0.0.1="172.16.1.2,172.16.1.3,172.16.1.4"`
 ovn-nbctl set logical_switch foo load_balancer=$uuid

+# Config OVN load-balancer with another VIP (this time with ports).
+ovn-nbctl set load_balancer $uuid vips:'"30.0.0.2:8000"'='"172.16.1.2:80,
172.16.1.3:80,172.16.1.4:80"'
+
 # Wait for ovn-controller to catch up.
 sleep 2

@@ -260,6 +263,19 @@
tcp,orig=(src=192.168.1.2,dst=30.0.0.1,sport=<cleared>,dport=<cleared>),reply=(s
 tcp,orig=(src=192.168.1.2,dst=30.0.0.1,sport=<cleared>,dport=<cleared>),reply=(src=172.16.1.4,dst=192.168.1.2
 ])

+dnl Test load-balancing that includes L4 ports in NAT.
+for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
+    echo Request $i
+    NS_CHECK_EXEC([foo1], [wget 30.0.0.2:8000 -t 5 -T 1
--retry-connrefused -v -o wget$i.log])
+done
+
+dnl Each server should have at least one connection.
+AT_CHECK([ovs-appctl dpctl/dump-conntrack | FORMAT_CT(30.0.0.2)], [0], [dnl
+tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=<cleared>,dport=<cleared>),reply=(src=172.16.1.2,dst=192.168.1.2
+tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=<cleared>,dport=<cleared>),reply=(src=172.16.1.3,dst=192.168.1.2
+tcp,orig=(src=192.168.1.2,dst=30.0.0.2,sport=<cleared>,dport=<cleared>),reply=(src=172.16.1.4,dst=192.168.1.2
+])
+



More information about the dev mailing list