File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed
internal/datasource/config Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,31 @@ var (
260
260
api write=on;
261
261
}
262
262
}
263
+ `
264
+
265
+ testConf22 = ` server {
266
+ listen unix:/var/lib/nginx/nginx-plus-api.sock;
267
+ access_log off;
268
+
269
+ # $config_version_mismatch is defined in /etc/nginx/config-version.conf
270
+ location /configVersionCheck {
271
+ if ($config_version_mismatch) {
272
+ return 503;
273
+ }
274
+ return 200;
275
+ }
276
+
277
+ location /api {
278
+ api write=on;
279
+ }
280
+ }
281
+
282
+ server {
283
+ listen unix:/var/lib/nginx/nginx-418-server.sock;
284
+ access_log off;
285
+
286
+ return 418;
287
+ }
263
288
`
264
289
)
265
290
@@ -965,9 +990,20 @@ func TestNginxConfigParser_urlsForLocationDirective(t *testing.T) {
965
990
Location : "/api" ,
966
991
},
967
992
},
968
- name : "Test 21: listen unix:/var/run/nginx/nginx-plus-api.sock- Plus Unix Socket" ,
993
+ name : "Test 21: listen unix:/var/run/nginx/nginx-plus-api.sock - Plus Unix Socket" ,
969
994
conf : testConf21 ,
970
995
},
996
+ {
997
+ plus : []* model.APIDetails {
998
+ {
999
+ URL : "http://nginx-plus-api/api" ,
1000
+ Listen : "unix:/var/lib/nginx/nginx-plus-api.sock" ,
1001
+ Location : "/api" ,
1002
+ },
1003
+ },
1004
+ name : "Test 22: Multiple Plus Unix Sockets" ,
1005
+ conf : testConf22 ,
1006
+ },
971
1007
} {
972
1008
ctx := context .Background ()
973
1009
f , err := os .CreateTemp (tmpDir , "conf" )
You can’t perform that action at this time.
0 commit comments