diff --git a/bin/test-image b/bin/test-image index f6e5fbddd..81db05707 100755 --- a/bin/test-image +++ b/bin/test-image @@ -275,11 +275,16 @@ if [ "${VARIANT}" = "cloud" ]; then 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 + if lxc exec "${name}" -- test -d /run/systemd/system/; then + lxc exec "${name}" -- systemctl is-system-running --wait || true + fi lxc restart "${name}" waitInstanceReady "${name}" + # Give instance extra few seconds to boot properly. + sleep 10 + # cloud-init status. if lxc exec "${name}" -- cloud-init status --wait --long; then echo "===> PASS: cloud-init reboot: ${name}"