summaryrefslogtreecommitdiff
path: root/memc-nginx-module-0.20/t/errors.t
blob: 1cda000d280c9d92c06576076575079d89e0c4fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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