Skip to content

Commit 694817b

Browse files
committed
update unit tests
1 parent 4c5f48a commit 694817b

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

internal/mode/static/nginx/config/servers_test.go

+27-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,32 @@ func TestExecuteServers(t *testing.T) {
4848
KeyPairID: "test-keypair",
4949
},
5050
Port: 8443,
51+
PathRules: []dataplane.PathRule{
52+
{
53+
Path: "/",
54+
PathType: dataplane.PathTypePrefix,
55+
MatchRules: []dataplane.MatchRule{
56+
{
57+
Match: dataplane.Match{},
58+
BackendGroup: dataplane.BackendGroup{
59+
Source: types.NamespacedName{Namespace: "test", Name: "route1"},
60+
RuleIdx: 0,
61+
Backends: []dataplane.Backend{
62+
{
63+
UpstreamName: "test_foo_443",
64+
Valid: true,
65+
Weight: 1,
66+
VerifyTLS: &dataplane.VerifyTLS{
67+
CertBundleID: "test-foo",
68+
Hostname: "test-foo.example.com",
69+
},
70+
},
71+
},
72+
},
73+
},
74+
},
75+
},
76+
},
5177
},
5278
},
5379
}
@@ -61,7 +87,7 @@ func TestExecuteServers(t *testing.T) {
6187
"server_name cafe.example.com;": 2,
6288
"ssl_certificate /etc/nginx/secrets/test-keypair.pem;": 2,
6389
"ssl_certificate_key /etc/nginx/secrets/test-keypair.pem;": 2,
64-
"proxy_ssl_server_name on;": 2,
90+
"proxy_ssl_server_name on;": 1,
6591
}
6692
g := NewWithT(t)
6793
serverResults := executeServers(conf)

0 commit comments

Comments
 (0)