Skip to content

Commit

Permalink
microcloud/test/suites: Update instance tests
Browse files Browse the repository at this point in the history
Signed-off-by: Max Asnaashari <[email protected]>
  • Loading branch information
masnax committed Jan 7, 2025
1 parent 5fa6257 commit 676bfcc
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions microcloud/test/suites/instances.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ test_instances_config() {

# Setup a MicroCloud with 3 systems, ZFS storage, and a FAN network.
addr=$(lxc ls micro01 -f csv -c4 | grep enp5s0 | cut -d' ' -f1)
lxc exec micro01 -- sh -c "
cat << EOF > /var/snap/microcloud/common/preseed.yaml
preseed="
lookup_subnet: ${addr}/24
systems:
- name: micro01
Expand All @@ -77,10 +76,9 @@ systems:
local:
path: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_disk1
wipe: true
EOF
"

lxc exec micro01 --env TEST_CONSOLE=0 -- microcloud init --preseed /var/snap/microcloud/common/preseed.yaml
lxc exec micro01 --env TEST_CONSOLE=0 -- microcloud init --preseed <<< "${preseed}"

# Init a container and VM with ZFS storage & FAN network.
lxc exec micro01 -- lxc init --empty v1 --vm
Expand All @@ -96,8 +94,7 @@ EOF

# Create a MicroCloud with ceph and ovn setup.
addr=$(lxc ls micro01 -f csv -c4 | grep enp5s0 | cut -d' ' -f1)
lxc exec micro01 -- sh -c "
cat << EOF > /var/snap/microcloud/common/preseed.yaml
preseed="
lookup_subnet: ${addr}/24
systems:
- name: micro01
Expand Down Expand Up @@ -125,10 +122,9 @@ ovn:
ipv4_gateway: 10.1.123.1/24
ipv4_range: 10.1.123.100-10.1.123.254
ipv6_gateway: fd42:1:1234:1234::1/64
EOF
"

lxc exec micro01 --env TEST_CONSOLE=0 -- microcloud init --preseed /var/snap/microcloud/common/preseed.yaml
lxc exec micro01 --env TEST_CONSOLE=0 -- microcloud init --preseed <<< "${preseed}"

# Delete any instances left behind.
lxc exec micro01 -- sh -c "
Expand All @@ -153,8 +149,7 @@ test_instances_launch() {

# Setup a MicroCloud with 3 systems, ZFS storage, and a FAN network.
addr=$(lxc ls micro01 -f csv -c4 | grep enp5s0 | cut -d' ' -f1)
lxc exec micro01 -- sh -c "
cat << EOF > /var/snap/microcloud/common/preseed.yaml
preseed="
lookup_subnet: ${addr}/24
systems:
- name: micro01
Expand All @@ -175,10 +170,9 @@ systems:
local:
path: /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_lxd_disk1
wipe: true
EOF
"

lxc exec micro01 --env TEST_CONSOLE=0 -- microcloud init --preseed /var/snap/microcloud/common/preseed.yaml
lxc exec micro01 --env TEST_CONSOLE=0 -- microcloud init --preseed <<< "${preseed}"

# Delete any instances left behind.
lxc exec micro01 -- sh -c "
Expand Down Expand Up @@ -235,8 +229,7 @@ EOF

# Create a MicroCloud with ceph and ovn setup.
addr=$(lxc ls micro01 -f csv -c4 | grep enp5s0 | cut -d' ' -f1)
lxc exec micro01 -- sh -c "
cat << EOF > /var/snap/microcloud/common/preseed.yaml
preseed="
lookup_subnet: ${addr}/24
systems:
- name: micro01
Expand Down Expand Up @@ -264,10 +257,9 @@ ovn:
ipv4_gateway: 10.1.123.1/24
ipv4_range: 10.1.123.100-10.1.123.254
ipv6_gateway: fd42:1:1234:1234::1/64
EOF
"

lxc exec micro01 --env TEST_CONSOLE=0 -- microcloud init --preseed /var/snap/microcloud/common/preseed.yaml
lxc exec micro01 --env TEST_CONSOLE=0 -- microcloud init --preseed <<< "${preseed}"

# Delete any instances left behind.
lxc exec micro01 -- sh -c "
Expand Down

0 comments on commit 676bfcc

Please sign in to comment.