Skip to content

Commit 9dbc054

Browse files
vbhargav875l-technicore
authored andcommitted
Add E2E test
1 parent b605f1a commit 9dbc054

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
@@ -38,7 +38,7 @@ var _ = Describe("Service [Slow]", func() {
3838
f := sharedfw.NewDefaultFramework(baseName)
3939

4040
basicTestArray := []struct {
41-
lbType string
41+
lbType string
4242
CreationAnnotations map[string]string
4343
}{
4444
{
@@ -48,7 +48,7 @@ var _ = Describe("Service [Slow]", func() {
4848
{
4949
"nlb",
5050
map[string]string{
51-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
51+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
5252
cloudprovider.ServiceAnnotationNetworkLoadBalancerSecurityListManagementMode: "All",
5353
},
5454
},
@@ -57,7 +57,7 @@ var _ = Describe("Service [Slow]", func() {
5757
It("should be possible to create and mutate a Service type:LoadBalancer (change nodeport) [Canary]", func() {
5858
for _, test := range basicTestArray {
5959
By("Running test for: " + test.lbType)
60-
serviceName := "basic-"+ test.lbType +"-test"
60+
serviceName := "basic-" + test.lbType + "-test"
6161
ns := f.Namespace.Name
6262

6363
jig := sharedfw.NewServiceTestJig(f.ClientSet, serviceName)
@@ -212,7 +212,7 @@ var _ = Describe("ESIPP [Slow]", func() {
212212
cs = f.ClientSet
213213
})
214214
esippTestsArray := []struct {
215-
lbType string
215+
lbType string
216216
CreationAnnotations map[string]string
217217
}{
218218
{
@@ -222,7 +222,7 @@ var _ = Describe("ESIPP [Slow]", func() {
222222
{
223223
"nlb",
224224
map[string]string{
225-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
225+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
226226
cloudprovider.ServiceAnnotationNetworkLoadBalancerSecurityListManagementMode: "All",
227227
},
228228
},
@@ -232,7 +232,7 @@ var _ = Describe("ESIPP [Slow]", func() {
232232
for _, test := range esippTestsArray {
233233
By("Running test for: " + test.lbType)
234234
namespace := f.Namespace.Name
235-
serviceName := "external-local-"+test.lbType
235+
serviceName := "external-local-" + test.lbType
236236
jig := sharedfw.NewServiceTestJig(cs, serviceName)
237237
nodes := jig.GetNodes(sharedfw.MaxNodesForEndpointsTests)
238238

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

300-
svc := jig.CreateOnlyLocalLoadBalancerService(namespace, serviceName, loadBalancerCreateTimeout, true, test.CreationAnnotations,nil)
300+
svc := jig.CreateOnlyLocalLoadBalancerService(namespace, serviceName, loadBalancerCreateTimeout, true, test.CreationAnnotations, nil)
301301
serviceLBNames = append(serviceLBNames, cloudprovider.GetLoadBalancerName(svc))
302302
defer func() {
303303
jig.ChangeServiceType(svc.Namespace, svc.Name, v1.ServiceTypeClusterIP, loadBalancerCreateTimeout)
@@ -683,12 +683,12 @@ var _ = Describe("LB Properties", func() {
683683
Context("[cloudprovider][ccm][lb]", func() {
684684

685685
healthCheckTestArray := []struct {
686-
lbType string
686+
lbType string
687687
CreationAnnotations map[string]string
688-
UpdatedAnnotations map[string]string
689-
RemovedAnnotations map[string]string
690-
CreateInterval int
691-
UpdateInterval int
688+
UpdatedAnnotations map[string]string
689+
RemovedAnnotations map[string]string
690+
CreateInterval int
691+
UpdateInterval int
692692
}{
693693
{
694694
"lb",
@@ -712,13 +712,13 @@ var _ = Describe("LB Properties", func() {
712712
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckRetries: "1",
713713
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckTimeout: "1000",
714714
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckInterval: "10000",
715-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
715+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
716716
},
717717
map[string]string{
718718
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckRetries: "2",
719719
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckTimeout: "2000",
720720
cloudprovider.ServiceAnnotationNetworkLoadBalancerHealthCheckInterval: "15000",
721-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
721+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
722722
},
723723
map[string]string{
724724
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
@@ -730,7 +730,7 @@ var _ = Describe("LB Properties", func() {
730730
It("should be possible to create Service type:LoadBalancer and mutate health-check config", func() {
731731
for _, test := range healthCheckTestArray {
732732
By("Running test for: " + test.lbType)
733-
serviceName := "e2e-"+ test.lbType +"-healthcheck-config"
733+
serviceName := "e2e-" + test.lbType + "-healthcheck-config"
734734
ns := f.Namespace.Name
735735

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

10421042
})
10431043

1044-
nsgTestArray := []struct{
1045-
lbtype string
1046-
Annotations map[string]string
1044+
nsgTestArray := []struct {
1045+
lbtype string
1046+
Annotations map[string]string
10471047
nsgAnnotation string
10481048
}{
10491049
{
10501050
"lb",
10511051
map[string]string{
1052-
cloudprovider.ServiceAnnotationLoadBalancerInternal: "true",
1053-
cloudprovider.ServiceAnnotationLoadBalancerShape: "10Mbps",
1052+
cloudprovider.ServiceAnnotationLoadBalancerInternal: "true",
1053+
cloudprovider.ServiceAnnotationLoadBalancerShape: "10Mbps",
10541054
},
10551055
cloudprovider.ServiceAnnotationLoadBalancerNetworkSecurityGroups,
10561056
},
10571057
{
10581058
"nlb",
10591059
map[string]string{
1060-
cloudprovider.ServiceAnnotationLoadBalancerInternal: "true",
1061-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
1060+
cloudprovider.ServiceAnnotationLoadBalancerInternal: "true",
1061+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
10621062
},
10631063
cloudprovider.ServiceAnnotationNetworkLoadBalancerNetworkSecurityGroups,
10641064
},
10651065
}
10661066
// Test NSG feature
10671067
It("should be possible to create/update/delete Service type:LoadBalancer with NSGs config", func() {
10681068
for _, test := range nsgTestArray {
1069-
By("Running test for: "+ test.lbtype)
1070-
serviceName := "e2e-"+test.lbtype+"-nsg"
1069+
By("Running test for: " + test.lbtype)
1070+
serviceName := "e2e-" + test.lbtype + "-nsg"
10711071
ns := f.Namespace.Name
10721072

10731073
jig := sharedfw.NewServiceTestJig(f.ClientSet, serviceName)
@@ -1170,10 +1170,10 @@ var _ = Describe("LB Properties", func() {
11701170
})
11711171

11721172
lbPolicyTestArray := []struct {
1173-
lbType string
1173+
lbType string
11741174
CreationAnnotations map[string]string
1175-
UpdatedAnnotations map[string]string
1176-
PolicyAnnotation string
1175+
UpdatedAnnotations map[string]string
1176+
PolicyAnnotation string
11771177
}{
11781178
{
11791179
"lb",
@@ -1189,12 +1189,12 @@ var _ = Describe("LB Properties", func() {
11891189
{
11901190
"nlb",
11911191
map[string]string{
1192-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
1192+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
11931193
cloudprovider.ServiceAnnotationNetworkLoadBalancerBackendPolicy: cloudprovider.NetworkLoadBalancingPolicyTwoTuple,
11941194
},
11951195
map[string]string{
1196-
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
1197-
cloudprovider.ServiceAnnotationNetworkLoadBalancerBackendPolicy: cloudprovider.NetworkLoadBalancingPolicyThreeTuple,
1196+
cloudprovider.ServiceAnnotationLoadBalancerType: "nlb",
1197+
cloudprovider.ServiceAnnotationNetworkLoadBalancerBackendPolicy: cloudprovider.NetworkLoadBalancingPolicyThreeTuple,
11981198
},
11991199
cloudprovider.ServiceAnnotationNetworkLoadBalancerBackendPolicy,
12001200
},
@@ -1206,7 +1206,7 @@ var _ = Describe("LB Properties", func() {
12061206
for _, test := range lbPolicyTestArray {
12071207
By("Running test for: " + test.lbType)
12081208

1209-
serviceName := "e2e-"+ test.lbType +"-policy"
1209+
serviceName := "e2e-" + test.lbType + "-policy"
12101210
ns := f.Namespace.Name
12111211

12121212
jig := sharedfw.NewServiceTestJig(f.ClientSet, serviceName)
@@ -1281,8 +1281,8 @@ var _ = Describe("LB Properties", func() {
12811281
}
12821282
})
12831283

1284-
reservedIpTestArray := []struct{
1285-
lbtype string
1284+
reservedIpTestArray := []struct {
1285+
lbtype string
12861286
CreationAnnotations map[string]string
12871287
}{
12881288
{
@@ -1301,8 +1301,8 @@ var _ = Describe("LB Properties", func() {
13011301
//Test Reserved IP feature
13021302
It("should be possible to create Service type:LoadbBalancer with public reservedIP", func() {
13031303
for _, test := range reservedIpTestArray {
1304-
By("Running test for: "+ test.lbtype)
1305-
serviceName := "e2e-"+ test.lbtype +"-reserved-ip"
1304+
By("Running test for: " + test.lbtype)
1305+
serviceName := "e2e-" + test.lbtype + "-reserved-ip"
13061306
ns := f.Namespace.Name
13071307

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

0 commit comments

Comments
 (0)