@@ -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: types.NamespacedName{Namespace: "test", Name: "route1"},
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,32 @@ 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 : dataplane.BackendGroup {
75
+ Source : types.NamespacedName {Namespace : "test" , Name : "route1" },
76
+ RuleIdx : 0 ,
77
+ Backends : []dataplane.Backend {
78
+ {
79
+ UpstreamName : "test_foo_443" ,
80
+ Valid : true ,
81
+ Weight : 1 ,
82
+ VerifyTLS : & dataplane.VerifyTLS {
83
+ CertBundleID : "test-foo" ,
84
+ Hostname : "test-foo.example.com" ,
85
+ },
86
+ },
87
+ },
88
+ },
89
+ },
90
+ },
91
+ },
92
+ },
51
93
},
52
94
},
53
95
}
@@ -61,7 +103,7 @@ func TestExecuteServers(t *testing.T) {
61
103
"server_name cafe.example.com;" : 2 ,
62
104
"ssl_certificate /etc/nginx/secrets/test-keypair.pem;" : 2 ,
63
105
"ssl_certificate_key /etc/nginx/secrets/test-keypair.pem;" : 2 ,
64
- "proxy_ssl_server_name on;" : 2 ,
106
+ "proxy_ssl_server_name on;" : 1 ,
65
107
}
66
108
g := NewWithT (t )
67
109
serverResults := executeServers (conf )
0 commit comments