Skip to content

Commit

Permalink
tests/storage-vm: use empty VMs when only checking resulting config
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Sep 24, 2024
1 parent 101d5be commit 18514a8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/storage-vm
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ for poolDriver in $poolDriverList; do

# Ensure non-power-of-two sizes are rounded appropriately for zfs
if [ "${poolDriver}" = "zfs" ]; then
lxc init "${IMAGE}" rounded --vm -s "${poolName}" -d root,size=13GB
lxc init --empty rounded --vm -s "${poolName}" -d root,size=13GB
lxc delete rounded
fi

Expand Down Expand Up @@ -594,24 +594,24 @@ for poolDriver in $poolDriverList; do
# if no local instance config nor profile value of `migration.stateful` is set.

lxc config set instances.migration.stateful=true
lxc init "${IMAGE}" v1 --vm -s "${poolName}"

lxc init --empty v1 --vm -s "${poolName}"
[ "$(lxc query /1.0/instances/v1 | jq -r '.expanded_config["migration.stateful"]')" = true ]
lxc delete v1 -f

lxc config set instances.migration.stateful=false
lxc init "${IMAGE}" v1 --vm -s "${poolName}"
lxc init --empty v1 --vm -s "${poolName}"
[ -z "$(lxc config get --expanded v1 migration.stateful)" ] # instances.migration.stateful leave it unset because since it is `false`, it is the same as the default value of `migration.stateful`.
lxc delete v1 -f

lxc config set instances.migration.stateful=true
lxc init "${IMAGE}" v1 --vm --config migration.stateful=false -s "${poolName}"
lxc init --empty v1 --vm --config migration.stateful=false -s "${poolName}"
[ "$(lxc query /1.0/instances/v1 | jq -r '.expanded_config["migration.stateful"]')" = "false" ] # the instance local config should take precedence
lxc delete v1 -f

lxc config set instances.migration.stateful=false
lxc profile copy default stateful_profile
lxc profile set stateful_profile migration.stateful=true
lxc init "${IMAGE}" v1 --vm -p stateful_profile -s "${poolName}"
lxc init --empty v1 --vm -p stateful_profile -s "${poolName}"
[ "$(lxc query /1.0/instances/v1 | jq -r '.expanded_config["migration.stateful"]')" = "true" ] # the profile config should take precedence
lxc delete v1 -f
lxc profile delete stateful_profile
Expand Down

0 comments on commit 18514a8

Please sign in to comment.