Skip to content

Commit dacb1d8

Browse files
committed
JIRA:task/OKE-21088 Add E2E test
1 parent bf954fb commit dacb1d8

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

test/e2e/cloud-provider-oci/load_balancer.go

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var _ = Describe("Service [Slow]", func() {
4040
f := sharedfw.NewDefaultFramework(baseName)
4141

4242
basicTestArray := []struct {
43-
lbType string
43+
lbType string
4444
CreationAnnotations map[string]string
4545
}{
4646
{
@@ -50,7 +50,7 @@ var _ = Describe("Service [Slow]", func() {
5050
{
5151
"nlb",
5252
map[string]string{
53-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
53+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
5454
cloudprovider.ServiceAnnotationNetworkLoadBalancerSecurityListManagementMode: "All",
5555
},
5656
},
@@ -59,7 +59,7 @@ var _ = Describe("Service [Slow]", func() {
5959
It("should be possible to create and mutate a Service type:LoadBalancer (change nodeport) [Canary]", func() {
6060
for _, test := range basicTestArray {
6161
By("Running test for: " + test.lbType)
62-
serviceName := "basic-"+ test.lbType +"-test"
62+
serviceName := "basic-" + test.lbType + "-test"
6363
ns := f.Namespace.Name
6464

6565
jig := sharedfw.NewServiceTestJig(f.ClientSet, serviceName)
@@ -214,7 +214,7 @@ var _ = Describe("ESIPP [Slow]", func() {
214214
cs = f.ClientSet
215215
})
216216
esippTestsArray := []struct {
217-
lbType string
217+
lbType string
218218
CreationAnnotations map[string]string
219219
}{
220220
{
@@ -224,7 +224,7 @@ var _ = Describe("ESIPP [Slow]", func() {
224224
{
225225
"nlb",
226226
map[string]string{
227-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
227+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
228228
cloudprovider.ServiceAnnotationNetworkLoadBalancerSecurityListManagementMode: "All",
229229
},
230230
},
@@ -234,7 +234,7 @@ var _ = Describe("ESIPP [Slow]", func() {
234234
for _, test := range esippTestsArray {
235235
By("Running test for: " + test.lbType)
236236
namespace := f.Namespace.Name
237-
serviceName := "external-local-"+test.lbType
237+
serviceName := "external-local-" + test.lbType
238238
jig := sharedfw.NewServiceTestJig(cs, serviceName)
239239
nodes := jig.GetNodes(sharedfw.MaxNodesForEndpointsTests)
240240

@@ -295,11 +295,11 @@ var _ = Describe("ESIPP [Slow]", func() {
295295
for _, test := range esippTestsArray {
296296
By("Running test for: " + test.lbType)
297297
namespace := f.Namespace.Name
298-
serviceName := "external-local-"+ test.lbType
298+
serviceName := "external-local-" + test.lbType
299299
jig := sharedfw.NewServiceTestJig(cs, serviceName)
300300
nodes := jig.GetNodes(sharedfw.MaxNodesForEndpointsTests)
301301

302-
svc := jig.CreateOnlyLocalLoadBalancerService(namespace, serviceName, loadBalancerCreateTimeout, true, test.CreationAnnotations,nil)
302+
svc := jig.CreateOnlyLocalLoadBalancerService(namespace, serviceName, loadBalancerCreateTimeout, true, test.CreationAnnotations, nil)
303303
serviceLBNames = append(serviceLBNames, cloudprovider.GetLoadBalancerName(svc))
304304
defer func() {
305305
jig.ChangeServiceType(svc.Namespace, svc.Name, v1.ServiceTypeClusterIP, loadBalancerCreateTimeout)
@@ -685,12 +685,12 @@ var _ = Describe("LB Properties", func() {
685685
Context("[cloudprovider][ccm][lb]", func() {
686686

687687
healthCheckTestArray := []struct {
688-
lbType string
688+
lbType string
689689
CreationAnnotations map[string]string
690-
UpdatedAnnotations map[string]string
691-
RemovedAnnotations map[string]string
692-
CreateInterval int
693-
UpdateInterval int
690+
UpdatedAnnotations map[string]string
691+
RemovedAnnotations map[string]string
692+
CreateInterval int
693+
UpdateInterval int
694694
}{
695695
{
696696
"lb",
@@ -714,13 +714,13 @@ var _ = Describe("LB Properties", func() {
714714
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckRetries: "1",
715715
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckTimeout: "1000",
716716
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckInterval: "10000",
717-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
717+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
718718
},
719719
map[string]string{
720720
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckRetries: "2",
721721
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckTimeout: "2000",
722722
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckInterval: "15000",
723-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
723+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
724724
},
725725
map[string]string{
726726
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
@@ -732,7 +732,7 @@ var _ = Describe("LB Properties", func() {
732732
It("should be possible to create Service type:LoadBalancer and mutate health-check config", func() {
733733
for _, test := range healthCheckTestArray {
734734
By("Running test for: " + test.lbType)
735-
serviceName := "e2e-"+ test.lbType +"-healthcheck-config"
735+
serviceName := "e2e-" + test.lbType + "-healthcheck-config"
736736
ns := f.Namespace.Name
737737

738738
jig := sharedfw.NewServiceTestJig(f.ClientSet, serviceName)
@@ -1043,33 +1043,33 @@ var _ = Describe("LB Properties", func() {
10431043

10441044
})
10451045

1046-
nsgTestArray := []struct{
1047-
lbtype string
1048-
Annotations map[string]string
1046+
nsgTestArray := []struct {
1047+
lbtype string
1048+
Annotations map[string]string
10491049
nsgAnnotation string
10501050
}{
10511051
{
10521052
"lb",
10531053
map[string]string{
1054-
cloudprovider.ServiceAnnotationLoadBalancerInternal: "true",
1055-
cloudprovider.ServiceAnnotationLoadBalancerShape: "10Mbps",
1054+
cloudprovider.ServiceAnnotationLoadBalancerInternal: "true",
1055+
cloudprovider.ServiceAnnotationLoadBalancerShape: "10Mbps",
10561056
},
10571057
cloudprovider.ServiceAnnotationLoadBalancerNetworkSecurityGroups,
10581058
},
10591059
{
10601060
"nlb",
10611061
map[string]string{
1062-
cloudprovider.ServiceAnnotationLoadBalancerInternal: "true",
1063-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
1062+
cloudprovider.ServiceAnnotationLoadBalancerInternal: "true",
1063+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
10641064
},
10651065
cloudprovider.ServiceAnnotationNetworkLoadBalancerNetworkSecurityGroups,
10661066
},
10671067
}
10681068
// Test NSG feature
10691069
It("should be possible to create/update/delete Service type:LoadBalancer with NSGs config", func() {
10701070
for _, test := range nsgTestArray {
1071-
By("Running test for: "+ test.lbtype)
1072-
serviceName := "e2e-"+test.lbtype+"-nsg"
1071+
By("Running test for: " + test.lbtype)
1072+
serviceName := "e2e-" + test.lbtype + "-nsg"
10731073
ns := f.Namespace.Name
10741074

10751075
jig := sharedfw.NewServiceTestJig(f.ClientSet, serviceName)
@@ -1172,10 +1172,10 @@ var _ = Describe("LB Properties", func() {
11721172
})
11731173

11741174
lbPolicyTestArray := []struct {
1175-
lbType string
1175+
lbType string
11761176
CreationAnnotations map[string]string
1177-
UpdatedAnnotations map[string]string
1178-
PolicyAnnotation string
1177+
UpdatedAnnotations map[string]string
1178+
PolicyAnnotation string
11791179
}{
11801180
{
11811181
"lb",
@@ -1191,12 +1191,12 @@ var _ = Describe("LB Properties", func() {
11911191
{
11921192
"nlb",
11931193
map[string]string{
1194-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
1194+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
11951195
cloudprovider.ServiceAnnotationNetworkLoadBalancerBackendPolicy: cloudprovider.NetworkLoadBalancingPolicyTwoTuple,
11961196
},
11971197
map[string]string{
1198-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
1199-
cloudprovider.ServiceAnnotationNetworkLoadBalancerBackendPolicy: cloudprovider.NetworkLoadBalancingPolicyThreeTuple,
1198+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
1199+
cloudprovider.ServiceAnnotationNetworkLoadBalancerBackendPolicy: cloudprovider.NetworkLoadBalancingPolicyThreeTuple,
12001200
},
12011201
cloudprovider.ServiceAnnotationNetworkLoadBalancerBackendPolicy,
12021202
},
@@ -1208,7 +1208,7 @@ var _ = Describe("LB Properties", func() {
12081208
for _, test := range lbPolicyTestArray {
12091209
By("Running test for: " + test.lbType)
12101210

1211-
serviceName := "e2e-"+ test.lbType +"-policy"
1211+
serviceName := "e2e-" + test.lbType + "-policy"
12121212
ns := f.Namespace.Name
12131213

12141214
jig := sharedfw.NewServiceTestJig(f.ClientSet, serviceName)
@@ -1283,8 +1283,8 @@ var _ = Describe("LB Properties", func() {
12831283
}
12841284
})
12851285

1286-
reservedIpTestArray := []struct{
1287-
lbtype string
1286+
reservedIpTestArray := []struct {
1287+
lbtype string
12881288
CreationAnnotations map[string]string
12891289
}{
12901290
{
@@ -1303,8 +1303,8 @@ var _ = Describe("LB Properties", func() {
13031303
//Test Reserved IP feature
13041304
It("should be possible to create Service type:LoadbBalancer with public reservedIP", func() {
13051305
for _, test := range reservedIpTestArray {
1306-
By("Running test for: "+ test.lbtype)
1307-
serviceName := "e2e-"+ test.lbtype +"-reserved-ip"
1306+
By("Running test for: " + test.lbtype)
1307+
serviceName := "e2e-" + test.lbtype + "-reserved-ip"
13081308
ns := f.Namespace.Name
13091309

13101310
jig := sharedfw.NewServiceTestJig(f.ClientSet, serviceName)
@@ -1383,10 +1383,10 @@ func CreateHealthCheckScript(healthCheckNodePort int, ips []string, path string,
13831383
port := strconv.Itoa(healthCheckNodePort)
13841384
ipPort := net.JoinHostPort(privateIP, port)
13851385
//command to get health status of the pod on the node
1386-
script += "healthCheckPassed=$(curl -s http://"+ ipPort + path + " | grep -i localEndpoints* | cut -d ':' -f2);"
1387-
if n == nodeIndex{
1386+
script += "healthCheckPassed=$(curl -s http://" + ipPort + path + " | grep -i localEndpoints* | cut -d ':' -f2);"
1387+
if n == nodeIndex {
13881388
script += "if ((\"$healthCheckPassed\"==\"0\")); then exit 1; fi;"
1389-
}else{
1389+
} else {
13901390
script += "if ((\"$healthCheckPassed\"==\"1\")); then exit 1; fi;"
13911391
}
13921392
}

0 commit comments

Comments
 (0)