Download this file
| 1 | package hostbox |
| 2 | |
| 3 | import ( |
| 4 | "github.com/carlosframework/platform/internal/hostguard" |
| 5 | "reflect" |
| 6 | "testing" |
| 7 | ) |
| 8 | |
| 9 | func TestPlan11Fix1StopProjectionIncludesUnitIDs(t *testing.T) { |
| 10 | target := hostguard.FenceTarget{Host: "shop.example", Incarnation: "inc", Stamp: 1, Session: 1, Box: "box", Enrollment: "enroll", BootID: "boot", ControllerID: "controller"} |
| 11 | in := LaunchInventory{Target: target, NoState: true, WritersClosed: true, Reservations: []LaunchReservation{{ID: "first", State: UnitSettled, Group: LaunchGroup{RelativePath: "carlos.slice/carlos-habc.slice/carlos-run@shop.example.service"}}}} |
| 12 | before, err := launchStopKernelJournal(in, target) |
| 13 | if err != nil { |
| 14 | t.Fatal(err) |
| 15 | } |
| 16 | in.Reservations = append(in.Reservations, LaunchReservation{ID: "second", State: UnitSettled, Group: LaunchGroup{RelativePath: "carlos.slice/carlos-habc.slice/carlos-run@shop.example.service"}}) |
| 17 | after, err := launchStopKernelJournal(in, target) |
| 18 | if err != nil { |
| 19 | t.Fatal(err) |
| 20 | } |
| 21 | if reflect.DeepEqual(before, after) { |
| 22 | t.Fatal("new settled unit reservation invisible in scan projection") |
| 23 | } |
| 24 | } |
| 25 | |