README.md 1.8 KB
Newer Older
root's avatar
inital  
root committed
1
2
# Autoupdate Tester

Nico's avatar
Nico committed
3
4
This script tests the Gluon autoupdater by continuously updating a VM from one
firmware version to another using the autoupdater.
root's avatar
inital  
root committed
5

Nico's avatar
Nico committed
6
## How it works
root's avatar
inital  
root committed
7

Nico's avatar
Nico committed
8
9
10
11
12
13
14
15
16
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.
root's avatar
inital  
root committed
17

Nico's avatar
Nico committed
18
19
20
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`.
root's avatar
inital  
root committed
21

Nico's avatar
Nico committed
22
23
24
25
26
27
28
29
30
31
32
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
root's avatar
inital  
root committed
33

Nico's avatar
Nico committed
34
35
36
37
38
39
40
1. Set up a Gluon node with connectivity to your community as a Proxmox VM.
1. 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.
1. 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.