[lxc-devel] [lxc-ci/master] bin/test-lxd-ovn: Adds routed ingress anycast tests

tomponline on Github lxc-bot at linuxcontainers.org
Wed Dec 9 18:20:49 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 363 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20201209/05985013/attachment.bin>
-------------- next part --------------
From 4888daacd0a6fcef92f8be2460070445277eb38a Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parrott at canonical.com>
Date: Wed, 9 Dec 2020 18:20:04 +0000
Subject: [PATCH] bin/test-lxd-ovn: Adds routed ingress anycast tests

Signed-off-by: Thomas Parrott <thomas.parrott at canonical.com>
---
 bin/test-lxd-ovn | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/bin/test-lxd-ovn b/bin/test-lxd-ovn
index 24d5f2c..6d904dc 100755
--- a/bin/test-lxd-ovn
+++ b/bin/test-lxd-ovn
@@ -151,13 +151,29 @@ lxc network create ovn-virtual-network --type=ovn --project testovn network=dumm
     ipv4.nat=false \
     ipv6.nat=false
 
-# Check network external subnet overlap.
+# Check network external subnet overlap is prevented.
 ! lxc network create ovn-virtual-network2 --type=ovn --project default network=dummy \
     ipv4.address=198.51.100.1/26 \
+    ipv4.nat=false || false
+
+! lxc network create ovn-virtual-network2 --type=ovn --project default network=dummy \
     ipv6.address=2001:db8:1:2::1/122 \
-    ipv4.nat=false \
     ipv6.nat=false || false
 
+# Check network external subnet overlap check relaxation when uplink has anycast routed ingress mode enabled.
+lxc network set dummy ovn.ingress_mode=routed ipv4.routes.anycast=true ipv6.routes.anycast=true --project default
+
+lxc network create ovn-virtual-network2 --type=ovn --project default network=dummy \
+    ipv4.address=198.51.100.1/26 \
+    ipv4.nat=false \
+    ipv6.address=2001:db8:1:2::1/122 \
+    ipv6.nat=false
+
+lxc network delete ovn-virtual-network2 --project default
+lxc network unset dummy ovn.ingress_mode --project default
+lxc network unset dummy ipv4.routes.anycast --project default
+lxc network unset dummy ipv6.routes.anycast --project default
+
 lxc init images:ubuntu/20.04 u1 --project testovn
 lxc config device add u1 eth0 nic network=ovn-virtual-network name=eth0 --project testovn
 
@@ -206,7 +222,15 @@ lxc init images:ubuntu/20.04 u2 --project testovn
 lxc config device add u2 eth0 nic network=ovn-virtual-network name=eth0 --project testovn
 ! lxc config device set u2 eth0 ipv4.routes.external=198.51.100.1/32 --project testovn || false
 ! lxc config device set u2 eth0 ipv6.routes.external=2001:db8:1:2::1/128 --project testovn || false
+
+# Check NIC external route overlap check relaxation when uplink has anycast routed ingress mode enabled.
+lxc network set dummy ovn.ingress_mode=routed ipv4.routes.anycast=true ipv6.routes.anycast=true --project default
+lxc config device set u2 eth0 ipv4.routes.external=198.51.100.1/32 --project testovn
+lxc config device set u2 eth0 ipv6.routes.external=2001:db8:1:2::1/128 --project testovn
 lxc delete -f u2 --project testovn
+lxc network unset dummy ovn.ingress_mode --project default
+lxc network unset dummy ipv4.routes.anycast --project default
+lxc network unset dummy ipv6.routes.anycast --project default
 
 # Check DNAT rules get added when starting instance port with external routes.
 lxc start u1 --project testovn


More information about the lxc-devel mailing list