Mercurial > hg > nginx-tests
annotate binary_upgrade.t @ 1477:8b122b35703b
Tests: fixed session reuse tests in ssl_certificate.t with TLSv1.3.
Previously, session data was retrieved too early, before server passed
application data, which usually means NewSessionTicket is not yet sent.
The fix is to ask server for application data, then retrieve a session.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 20 May 2019 16:00:40 +0300 |
parents | fe60c3959069 |
children | d7e83ce613c2 |
rev | line source |
---|---|
1254 | 1 #!/usr/bin/perl |
2 | |
3 # (C) Sergey Kandaurov | |
4 # (C) Nginx, Inc. | |
5 | |
6 # Tests for binary upgrade. | |
7 | |
8 ############################################################################### | |
9 | |
10 use warnings; | |
11 use strict; | |
12 | |
13 use Test::More; | |
14 | |
15 BEGIN { use FindBin; chdir($FindBin::Bin); } | |
16 | |
17 use lib 'lib'; | |
18 use Test::Nginx; | |
19 | |
20 ############################################################################### | |
21 | |
22 select STDERR; $| = 1; | |
23 select STDOUT; $| = 1; | |
24 | |
25 plan(skip_all => 'can leave orphaned process group') | |
26 unless $ENV{TEST_NGINX_UNSAFE}; | |
27 | |
28 my $t = Test::Nginx->new()->plan(2)->write_file_expand('nginx.conf', <<'EOF'); | |
29 | |
30 %%TEST_GLOBALS%% | |
31 | |
32 events { | |
33 } | |
34 | |
35 EOF | |
36 | |
37 $t->run(); | |
38 | |
39 ############################################################################### | |
40 | |
41 my $pid = $t->read_file('nginx.pid'); | |
42 ok($pid, 'master pid'); | |
43 | |
44 kill 'USR2', $pid; | |
45 | |
1332
fe60c3959069
Tests: adjusted binary_upgrade.t for instrumented binaries.
Sergey Kandaurov <pluknet@nginx.com>
parents:
1288
diff
changeset
|
46 for (1 .. 30) { |
1254 | 47 last if -e $t->testdir() . '/nginx.pid' |
48 && -e $t->testdir() . '/nginx.pid.oldbin'; | |
49 select undef, undef, undef, 0.2 | |
50 } | |
51 | |
52 isnt($t->read_file('nginx.pid'), $pid, 'master pid changed'); | |
53 | |
54 kill 'QUIT', $pid; | |
55 | |
56 ############################################################################### |