annotate stream_access_log_none.t @ 1370:23e407a72fe9

Tests: upstream keepalive with grpc pending frames. This is a specific test for the bug fixed in 1.15.4. Note that a similar test in grpc_ssl.t manifests the bug as a side effect and with certain event methods.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 03 Sep 2018 21:21:30 +0300
parents 5d75938b2622
children 97c8280de681
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 # Stream 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/stream stream_map stream_return/)
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 stream {
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
36 map $pid $a {
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
37 default '" \ "';
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
38 }
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
39 map $pid $b {
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
40 default "foo";
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
41 }
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
42
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
43 log_format none escape=none $a$b$upstream_addr;
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
44
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
45 server {
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
46 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
47 return ok;
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
48
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
49 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
50 }
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 EOF
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
54
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
55 $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
56
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
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
59 http_get('/');
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
60
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
61 $t->stop();
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
62
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
63 is($t->read_file('none.log'), '" \\ "foo' . "\n", 'none');
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
64
5d75938b2622 Tests: basic access_log tests with log_format 'escape=none'.
Sergey Kandaurov <pluknet@nginx.com>
parents:
diff changeset
65 ###############################################################################