Skip to content

Commit

Permalink
Merge pull request #105 from simondeziel/5.21-tests
Browse files Browse the repository at this point in the history
Run tests against `5.21/edge`
  • Loading branch information
tomponline authored Mar 13, 2024
2 parents bd37336 + c7c3d22 commit 5607f70
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
strategy:
fail-fast: false
matrix:
track: ${{ fromJSON(inputs.snap-tracks || '["latest/edge", "5.0/edge"]') }}
track: ${{ fromJSON(inputs.snap-tracks || '["latest/edge", "5.21/edge", "5.0/edge"]') }}
test:
- cgroup
- cluster
Expand Down
5 changes: 3 additions & 2 deletions tests/devlxd-vm
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,14 @@ if hasNeededAPIExtension instance_ready_state; then
[ "$(lxc config get v1 volatile.last_state.ready)" = "false" ]

lxc start v1
waitInstanceReady v1
else
echo "Skipping instance Ready state tests, not supported"
fi

# Wait for boot to be completed to interact with snap/snapd
waitInstanceBooted v1

# Test nested VM functionality.
lxc exec v1 -- snap wait system seed.loaded
lxc exec v1 -- snap remove --purge lxd || true
lxc exec v1 -- snap install lxd --channel="${LXD_SNAP_CHANNEL}"
lxc exec v1 -- /snap/bin/lxd init --auto
Expand Down
11 changes: 7 additions & 4 deletions tests/storage-vm
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ for poolDriver in $poolDriverList; do
elif [ "${poolDriver}" = "lvm" ]; then
lxc storage create "${poolName}" "${poolDriver}" size=59GiB lvm.use_thinpool=false
lxc storage set "${poolName}" size=60GiB
! lxc storage set "${poolName}" size=58GiB || false
[ "$(lxc storage get ${poolName} size)" = "60GiB" ]
elif [ "${poolDriver}" = "lvm-thin" ]; then
lxc storage create "${poolName}" lvm size=19GiB
lxc storage set "${poolName}" size=20GiB
! lxc storage set "${poolName}" size=18GiB || false
[ "$(lxc storage get ${poolName} size)" = "20GiB" ]
elif [ "${poolDriver}" = "powerflex" ]; then
createPowerFlexPool "${poolName}"
else
lxc storage create "${poolName}" "${poolDriver}" size=19GiB
lxc storage set "${poolName}" size=20GiB
! lxc storage set "${poolName}" size=18GiB || false
[ "$(lxc storage get ${poolName} size)" = "20GiB" ]
fi

Expand Down Expand Up @@ -87,7 +90,7 @@ for poolDriver in $poolDriverList; do
echo "==> Checking restore VM snapshot"
lxc restore v1 snap0
waitInstanceReady v1
lxc exec v1 -- cat /root/foo.txt | grep -Fx "foo"
lxc exec v1 -- grep -Fx "foo" /root/foo.txt

echo "==> Checking VM filesystem volume was restored too"
nsenter --mount=/run/snapd/ns/lxd.mnt [ -f "/var/snap/lxd/common/lxd/storage-pools/${poolName}/virtual-machines/v1/foo" ]
Expand All @@ -110,7 +113,7 @@ for poolDriver in $poolDriverList; do
lxc copy v1/snap0 v2
lxc start v2
waitInstanceReady v2
lxc exec v2 -- cat /root/foo.txt | grep -Fx "foo"
lxc exec v2 -- grep -Fx "foo" /root/foo.txt

if [ "${poolDriver}" != "powerflex" ]; then
echo "==> Checking VM snapshot copy root disk size is 3GiB"
Expand Down Expand Up @@ -141,7 +144,7 @@ for poolDriver in $poolDriverList; do
lxc copy v1/snap0 localhost:v2
lxc start v2
waitInstanceReady v2
lxc exec v2 -- cat /root/foo.txt | grep -Fx "foo"
lxc exec v2 -- grep -Fx "foo" /root/foo.txt

if [ "${poolDriver}" != "powerflex" ]; then
echo "==> Checking VM snapshot copy root disk size is 3GiB"
Expand Down Expand Up @@ -176,7 +179,7 @@ for poolDriver in $poolDriverList; do
lxc copy v1/snap0 localhost:v2 -s "${poolName}2"
lxc start v2
waitInstanceReady v2
lxc exec v2 -- cat /root/foo.txt | grep -Fx "foo"
lxc exec v2 -- grep -Fx "foo" /root/foo.txt

if [ "${poolDriver}" != "powerflex" ]; then
echo "==> Checking VM snapshot copy root disk size is 3GiB"
Expand Down

0 comments on commit 5607f70

Please sign in to comment.