Mercurial > hg > nginx-tests
annotate binary_upgrade.t @ 1542:451e787aad76
Tests: reworked libgd version detection.
The "libgd-config" binary is deprecated in recent versions and may not exist
or have unexpected output. More, it may not present within older versions,
as well, if installed separately, which previously broke test assumptions.
The fix is change the fallback to skip tests. In addition, recent Perl GD
module (2.57) started to export libgd version, which is now also consulted.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 13 Jan 2020 18:15:35 +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 ############################################################################### |