mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Svc REST: Add proof funcs in feature test logic
Allows for more control of tests to assert specific things.
This commit is contained in:
parent
8bcba526b6
commit
ced629e657
@ -5826,8 +5826,13 @@ type svcTestCase struct {
|
||||
expectHeadless bool
|
||||
expectNodePorts bool
|
||||
expectHealthCheckNodePort bool
|
||||
|
||||
// Additional proofs, provided by the tests which use this.
|
||||
prove []svcTestProof
|
||||
}
|
||||
|
||||
type svcTestProof func(t *testing.T, storage *GenericREST, before, after *api.Service)
|
||||
|
||||
func callName(before, after *api.Service) string {
|
||||
if before == nil && after != nil {
|
||||
return "create"
|
||||
@ -6287,6 +6292,10 @@ func verifyExpectations(t *testing.T, storage *GenericREST, tc svcTestCase, befo
|
||||
} else {
|
||||
proveHealthCheckNodePortDeallocated(t, storage, before, after)
|
||||
}
|
||||
|
||||
for _, p := range tc.prove {
|
||||
p(t, storage, before, after)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFeatureExternalName(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user