mirror of
https://github.com/outbackdingo/kubernetes.git
synced 2026-01-27 10:19:35 +00:00
Remove WinDSR feature gate unit test
This commit is contained in:
@@ -1524,74 +1524,6 @@ func TestWinDSRWithOverlayEnabled(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDSRFeatureGateValidation(t *testing.T) {
|
||||
testCases := []struct {
|
||||
name string
|
||||
enableDSR bool
|
||||
featureGate bool
|
||||
expectFailure bool
|
||||
}{
|
||||
{
|
||||
name: "DSR enabled but feature gate disabled",
|
||||
enableDSR: true,
|
||||
featureGate: false,
|
||||
expectFailure: true,
|
||||
},
|
||||
{
|
||||
name: "DSR enabled and feature gate enabled",
|
||||
enableDSR: true,
|
||||
featureGate: true,
|
||||
expectFailure: false,
|
||||
},
|
||||
{
|
||||
name: "DSR disabled, feature gate does not matter",
|
||||
enableDSR: false,
|
||||
featureGate: false,
|
||||
expectFailure: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
// Mock feature gate
|
||||
featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, kubefeatures.WinDSR, tc.featureGate)
|
||||
|
||||
config := config.KubeProxyWinkernelConfiguration{
|
||||
EnableDSR: tc.enableDSR,
|
||||
NetworkName: testNetwork,
|
||||
SourceVip: serviceVip,
|
||||
}
|
||||
|
||||
hostMacProvider := &testHostMacProvider{macAddress: macAddress}
|
||||
|
||||
hcnMock := getHcnMock(NETWORK_TYPE_OVERLAY)
|
||||
|
||||
_, err := newProxierInternal(
|
||||
v1.IPv4Protocol, // ipFamily
|
||||
testNodeName, // nodeName
|
||||
netutils.ParseIPSloppy("192.168.1.1"), // nodeIP
|
||||
nil, // serviceHealthServer (not needed in this unit test)
|
||||
nil, // healthzServer (not needed in this unit test)
|
||||
0, // healthzPort
|
||||
hcnMock, // hcnImpl
|
||||
hostMacProvider, // hostMacProvider
|
||||
config, // kube-proxy config
|
||||
false, // waitForHNSOverlay
|
||||
)
|
||||
|
||||
if tc.expectFailure {
|
||||
if err == nil {
|
||||
t.Errorf("Expected failure for case %q, but got success", tc.name)
|
||||
}
|
||||
} else {
|
||||
if err != nil {
|
||||
t.Errorf("Expected success for case %q, but got error: %v", tc.name, err)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func makeNSN(namespace, name string) types.NamespacedName {
|
||||
return types.NamespacedName{Namespace: namespace, Name: name}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user