diff options
author | kaiwu <kaiwu2004@gmail.com> | 2025-03-01 12:42:23 +0800 |
---|---|---|
committer | kaiwu <kaiwu2004@gmail.com> | 2025-03-01 12:42:23 +0800 |
commit | 3f33461e4948bf05e60bdff35ec6c57a649c7860 (patch) | |
tree | 284c2ba95a41536ae1bff6bea710db0709a64739 /memc-nginx-module-0.20/t/errors.t | |
download | openresty-3f33461e4948bf05e60bdff35ec6c57a649c7860.tar.gz openresty-3f33461e4948bf05e60bdff35ec6c57a649c7860.zip |
openresty bundle
Diffstat (limited to 'memc-nginx-module-0.20/t/errors.t')
-rw-r--r-- | memc-nginx-module-0.20/t/errors.t | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/memc-nginx-module-0.20/t/errors.t b/memc-nginx-module-0.20/t/errors.t new file mode 100644 index 0000000..1cda000 --- /dev/null +++ b/memc-nginx-module-0.20/t/errors.t @@ -0,0 +1,45 @@ +# vi:filetype= + +use lib 'lib'; +use Test::Nginx::Socket; + +plan tests => repeat_each() * 2 * blocks(); + +$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211; + +#no_diff; + +run_tests(); + +__DATA__ + +=== TEST 1: empty pass +little-endian systems only + +--- config + location /memc { + set $memc_key foo; + set $backend "not-exist"; + memc_pass $backend; + } +--- request +GET /memc +--- error_code: 500 +--- response_body_like: 500 Internal Server Error + + + +=== TEST 2: connection refused +little-endian systems only + +--- config + location /memc { + set $memc_key foo; + set $backend "not-exist"; + memc_pass 127.0.0.1:1; + } +--- request +GET /memc +--- error_code: 502 +--- response_body_like: 502 Bad Gateway + |