Skip to content

Commit 6e267ea

Browse files
committed
enable tests
1 parent 6666868 commit 6e267ea

File tree

2 files changed

+102
-102
lines changed

2 files changed

+102
-102
lines changed

Diff for: tests/framework/crossplane.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,18 @@ func ValidateNginxFieldExists(conf *Payload, expFieldCfg ExpectedNginxField) err
5252
}
5353

5454
for _, directive := range config.Parsed {
55-
if len(expFieldCfg.Server) == 0 && len(expFieldCfg.Upstream) == 0 {
55+
if expFieldCfg.Server == "" && expFieldCfg.Upstream == "" {
5656
if expFieldCfg.fieldFound(directive) {
5757
return nil
5858
}
5959
continue
6060
}
6161

62-
if len(expFieldCfg.Server) > 0 && fieldExistsInServer(expFieldCfg, *directive) {
62+
if expFieldCfg.Server != "" && fieldExistsInServer(expFieldCfg, *directive) {
6363
return nil
6464
}
6565

66-
if len(expFieldCfg.Upstream) > 0 && fieldExistsInUpstream(expFieldCfg, *directive) {
66+
if expFieldCfg.Upstream != "" && fieldExistsInUpstream(expFieldCfg, *directive) {
6767
return nil
6868
}
6969
}

Diff for: tests/suite/upstream_settings_test.go

+99-99
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var _ = Describe("UpstreamSettingsPolicy", Ordered, Label("functional", "uspolic
6464

6565
Specify("they are accepted", func() {
6666
usPolicies := []string{
67-
// "multiple-http-svc-usp",
67+
"multiple-http-svc-usp",
6868
"grpc-svc-usp",
6969
}
7070

@@ -81,32 +81,32 @@ var _ = Describe("UpstreamSettingsPolicy", Ordered, Label("functional", "uspolic
8181
}
8282
})
8383

84-
// Context("verify working traffic", func() {
85-
// It("should return a 200 response for HTTPRoutes", func() {
86-
// port := 80
87-
// if portFwdPort != 0 {
88-
// port = portFwdPort
89-
// }
90-
// baseCoffeeURL := fmt.Sprintf("http://cafe.example.com:%d%s", port, "/coffee")
91-
// baseTeaURL := fmt.Sprintf("http://cafe.example.com:%d%s", port, "/tea")
92-
93-
// Eventually(
94-
// func() error {
95-
// return expectRequestToSucceed(baseCoffeeURL, address, "URI: /coffee")
96-
// }).
97-
// WithTimeout(timeoutConfig.RequestTimeout).
98-
// WithPolling(500 * time.Millisecond).
99-
// Should(Succeed())
100-
101-
// Eventually(
102-
// func() error {
103-
// return expectRequestToSucceed(baseTeaURL, address, "URI: /tea")
104-
// }).
105-
// WithTimeout(timeoutConfig.RequestTimeout).
106-
// WithPolling(500 * time.Millisecond).
107-
// Should(Succeed())
108-
// })
109-
// })
84+
Context("verify working traffic", func() {
85+
It("should return a 200 response for HTTPRoutes", func() {
86+
port := 80
87+
if portFwdPort != 0 {
88+
port = portFwdPort
89+
}
90+
baseCoffeeURL := fmt.Sprintf("http://cafe.example.com:%d%s", port, "/coffee")
91+
baseTeaURL := fmt.Sprintf("http://cafe.example.com:%d%s", port, "/tea")
92+
93+
Eventually(
94+
func() error {
95+
return expectRequestToSucceed(baseCoffeeURL, address, "URI: /coffee")
96+
}).
97+
WithTimeout(timeoutConfig.RequestTimeout).
98+
WithPolling(500 * time.Millisecond).
99+
Should(Succeed())
100+
101+
Eventually(
102+
func() error {
103+
return expectRequestToSucceed(baseTeaURL, address, "URI: /tea")
104+
}).
105+
WithTimeout(timeoutConfig.RequestTimeout).
106+
WithPolling(500 * time.Millisecond).
107+
Should(Succeed())
108+
})
109+
})
110110

111111
Context("nginx directives", func() {
112112
var conf *framework.Payload
@@ -128,78 +128,78 @@ var _ = Describe("UpstreamSettingsPolicy", Ordered, Label("functional", "uspolic
128128
Expect(framework.ValidateNginxFieldExists(conf, expCfg)).To(Succeed())
129129
}
130130
},
131-
// Entry("HTTP upstreams", []framework.ExpectedNginxField{
132-
// {
133-
// Directive: "upstream",
134-
// Value: "uspolicy_coffee_80",
135-
// File: "http.conf",
136-
// },
137-
// {
138-
// Directive: "upstream",
139-
// Value: "uspolicy_tea_80",
140-
// File: "http.conf",
141-
// },
142-
// {
143-
// Directive: "zone",
144-
// Value: "uspolicy_coffee_80 512k",
145-
// Upstream: "uspolicy_coffee_80",
146-
// File: "http.conf",
147-
// },
148-
// {
149-
// Directive: "zone",
150-
// Value: "uspolicy_tea_80 512k",
151-
// Upstream: "uspolicy_tea_80",
152-
// File: "http.conf",
153-
// },
154-
// {
155-
// Directive: "keepalive",
156-
// Value: "10",
157-
// Upstream: "uspolicy_coffee_80",
158-
// File: "http.conf",
159-
// },
160-
// {
161-
// Directive: "keepalive",
162-
// Value: "10",
163-
// Upstream: "uspolicy_tea_80",
164-
// File: "http.conf",
165-
// },
166-
// {
167-
// Directive: "keepalive_requests",
168-
// Value: "3",
169-
// Upstream: "uspolicy_coffee_80",
170-
// File: "http.conf",
171-
// },
172-
// {
173-
// Directive: "keepalive_requests",
174-
// Value: "3",
175-
// Upstream: "uspolicy_tea_80",
176-
// File: "http.conf",
177-
// },
178-
// {
179-
// Directive: "keepalive_time",
180-
// Value: "10s",
181-
// Upstream: "uspolicy_coffee_80",
182-
// File: "http.conf",
183-
// },
184-
// {
185-
// Directive: "keepalive_time",
186-
// Value: "10s",
187-
// Upstream: "uspolicy_tea_80",
188-
// File: "http.conf",
189-
// },
190-
// {
191-
// Directive: "keepalive_timeout",
192-
// Value: "50s",
193-
// Upstream: "uspolicy_coffee_80",
194-
// File: "http.conf",
195-
// },
196-
// {
197-
// Directive: "keepalive_timeout",
198-
// Value: "50s",
199-
// Upstream: "uspolicy_tea_80",
200-
// File: "http.conf",
201-
// },
202-
// }),
131+
Entry("HTTP upstreams", []framework.ExpectedNginxField{
132+
{
133+
Directive: "upstream",
134+
Value: "uspolicy_coffee_80",
135+
File: "http.conf",
136+
},
137+
{
138+
Directive: "upstream",
139+
Value: "uspolicy_tea_80",
140+
File: "http.conf",
141+
},
142+
{
143+
Directive: "zone",
144+
Value: "uspolicy_coffee_80 512k",
145+
Upstream: "uspolicy_coffee_80",
146+
File: "http.conf",
147+
},
148+
{
149+
Directive: "zone",
150+
Value: "uspolicy_tea_80 512k",
151+
Upstream: "uspolicy_tea_80",
152+
File: "http.conf",
153+
},
154+
{
155+
Directive: "keepalive",
156+
Value: "10",
157+
Upstream: "uspolicy_coffee_80",
158+
File: "http.conf",
159+
},
160+
{
161+
Directive: "keepalive",
162+
Value: "10",
163+
Upstream: "uspolicy_tea_80",
164+
File: "http.conf",
165+
},
166+
{
167+
Directive: "keepalive_requests",
168+
Value: "3",
169+
Upstream: "uspolicy_coffee_80",
170+
File: "http.conf",
171+
},
172+
{
173+
Directive: "keepalive_requests",
174+
Value: "3",
175+
Upstream: "uspolicy_tea_80",
176+
File: "http.conf",
177+
},
178+
{
179+
Directive: "keepalive_time",
180+
Value: "10s",
181+
Upstream: "uspolicy_coffee_80",
182+
File: "http.conf",
183+
},
184+
{
185+
Directive: "keepalive_time",
186+
Value: "10s",
187+
Upstream: "uspolicy_tea_80",
188+
File: "http.conf",
189+
},
190+
{
191+
Directive: "keepalive_timeout",
192+
Value: "50s",
193+
Upstream: "uspolicy_coffee_80",
194+
File: "http.conf",
195+
},
196+
{
197+
Directive: "keepalive_timeout",
198+
Value: "50s",
199+
Upstream: "uspolicy_tea_80",
200+
File: "http.conf",
201+
},
202+
}),
203203
Entry("GRPC upstreams", []framework.ExpectedNginxField{
204204
{
205205
Directive: "zone",

0 commit comments

Comments
 (0)