~ubuntu-branches/ubuntu/raring/nginx/raring-security

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/t/090-log-socket-errors.t

  • Committer: Package Import Robot
  • Author(s): Kartik Mistry, Kartik Mistry, Cyril Lavier, Michael Lustfield
  • Date: 2012-12-18 10:29:18 UTC
  • mfrom: (4.2.56 sid)
  • Revision ID: package-import@ubuntu.com-20121218102918-dxtwj9vj89sbj8dz
Tags: 1.2.6-1
[ Kartik Mistry ]
* New upstream release.
* debian/nginx-common.nginx.init:
  + Used log_*_msg instead of echo for better init messages.
  + Added patch to check start-stop-daemon exit status, Thanks to
    Sergey B Kirpichev <skirpichev@gmail.com> (Closes: #695374).
* debian/po/ja.po:
  + Added new Japanese translation. Thanks to victory <victory.deb@gmail.com>
    (Closes: #692481).
* debian/po/pt_BR.po:
  + Added new Brazilian Portuguese translation. Thanks to
    Adriano Rafael Gomes <adrianorg@gmail.com> (Closes: #692481).

[ Cyril Lavier ]
* debian/rules
  + Added RealIP module in nginx-naxsi (Closes: #693302).
* debian/modules/nginx-cache-purge/
  + Updated nginx-cache-purge module with the 2.0 version.
* debian/modules/nginx-lua/
  + Updated nginx-lua module with the 0.7.8 version.
* debian/modules/nginx-echo/
  + Updated the nginx-echo module with the 0.41 version.
* debian/modules/headers-more-nginx-module/
  + Updated the Headers-more module with the 0.19 version.
* debian/modules/README.Modules-versions
  + Updated the current version of modules following the updates.

[ Michael Lustfield ]
* debian/conf/sites-available/default
  + Uncommented listen lines to make server block default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# vim:set ft= ts=4 sw=4 et fdm=marker:
 
2
use lib 'lib';
 
3
use Test::Nginx::Socket;
 
4
 
 
5
#worker_connections(1014);
 
6
#master_on();
 
7
#workers(2);
 
8
log_level('warn');
 
9
 
 
10
repeat_each(2);
 
11
#repeat_each(1);
 
12
 
 
13
plan tests => repeat_each() * (blocks() * 3);
 
14
 
 
15
#no_diff();
 
16
#no_long_string();
 
17
run_tests();
 
18
 
 
19
__DATA__
 
20
 
 
21
=== TEST 1: log socket errors off (tcp)
 
22
--- config
 
23
    location /t {
 
24
        lua_socket_connect_timeout 1ms;
 
25
        lua_socket_log_errors off;
 
26
        content_by_lua '
 
27
            local sock = ngx.socket.tcp()
 
28
            local ok, err = sock:connect("8.8.8.8", 80)
 
29
            ngx.say(err)
 
30
        ';
 
31
    }
 
32
--- request
 
33
GET /t
 
34
--- response_body
 
35
timeout
 
36
--- no_error_log
 
37
[error]
 
38
 
 
39
 
 
40
 
 
41
=== TEST 2: log socket errors on (tcp)
 
42
--- config
 
43
    location /t {
 
44
        lua_socket_connect_timeout 1ms;
 
45
        lua_socket_log_errors on;
 
46
        content_by_lua '
 
47
            local sock = ngx.socket.tcp()
 
48
            local ok, err = sock:connect("8.8.8.8", 80)
 
49
            ngx.say(err)
 
50
        ';
 
51
    }
 
52
--- request
 
53
GET /t
 
54
--- response_body
 
55
timeout
 
56
--- error_log
 
57
lua tcp socket connect timed out
 
58
 
 
59
 
 
60
 
 
61
=== TEST 3: log socket errors on (udp)
 
62
--- config
 
63
    location /t {
 
64
        lua_socket_log_errors on;
 
65
        lua_socket_read_timeout 1ms;
 
66
        content_by_lua '
 
67
            local sock = ngx.socket.udp()
 
68
            local ok, err = sock:setpeername("8.8.8.8", 80)
 
69
            ok, err = sock:receive()
 
70
            ngx.say(err)
 
71
        ';
 
72
    }
 
73
--- request
 
74
GET /t
 
75
--- response_body
 
76
timeout
 
77
--- error_log
 
78
lua udp socket read timed out
 
79
 
 
80
 
 
81
 
 
82
=== TEST 4: log socket errors off (udp)
 
83
--- config
 
84
    location /t {
 
85
        lua_socket_log_errors off;
 
86
        lua_socket_read_timeout 1ms;
 
87
        content_by_lua '
 
88
            local sock = ngx.socket.udp()
 
89
            local ok, err = sock:setpeername("8.8.8.8", 80)
 
90
            ok, err = sock:receive()
 
91
            ngx.say(err)
 
92
        ';
 
93
    }
 
94
--- request
 
95
GET /t
 
96
--- response_body
 
97
timeout
 
98
--- no_error_log
 
99
[error]
 
100