comparison binary_upgrade.t @ 1288:eee96c138c5b

Tests: renamed upgrade.t for better sorting.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 20 Feb 2018 16:22:58 +0300
parents upgrade.t@6fff42643fd7
children fe60c3959069
comparison
equal deleted inserted replaced
1287:b575be896b99 1288:eee96c138c5b
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
46 for (1 .. 10) {
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 ###############################################################################