Mercurial > hg > nginx-tests
comparison ssl_password_file.t @ 1087:534d209f6ae4
Tests: fixed ssl_password_file test hang with missing FIFO reader.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 06 Dec 2016 14:06:44 +0300 |
parents | 90a0d85436c1 |
children | 8ef51dbb5d69 |
comparison
equal
deleted
inserted
replaced
1086:b3b1403641d3 | 1087:534d209f6ae4 |
---|---|
115 | 115 |
116 $t->write_file('password', 'localhost'); | 116 $t->write_file('password', 'localhost'); |
117 $t->write_file('password_many', "wrong$CRLF" . "localhost$CRLF"); | 117 $t->write_file('password_many', "wrong$CRLF" . "localhost$CRLF"); |
118 $t->write_file('password_http', 'inherits'); | 118 $t->write_file('password_http', 'inherits'); |
119 | 119 |
120 fork() || exec("echo localhost > $d/password_fifo"); | 120 my $p = fork(); |
121 exec("echo localhost > $d/password_fifo") if $p == 0; | |
121 | 122 |
122 # do not mangle with try_run() | 123 # do not mangle with try_run() |
123 # we need to distinguish ssl_password_file support vs its brokenness | 124 # we need to distinguish ssl_password_file support vs its brokenness |
124 | 125 |
125 eval { | 126 eval { |
126 open OLDERR, ">&", \*STDERR; close STDERR; | 127 open OLDERR, ">&", \*STDERR; close STDERR; |
127 $t->run(); | 128 $t->run(); |
128 open STDERR, ">&", \*OLDERR; | 129 open STDERR, ">&", \*OLDERR; |
129 }; | 130 }; |
131 kill 'INT', $p if $@; | |
130 | 132 |
131 ############################################################################### | 133 ############################################################################### |
132 | 134 |
133 is($@, '', 'ssl_password_file works'); | 135 is($@, '', 'ssl_password_file works'); |
134 | 136 |