fix(tests): snapshot-reset harness for Proxmox VMs - #86
Open
catinspace-au wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 stateevery 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 .envunder/bin/sh, which is dash on Debian and Ubuntu and has no
source. Thefailure was silent - the pipeline's exit status is jq's - so
envreturned 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.