2012-05-30 11:05:00 +04:00
|
|
|
# vim:set ft= ts=4 sw=4 et fdm=marker:
|
|
|
|
|
2012-07-30 08:12:43 +04:00
|
|
|
our $SkipReason;
|
|
|
|
|
2012-05-30 11:05:00 +04:00
|
|
|
BEGIN {
|
2012-07-30 08:12:43 +04:00
|
|
|
if ($ENV{TEST_NGINX_CHECK_LEAK}) {
|
|
|
|
$SkipReason = "unavailable for the hup tests";
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$ENV{TEST_NGINX_USE_HUP} = 1;
|
2013-04-02 22:54:36 +04:00
|
|
|
undef $ENV{TEST_NGINX_USE_STAP};
|
2012-07-30 08:12:43 +04:00
|
|
|
}
|
2012-05-30 11:05:00 +04:00
|
|
|
}
|
|
|
|
|
2013-12-06 02:46:51 +04:00
|
|
|
use Test::Nginx::Socket::Lua $SkipReason ? (skip_all => $SkipReason) : ();
|
2012-05-30 11:05:00 +04:00
|
|
|
|
|
|
|
#worker_connections(1014);
|
|
|
|
#master_on();
|
|
|
|
#workers(2);
|
2012-05-30 11:17:47 +04:00
|
|
|
#log_level('debug');
|
2012-05-30 11:05:00 +04:00
|
|
|
|
|
|
|
repeat_each(2);
|
|
|
|
|
|
|
|
plan tests => repeat_each() * (3 * blocks());
|
|
|
|
|
|
|
|
#no_diff();
|
|
|
|
#no_long_string();
|
|
|
|
no_shuffle();
|
|
|
|
|
|
|
|
run_tests();
|
|
|
|
|
|
|
|
__DATA__
|
|
|
|
|
|
|
|
=== TEST 1: nginx variable hup bug (step 1)
|
|
|
|
http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002223.html
|
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
set $vv $http_host;
|
|
|
|
set_by_lua $i 'return ngx.var.http_host';
|
|
|
|
echo $i;
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
localhost
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
=== TEST 2: nginx variable hup bug (step 2)
|
|
|
|
http://mailman.nginx.org/pipermail/nginx-devel/2012-May/002223.html
|
|
|
|
--- config
|
|
|
|
location /t {
|
|
|
|
#set $vv $http_host;
|
|
|
|
set_by_lua $i 'return ngx.var.http_host';
|
|
|
|
echo $i;
|
|
|
|
}
|
|
|
|
--- request
|
|
|
|
GET /t
|
|
|
|
--- response_body
|
|
|
|
localhost
|
|
|
|
--- no_error_log
|
|
|
|
[error]
|
|
|
|
|