From 9b3d70d0273e441c1bd6996134ae2d1660f80608 Mon Sep 17 00:00:00 2001 From: Max Asnaashari Date: Mon, 15 Apr 2024 18:40:35 +0000 Subject: [PATCH 1/3] microcloud/test/includes: Shorter dns env var Signed-off-by: Max Asnaashari --- microcloud/test/includes/microcloud.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/microcloud/test/includes/microcloud.sh b/microcloud/test/includes/microcloud.sh index a47f7ce7f..1608d0df7 100644 --- a/microcloud/test/includes/microcloud.sh +++ b/microcloud/test/includes/microcloud.sh @@ -3,7 +3,7 @@ unset_interactive_vars() { unset LOOKUP_IFACE LIMIT_SUBNET SKIP_SERVICE EXPECT_PEERS \ SETUP_ZFS ZFS_FILTER ZFS_WIPE \ SETUP_CEPH CEPH_WARNING CEPH_FILTER CEPH_WIPE SETUP_CEPHFS \ - SETUP_OVN OVN_WARNING OVN_FILTER IPV4_SUBNET IPV4_START IPV4_END CUSTOM_DNS_ADDRESSES IPV6_SUBNET + SETUP_OVN OVN_WARNING OVN_FILTER IPV4_SUBNET IPV4_START IPV4_END DNS_ADDRESSES IPV6_SUBNET } # microcloud_interactive: outputs text that can be passed to `TEST_CONSOLE=1 microcloud init` @@ -29,7 +29,7 @@ microcloud_interactive() { IPV4_SUBNET=${IPV4_SUBNET:-} # OVN ipv4 gateway subnet. IPV4_START=${IPV4_START:-} # OVN ipv4 range start. IPV4_END=${IPV4_END:-} # OVN ipv4 range end. - CUSTOM_DNS_ADDRESSES=${CUSTOM_DNS_ADDRESSES:-} # OVN custom DNS addresses. + DNS_ADDRESSES=${DNS_ADDRESSES:-} # OVN custom DNS addresses. IPV6_SUBNET=${IPV6_SUBNET:-} # OVN ipv6 range. setup=$(cat << EOF @@ -88,7 +88,7 @@ ${IPV4_SUBNET} # setup ipv4/ipv6 gateway ${IPV4_START} ${IPV4_END} ${IPV6_SUBNET} -${CUSTOM_DNS_ADDRESSES} +${DNS_ADDRESSES} EOF ) fi From e65cee7a83bf5bc71cbeca2b01c66401780b78aa Mon Sep 17 00:00:00 2001 From: Max Asnaashari Date: Mon, 15 Apr 2024 18:42:37 +0000 Subject: [PATCH 2/3] microcloud/test/suites: Apply and validate dns env var Signed-off-by: Max Asnaashari --- microcloud/test/suites/add.sh | 4 ++-- microcloud/test/suites/basic.sh | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/microcloud/test/suites/add.sh b/microcloud/test/suites/add.sh index 0a137f36f..04dac3051 100644 --- a/microcloud/test/suites/add.sh +++ b/microcloud/test/suites/add.sh @@ -123,8 +123,8 @@ test_add_interactive() { export IPV4_SUBNET="10.1.123.1/24" export IPV4_START="10.1.123.100" export IPV4_END="10.1.123.254" - export CUSTOM_DNS_ADDRESSES="10.1.123.1,8.8.8.8" # comma-separated list of custom DNS addresses to be set for the OVN uplink. export IPV6_SUBNET="fd42:1:1234:1234::1/64" + export DNS_ADDRESSES="10.1.123.1,fd42:1:1234:1234::1" microcloud_interactive | lxc exec micro01 -- sh -c "microcloud init > out" lxc exec micro01 -- tail -1 out | grep "MicroCloud is ready" -q @@ -149,7 +149,7 @@ test_add_interactive() { lxc exec micro01 -- tail -1 out | grep "MicroCloud is ready" -q for m in micro01 micro02 micro03 micro04 ; do - validate_system_lxd "${m}" 4 disk1 1 1 enp6s0 10.1.123.1/24 10.1.123.100-10.1.123.254 fd42:1:1234:1234::1/64 + validate_system_lxd "${m}" 4 disk1 1 1 enp6s0 10.1.123.1/24 10.1.123.100-10.1.123.254 fd42:1:1234:1234::1/64 10.1.123.1,fd42:1:1234:1234::1 validate_system_microceph "${m}" 1 disk2 validate_system_microovn "${m}" done diff --git a/microcloud/test/suites/basic.sh b/microcloud/test/suites/basic.sh index 0af230efa..794af4d68 100644 --- a/microcloud/test/suites/basic.sh +++ b/microcloud/test/suites/basic.sh @@ -77,11 +77,12 @@ test_interactive() { export IPV4_START="10.1.123.100" export IPV4_END="10.1.123.254" export IPV6_SUBNET="fd42:1:1234:1234::1/64" + export DNS_ADDRESSES="10.1.123.1,8.8.8.8" 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 0 0 "${OVN_FILTER}" "${IPV4_SUBNET}" "${IPV4_START}"-"${IPV4_END}" "${IPV6_SUBNET}" + validate_system_lxd "${m}" 3 disk1 0 0 "${OVN_FILTER}" "${IPV4_SUBNET}" "${IPV4_START}"-"${IPV4_END}" "${IPV6_SUBNET}" "${DNS_ADDRESSES}" validate_system_microovn "${m}" done @@ -98,7 +99,7 @@ test_interactive() { lxc exec micro01 -- tail -1 out | grep "MicroCloud is ready" -q for m in micro01 micro02 micro03 ; do - validate_system_lxd "${m}" 3 disk1 3 1 "${OVN_FILTER}" "${IPV4_SUBNET}" "${IPV4_START}"-"${IPV4_END}" "${IPV6_SUBNET}" + validate_system_lxd "${m}" 3 disk1 3 1 "${OVN_FILTER}" "${IPV4_SUBNET}" "${IPV4_START}"-"${IPV4_END}" "${IPV6_SUBNET}" "${DNS_ADDRESSES}" validate_system_microceph "${m}" 1 disk2 validate_system_microovn "${m}" done @@ -354,6 +355,7 @@ test_case() { IPV4_START="10.1.123.100" IPV4_END="10.1.123.254" IPV6_SUBNET="fd42:1:1234:1234::1/64" + DNS_ADDRESSES="10.1.123.1,8.8.8.8" expected_ovn_iface="enp6s0" else @@ -367,7 +369,7 @@ test_case() { name="$(printf "micro%02d" "${i}")" if [ -n "${expected_ovn_iface}" ]; then - validate_system_lxd "${name}" "${num_systems}" "${expected_zfs_disk}" "${expected_ceph_disks}" "${expected_cephfs}" "${expected_ovn_iface}" "${IPV4_SUBNET}" "${IPV4_START}"-"${IPV4_END}" "${IPV6_SUBNET}" + validate_system_lxd "${name}" "${num_systems}" "${expected_zfs_disk}" "${expected_ceph_disks}" "${expected_cephfs}" "${expected_ovn_iface}" "${IPV4_SUBNET}" "${IPV4_START}"-"${IPV4_END}" "${IPV6_SUBNET}" "${DNS_ADDRESSES}" else validate_system_lxd "${name}" "${num_systems}" "${expected_zfs_disk}" "${expected_ceph_disks}" "${expected_cephfs}" "${expected_ovn_iface}" fi From c4f7ac8053fa3d727e90e8a55ebf731163908ae1 Mon Sep 17 00:00:00 2001 From: Max Asnaashari Date: Mon, 15 Apr 2024 19:04:06 +0000 Subject: [PATCH 3/3] microcloud/test/includes: Fix dns validation Signed-off-by: Max Asnaashari --- microcloud/test/includes/microcloud.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/microcloud/test/includes/microcloud.sh b/microcloud/test/includes/microcloud.sh index 1608d0df7..fdeb22222 100644 --- a/microcloud/test/includes/microcloud.sh +++ b/microcloud/test/includes/microcloud.sh @@ -275,7 +275,7 @@ validate_system_lxd_ovn() { # Check that the created UPLINK network has the right DNS servers. if [ -n "${dns_namesersers}" ] ; then - dns_addresses=$(lxc exec "${name}" -- sh -c "lxc network get UPLINK dns.nameservers") + dns_addresses=$(lxc exec "local:${name}" -- sh -c "lxc network get UPLINK dns.nameservers") if [ "${dns_addresses}" != "${dns_namesersers}" ] ; then echo "ERROR: UPLINK network has wrong DNS server addresses: ${dns_addresses}" return 1