Skip to content

Commit

Permalink
Merge pull request #164 from simondeziel/vm-time-sync
Browse files Browse the repository at this point in the history
tests/container-copy: allow some time for the VM time to stabilize
  • Loading branch information
tomponline authored Apr 26, 2024
2 parents afca62a + 9884141 commit 6aad18c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/container-copy
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ echo "==> Launch a VM which will be the target of the copy"
lxc launch "${IMAGE}" target --vm
waitInstanceBooted target

echo "==> Add the target VM as a remote LXD"
echo "==> Setup LXD on the target VM"
lxc exec target -- snap install lxd --channel "${LXD_SNAP_CHANNEL}"
lxc exec target -- lxd init --auto
lxc exec target -- lxc config set core.https_address=:8443

echo "==> Wait for the target VM time to be synchronized with NTP"
for _ in $(seq 6); do
[ "$(lxc exec target -- timedatectl show --property=NTPSynchronized --value)" = "yes" ] && break
sleep 10
done

echo "==> Add the target VM as a remote LXD"
token="$(lxc exec target -- lxc config trust add --name host --quiet)"
lxc remote add target "${token}" --accept-certificate

Expand Down

0 comments on commit 6aad18c

Please sign in to comment.