~spuul/nginx/trunk

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/t/075-logby.t

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2014-02-15 03:05:42 UTC
  • mfrom: (4.3.10 sid)
  • Revision ID: package-import@ubuntu.com-20140215030542-71ubtowl24vf7nfn
Tags: 1.4.5-1ubuntu1
* Resynchronise with Debian (LP: #1280511).  Remaining changes:
  - debian/patches/ubuntu-branding.patch:
    + Add Ubuntu branding to server_tokens.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# vim:set ft= ts=4 sw=4 et fdm=marker:
2
2
 
3
3
use lib 'lib';
4
 
use Test::Nginx::Socket;
 
4
use Test::Nginx::Socket::Lua;
5
5
 
6
6
#worker_connections(1014);
7
7
#master_on();
10
10
 
11
11
repeat_each(2);
12
12
 
13
 
plan tests => repeat_each() * (blocks() * 3 + 8);
 
13
plan tests => repeat_each() * (blocks() * 3 + 9);
14
14
 
15
15
#no_diff();
16
16
#no_long_string();
518
518
in function 'bar'
519
519
in function 'foo'
520
520
 
 
521
 
 
522
 
 
523
=== TEST 29: Lua file does not exist
 
524
--- config
 
525
    location /lua {
 
526
        echo ok;
 
527
        log_by_lua_file html/test2.lua;
 
528
    }
 
529
--- user_files
 
530
>>> test.lua
 
531
v = ngx.var["request_uri"]
 
532
ngx.print("request_uri: ", v, "\n")
 
533
--- request
 
534
GET /lua?a=1&b=2
 
535
--- response_body
 
536
ok
 
537
--- error_log eval
 
538
qr/failed to load external Lua file: cannot open .*? No such file or directory/
 
539
 
 
540
 
 
541
 
 
542
=== TEST 30: log_by_lua runs before access logging (github issue #254)
 
543
--- config
 
544
    location /lua {
 
545
        echo ok;
 
546
        access_log logs/foo.log;
 
547
        log_by_lua 'print("hello")';
 
548
    }
 
549
--- request
 
550
GET /lua
 
551
--- stap
 
552
F(ngx_http_log_handler) {
 
553
    println("log handler")
 
554
}
 
555
F(ngx_http_lua_log_handler) {
 
556
    println("lua log handler")
 
557
}
 
558
--- stap_out
 
559
lua log handler
 
560
log handler
 
561
 
 
562
--- response_body
 
563
ok
 
564
--- no_error_log
 
565
[error]
 
566