mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-06-08 16:30:57 -04: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
1 changed files with 9 additions and 0 deletions
|
|
@ -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 a new issue