Skip to content

Commit

Permalink
test: assert machine labels in static infra provider tests
Browse files Browse the repository at this point in the history
Assert that a set of known labels are set by the static infra provider on the `InfraMachineStatus` resources.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
  • Loading branch information
utkuozdemir committed Dec 11, 2024
1 parent 8aeff65 commit 471831c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion cmd/integration-test/pkg/tests/infra.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,14 @@ func AcceptInfraMachines(testCtx context.Context, omniState state.State, expecte
assertion.True(isManagedByStaticInfraProvider)
})

// Assert that infra.MachineStatus resources are now created, and they are marked as ready to use
// Assert that infra.MachineStatus resources are now created, machine labels are set on them, and they are marked as ready to use
rtestutils.AssertResources(ctx, t, omniState, ids, func(res *infra.MachineStatus, assertion *assert.Assertions) {
aVal, _ := res.Metadata().Labels().Get("a")
assertion.Equal("b", aVal)

_, cOk := res.Metadata().Labels().Get("c")
assertion.True(cOk)

assertion.True(res.TypedSpec().Value.ReadyToUse)
})
}
Expand Down

0 comments on commit 471831c

Please sign in to comment.