-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
65 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# vim:set ft= ts=4 sts=4 sw=4 et fdm=marker: | ||
use strict; | ||
use lib '.'; | ||
use t::TestWasmX; | ||
|
||
skip_no_hup(); | ||
|
||
|
||
our $metrics = "c2,g2,h2"; | ||
|
||
no_shuffle(); | ||
plan_tests(6); | ||
run_tests(); | ||
|
||
__DATA__ | ||
|
||
=== TEST 1: SIGHUP metrics - define metrics | ||
--- valgrind | ||
--- load_nginx_modules: ngx_http_echo_module | ||
--- wasm_modules: hostcalls | ||
--- config eval | ||
qq{ | ||
location /t { | ||
proxy_wasm hostcalls 'on_configure=define_and_increment_counters \ | ||
metrics=$::metrics'; | ||
echo ok; | ||
} | ||
} | ||
--- error_log eval | ||
qr/c2_Configure: $::workers.*/ | ||
--- no_error_log | ||
[error] | ||
[crit] | ||
[emerg] | ||
[alert] | ||
|
||
|
||
|
||
=== TEST 2: SIGHUP metrics - decreased slab_size - not enough memory | ||
--- reload_fails | ||
--- valgrind | ||
--- load_nginx_modules: ngx_http_echo_module | ||
--- main_config eval | ||
qq{ | ||
wasm { | ||
module hostcalls $ENV{TEST_NGINX_CRATES_DIR}/hostcalls.wasm; | ||
|
||
metrics { | ||
slab_size 12k; | ||
} | ||
} | ||
} | ||
--- config eval | ||
qq{ | ||
location /t { | ||
echo ok; | ||
} | ||
} | ||
--- error_log: failed redefining metric | ||
--- no_error_log | ||
[stub] | ||
[stub] | ||
[stub] | ||
[stub] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters