Skip to content

fix(tests): snapshot-reset harness for Proxmox VMs - #86

Open
catinspace-au wants to merge 1 commit into
mainfrom
fix/tests-proxmox-harness
Open

fix(tests): snapshot-reset harness for Proxmox VMs#86
catinspace-au wants to merge 1 commit into
mainfrom
fix/tests-proxmox-harness

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

Three playbooks under tests/proxmox/, driven by hand, not CI. create.yml
clones the base template into the test range, sizes it to the lab's
other test machines, gives it a static address or DHCP, boots it once to
bring every package current, then stops and snapshots the VM as
clean. hyperi-developer never runs there: the snapshot is the state
every test starts from. reset.yml rolls a VM back to that snapshot and
starts it, or with start=false leaves it stopped, which is the resting
state of a test VM. delete.yml removes one. All three refuse a vmid
outside the range, which is the safety mechanism .env.sample had
promised and nothing had implemented.

A static VM is reached by its address and a DHCP VM by the name the lab
DNS registers for it, so nothing waits on a DNS entry that may not exist
yet. The free-vmid picker now sorts: difference() is a set operation and
its first element was arbitrary.

Authentication is the API token hyperi-infra's tools use, not a root
password, and the modules are community.proxmox: the community.general
proxmox_* modules are deprecated and removed at 15.0.0, which the
existing floor reaches. Login to the VM is by key, because cloud images
ship sshd with password login off.

The shared loader in tests/common/setup_env.yml ran source .env under
/bin/sh, which is dash on Debian and Ubuntu and has no source. The
failure was silent - the pipeline's exit status is jq's - so env
returned whatever PROXMOX_* the operator's shell already carried, and a
token from the environment quietly stood in for the file's. It now runs
under bash with set -euo pipefail. provision.yml, which shares the
loader, only ever worked by the same accident.

create.yml adopts a VM of the same name so a run that stopped partway is
finished rather than doubled. Proven against Proxmox: a VM created,
rolled back, started, converged and returned to its snapshot stopped.

Three playbooks under tests/proxmox/, driven by hand, not CI. create.yml
clones the base template into the test range, sizes it to the lab's
other test machines, gives it a static address or DHCP, boots it once to
bring every package current, then stops and snapshots the VM as
`clean`. hyperi-developer never runs there: the snapshot is the state
every test starts from. reset.yml rolls a VM back to that snapshot and
starts it, or with start=false leaves it stopped, which is the resting
state of a test VM. delete.yml removes one. All three refuse a vmid
outside the range, which is the safety mechanism .env.sample had
promised and nothing had implemented.

A static VM is reached by its address and a DHCP VM by the name the lab
DNS registers for it, so nothing waits on a DNS entry that may not exist
yet. The free-vmid picker now sorts: difference() is a set operation and
its first element was arbitrary.

Authentication is the API token hyperi-infra's tools use, not a root
password, and the modules are community.proxmox: the community.general
proxmox_* modules are deprecated and removed at 15.0.0, which the
existing floor reaches. Login to the VM is by key, because cloud images
ship sshd with password login off.

The shared loader in tests/common/setup_env.yml ran `source .env` under
/bin/sh, which is dash on Debian and Ubuntu and has no `source`. The
failure was silent - the pipeline's exit status is jq's - so `env`
returned whatever PROXMOX_* the operator's shell already carried, and a
token from the environment quietly stood in for the file's. It now runs
under bash with set -euo pipefail. provision.yml, which shares the
loader, only ever worked by the same accident.

create.yml adopts a VM of the same name so a run that stopped partway is
finished rather than doubled. Proven against Proxmox: a VM created,
rolled back, started, converged and returned to its snapshot stopped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant