Autoupdate Tester
This script tests the Gluon autoupdater by continuously updating a VM from one firmware version to another using the autoupdater.
How it works
Communicating with the Gluon node works over a virtual serial port.
First of all, we will create a snapshot of your VM. This makes sure the script never touches your actual VM state. The script will also take care of cleaning up any snapshots it has created, except when an update failed.
Then, we make sure your node is actually running the expected firmware version
by comparing the contents of /lib/gluon/release
with what you specified in
the --before-version
parameter.
If that matches, we try to ping the IP specified in --ping-ip
every second to
make sure your node has connectivty to your network. As soon as it succeeds, we
run autoupdate -f
.
After updating, we will again the read the firmware version and compare that to
what you specified in the --after-version
parameter. If it doesn't, we
consider the update failed. Then, we again try to ping the IP specified in
--ping-ip
. If pinging that IP fails 90 times in a row with retries every
second, we will consider the update failed.
After successful update, we will rollback to the snapshot and start again.
When a update failed, we will exit and leave a snapshot
test_fail_%Y_%m_%d_%H_%M_%S
behind so you can investigate what went wrong.
Setup
- Set up a Gluon node with connectivity to your community as a Proxmox VM.
- In Gluon, set up the update channel as desired, but disable the autoupdater.
The script will run
autoupdater -f
, so the autoupdater will run even when disabled. - Make sure the Gluon node has a virtual serial port attached. To verify it's
working run
qm terminal <vmid>
and press enter a few times. You should see a root prompt of your Gluon node.