-
Notifications
You must be signed in to change notification settings - Fork 365
/
tcp_check.t
80 lines (64 loc) · 1.39 KB
/
tcp_check.t
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#
#===============================================================================
#
# FILE: tcp_check.t
#
# DESCRIPTION: test
#
# FILES: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Weibin Yao (http://yaoweibin.cn/), yaoweibin@gmail.com
# COMPANY:
# VERSION: 1.0
# CREATED: 03/02/2010 03:18:28 PM
# REVISION: ---
#===============================================================================
# vi:filetype=perl
use lib 'lib';
use Test::Nginx::LWP;
plan tests => repeat_each() * 2 * blocks();
#no_diff;
run_tests();
__DATA__
=== TEST 1: the tcp_check test
--- config
upstream test{
server blog.163.com;
#ip_hash;
check interval=3000 rise=1 fall=5 timeout=1000;
}
server {
listen 1984;
protocol tcp_generic;
proxy_pass test;
}
--- request
GET /
--- response_body_like: ^<(.*)>$
=== TEST 2: the round robin test without check
--- config
upstream test{
server blog.163.com;
}
server {
listen 1984;
#server_names a.b.c d.e.f;
proxy_pass test;
}
--- request
GET /
--- response_body_like: ^<(.*)>$
=== TEST 3: the ip_hash test without check
--- config
upstream test{
server blog.163.com;
ip_hash;
}
server {
listen 1984;
proxy_pass test;
}
--- request
GET /
--- response_body_like: ^<(.*)>$