Mercurial > hg > nginx-tests
annotate access_log_none.t @ 1349:99a83f7e7755
Tests: adjusted read timeout in stream_udp_limit_conn.t.
Now that the test is expected to be positive on mainline, increase the timeout.
Note that it should still be below proxy_timeout to not break a subsequent test
on stable branch.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 14 Jun 2018 15:00:57 +0300 |
parents | 5d75938b2622 |
children | 97c8280de681 |
rev | line source |
---|---|
1296
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
1 #!/usr/bin/perl |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
2 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
3 # (C) Sergey Kandaurov |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
4 # (C) Nginx, Inc. |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
5 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
6 # Tests for access_log with escape parameter. |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
7 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
8 ############################################################################### |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
9 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
10 use warnings; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
11 use strict; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
12 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
13 use Test::More; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
14 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
15 BEGIN { use FindBin; chdir($FindBin::Bin); } |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
16 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
17 use lib 'lib'; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
18 use Test::Nginx; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
19 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
20 ############################################################################### |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
21 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
22 select STDERR; $| = 1; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
23 select STDOUT; $| = 1; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
24 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
25 my $t = Test::Nginx->new()->has(qw/http/) |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
26 ->write_file_expand('nginx.conf', <<'EOF'); |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
27 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
28 %%TEST_GLOBALS%% |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
29 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
30 daemon off; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
31 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
32 events { |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
33 } |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
34 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
35 http { |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
36 %%TEST_GLOBALS_HTTP%% |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
37 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
38 log_format none escape=none $arg_a$arg_b$arg_c; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
39 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
40 server { |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
41 listen 127.0.0.1:8080; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
42 server_name localhost; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
43 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
44 access_log %%TESTDIR%%/none.log none; |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
45 } |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
46 } |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
47 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
48 EOF |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
49 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
50 $t->try_run('no escape=none')->plan(1); |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
51 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
52 ############################################################################### |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
53 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
54 http_get('/?a="1 \\ ' . pack("n", 0x1b1c) . ' "&c=2'); |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
55 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
56 $t->stop(); |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
57 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
58 is($t->read_file('none.log'), '"1 \\ ' . pack("n", 0x1b1c) . " \"2\n", 'none'); |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
59 |
5d75938b2622
Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff
changeset
|
60 ############################################################################### |