Skip to content

Commit 8c97e20

Browse files
committed
fix tests
1 parent 88923e3 commit 8c97e20

File tree

2 files changed

+25
-10
lines changed

2 files changed

+25
-10
lines changed

pkg/appgw/backendhttpsettings_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ var _ = Describe("Test the creation of Backend http settings from Ingress defini
7272

7373
for _, setting := range httpSettings {
7474
if *setting.Name == DefaultBackendHTTPSettingsName {
75-
Expect(setting.Protocol).To(Equal(n.ApplicationGatewayProtocolHTTP), "default backend %s should have %s", *setting.Name, n.ApplicationGatewayProtocolHTTP)
76-
Expect(probes[utils.GetLastChunkOfSlashed(*setting.Probe.ID)].Protocol).To(Equal(n.ApplicationGatewayProtocolHTTP), "default probe should have http")
75+
Expect(setting.Protocol).To(Equal(n.ApplicationGatewayProtocolHTTPS), "default backend %s should have %s", *setting.Name, n.ApplicationGatewayProtocolHTTPS)
76+
Expect(probes[utils.GetLastChunkOfSlashed(*setting.Probe.ID)].Protocol).To(Equal(n.ApplicationGatewayProtocolHTTPS), "default probe should have http")
7777
continue
7878
}
7979

@@ -114,8 +114,8 @@ var _ = Describe("Test the creation of Backend http settings from Ingress defini
114114

115115
for _, setting := range httpSettings {
116116
if *setting.Name == DefaultBackendHTTPSettingsName {
117-
Expect(setting.Protocol).To(Equal(n.ApplicationGatewayProtocolHTTP), "default backend %s should have %s", *setting.Name, n.ApplicationGatewayProtocolHTTP)
118-
Expect(probes[utils.GetLastChunkOfSlashed(*setting.Probe.ID)].Protocol).To(Equal(n.ApplicationGatewayProtocolHTTP), "default probe should have http")
117+
Expect(setting.Protocol).To(Equal(n.ApplicationGatewayProtocolHTTPS), "default backend %s should have %s", *setting.Name, n.ApplicationGatewayProtocolHTTP)
118+
Expect(probes[utils.GetLastChunkOfSlashed(*setting.Probe.ID)].Protocol).To(Equal(n.ApplicationGatewayProtocolHTTPS), "default probe should have http")
119119
continue
120120
}
121121

@@ -154,7 +154,7 @@ var _ = Describe("Test the creation of Backend http settings from Ingress defini
154154

155155
for _, setting := range httpSettings {
156156
if *setting.Name == DefaultBackendHTTPSettingsName {
157-
Expect(int32(80)).To(Equal(*setting.Port), "default backend port %d should be 80", *setting.Port)
157+
Expect(int32(443)).To(Equal(*setting.Port), "default backend port %d should be 80", *setting.Port)
158158
} else if strings.Contains(*setting.Name, strconv.Itoa(int(tests.ContainerPort))) {
159159
// http setting for ingress with service port as 80
160160
Expect(tests.ContainerPort).To(Equal(*setting.Port), "setting %s backend port %d should be 9876", *setting.Name, *setting.Port)
@@ -189,7 +189,7 @@ var _ = Describe("Test the creation of Backend http settings from Ingress defini
189189

190190
for _, setting := range httpSettings {
191191
if *setting.Name == DefaultBackendHTTPSettingsName {
192-
Expect(int32(80)).To(Equal(*setting.Port), "default backend port %d should be 80", *setting.Port)
192+
Expect(int32(443)).To(Equal(*setting.Port), "default backend port %d should be 80", *setting.Port)
193193
} else if strings.Contains(*setting.Name, strconv.Itoa(int(tests.ContainerPort))) {
194194
// http setting for ingress with service port as 80
195195
Expect(tests.ContainerPort).To(Equal(*setting.Port), "setting %s backend port %d should be 9876", *setting.Name, *setting.Port)
@@ -238,7 +238,7 @@ var _ = Describe("Test the creation of Backend http settings from Ingress defini
238238

239239
for _, setting := range httpSettings {
240240
if *setting.Name == DefaultBackendHTTPSettingsName {
241-
Expect(int32(80)).To(Equal(*setting.Port), "default backend port %d should be 80", *setting.Port)
241+
Expect(int32(443)).To(Equal(*setting.Port), "default backend port %d should be 80", *setting.Port)
242242
} else if strings.Contains(*setting.Name, strconv.Itoa(int(tests.ContainerPort))) {
243243
// http setting for ingress with service port as 80
244244
Expect(tests.ContainerPort).To(Equal(*setting.Port), "setting %s backend port %d should be 9876", *setting.Name, *setting.Port)

pkg/appgw/configbuilder_test.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,11 +489,11 @@ var _ = Describe("Tests `appgw.ConfigBuilder`", func() {
489489
-- "properties": {
490490
-- "cookieBasedAffinity": "Disabled",
491491
-- "pickHostNameFromBackendAddress": false,
492-
-- "port": 80,
492+
-- "port": 443,
493493
-- "probe": {
494-
-- "id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/probes/defaultprobe-Http"
494+
-- "id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/probes/defaultprobe-Https"
495495
-- },
496-
-- "protocol": "Http",
496+
-- "protocol": "Https",
497497
-- "requestTimeout": 30
498498
-- }
499499
-- }
@@ -557,6 +557,21 @@ var _ = Describe("Tests `appgw.ConfigBuilder`", func() {
557557
-- "timeout": 30,
558558
-- "unhealthyThreshold": 3
559559
-- }
560+
-- },
561+
-- {
562+
-- "id": "/subscriptions/--subscription--/resourceGroups/--resource-group--/providers/Microsoft.Network/applicationGateways/--app-gw-name--/probes/defaultprobe-Https",
563+
-- "name": "defaultprobe-Https",
564+
-- "properties": {
565+
-- "host": "localhost",
566+
-- "interval": 30,
567+
-- "match": {},
568+
-- "minServers": 0,
569+
-- "path": "/",
570+
-- "pickHostNameFromBackendHttpSettings": false,
571+
-- "protocol": "Https",
572+
-- "timeout": 30,
573+
-- "unhealthyThreshold": 3
574+
-- }
560575
-- }
561576
-- ],
562577
-- "redirectConfigurations": [],

0 commit comments

Comments
 (0)