mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
ammend tests to ensure feat gate is off when expected (beta: gate is always on)
This commit is contained in:
parent
3e56ddae67
commit
32b9e31c23
@ -1897,6 +1897,11 @@ func TestSetDefaultIPFamilies(t *testing.T) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// TODO: @khenidak
|
||||||
|
// with BETA feature is always on. This ensure we test for gate on/off scenarios
|
||||||
|
// as we move to stable this entire test will need to be folded into one test
|
||||||
|
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, false)()
|
||||||
|
|
||||||
// run without gate (families should not change)
|
// run without gate (families should not change)
|
||||||
t.Run(fmt.Sprintf("without-gate:%s", test.name), func(t *testing.T) {
|
t.Run(fmt.Sprintf("without-gate:%s", test.name), func(t *testing.T) {
|
||||||
obj2 := roundTrip(t, runtime.Object(&test.svc))
|
obj2 := roundTrip(t, runtime.Object(&test.svc))
|
||||||
@ -2039,6 +2044,10 @@ func TestSetDefaultServiceIPFamilyPolicy(t *testing.T) {
|
|||||||
|
|
||||||
// without gate. IPFamilyPolicy should never change
|
// without gate. IPFamilyPolicy should never change
|
||||||
t.Run(test.name, func(t *testing.T) {
|
t.Run(test.name, func(t *testing.T) {
|
||||||
|
//TODO: @khenidak
|
||||||
|
// BETA feature. gate is on. when we go stable fold the test into one scenario
|
||||||
|
defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.IPv6DualStack, false)()
|
||||||
|
|
||||||
obj2 := roundTrip(t, runtime.Object(&test.svc))
|
obj2 := roundTrip(t, runtime.Object(&test.svc))
|
||||||
svc2 := obj2.(*v1.Service)
|
svc2 := obj2.(*v1.Service)
|
||||||
|
|
||||||
|
@ -183,6 +183,15 @@ func TestCNIPlugin(t *testing.T) {
|
|||||||
},
|
},
|
||||||
}, cmd, args...)
|
}, cmd, args...)
|
||||||
},
|
},
|
||||||
|
func(cmd string, args ...string) exec.Cmd {
|
||||||
|
return fakeexec.InitFakeCmd(&fakeexec.FakeCmd{
|
||||||
|
CombinedOutputScript: []fakeexec.FakeAction{
|
||||||
|
func() ([]byte, []byte, error) {
|
||||||
|
return []byte(podIPOutput), nil, nil
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}, cmd, args...)
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
fexec := &fakeexec.FakeExec{
|
fexec := &fakeexec.FakeExec{
|
||||||
|
Loading…
Reference in New Issue
Block a user