From 42850ebc0237d2f87444b8a7f6b7087138567ad5 Mon Sep 17 00:00:00 2001 From: Gabriel Mougard Date: Fri, 24 May 2024 10:12:44 +0200 Subject: [PATCH] tests: Add an interactive MicroCloud test with IPv6 disabled and IPv4 disabled Signed-off-by: Gabriel Mougard --- test/suites/basic.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/test/suites/basic.sh b/test/suites/basic.sh index 155af598e..e2c136642 100644 --- a/test/suites/basic.sh +++ b/test/suites/basic.sh @@ -41,6 +41,44 @@ test_interactive() { validate_system_lxd "${m}" 3 disk1 done + # Reset the systems with just LXD and no IPv6 support. + reset_systems 3 3 1 + + for m in micro01 micro02 micro03 ; do + lxc exec "${m}" -- echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6 + lxc exec "${m}" -- snap disable microceph || true + lxc exec "${m}" -- snap disable microovn || true + lxc exec "${m}" -- snap restart microcloud + done + + echo "Creating a MicroCloud with ZFS storage and no IPv6 support" + microcloud_interactive | lxc exec micro01 -- sh -c "microcloud init > out" + + lxc exec micro01 -- tail -1 out | grep "MicroCloud is ready" -q + for m in micro01 micro02 micro03 ; do + validate_system_lxd "${m}" 3 disk1 + done + + # Reset the systems with just LXD and no IPv4 support. + gw_net_addr=$(lxc network get lxdbr0 ipv4.address) + lxc network set lxdbr0 ipv4.address none + reset_systems 3 3 1 + + for m in micro01 micro02 micro03 ; do + lxc exec "${m}" -- snap disable microceph || true + lxc exec "${m}" -- snap disable microovn || true + lxc exec "${m}" -- snap restart microcloud + done + + echo "Creating a MicroCloud with ZFS storage and no IPv4 support" + ! microcloud_interactive | lxc exec micro01 -- sh -c "microcloud init 2> out" || false + + # Ensure we exited with the right error message. + lxc exec micro01 -- tail -1 err | grep "Error: Could not determine Fan overlay subnet: No default gateway for IPv4" -q + + # Set the IPv4 address back to the original value. + lxc network set lxdbr0 ipv4.address "${gw_net_addr}" + # Reset the systems and install microceph. reset_systems 3 3 1