Skip to content

Commit

Permalink
Test: Added APICAST_SERVICE_FILTER_BY_URL integration test.
Browse files Browse the repository at this point in the history
This test validates that the parameter `APICAST_SERVICE_FILTER_BY_URL`
is working correctly across multiple services and the service discarding
is working correctly.

Signed-off-by: Eloy Coto <eloy.coto@gmail.com>
  • Loading branch information
eloycoto committed Apr 26, 2019
1 parent 6d83d3e commit 16e837e
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions t/apicast-subset-of-services.t
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,56 @@ __DATA__
["yay, api backend: /one/\n", ""]
--- error_code eval
[200, 404]
=== TEST 2: multi service configuration limited with Regexp Filter
--- env eval
("APICAST_SERVICES_FILTER_BY_URL", "^on*")
--- configuration
{
"services": [
{
"backend_version": 1,
"proxy": {
"hosts": [
"one"
],
"api_backend": "http://test:$TEST_NGINX_SERVER_PORT/api-backend/one/",
"proxy_rules": [
{
"http_method": "GET",
"delta": 1,
"metric_system_name": "one",
"pattern": "/"
}
]
},
"id": 42
},
{
"proxy": {
"hosts": [
"two"
]
},
"id": 11
}
]
}
--- backend
location /transactions/authrep.xml {
content_by_lua_block { ngx.exit(200) }
}
--- upstream
location ~ /api-backend(/.+) {
echo 'yay, api backend: $1';
}
--- pipelined_requests eval
["GET /?user_key=1","GET /?user_key=2"]
--- more_headers eval
["Host: one", "Host: two"]
--- response_body eval
["yay, api backend: /one/\n", ""]
--- error_code eval
[200, 404]

0 comments on commit 16e837e

Please sign in to comment.