The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxc-ci/pull/219

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
From 2a082c21078b1646928c5d6b19fdf32ed59e21d9 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Wed, 16 Dec 2020 16:42:41 +0000
Subject: [PATCH] bin/test-lxd-ovn: Adds tests for using a physical bridge
 uplink

Signed-off-by: Thomas Parrott <thomas.parr...@canonical.com>
---
 bin/test-lxd-ovn | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/bin/test-lxd-ovn b/bin/test-lxd-ovn
index 2256cac..f1be7fa 100755
--- a/bin/test-lxd-ovn
+++ b/bin/test-lxd-ovn
@@ -385,6 +385,51 @@ lxc delete -f u2 u3
 lxc network delete ovn-virtual-network
 lxc network delete lxdbr0 --project default
 
+# Test physical uplinks using native bridge.
+lxc project switch default
+ip link add dummybr0 type bridge # Create dummy uplink bridge.
+ip address add 192.0.2.1/24 dev dummybr0
+ip address add 2001:db8:1:1::1/64 dev dummybr0
+ip link set dummybr0 up
+lxc network create dummy --type=physical \
+    parent=dummybr0 \
+    ipv4.gateway=192.0.2.1/24 \
+    ipv6.gateway=2001:db8:1:1::1/64 \
+    ipv4.ovn.ranges=192.0.2.10-192.0.2.19
+lxc network create ovn-virtual-network --type=ovn network=dummy
+bridge link show dummybr0 | wc -l | grep 1 # Check we have one port connected 
to the uplink bridge.
+ovs-vsctl list-br | grep ovn | wc  -l | grep 1 # Check we have one OVS bridge.
+ovnIPv4="$(lxc network get ovn-virtual-network volatile.network.ipv4.address)"
+ovnIPv6="$(lxc network get ovn-virtual-network volatile.network.ipv6.address)"
+ping -c1 -4 "${ovnIPv4}" # Check IPv4 connectivity over dummy bridge to OVN 
router.
+ping -c1 -6 "${ovnIPv6}" # Check IPv6 connectivity over dummy bridge to OVN 
router.
+lxc network delete ovn-virtual-network
+lxc network delete dummy
+bridge link show dummybr0 | wc -l | grep 0 # Check the port is removed from 
the uplink bridge.
+ovs-vsctl list-br | grep ovn | wc  -l | grep 0 # Check the OVS bridge is 
removed.
+ip link delete dummybr0 # Remove dummy uplink bridge.
+
+# Test physical uplinks using OVS bridge.
+ovs-vsctl add-br dummybr0 # Create dummy uplink bridge.
+ip address add 192.0.2.1/24 dev dummybr0
+ip address add 2001:db8:1:1::1/64 dev dummybr0
+ip link set dummybr0 up
+lxc network create dummy --type=physical \
+    parent=dummybr0 \
+    ipv4.gateway=192.0.2.1/24 \
+    ipv6.gateway=2001:db8:1:1::1/64 \
+    ipv4.ovn.ranges=192.0.2.10-192.0.2.19
+lxc network create ovn-virtual-network --type=ovn network=dummy
+ovs-vsctl list-ports dummybr0 | grep patch-lxd-net | wc -l | grep 1 # Check 
bridge has an OVN patch port connected.
+ovnIPv4="$(lxc network get ovn-virtual-network volatile.network.ipv4.address)"
+ovnIPv6="$(lxc network get ovn-virtual-network volatile.network.ipv6.address)"
+ping -c1 -4 "${ovnIPv4}" # Check IPv4 connectivity over dummy bridge to OVN 
router.
+ping -c1 -6 "${ovnIPv6}" # Check IPv6 connectivity over dummy bridge to OVN 
router.
+lxc network delete ovn-virtual-network
+lxc network delete dummy
+ovs-vsctl list-ports dummybr0 | grep patch-lxd-net | wc -l | grep 0 # Check 
bridge has no OVN patch port connected.
+ovs-vsctl del-br dummybr0 # Remove dummy uplink bridge.
+
 lxc image delete "${FINGERPRINT}" --project testovn
 lxc image delete "${FINGERPRINT}" --project default
 lxc profile device remove default root --project testovn
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to