Skip to content

Commit

Permalink
bin/test-image: do a post cloud-init reboot test for cloud variants
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Jul 3, 2024
1 parent 9e45e2f commit 9363ecb
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions bin/test-image
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,28 @@ for url in $(lxc query "/1.0/instances" | jq -r .[] | grep "${TEST_IMAGE}"); do
fi
done

# Check that cloud variants can be rebooted cleanly.
if [ "${VARIANT}" = "cloud" ]; then
for name in ${INSTANCES}; do
echo "==> Performing post cloud-init reboot test"
lxc exec "${name}" -- cloud-init status --wait --long

# If systemd is available, use it to wait for any other job to complete before the restart
lxc exec "${name}" -- systemctl is-system-running --wait || true

lxc restart "${name}"
waitInstanceReady "${name}"

# cloud-init status.
if lxc exec "${name}" -- cloud-init status --wait --long; then
echo "===> PASS: cloud-init reboot: ${name}"
else
echo "===> FAIL: cloud-init reboot: ${name}"
FAIL=1
fi
done
fi

# Check that all instances can be stopped.
echo "==> Performing shutdown test"
STOPPED=0
Expand Down

0 comments on commit 9363ecb

Please sign in to comment.