Skip to content

Commit

Permalink
microcloud/test/suites: Run interactive first
Browse files Browse the repository at this point in the history
Signed-off-by: Max Asnaashari <[email protected]>
  • Loading branch information
masnax committed Apr 18, 2024
1 parent a565f16 commit 3067243
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 59 deletions.
2 changes: 1 addition & 1 deletion microcloud/test/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ run_add_tests() {
run_basic_tests() {
run_test test_instances_config "instances config"
run_test test_instances_launch "instances launch"
run_test test_interactive "interactive"
run_test test_service_mismatch "service mismatch"
run_test test_disk_mismatch "disk mismatch"
run_test test_interactive_combinations "interactive combinations"
Expand All @@ -147,6 +146,7 @@ run_preseed_tests() {
run_test test_preseed "preseed"
}

run_test test_interactive "interactive"
run_test test_service_mismatch "service mismatch"

# shellcheck disable=SC2034
Expand Down
65 changes: 7 additions & 58 deletions microcloud/test/suites/basic.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
test_interactive() {
reset_systems 3 3 1

echo "Creating a MicroCloud with all services but no devices"
export LOOKUP_IFACE="enp5s0"
Expand All @@ -8,65 +7,19 @@ test_interactive() {
export SETUP_ZFS="no"
export SETUP_CEPH="no"
export SETUP_OVN="no"
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
validate_system_microceph "${m}"
validate_system_microovn "${m}"
done

# Reset the systems with just LXD.
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"
export SKIP_SERVICE="yes"
export SETUP_ZFS="yes"
export ZFS_FILTER="lxd_disk1"
export ZFS_WIPE="yes"
unset SETUP_CEPH SETUP_OVN
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 and install microceph.
reset_systems 3 3 1

for m in micro01 micro02 micro03 ; do
lxc exec "${m}" -- snap disable microovn || true
lxc exec "${m}" -- snap restart microcloud
done

echo "Creating a MicroCloud with ZFS and Ceph storage"
export SETUP_CEPH="yes"
export SETUP_CEPHFS="yes"
export CEPH_FILTER="lxd_disk2"
export CEPH_WIPE="yes"
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 1 1
validate_system_microceph "${m}" 1 disk2
done

# Reset the systems and install microovn.
reset_systems 3 3 1

for m in micro01 micro02 micro03 ; do
lxc exec "${m}" -- snap disable microceph || true
lxc exec "${m}" -- snap restart microcloud
done

echo "Creating a MicroCloud with ZFS storage and OVN network"
unset SETUP_CEPH CEPH_FILTER CEPH_WIPE SETUP_CEPHFS
Expand All @@ -77,17 +30,10 @@ 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}" "${DNS_ADDRESSES}"
validate_system_microovn "${m}"
done
export DNS_ADDRESSES="10.1.123.1,8.8.8.8"

# Reset the systems and install microovn and microceph.
reset_systems 3 3 1
export CONCURRENT_SETUP=1
CONCURRENT_SETUP=1 reset_systems 3 3 1

echo "Creating a MicroCloud with ZFS and Ceph storage, and OVN network"
unset SKIP_SERVICE
Expand Down Expand Up @@ -602,7 +548,8 @@ test_service_mismatch() {
export SETUP_OVN="no"

# Restore the snapshots from the previous test.
reset_systems 3 3 1
export CONCURRENT_SETUP=1
CONCURRENT_SETUP=1 reset_systems 3 3 1

# Install microceph and microovn on the first machine only.
for m in micro02 micro03 ; do
Expand All @@ -623,6 +570,8 @@ test_service_mismatch() {
lxc exec micro02 -- snap install microceph microovn
lxc exec micro03 -- snap install microceph microovn

return 0

# Init should now work.
echo "Creating a MicroCloud with MicroCeph and MicroOVN, but without their LXD devices"
microcloud_interactive | lxc exec micro01 -- sh -c "microcloud init > out"
Expand Down

0 comments on commit 3067243

Please sign in to comment.