Mercurial > hg > nginx-tests
changeset 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 | b3b1403641d3 |
children | 83b7b3f8b6c5 |
files | ssl_password_file.t stream_ssl.t |
diffstat | 2 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ssl_password_file.t Mon Dec 05 22:18:22 2016 +0300 +++ b/ssl_password_file.t Tue Dec 06 14:06:44 2016 +0300 @@ -117,7 +117,8 @@ $t->write_file('password_many', "wrong$CRLF" . "localhost$CRLF"); $t->write_file('password_http', 'inherits'); -fork() || exec("echo localhost > $d/password_fifo"); +my $p = fork(); +exec("echo localhost > $d/password_fifo") if $p == 0; # do not mangle with try_run() # we need to distinguish ssl_password_file support vs its brokenness @@ -127,6 +128,7 @@ $t->run(); open STDERR, ">&", \*OLDERR; }; +kill 'INT', $p if $@; ###############################################################################
--- a/stream_ssl.t Mon Dec 05 22:18:22 2016 +0300 +++ b/stream_ssl.t Tue Dec 06 14:06:44 2016 +0300 @@ -118,10 +118,17 @@ $t->write_file('password_many', "wrong$CRLF" . "localhost$CRLF"); $t->write_file('password_http', 'inherits'); -fork() || exec("echo localhost > $d/password_fifo"); +my $p = fork(); +exec("echo localhost > $d/password_fifo") if $p == 0; $t->run_daemon(\&http_daemon); -$t->run(); + +eval { + open OLDERR, ">&", \*STDERR; close STDERR; + $t->run(); + open STDERR, ">&", \*OLDERR; +}; +kill 'INT', $p if $@; $t->waitforsocket('127.0.0.1:' . port(8081));