Skip to content

Commit

Permalink
fix: enable service-lb only when running on kind
Browse files Browse the repository at this point in the history
Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh committed Jan 6, 2025
1 parent af4f41a commit 3135b8e
Showing 1 changed file with 35 additions and 61 deletions.
96 changes: 35 additions & 61 deletions tests/e2e/e2e_gatewayapi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,37 +45,7 @@ var _ = FSMDescribe("Test traffic routing by FSM Gateway with trafficInterceptio
func() {
Context("Test traffic from client to backend service routing by FSM Gateway", func() {
It("allow traffic of multiple protocols through Gateway", func() {
// Install FSM
installOpts := Td.GetFSMInstallOpts()
installOpts.EnableIngress = false
installOpts.EnableGateway = true
installOpts.EnableServiceLB = true
installOpts.TrafficInterceptionMode = constants.TrafficInterceptionModePodLevel

Expect(Td.InstallFSM(installOpts)).To(Succeed())
Expect(Td.WaitForPodsRunningReady(Td.FsmNamespace, 3, &metav1.LabelSelector{
MatchLabels: map[string]string{
"app.kubernetes.io/instance": "fsm",
"app.kubernetes.io/name": "flomesh.io",
},
})).To(Succeed())

testDeployFSMGateway()

testFSMGatewayHTTPTrafficSameNamespace()
testFSMGatewayHTTPTrafficCrossNamespace()
testFSMGatewayHTTPSTraffic()
testFSMGatewayTLSTerminate()
testFSMGatewayTLSPassthrough()

testFSMGatewayGRPCTrafficSameNamespace()
testFSMGatewayGRPCTrafficCrossNamespace()
testFSMGatewayGRPCSTraffic()

testFSMGatewayTCPTrafficSameNamespace()
testFSMGatewayTCPTrafficCrossNamespace()
testFSMGatewayUDPTrafficSameNamespace()
testFSMGatewayUDPTrafficCrossNamespace()
testGatewayAPI(constants.TrafficInterceptionModePodLevel)
})
})
})
Expand All @@ -89,40 +59,44 @@ var _ = FSMDescribe("Test traffic routing by FSM Gateway with trafficInterceptio
func() {
Context("Test traffic from client to backend service routing by FSM Gateway", func() {
It("allow traffic of multiple protocols through Gateway", func() {
// Install FSM
installOpts := Td.GetFSMInstallOpts()
installOpts.EnableIngress = false
installOpts.EnableGateway = true
installOpts.EnableServiceLB = true
installOpts.TrafficInterceptionMode = constants.TrafficInterceptionModeNodeLevel

Expect(Td.InstallFSM(installOpts)).To(Succeed())
Expect(Td.WaitForPodsRunningReady(Td.FsmNamespace, 3, &metav1.LabelSelector{
MatchLabels: map[string]string{
"app.kubernetes.io/instance": "fsm",
"app.kubernetes.io/name": "flomesh.io",
},
})).To(Succeed())
testGatewayAPI(constants.TrafficInterceptionModeNodeLevel)
})
})
})

testDeployFSMGateway()
func testGatewayAPI(trafficInterceptionMode string) {
// Install FSM
installOpts := Td.GetFSMInstallOpts()
installOpts.EnableIngress = false
installOpts.EnableGateway = true
installOpts.EnableServiceLB = Td.InstType == KindCluster
installOpts.TrafficInterceptionMode = trafficInterceptionMode

testFSMGatewayHTTPTrafficSameNamespace()
testFSMGatewayHTTPTrafficCrossNamespace()
testFSMGatewayHTTPSTraffic()
testFSMGatewayTLSTerminate()
testFSMGatewayTLSPassthrough()
Expect(Td.InstallFSM(installOpts)).To(Succeed())
Expect(Td.WaitForPodsRunningReady(Td.FsmNamespace, 3, &metav1.LabelSelector{
MatchLabels: map[string]string{
"app.kubernetes.io/instance": "fsm",
"app.kubernetes.io/name": "flomesh.io",
},
})).To(Succeed())

testFSMGatewayGRPCTrafficSameNamespace()
testFSMGatewayGRPCTrafficCrossNamespace()
testFSMGatewayGRPCSTraffic()
testDeployFSMGateway()

testFSMGatewayTCPTrafficSameNamespace()
testFSMGatewayTCPTrafficCrossNamespace()
testFSMGatewayUDPTrafficSameNamespace()
testFSMGatewayUDPTrafficCrossNamespace()
})
})
})
testFSMGatewayHTTPTrafficSameNamespace()
testFSMGatewayHTTPTrafficCrossNamespace()
testFSMGatewayHTTPSTraffic()
testFSMGatewayTLSTerminate()
testFSMGatewayTLSPassthrough()

testFSMGatewayGRPCTrafficSameNamespace()
testFSMGatewayGRPCTrafficCrossNamespace()
testFSMGatewayGRPCSTraffic()

testFSMGatewayTCPTrafficSameNamespace()
testFSMGatewayTCPTrafficCrossNamespace()
testFSMGatewayUDPTrafficSameNamespace()
testFSMGatewayUDPTrafficCrossNamespace()
}

func testDeployFSMGateway() {
// Create namespaces
Expand Down

0 comments on commit 3135b8e

Please sign in to comment.