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

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 c202714c45dc8752775474c47b6001c6b53c2d90 Mon Sep 17 00:00:00 2001
From: Thomas Parrott <thomas.parr...@canonical.com>
Date: Fri, 30 Oct 2020 17:52:18 +0000
Subject: [PATCH] bin/test-lxd-cluster: Adds cluster fan networking tests

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

diff --git a/bin/test-lxd-cluster b/bin/test-lxd-cluster
index f1cc6a4..297a6d3 100755
--- a/bin/test-lxd-cluster
+++ b/bin/test-lxd-cluster
@@ -61,6 +61,11 @@ for i in $(seq "$1"); do
         lxc exec "${PREFIX}-$i" -- lxc config set cluster.https_address 
"${CLUSTER_IP}:8443"
         lxc exec "${PREFIX}-$i" -- lxc config set core.trust_password "cluster"
         lxc exec "${PREFIX}-$i" -- lxc cluster enable "${PREFIX}-$i"
+        lxc exec "${PREFIX}-$i" -- lxc network create lxdfan0 bridge.mode=fan
+        lxc exec "${PREFIX}-$i" -- lxc storage create default dir
+        lxc exec "${PREFIX}-$i" -- lxc profile device add default root disk 
path=/ pool=default
+        lxc exec "${PREFIX}-$i" -- lxc profile device add default eth0 nic 
name=eth0 network=lxdfan0
+        lxc exec "${PREFIX}-$i" -- lxc network show lxdfan0
         CLUSTER_CRT=$(lxc file pull 
"${PREFIX}-$i"/var/snap/lxd/common/lxd/cluster.crt - | sed 
':a;N;$!ba;s/\n/\n\n/g')
     else
         MEMBER_IP=$(lxc exec "${PREFIX}-$i" -- ip -4 addr show dev eth0 scope 
global | grep inet | cut -d' ' -f6 | cut -d/ -f1)
@@ -85,6 +90,20 @@ echo "==> Validating the cluster"
 lxc exec "${PREFIX}-1" -- lxc info
 lxc exec "${PREFIX}-1" -- lxc cluster list
 
+# Test fan networking (intra fan from container and host, as well as external 
NAT comms)
+echo "==> Test fan networking"
+lxc exec "${PREFIX}-1" -- lxc launch images:ubuntu/focal u1
+lxc exec "${PREFIX}-1" -- lxc launch images:ubuntu/focal u2
+
+echo "==> Wait for addresses"
+sleep 10
+lxc exec "${PREFIX}-1" -- lxc list
+
+U2_IPV4="$(lxc exec ${PREFIX}-1 -- lxc list u2 -c4 --format=csv | cut -d' ' 
-f1)"
+lxc exec "${PREFIX}-1" -- lxc exec u1 -- ping -c1 -4 linuxcontainers.org
+lxc exec "${PREFIX}-1" -- lxc exec u1 -- ping -c1 "${U2_IPV4}"
+lxc exec "${PREFIX}-1" -- ping -c1 "${U2_IPV4}"
+
 # Upgrade the cluster
 echo "==> Upgrading the cluster"
 for i in $(seq "$1"); do
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to