@@ -15,6 +15,22 @@ import (
15
15
)
16
16
17
17
func TestExecuteServers (t * testing.T ) {
18
+ hrNsName := types.NamespacedName {Namespace : "test" , Name : "route1" }
19
+ fooGroup := dataplane.BackendGroup {
20
+ Source : hrNsName ,
21
+ RuleIdx : 0 ,
22
+ Backends : []dataplane.Backend {
23
+ {
24
+ UpstreamName : "test_foo_443" ,
25
+ Valid : true ,
26
+ Weight : 1 ,
27
+ VerifyTLS : & dataplane.VerifyTLS {
28
+ CertBundleID : "test-foo" ,
29
+ Hostname : "test-foo.example.com" ,
30
+ },
31
+ },
32
+ },
33
+ }
18
34
conf := dataplane.Configuration {
19
35
HTTPServers : []dataplane.VirtualServer {
20
36
{
@@ -48,6 +64,18 @@ func TestExecuteServers(t *testing.T) {
48
64
KeyPairID : "test-keypair" ,
49
65
},
50
66
Port : 8443 ,
67
+ PathRules : []dataplane.PathRule {
68
+ {
69
+ Path : "/" ,
70
+ PathType : dataplane .PathTypePrefix ,
71
+ MatchRules : []dataplane.MatchRule {
72
+ {
73
+ Match : dataplane.Match {},
74
+ BackendGroup : fooGroup ,
75
+ },
76
+ },
77
+ },
78
+ },
51
79
},
52
80
},
53
81
}
@@ -61,7 +89,7 @@ func TestExecuteServers(t *testing.T) {
61
89
"server_name cafe.example.com;" : 2 ,
62
90
"ssl_certificate /etc/nginx/secrets/test-keypair.pem;" : 2 ,
63
91
"ssl_certificate_key /etc/nginx/secrets/test-keypair.pem;" : 2 ,
64
- "proxy_ssl_server_name on;" : 2 ,
92
+ "proxy_ssl_server_name on;" : 1 ,
65
93
}
66
94
g := NewWithT (t )
67
95
serverResults := executeServers (conf )
0 commit comments