Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ba36323
apply: test executor rounds, stops, unfollowable tasks and error texts
tire-fire Nov 18, 2026
1a6b4f6
apply: test behaviour surviving item, guest, cleanup and template mut…
tire-fire Nov 18, 2026
fc0b665
apply: delete unfollowable's qmclone check
tire-fire Nov 18, 2026
c09edab
pods: test the access, capacity, details, discovery and envcheck gaps…
tire-fire Nov 18, 2026
117e153
pods: test a Windows host name at the length limit
tire-fire Nov 19, 2026
083ab37
pods: test that a resumed host without an address is checked, and a r…
tire-fire Nov 19, 2026
24ceb4c
pods: test EnvEdit's checks, blocks, addresses, DNS, tags and locks
tire-fire Nov 18, 2026
c1a8a27
pods: test environment reading, host warnings and env planning edges
tire-fire Nov 19, 2026
329f2be
pods: test that a bad ops CA key still plans every host
tire-fire Nov 19, 2026
acb1cf7
pods: delete Environments' unreachable template skip
tire-fire Nov 19, 2026
18943ae
pods: test guest prefix bounds, image listing, register and host-edit…
tire-fire Nov 19, 2026
660c730
web: test confirm refusals, submit summaries and cancels of jobs with…
tire-fire Nov 19, 2026
4ab7edb
pods: test live address reads and SSH check parsing
tire-fire Nov 19, 2026
4974d10
web: test review folding, env edit/power/delete reviews, router rows …
tire-fire Nov 19, 2026
b856ce5
pods: test planner paths surviving mutation
tire-fire Nov 19, 2026
f626554
pods: delete SetOfPattern's redundant empty-set check
tire-fire Nov 19, 2026
452a7f3
apply: test behaviour surviving template copy, restart, rebuild and c…
tire-fire Nov 19, 2026
32ce313
apply: stop TestUnfollowableTaskStillLockedAtStop racing the stop's a…
tire-fire Nov 19, 2026
3fa439e
pods: pin where a rebuilt pod VM goes, and where a blocked one is rep…
tire-fire Nov 19, 2026
93f42bd
apply: make timing tests deterministic and drop the delete-order test
tire-fire Nov 20, 2026
39cfed3
pods: record SSH checks in the fake and trim duplicate tests
tire-fire Nov 20, 2026
981a762
test: name the stop-report gate for what it waits on; drop a redundan…
tire-fire Nov 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/apply/calls.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (e *Executor) taskUPID(ctx context.Context, vmid int, start func() (string,
// vmid, if given, is the locked VM (a clone locks its target).
func (e *Executor) unfollowable(ctx context.Context, upid string, vmid int, err error) error {
u, _ := proxmox.ParseUPID(upid)
if vmid == 0 && u.Type != "qmclone" {
if vmid == 0 {
vmid, _ = strconv.Atoi(u.ID)
}
node := u.Node
Expand Down
43 changes: 42 additions & 1 deletion internal/apply/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/netip"
"slices"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -56,6 +57,23 @@ func TestEnvHostCloneIsRemovedWhenItFails(t *testing.T) {
}
}

// A clone that failed after it was started is stopped, then removed.
func TestStartedEnvHostCloneIsStoppedAndRemovedWhenItFails(t *testing.T) {
f := podstest.New("alder")
f.Add(proxmox.VM{VMID: 8001, Name: "deb-v1", Node: "alder", Template: true}, map[string]string{"net0": "virtio=BC:24:11:00:80:01,bridge=vmbr0"})
plan := &pods.Plan{Kind: pods.KindEnvCreate, Items: []pods.Item{{
Name: "teak.kilo.alpha", Host: "teak", VMID: 2101, Node: "alder", Pool: "dev-01", Tags: "dev;kilo.alpha",
Source: &pods.Source{VMID: 8001, Node: "alder", Name: "deb-v1"}, NICs: map[string]string{"net0": "devint01"},
Steps: []pods.Step{pods.StepClone, pods.StepLabel, pods.StepNetwork, pods.StepStart, pods.StepWaitAgent}}}} // no agent answers
res := catalogExec(f).Run(context.Background(), plan)
if len(res.Failed) != 1 || !slices.Equal(res.Removed, []string{"teak.kilo.alpha"}) || f.VMs[2101] != nil {
t.Errorf("result = %+v; the started clone must be removed", res)
}
if f.Called("power:2101:stop") != 1 {
t.Errorf("calls %v, want one stop before the delete", f.Calls)
}
}

func TestEnvHostIsWiredAndLabelled(t *testing.T) {
f := podstest.New("alder")
f.Add(proxmox.VM{VMID: 8001, Name: "deb-v1", Node: "alder", Template: true}, map[string]string{"tags": "base;linux", "net0": "virtio=BC:24:11:00:80:01,bridge=vmbr0"})
Expand All @@ -66,7 +84,7 @@ func TestEnvHostIsWiredAndLabelled(t *testing.T) {
Steps: []pods.Step{pods.StepClone, pods.StepLabel, pods.StepNetwork, pods.StepStart}}}}
res := catalogExec(f).Run(context.Background(), plan)
v := f.VMs[2101]
if len(res.Succeeded) != 1 || v.Config["tags"] != "dev;kilo.alpha" || !strings.Contains(v.Config["net0"], "bridge=devint01") ||
if len(res.Succeeded) != 1 || v.Name != "teak.kilo.alpha" || v.Config["tags"] != "dev;kilo.alpha" || !strings.Contains(v.Config["net0"], "bridge=devint01") ||
v.Config["description"] != "battleship: ip=192.168.100.10 os=linux base=deb-v1 dns=router" || v.Status != "running" {
t.Errorf("res %+v vm %+v %v", res, v.VM, v.Config)
}
Expand Down Expand Up @@ -110,6 +128,29 @@ func TestRegisterKeepsConvertedImageWhenRetireFails(t *testing.T) {
}
}

// Retiring finds the previous version on the node it is listed on now, and
// never tags another VM that took its VMID.
func TestRetireFindsThePreviousVersionWhereItIs(t *testing.T) {
for _, tc := range []struct {
name string
at string // the VM at 8000, on birch since the plan
retired bool
}{
{"moved", "deb-v1", true},
{"replaced", "other", false},
} {
t.Run(tc.name, func(t *testing.T) {
f := registerFake()
f.Nodes = append(f.Nodes, "birch")
f.VMs[8000].Node, f.VMs[8000].Name = "birch", tc.at
res := catalogExec(f).Run(context.Background(), registerPlan(pods.StepClone, pods.StepRetire))
if retired := strings.Contains(f.VMs[8000].Config["tags"], "deprecated"); retired != tc.retired || (len(res.Succeeded) == 1) != tc.retired {
t.Errorf("result %+v, tags %q; want retired %v", res, f.VMs[8000].Config["tags"], tc.retired)
}
})
}
}

// The details step rewrites only the notes' details block, or with free
// text the notes less their battleship lines. It refuses details or text
// that would break them, however the plan came by them.
Expand Down
Loading