~spuul/nginx/trunk

« back to all changes in this revision

Viewing changes to debian/modules/nginx-lua/t/123-lua-path.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
# vim:set ft= ts=4 sw=4 et fdm=marker:
 
2
use lib 'lib';
 
3
use Test::Nginx::Socket::Lua;
 
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 + 1);
 
14
 
 
15
$ENV{LUA_PATH} = "/foo/bar/baz";
 
16
$ENV{LUA_CPATH} = "/baz/bar/foo";
 
17
#no_diff();
 
18
#no_long_string();
 
19
master_on();
 
20
no_shuffle();
 
21
check_accum_error_log();
 
22
run_tests();
 
23
 
 
24
__DATA__
 
25
 
 
26
=== TEST 1: LUA_PATH & LUA_CPATH env (code cache on)
 
27
--- config
 
28
    location /lua {
 
29
        content_by_lua '
 
30
            ngx.say(package.path)
 
31
            ngx.say(package.cpath)
 
32
        ';
 
33
    }
 
34
--- request
 
35
GET /lua
 
36
--- response_body
 
37
/foo/bar/baz
 
38
/baz/bar/foo
 
39
 
 
40
--- no_error_log
 
41
[error]
 
42
 
 
43
 
 
44
 
 
45
=== TEST 2: LUA_PATH & LUA_CPATH env (code cache off)
 
46
--- config
 
47
    lua_code_cache off;
 
48
    location /lua {
 
49
        content_by_lua '
 
50
            ngx.say(package.path)
 
51
            ngx.say(package.cpath)
 
52
        ';
 
53
    }
 
54
--- request
 
55
GET /lua
 
56
--- response_body
 
57
/foo/bar/baz
 
58
/baz/bar/foo
 
59
 
 
60
--- no_error_log
 
61
[error]
 
62
--- error_log eval
 
63
qr/\[alert\] .*? lua_code_cache is off/
 
64