Remove unused certificate generation and test files for mTLS

This commit is contained in:
Théophile Diot 2025-01-16 10:23:19 +01:00
parent 116a8b5b26
commit e03b67d044
No known key found for this signature in database
GPG key ID: FA995104A0BA376A
157 changed files with 0 additions and 44557 deletions

View file

@ -1,81 +0,0 @@
package t::TestCore;
use Test::Nginx::Socket::Lua -Base;
use Cwd qw(cwd realpath abs_path);
use File::Basename;
use Test::Nginx::Util 'is_tcp_port_used';
$ENV{TEST_NGINX_HOTLOOP} ||= 10;
$ENV{TEST_NGINX_MEMCACHED_PORT} ||= 11211;
$ENV{TEST_NGINX_CERT_DIR} ||= dirname(realpath(abs_path(__FILE__)));
sub get_unused_port ($);
$ENV{TEST_NGINX_SERVER_SSL_PORT} ||= get_unused_port 23456;
our $pwd = cwd();
our $lua_package_path = './lib/?.lua;./t/lib/?.lua;../lua-resty-lrucache/lib/?.lua;;';
our $init_by_lua_block = <<_EOC_;
local verbose = false
if verbose then
local dump = require "jit.dump"
dump.on("b", "$Test::Nginx::Util::ErrLogFile")
else
local v = require "jit.v"
v.on("$Test::Nginx::Util::ErrLogFile")
end
require "resty.core"
jit.opt.start("hotloop=$ENV{TEST_NGINX_HOTLOOP}")
-- jit.off()
_EOC_
our $HttpConfig = <<_EOC_;
lua_package_path '$lua_package_path';
init_by_lua_block {
$t::TestCore::init_by_lua_block
}
_EOC_
our @EXPORT = qw(
$pwd
$lua_package_path
$init_by_lua_block
$HttpConfig
get_unused_port
);
add_block_preprocessor(sub {
my $block = shift;
if (!defined $block->http_config) {
$block->set_value("http_config", $HttpConfig);
}
if ($Test::Nginx::Util::UseValgrind) {
my $timeout = $block->timeout || 3;
$timeout *= 5;
$block->set_value("timeout", $timeout);
}
});
sub get_unused_port ($) {
my $port = shift;
my $i = 1000;
srand($$); # reset the random seed
while ($i-- > 0) {
my $rand_port = $port + int(rand(65535 - $port));
if (!is_tcp_port_used $rand_port) {
#warn "found unused port $rand_port, pid $$\n";
return $rand_port;
}
}
die "no unused port available";
}
1;

View file

@ -1,70 +0,0 @@
package t::TestCore::Stream;
use Test::Nginx::Socket::Lua::Stream -Base;
use Cwd qw(cwd);
use Test::Nginx::Util 'is_tcp_port_used';
$ENV{TEST_NGINX_HOTLOOP} ||= 10;
sub get_unused_port ($);
our $pwd = cwd();
our $lua_package_path = './lib/?.lua;../lua-resty-lrucache/lib/?.lua;;';
our $init_by_lua_block = <<_EOC_;
local verbose = false
if verbose then
local dump = require "jit.dump"
dump.on("b", "$Test::Nginx::Util::ErrLogFile")
else
local v = require "jit.v"
v.on("$Test::Nginx::Util::ErrLogFile")
end
require "resty.core"
jit.opt.start("hotloop=$ENV{TEST_NGINX_HOTLOOP}")
-- jit.off()
_EOC_
our $StreamConfig = <<_EOC_;
lua_package_path '$lua_package_path';
init_by_lua_block {
$t::TestCore::Stream::init_by_lua_block
}
_EOC_
our @EXPORT = qw(
$pwd
$lua_package_path
$init_by_lua_block
$StreamConfig
get_unused_port
);
add_block_preprocessor(sub {
my $block = shift;
if (!defined $block->stream_config) {
$block->set_value("stream_config", $StreamConfig);
}
});
sub get_unused_port ($) {
my $port = shift;
my $i = 1000;
srand($$); # reset the random seed
while ($i-- > 0) {
my $rand_port = $port + int(rand(65535 - $port));
if (!is_tcp_port_used $rand_port) {
#warn "found unused port $rand_port, pid $$\n";
return $rand_port;
}
}
die "no unused port available";
}
1;

View file

@ -1,448 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
my $NginxBinary = $ENV{TEST_NGINX_BINARY} || 'nginx';
my $NginxV = eval { `$NginxBinary -V 2>&1` };
if ($NginxV !~ m/built with OpenSSL/) {
plan(skip_all => "OpenSSL required");
} elsif ($NginxV !~ m/--with-debug/) {
plan(skip_all => "--with-debug required");
} else {
plan tests => repeat_each() * (blocks() * 4);
}
our $UpstreamSrvConfig = <<_EOC_;
server {
listen 127.0.0.1:$ENV{TEST_NGINX_SERVER_SSL_PORT} ssl;
listen 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT} ssl;
ssl_certificate $ENV{TEST_NGINX_CERT_DIR}/cert/test.crt;
ssl_certificate_key $ENV{TEST_NGINX_CERT_DIR}/cert/test.key;
ssl_session_tickets off;
ssl_verify_client optional_no_ca;
keepalive_requests 1000;
location = /echo_client_addr {
content_by_lua_block {
ngx.say(ngx.var.remote_addr)
}
}
location = /echo_client_addr_port {
content_by_lua_block {
ngx.say(ngx.var.remote_addr, ":", ngx.var.remote_port)
}
}
location / {
return 200;
}
}
_EOC_
our $ProxyLocConfig = <<_EOC_;
location ~ ^/proxy/(?<upstream_uri>.*) {
proxy_ssl_verify off;
proxy_ssl_server_name on;
proxy_ssl_name '\$arg_sni';
proxy_http_version 1.1;
proxy_set_header Connection '';
proxy_pass https://test_upstream/\$upstream_uri;
}
_EOC_
add_block_preprocessor(sub {
my $block = shift;
if (defined $block->http_upstream) {
$block->set_value("http_config",
$block->http_upstream . "\n" . $UpstreamSrvConfig);
}
if (defined $block->config) {
$block->set_value("config",
$block->config . "\n" . $ProxyLocConfig);
} else {
$block->set_value("config", $ProxyLocConfig);
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
if (!defined $block->grep_error_log) {
$block->set_value("grep_error_log", qr/lua balancer: keepalive (?!closing).*/);
}
if (!defined $block->no_error_log) {
$block->set_value("no_error_log", "[error]");
}
});
log_level('debug');
no_long_string();
run_tests();
__DATA__
=== TEST 1: get keepalive from pool
--- http_upstream
upstream test_upstream {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local ip = ngx.var.arg_ip or "127.0.0.1"
local port = ngx.var.arg_port or $TEST_NGINX_SERVER_SSL_PORT
local ok, err = b.set_current_peer(ip, port, "test.com")
if not ok then
ngx.log(ngx.ERR, "failed to set current peer: ", err)
return
end
local ok, err = b.enable_keepalive()
if not ok then
ngx.log(ngx.ERR, "failed to set keepalive: ", err)
return
end
ok, err = b.bind_to_local_addr("127.0.0.11")
if not ok then
ngx.log(ngx.ERR, "failed to set local addr: ", err)
return
end
}
}
--- config eval
"
location = /t {
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2';
}
"
--- response_body
127.0.0.11
127.0.0.11
--- grep_error_log_out eval
qr/^lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive reusing connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
$/
=== TEST 2: get keepalive from pool twice
--- http_upstream
upstream test_upstream {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local ip = ngx.var.arg_ip or "127.0.0.1"
local port = ngx.var.arg_port or $TEST_NGINX_SERVER_SSL_PORT
local ok, err = b.set_current_peer(ip, port, "test.com")
if not ok then
ngx.log(ngx.ERR, "failed to set current peer: ", err)
return
end
local ok, err = b.enable_keepalive()
if not ok then
ngx.log(ngx.ERR, "failed to set keepalive: ", err)
return
end
ok, err = b.bind_to_local_addr("127.0.0.11")
if not ok then
ngx.log(ngx.ERR, "failed to set local addr: ", err)
return
end
}
}
--- config eval
"
location = /t {
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2';
}
"
--- response_body
127.0.0.11
127.0.0.11
127.0.0.11
--- grep_error_log_out eval
qr/^lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive reusing connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive reusing connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
$/
=== TEST 3: can not get idle connection from the pool
--- http_upstream
upstream test_upstream {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local ip = ngx.var.arg_ip or "127.0.0.1"
local port = ngx.var.arg_port or $TEST_NGINX_SERVER_SSL_PORT
local ok, err = b.set_current_peer(ip, port, "test.com")
if not ok then
ngx.log(ngx.ERR, "failed to set current peer: ", err)
return
end
local ok, err = b.enable_keepalive()
if not ok then
ngx.log(ngx.ERR, "failed to set keepalive: ", err)
return
end
local src_ip = ngx.var.arg_src_ip or "127.0.0.1"
ok, err = b.bind_to_local_addr(src_ip)
if not ok then
ngx.log(ngx.ERR, "failed to set local addr: ", err)
return
end
}
}
--- config eval
"
location = /t {
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2&src_ip=127.0.0.10';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2&src_ip=127.0.0.11';
}
"
--- response_body
127.0.0.10
127.0.0.11
--- grep_error_log_out eval
qr/^lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
$/
=== TEST 4: et idle connections from the pool for different src ip
--- http_upstream
upstream test_upstream {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local ip = ngx.var.arg_ip or "127.0.0.1"
local port = ngx.var.arg_port or $TEST_NGINX_SERVER_SSL_PORT
local ok, err = b.set_current_peer(ip, port, "test.com")
if not ok then
ngx.log(ngx.ERR, "failed to set current peer: ", err)
return
end
local ok, err = b.enable_keepalive()
if not ok then
ngx.log(ngx.ERR, "failed to set keepalive: ", err)
return
end
local src_ip = ngx.var.arg_src_ip or "127.0.0.1"
ok, err = b.bind_to_local_addr(src_ip)
if not ok then
ngx.log(ngx.ERR, "failed to set local addr: ", err)
return
end
}
}
--- config eval
"
location = /t {
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2&src_ip=127.0.0.10';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2&src_ip=127.0.0.11';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2&src_ip=127.0.0.11';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2&src_ip=127.0.0.10';
}
"
--- response_body
127.0.0.10
127.0.0.11
127.0.0.11
127.0.0.10
--- grep_error_log_out eval
qr/^lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive reusing connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive reusing connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
$/
=== TEST 5: should not use idle connection with different dest ip
--- http_upstream
upstream test_upstream {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local ip = ngx.var.arg_ip or "127.0.0.1"
local port = ngx.var.arg_port or $TEST_NGINX_SERVER_SSL_PORT
local ok, err = b.set_current_peer(ip, port, "test.com")
if not ok then
ngx.log(ngx.ERR, "failed to set current peer: ", err)
return
end
local ok, err = b.enable_keepalive()
if not ok then
ngx.log(ngx.ERR, "failed to set keepalive: ", err)
return
end
ok, err = b.bind_to_local_addr("127.0.0.11")
if not ok then
ngx.log(ngx.ERR, "failed to set local addr: ", err)
return
end
}
}
--- config eval
"
location = /t {
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.1';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2';
}
"
--- response_body
127.0.0.11
127.0.0.11
--- grep_error_log_out eval
qr/^lua balancer: keepalive no free connection, host: 127.0.0.1:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.1:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
$/
=== TEST 6: empty host
--- http_upstream
upstream test_upstream {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local ip = ngx.var.arg_ip or "127.0.0.1"
local port = ngx.var.arg_port or $TEST_NGINX_SERVER_SSL_PORT
local ok, err = b.set_current_peer(ip, port, "test.com")
if not ok then
ngx.log(ngx.ERR, "failed to set current peer: ", err)
return
end
local ok, err = b.enable_keepalive()
if not ok then
ngx.log(ngx.ERR, "failed to set keepalive: ", err)
return
end
ok, err = b.bind_to_local_addr("127.0.0.11")
if not ok then
ngx.log(ngx.ERR, "failed to set local addr: ", err)
return
end
}
}
--- config eval
"
location = /t {
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2';
echo_subrequest GET '/proxy/echo_client_addr' -q 'ip=127.0.0.2';
}
"
--- response_body
127.0.0.11
127.0.0.11
--- grep_error_log_out eval
qr/^lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive reusing connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
$/
=== TEST 7: bind addr with port
--- http_upstream
upstream test_upstream {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local ip = ngx.var.arg_ip or "127.0.0.1"
local port = ngx.var.arg_port or $TEST_NGINX_SERVER_SSL_PORT
local ok, err = b.set_current_peer(ip, port, "test.com")
if not ok then
ngx.log(ngx.ERR, "failed to set current peer: ", err)
return
end
local ok, err = b.enable_keepalive()
if not ok then
ngx.log(ngx.ERR, "failed to set keepalive: ", err)
return
end
ok, err = b.bind_to_local_addr("127.0.0.11:64321")
if not ok then
ngx.log(ngx.ERR, "failed to set local addr: ", err)
return
end
}
}
--- config eval
"
location = /t {
echo_subrequest GET '/proxy/echo_client_addr_port' -q 'ip=127.0.0.2';
echo_subrequest GET '/proxy/echo_client_addr_port' -q 'ip=127.0.0.2';
}
"
--- response_body
127.0.0.11:64321
127.0.0.11:64321
--- grep_error_log_out eval
qr/^lua balancer: keepalive no free connection, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive reusing connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
lua balancer: keepalive saving connection [0-9A-F]+, host: 127.0.0.2:$ENV{TEST_NGINX_SERVER_SSL_PORT}, name: test.com
$/

File diff suppressed because it is too large Load diff

View file

@ -1,392 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
BEGIN {
if (!defined $ENV{LD_PRELOAD}) {
$ENV{LD_PRELOAD} = '';
}
if ($ENV{LD_PRELOAD} !~ /\bmockeagain\.so\b/) {
$ENV{LD_PRELOAD} = "mockeagain.so $ENV{LD_PRELOAD}";
}
if (defined $ENV{MOCKEAGAIN} && $ENV{MOCKEAGAIN} eq 'r') {
$ENV{MOCKEAGAIN} = 'rw';
} else {
$ENV{MOCKEAGAIN} = 'w';
}
$ENV{TEST_NGINX_EVENT_TYPE} = 'poll';
$ENV{TEST_NGINX_POSTPONE_OUTPUT} = 1;
}
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_on();
#workers(2);
#log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 4);
$ENV{TEST_NGINX_LUA_PACKAGE_PATH} = $t::TestCore::lua_package_path;
#worker_connections(1024);
#no_diff();
no_long_string();
run_tests();
__DATA__
=== TEST 1: set_timeouts
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
assert(b.set_timeouts(1.234, 5.678, 7.689))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body
fake origin
--- grep_error_log eval: qr/event timer add: \d+: (?:1234|5678|7689):/
--- grep_error_log_out eval
qr/\Aevent timer add: \d+: 1234:
event timer add: \d+: 5678:
event timer add: \d+: 7689:
\z/
--- no_error_log
[warn]
=== TEST 2: set_timeouts (nil connect timeout)
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_connect_timeout 1234ms;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
assert(b.set_timeouts(nil, 5.678, 7.689))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body
fake origin
--- grep_error_log eval: qr/event timer add: \d+: (?:1234|5678|7689):/
--- grep_error_log_out eval
qr/\Aevent timer add: \d+: 1234:
event timer add: \d+: 5678:
event timer add: \d+: 7689:
\z/
--- no_error_log
[warn]
=== TEST 3: set_timeouts (nil send timeout)
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_send_timeout 5678ms;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
assert(b.set_timeouts(1.234, nil, 7.689))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body
fake origin
--- grep_error_log eval: qr/event timer add: \d+: (?:1234|5678|7689):/
--- grep_error_log_out eval
qr/\Aevent timer add: \d+: 1234:
event timer add: \d+: 5678:
event timer add: \d+: 7689:
\z/
--- no_error_log
[warn]
=== TEST 4: set_timeouts (nil read timeout)
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_read_timeout 7689ms;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
assert(b.set_timeouts(1.234, 5.678, nil))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body
fake origin
--- grep_error_log eval: qr/event timer add: \d+: (?:1234|5678|7689):/
--- grep_error_log_out eval
qr/\Aevent timer add: \d+: 1234:
event timer add: \d+: 5678:
event timer add: \d+: 7689:
\z/
--- no_error_log
[warn]
=== TEST 5: set connect timeout to 0
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_timeouts(0, 1.234, 5.678))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad connect timeout/
--- no_error_log
[warn]
=== TEST 6: set connect timeout to -1
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_timeouts(-1, 1.234, 5.678))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad connect timeout/
--- no_error_log
[warn]
=== TEST 7: set send timeout to 0
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_timeouts(1.234, 0, 5.678))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad send timeout/
--- no_error_log
[warn]
=== TEST 8: set send timeout to -1
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_timeouts(1.234, -1, 5.678))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad send timeout/
--- no_error_log
[warn]
=== TEST 9: set read timeout to -1
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_timeouts(1.234, 5.678, -1))
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
echo "fake origin";
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? balancer_by_lua\(nginx.conf:\d+\):4: bad read timeout/
--- no_error_log
[warn]
=== TEST 10: set_timeouts called in a wrong context
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
--- config
location = /t {
content_by_lua_block {
local balancer = require "ngx.balancer"
local ok, err = balancer.set_timeouts(1, 1, 1)
if not ok then
ngx.say("failed to call: ", err)
return
end
ngx.say("unexpected success!")
}
}
--- request
GET /t
--- response_body
failed to call: no upstream found
--- no_error_log
[error]
[alert]
=== TEST 11: set_timeouts called with a non-numerical parameter
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local balancer = require "ngx.balancer"
local ok, err = balancer.set_timeouts("1.234", 1, 1)
if not ok then
ngx.log(ngx.ERR, "failed to call: ", err)
end
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? bad connect timeout/
--- no_error_log
[alert]

View file

@ -1,986 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_on();
#workers(2);
#log_level('warn');
repeat_each(2);
my $TestPlan = $ENV{TEST_NGINX_CHECK_LEAK} ?
repeat_each() * (blocks() * 4 + 8) : repeat_each() * (blocks() * 4 + 6);
plan tests => $TestPlan;
$ENV{TEST_NGINX_LUA_PACKAGE_PATH} = "$t::TestCore::lua_package_path";
#worker_connections(1024);
#no_diff();
no_long_string();
run_tests();
__DATA__
=== TEST 1: set current peer (separate addr and port)
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_current_peer("127.0.0.3", 12345))
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- response_body_like: 502 Bad Gateway
--- error_code: 502
--- error_log eval
[
'[lua] balancer_by_lua(nginx.conf:29):2: hello from balancer by lua! while connecting to upstream,',
qr{connect\(\) failed .*?, upstream: "http://127\.0\.0\.3:12345/t"},
]
--- no_error_log
[warn]
=== TEST 2: set current peer & next upstream (3 tries)
--- skip_nginx: 4: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
proxy_next_upstream_tries 10;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
if not ngx.ctx.tries then
ngx.ctx.tries = 0
end
if ngx.ctx.tries < 2 then
local ok, err = b.set_more_tries(1)
if not ok then
return error("failed to set more tries: ", err)
elseif err then
ngx.log(ngx.WARN, "set more tries: ", err)
end
end
ngx.ctx.tries = ngx.ctx.tries + 1
assert(b.set_current_peer("127.0.0.3", 12345))
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- response_body_like: 502 Bad Gateway
--- error_code: 502
--- grep_error_log eval: qr{connect\(\) failed .*, upstream: "http://.*?"}
--- grep_error_log_out eval
qr#^(?:connect\(\) failed .*?, upstream: "http://127.0.0.3:12345/t"\n){3}$#
--- no_error_log
[warn]
=== TEST 3: set current peer & next upstream (no retries)
--- skip_nginx: 4: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
if not ngx.ctx.tries then
ngx.ctx.tries = 0
end
ngx.ctx.tries = ngx.ctx.tries + 1
assert(b.set_current_peer("127.0.0.3", 12345))
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- response_body_like: 502 Bad Gateway
--- error_code: 502
--- grep_error_log eval: qr{connect\(\) failed .*, upstream: "http://.*?"}
--- grep_error_log_out eval
qr#^(?:connect\(\) failed .*?, upstream: "http://127.0.0.3:12345/t"\n){1}$#
--- no_error_log
[warn]
=== TEST 4: set current peer & next upstream (3 tries exceeding the limit)
--- skip_nginx: 4: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
proxy_next_upstream_tries 2;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
if not ngx.ctx.tries then
ngx.ctx.tries = 0
end
if ngx.ctx.tries < 2 then
local ok, err = b.set_more_tries(1)
if not ok then
return error("failed to set more tries: ", err)
elseif err then
ngx.log(ngx.WARN, "set more tries: ", err)
end
end
ngx.ctx.tries = ngx.ctx.tries + 1
assert(b.set_current_peer("127.0.0.3", 12345))
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- response_body_like: 502 Bad Gateway
--- error_code: 502
--- grep_error_log eval: qr{connect\(\) failed .*, upstream: "http://.*?"}
--- grep_error_log_out eval
qr#^(?:connect\(\) failed .*?, upstream: "http://127.0.0.3:12345/t"\n){2}$#
--- error_log
set more tries: reduced tries due to limit
=== TEST 5: get last peer failure status (404)
--- skip_nginx: 4: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
proxy_next_upstream_tries 10;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local state, status = b.get_last_failure()
print("last peer failure: ", state, " ", status)
if not ngx.ctx.tries then
ngx.ctx.tries = 0
end
if ngx.ctx.tries < 2 then
local ok, err = b.set_more_tries(1)
if not ok then
return error("failed to set more tries: ", err)
elseif err then
ngx.log(ngx.WARN, "set more tries: ", err)
end
end
ngx.ctx.tries = ngx.ctx.tries + 1
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
return 404;
}
--- request
GET /t
--- response_body_like: 404 Not Found
--- error_code: 404
--- grep_error_log eval: qr{last peer failure: \S+ \S+}
--- grep_error_log_out
last peer failure: nil nil
last peer failure: next 404
last peer failure: next 404
--- no_error_log
[warn]
=== TEST 6: get last peer failure status (500)
--- skip_nginx: 4: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
proxy_next_upstream_tries 10;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local state, status = b.get_last_failure()
print("last peer failure: ", state, " ", status)
if not ngx.ctx.tries then
ngx.ctx.tries = 0
end
if ngx.ctx.tries < 2 then
local ok, err = b.set_more_tries(1)
if not ok then
return error("failed to set more tries: ", err)
elseif err then
ngx.log(ngx.WARN, "set more tries: ", err)
end
end
ngx.ctx.tries = ngx.ctx.tries + 1
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
return 500;
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- grep_error_log eval: qr{last peer failure: \S+ \S+}
--- grep_error_log_out
last peer failure: nil nil
last peer failure: failed 500
last peer failure: failed 500
--- no_error_log
[warn]
=== TEST 7: get last peer failure status (503)
--- skip_nginx: 4: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
proxy_next_upstream_tries 10;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local state, status = b.get_last_failure()
print("last peer failure: ", state, " ", status)
if not ngx.ctx.tries then
ngx.ctx.tries = 0
end
if ngx.ctx.tries < 2 then
local ok, err = b.set_more_tries(1)
if not ok then
return error("failed to set more tries: ", err)
elseif err then
ngx.log(ngx.WARN, "set more tries: ", err)
end
end
ngx.ctx.tries = ngx.ctx.tries + 1
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
return 503;
}
--- request
GET /t
--- response_body_like: 503 Service Temporarily Unavailable
--- error_code: 503
--- grep_error_log eval: qr{last peer failure: \S+ \S+}
--- grep_error_log_out eval
qr{\Alast peer failure: nil nil
last peer failure: failed 50[23]
last peer failure: failed 50[23]
\z}
--- no_error_log
[warn]
=== TEST 8: get last peer failure status (connect failed)
--- skip_nginx: 4: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504 http_403 http_404;
proxy_next_upstream_tries 10;
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
local state, status = b.get_last_failure()
print("last peer failure: ", state, " ", status)
if not ngx.ctx.tries then
ngx.ctx.tries = 0
end
if ngx.ctx.tries < 2 then
local ok, err = b.set_more_tries(1)
if not ok then
return error("failed to set more tries: ", err)
elseif err then
ngx.log(ngx.WARN, "set more tries: ", err)
end
end
ngx.ctx.tries = ngx.ctx.tries + 1
assert(b.set_current_peer("127.0.0.3", 12345))
}
}
--- config
location = /t {
proxy_pass http://backend/back;
}
location = /back {
return 404;
}
--- request
GET /t
--- response_body_like: 502 Bad Gateway
--- error_code: 502
--- grep_error_log eval: qr{last peer failure: \S+ \S+}
--- grep_error_log_out
last peer failure: nil nil
last peer failure: failed 502
last peer failure: failed 502
--- no_error_log
[warn]
=== TEST 9: set current peer (port embedded in addr)
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_current_peer("127.0.0.3:12345"))
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- response_body_like: 502 Bad Gateway
--- error_code: 502
--- error_log eval
[
'[lua] balancer_by_lua(nginx.conf:29):2: hello from balancer by lua! while connecting to upstream,',
qr{connect\(\) failed .*?, upstream: "http://127\.0\.0\.3:12345/t"},
]
--- no_error_log
[warn]
=== TEST 10: keepalive before balancer
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
keepalive 10;
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_current_peer("127.0.0.3:12345"))
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- response_body_like: 502 Bad Gateway
--- grep_error_log eval: qr/load balancing method redefined in/
--- grep_error_log_out eval
[
"load balancing method redefined in
",
"",
]
--- error_code: 502
--- error_log eval
[
'[lua] balancer_by_lua(nginx.conf:30):2: hello from balancer by lua! while connecting to upstream,',
qr{connect\(\) failed .*?, upstream: "http://127\.0\.0\.3:12345/t"},
]
--- no_error_log
[crit]
=== TEST 11: keepalive after balancer
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
assert(b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port)))
}
keepalive 1;
}
--- config
location = /t {
content_by_lua_block {
local res0 = ngx.location.capture("/tt")
local res1 = ngx.location.capture("/tt")
local res2 = ngx.location.capture("/tt")
if res2.status == ngx.HTTP_OK then
ngx.print(res2.body)
end
}
}
location = /tt {
proxy_pass http://backend/back;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
location = /back {
echo "hello keepalive!";
}
--- request
GET /t
--- response_body
hello keepalive!
--- error_code: 200
--- grep_error_log eval: qr{\S+ keepalive peer:.*?connection}
--- grep_error_log_out eval
["free keepalive peer: saving connection
get keepalive peer: using connection
free keepalive peer: saving connection
get keepalive peer: using connection
free keepalive peer: saving connection
",
"get keepalive peer: using connection
free keepalive peer: saving connection
get keepalive peer: using connection
free keepalive peer: saving connection
get keepalive peer: using connection
free keepalive peer: saving connection
",
]
--- no_error_log
[warn]
=== TEST 12: set_current_peer called in a wrong context
--- wait: 0.2
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 127.0.0.1:$TEST_NGINX_SERVER_PORT;
balancer_by_lua_block {
print("hello from balancer by lua!")
}
}
--- config
location = /fake {
echo ok;
}
location = /t {
proxy_pass http://backend/fake;
log_by_lua_block {
local balancer = require "ngx.balancer"
local ok, err = balancer.set_current_peer("127.0.0.1", 1234)
if not ok then
ngx.log(ngx.ERR, "failed to call: ", err)
return
end
ngx.log(ngx.ALERT, "unexpected success")
}
}
--- request
GET /t
--- response_body
ok
--- error_log eval
qr/\[error\] .*? log_by_lua.*? failed to call: API disabled in the current context/
--- no_error_log
[alert]
=== TEST 13: get_last_failure called in a wrong context
--- wait: 0.2
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 127.0.0.1:$TEST_NGINX_SERVER_PORT;
balancer_by_lua_block {
print("hello from balancer by lua!")
}
}
--- config
location = /fake {
echo ok;
}
location = /t {
proxy_pass http://backend/fake;
log_by_lua_block {
local balancer = require "ngx.balancer"
local state, status, err = balancer.get_last_failure()
if not state and err then
ngx.log(ngx.ERR, "failed to call: ", err)
return
end
ngx.log(ngx.ALERT, "unexpected success")
}
}
--- request
GET /t
--- response_body
ok
--- error_log eval
qr/\[error\] .*? log_by_lua.*? failed to call: API disabled in the current context/
--- no_error_log
[alert]
=== TEST 14: set_more_tries called in a wrong context
--- wait: 0.2
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 127.0.0.1:$TEST_NGINX_SERVER_PORT;
balancer_by_lua_block {
print("hello from balancer by lua!")
}
}
--- config
location = /fake {
echo ok;
}
location = /t {
proxy_pass http://backend/fake;
log_by_lua_block {
local balancer = require "ngx.balancer"
local ok, err = balancer.set_more_tries(1)
if not ok then
ngx.log(ngx.ERR, "failed to call: ", err)
return
end
ngx.log(ngx.ALERT, "unexpected success")
}
}
--- request
GET /t
--- response_body
ok
--- error_log eval
qr/\[error\] .*? log_by_lua.*? failed to call: API disabled in the current context/
--- no_error_log
[alert]
=== TEST 15: hot loop when proxy_upstream_next error is hit and keepalive is used.
github issue openresty/lua-nginx-module#693
--- skip_nginx: 4: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
print("hello from balancer by lua!")
assert(b.set_current_peer("127.0.0.1", $TEST_NGINX_SERVER_PORT))
}
keepalive 1;
}
--- config
location /t {
rewrite ^/t(.*) $1 break;
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
location = /back {
return 200;
}
location = /main {
echo_location /t/back;
echo_location /t/bad;
}
location = /bad {
content_by_lua_block {
ngx.exit(444)
}
}
--- request
GET /main
--- no_error_log
[alert]
--- ignore_response
--- grep_error_log eval: qr{hello from balancer by lua!}
--- grep_error_log_out
hello from balancer by lua!
hello from balancer by lua!
--- error_log eval
qr/\[error] .*? upstream prematurely closed connection while reading response header from upstream/
=== TEST 16: https (keepalive)
--- skip_nginx: 5: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
print("hello from balancer by lua!")
assert(b.set_current_peer("127.0.0.1", $TEST_NGINX_RAND_PORT_1))
}
keepalive 1;
}
server {
listen $TEST_NGINX_RAND_PORT_1 ssl;
ssl_certificate ../../cert/test.crt;
ssl_certificate_key ../../cert/test.key;
server_tokens off;
location = /back {
return 200 "ok";
}
}
--- config
location /t {
proxy_pass https://backend/back;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
--- request
GET /t
--- no_error_log
[alert]
[error]
--- response_body chomp
ok
--- grep_error_log eval: qr{hello from balancer by lua!}
--- grep_error_log_out
hello from balancer by lua!
--- no_check_leak
=== TEST 17: https (no keepalive)
--- skip_nginx: 5: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
print("hello from balancer by lua!")
assert(b.set_current_peer("127.0.0.1", $TEST_NGINX_RAND_PORT_2))
}
}
server {
listen $TEST_NGINX_RAND_PORT_2 ssl;
ssl_certificate ../../cert/test.crt;
ssl_certificate_key ../../cert/test.key;
server_tokens off;
location = /back {
return 200 "ok";
}
}
--- config
location /t {
proxy_pass https://backend/back;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
--- request
GET /t
--- no_error_log
[alert]
[error]
--- response_body chomp
ok
--- grep_error_log eval: qr{hello from balancer by lua!}
--- grep_error_log_out
hello from balancer by lua!
--- no_check_leak
=== TEST 18: test ngx.var.upstream_addr after using more than one set_current_peer
--- wait: 0.2
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
proxy_next_upstream_tries 3;
upstream backend {
server 127.0.0.1:$TEST_NGINX_SERVER_PORT;
balancer_by_lua_block {
local balancer = require "ngx.balancer"
if ngx.ctx.tries == nil then
balancer.set_more_tries(1)
ngx.ctx.tries = 1
balancer.set_current_peer("127.0.0.3", 12345)
else
balancer.set_current_peer("127.0.0.3", 12346)
end
}
}
--- config
location = /t {
proxy_pass http://backend;
log_by_lua_block {
ngx.log(ngx.INFO, "ngx.var.upstream_addr is " .. ngx.var.upstream_addr)
}
}
--- request
GET /t
--- response_body_like: 502 Bad Gateway
--- error_code: 502
--- error_log eval
qr/log_by_lua\(nginx.conf:\d+\):\d+: ngx.var.upstream_addr is 127.0.0.3:12345, 127.0.0.3:12346/
--- no_error_log
[alert]
=== TEST 19: no 'server' directive
--- http_config
upstream backend {
balancer_by_lua_block {
print("hello from balancer by lua!")
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- error_code: 500
--- ignore_response_body
--- error_log eval
[
'[lua] balancer_by_lua(nginx.conf:26):2: hello from balancer by lua! while connecting to upstream,',
qr/\[error\] .*? lua balancer: no peer set/,
]
--- no_error_log
[warn]
=== TEST 20: set current peer: no 'server' directive
--- http_config
upstream backend {
balancer_by_lua_block {
print("hello from balancer by lua!")
local b = require "ngx.balancer"
assert(b.set_current_peer("127.0.0.3", 12345))
}
}
--- config
location = /t {
proxy_pass http://backend;
}
--- request
GET /t
--- error_code: 502
--- ignore_response_body
--- error_log eval
[
'[lua] balancer_by_lua(nginx.conf:26):2: hello from balancer by lua! while connecting to upstream,',
qr{connect\(\) failed .*?, upstream: "http://127\.0\.0\.3:12345/t"},
]
--- no_error_log
[warn]
[crit]
=== TEST 21: set_upstream_tls off
--- skip_nginx: 5: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
b.set_current_peer("127.0.0.1", tonumber(ngx.var.server_port))
b.set_upstream_tls(false)
}
keepalive 1;
}
server {
listen $TEST_NGINX_RAND_PORT_1 ssl;
ssl_certificate ../../cert/test.crt;
ssl_certificate_key ../../cert/test.key;
server_tokens off;
location = /back {
return 200 "ok";
}
}
--- config
location /t {
proxy_pass https://backend/back;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
location /back {
echo "Hello world!";
}
--- request
GET /t
--- no_error_log
[alert]
[error]
--- response_body
Hello world!
--- no_check_leak
=== TEST 22: set_upstream_tls on
--- skip_nginx: 5: < 1.7.5
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
upstream backend {
server 0.0.0.1;
balancer_by_lua_block {
local b = require "ngx.balancer"
b.set_current_peer("127.0.0.1", $TEST_NGINX_RAND_PORT_1)
b.set_upstream_tls(false)
b.set_upstream_tls(true)
}
keepalive 1;
}
server {
listen $TEST_NGINX_RAND_PORT_1 ssl;
ssl_certificate ../../cert/test.crt;
ssl_certificate_key ../../cert/test.key;
server_tokens off;
location = /back {
return 200 "ok";
}
}
--- config
location /t {
proxy_pass https://backend/back;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
location /back {
echo "Hello world!";
}
--- request
GET /t
--- no_error_log
[alert]
[error]
--- response_body chomp
ok
--- no_check_leak

View file

@ -1,42 +0,0 @@
-----BEGIN CERTIFICATE-----
MIICijCCAfOgAwIBAgICEAQwDQYJKoZIh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NVBAoMCU9wZW5SZXN0eTEVMBMGA1UE
AwwMU2lnbmluZy1DQS0xMCAXDTE0MDkyMDA1MjUwNFoYDzIxMTQwODI3MDUyNTA0
WjBNMQswCQYDVQQGEwJVUzETMBEGA1UECAwKQ2FsaWZvcm5pYTESMBAGA1UECgwJ
BAD=BAD=BAD
-----END CERTIFICATE-----

View file

@ -1,172 +0,0 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4100 (0x1004)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, O=OpenResty, CN=Signing-CA-2
Validity
Not Before: Sep 20 05:27:46 2014 GMT
Not After : Aug 27 05:27:46 2114 GMT
Subject: C=US, ST=California, O=OpenResty, CN=test.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:d8:53:ac:ac:5c:3f:f9:80:a8:96:4b:b0:58:db:
5a:86:de:ca:30:02:d9:19:c8:f6:14:c5:40:c9:41:
eb:bb:7a:d1:e1:f9:96:3b:54:d5:e8:bf:ac:50:5a:
49:11:da:99:60:44:e0:25:68:40:36:7c:f6:ce:b4:
9c:b9:58:d6:ea:e7:44:98:63:eb:a2:72:f8:e9:69:
b4:4a:4d:68:86:41:ca:67:58:61:e6:70:e8:08:fe:
ad:c2:75:59:24:0e:f0:2f:1a:70:83:8c:a3:77:64:
e8:4d:d5:c5:28:62:a9:53:d1:a1:22:f5:36:43:a7:
46:00:aa:97:54:72:d4:72:47
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
1F:DB:C0:D9:3C:4B:77:A8:9A:AC:33:1F:7B:70:C4:CF:BA:C8:07:DD
X509v3 Authority Key Identifier:
keyid:39:77:77:A3:4E:92:8B:E2:25:20:72:64:35:0A:7A:87:A8:58:A9:F8
Signature Algorithm: sha1WithRSAEncryption
1e:cd:83:66:b1:db:ea:5c:37:7e:bc:31:44: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gLK0AIKXcz53IyI/fzyQmnEOD9NL/69nkfSXPH7iq
Y1gDudpSQvj+LnHMj94mNM3aXHo7ZAcYJ6FhtlgylhCX8n8AxERDt53iMWlPwpXF
ozLRwADG71i5D+YIOg3JwBT3JoxDE1Ubk3Fyx60v
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4098 (0x1002)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=San Francisco, O=OpenResty, CN=Root CA
Validity
Not Before: Sep 20 05:09:05 2014 GMT
Not After : Aug 27 05:09:05 2114 GMT
Subject: C=US, ST=California, O=OpenResty, CN=Signing-CA-1
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:b9:9a:3d:b6:31:dd:b6:8a:f1:9f:61:25:79:70:
f6:ea:4b:6a:0f:0c:72:ea:45:fc:4d:51:cf:f5:71:
88:94:9c:f9:04:40:99:fd:2d:17:15:3a:de:5f:70:
4a:06:79:13:fb:81:49:ad:da:59:44:12:81:74:9d:
d8:19:3e:4e:e8:c7:00:ee:f9:96:81:7a:bf:09:e6:
88:b0:e3:b2:e8:ca:e3:72:23:e4:86:83:41:ca:b3:
49:c0:f5:76:8a:d7:b5:fc:a3:12:1b:2b:0b:b4:57:
10:24:97:40:be:cb:17:e7:c5:de:93:1b:59:94:ff:
34:3f:cd:4d:14:76:09:0e:f3
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
12:57:8E:2C:9B:CA:C9:8D:F8:88:B1:4D:EE:A6:6D:F3:99:C3:AF:E1
X509v3 Authority Key Identifier:
keyid:56:65:C9:8B:65:55:27:2E:AB:14:F0:26:46:BD:BB:9E:A1:2B:41:58
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
1e:fb:6f:3e:12:bd:45:11:59:52:d5:60:ff:7c:73:9e:32:ce:
76:fa:0b:b6:4a:58:68:db:92:a4:a0:d2:63:24:27:9c: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ObUx/xgqpI4Ud3uiLFRL8KUsgxLE1RxKX3sxJu1jutWD4rUdw/M0oLrd7ofucHGu
G8WXmwimnK3Awg==
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4099 (0x1003)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, O=OpenResty, CN=Signing-CA-1
Validity
Not Before: Sep 20 05:25:04 2014 GMT
Not After : Aug 27 05:25:04 2114 GMT
Subject: C=US, ST=California, O=OpenResty, CN=Signing-CA-2
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:a4:d0:ae:16:a8:8f:9d:2c:ee:12:f5:0c:5e:29:
65:9b:cc:9b:67:6f:40:24:d7:44:ff:d4:de:8d:d4:
36:1c:e1:37:2b:df:ff:69:35:6d:0b:4f:ae:9a:16:
e7:a9:c6:24:d3:8e:a4:c3:2f:25:d8:f3:66:73:8e:
84:8e:9c:a6:c7:f9:ce:8c:b7:9d:60:26:85:4c:8f:
f4:43:17:af:9d:94:1a:f5:21:7b:1c:2b:9c:ee:fe:
4a:ca:6d:c7:cf:ee:2a:02:28:1f:6e:13:94:85:3f:
50:a3:03:18:bd:6c:f9:b5:9d:37:b9:27:61:29:75:
d3:39:77:5e:83:41:aa:8c:21
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
39:77:77:A3:4E:92:8B:E2:25:20:72:64:35:0A:7A:87:A8:58:A9:F8
X509v3 Authority Key Identifier:
keyid:12:57:8E:2C:9B:CA:C9:8D:F8:88:B1:4D:EE:A6:6D:F3:99:C3:AF:E1
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
3b:4b:b6:31:51:72:9a:ef:42:60:5e:98:60:71:d7:26:4a:46:
f1:0e:1f:08:be:e6:1b:5f:e2:fd:28:54:8d:b1:c5:09:6f:04:
cb:69:dc:39:5e:67:e0:91:9f:10:94:bc:35:90:4a:65:fe:58:
bd:e9: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2zaUS17DeI
+/lfOUXJOx4UsfNCDQECQD7nndBJDJeSggFSJKcZ0RI59NVG8eGRSX7/3ycbq6+t
guGI7WBvhDH4jNNL8jhuE+XuJuhhzOwP85872AFgIgw=
-----END RSA PRIVATE KEY-----

View file

@ -1,78 +0,0 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
32:ed:21:56:d8:4e:aa:03:89:a9:4a:a4:e2:85:2d:8a:3b:2b:89:22
Signature Algorithm: sha256WithRSAEncryption
Issuer: C = US, ST = California, O = OpenResty, CN = OpenResty Testing Root CA
Validity
Not Before: Mar 13 15:49:00 2022 GMT
Not After : Mar 8 15:49:00 2042 GMT
Subject: C = US, ST = California, O = OpenResty, CN = OpenResty Testing Root CA
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
00:e6:37:d2:c6:17:36:c7:b2:7f:7d:cf:d0:62:87:
99:d9:21:b8:de:ff:d8:e2:3a:1c:68:90:8f:ce:17:
68:22:b0:60:30:cc:29:e8:34:ee:ff:b2:25:de:6e:
1a:d4:df:10:19:11:4b:40:61:d3:a9:4d:80:ed:97:
81:4e:c5:74:e8:4d:63:e3:5f:21:bc:5a:6e:22:a0:
17:91:c1:cb:25:53:9b:9d:4e:e1:51:5b:f6:52:e7:
0a:27:f6:16:c2:31:cb:6c:47:f4:89:51:15:cc:06:
be:31:3e:1c:ea:ee:81:9b:c4:97:96:fd:e5:1c:95:
9e:c0:65:cd:a9:9a:cb:68:67:f2:62:a0:21:eb:5a:
c5:a1:92:ed:32:41:28:f9:47:34:eb:44:ae:d6:e7:
76:71:11:98:c9:2e:ce:6c:7c:10:1b:c7:4c:c3:14:
89:4e:d9:4c:d9:c7:43:e9:3c:29:ca:62:a9:91:b3:
87:e7:d7:b4:18:ab:65:f9:6b:ed:82:ca:a1:36:35:
18:05:cb:5c:24:26:13:13:f8:99:ac:99:be:9b:a6:
73:df:0d:16:95:b1:dc:be:fe:7a:c2:b6:dc:c8:93:
cf:10:e0:29:03:0e:28:78:18:84:ee:14:92:ab:be:
5a:a0:14:a2:4a:2f:d3:d0:b8:0e:00:d2:5a:cd:e4:
bd:a1
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Key Usage: critical
Certificate Sign, CRL Sign
X509v3 Basic Constraints: critical
CA:TRUE
X509v3 Subject Key Identifier:
F0:D7:4B:14:73:E1:67:00:6B:54:B4:19:20:76:12:9F:9D:8E:C8:09
Signature Algorithm: sha256WithRSAEncryption
6d:52:21:6d:6e:8c:e5:4a:28:07:65:6d:d8:7c:23:2e:c6:c1:
d0:ec:27:b3:b0:c3:d3:e8:fa:72:b9:de:32:4e:ff:97:8d:86:
a9:6d:b3:a9:b4:2d:77:ca:28:97:6a:3d:7b:a2:15:ed:34:dc:
72:9f:6f:e7:01:0c:d3:28:6a:80:1b:50:09:fd:d7:2c:d8:92:
d5:10:c4:73:15:20:7d:99:dc:de:30:7b:3c:6e:e9:66:b2:0e:
4e:1a:c1:51:57:6e:5b:b0:a9:f6:ff:0b:8f:07:67:31:40:5b:
11:a9:06:d3:d3:76:c5:d2:56:95:9a:9e:4a:16:44:4b:32:e5:
af:dd:4b:4d:5d:57:b8:85:69:36:93:2a:c6:0c:8f:e1:42:35:
be:8e:f3:e7:35:d3:2c:3a:03:31:40:75:8e:e8:dd:57:35:20:
5e:18:a9:76:ce:85:be:7e:3a:cf:6e:08:58:5b:47:d5:e9:c4:
ec:0e:e9:8e:3c:2d:5c:7b:59:20:5b:24:92:a0:e0:1e:a3:5a:
67:d8:ff:7f:a5:82:f1:df:db:05:65:79:88:b1:3c:e6:01:d1:
5a:c7:d2:6e:9a:e6:a2:da:4a:c7:19:78:d9:14:71:6e:1f:70:
f3:41:e5:b3:78:31:d5:22:0e:7c:1a:b2:43:d9:86:ff:53:ea:
2b:ba:d2:27
-----BEGIN CERTIFICATE-----
MIIDhDCCAmygAwIBAgIUMu0hVthOqgOJqUqk4oUtijsriSIwDQYJKoZIhvcNAQEL
BQAwWjELM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jx9UnhIcrEIIGANyxEQeBdhF56Nt9CJy/Iwi3a6qQ/GkbeoDm5FhXnXo
xcBaHyv2lwi4uO/hONY8eRnYxAWMwAKMZe6VnU1hWI2Ytkh+OcMPMh7NIGQf6X1o
JZrBtnTms060TuuDjLeIlaubDR/xDrMWTMKjKbsVAoGAVLuYAZ8J6xpIGlRhbGlA
6OrMxJCHcgpahvsWKc0BLXKmRBjHmTX7fslsSRihZWgKj1SZH7U2fpgpxV6cFxKJ
nPhUJEHhoKo+bjZ92tnANdqBq7iQjCsDJ8Bz52fuIlGD+1795+PsDA6bNKdkQkrV
zlNf80kuEqmFDFJ5+6EHx00CgYAf+jkpbZa71aeMgDpnZ+uhaqm0DYuEVhBAgBa/
9sRUbw86jc5IC7cCRcmAOzIosQ+ZZls9cV4KSUohVD4iJMzn2rkcM8AIPwOXjp/t
4DbxoHnrZjpaimW3Gjwju5AAbjEbl7tddFoNA2HHYlurvGlIW9MYzDJsOxGyKfZE
dRF2PQKBgQDUKNHgDYEjLJ99S5Fm5zN/64bKzzDtktGdqOxik5pBKcs/BvOdLM0i
eCjGz/3qrEoenFIBwF/IRz3ug90Zr8bWOu6DudReflAKI/N13dZ2gOTAfaX4ljJF
w0ohSi6xs+mu1GmtipGtNxHi/J3na2BeSnSRFSUg6Zd+oh8BZQKmNg==
-----END RSA PRIVATE KEY-----

View file

@ -1,4 +0,0 @@
*.pem
*.csr
cfssl
cfssljson

View file

@ -1,23 +0,0 @@
#!/bin/bash
rm *.pem *.csr cfssl cfssljson
wget -O cfssl https://github.com/cloudflare/cfssl/releases/download/v1.6.1/cfssl_1.6.1_linux_amd64
wget -O cfssljson https://github.com/cloudflare/cfssl/releases/download/v1.6.1/cfssljson_1.6.1_linux_amd64
chmod +x cfssl cfssljson
./cfssl gencert -initca -config profile.json mtls_ca.json | ./cfssljson -bare mtls_ca
./cfssl gencert -ca mtls_ca.pem -ca-key mtls_ca-key.pem -config profile.json -profile=client mtls_client.json | ./cfssljson -bare mtls_client
./cfssl gencert -ca mtls_ca.pem -ca-key mtls_ca-key.pem -config profile.json -profile=server mtls_server.json | ./cfssljson -bare mtls_server
openssl x509 -in mtls_ca.pem -text > ../mtls_ca.crt
mv mtls_ca-key.pem ../mtls_ca.key
openssl x509 -in mtls_client.pem -text > ../mtls_client.crt
mv mtls_client-key.pem ../mtls_client.key
openssl x509 -in mtls_server.pem -text > ../mtls_server.crt
mv mtls_server-key.pem ../mtls_server.key
rm *.pem *.csr cfssl cfssljson

View file

@ -1,18 +0,0 @@
{
"CA": {
"expiry": "175200h",
"pathlen": 0
},
"CN": "OpenResty Testing Root CA",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "US",
"O": "OpenResty",
"ST": "California"
}
]
}

View file

@ -1,18 +0,0 @@
{
"CN": "foo@example.com",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "US",
"O": "OpenResty",
"ST": "California"
}
],
"hosts": [
"foo@example.com",
"bar@example.com"
]
}

View file

@ -1,17 +0,0 @@
{
"CN": "example.com",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "US",
"O": "OpenResty",
"ST": "California"
}
],
"hosts": [
"example.com"
]
}

View file

@ -1,27 +0,0 @@
{
"signing": {
"default": {
"expiry": "175200h"
},
"profiles": {
"server": {
"usages": [
"signing",
"digital signing",
"key encipherment",
"server auth"
],
"expiry": "175199h"
},
"client": {
"usages": [
"signing",
"digital signature",
"key encipherment",
"client auth"
],
"expiry": "175199h"
}
}
}
}

View file

@ -1,87 +0,0 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
19:0a:a3:a8:9c:d4:0f:dc:c6:fa:23:7b:f8:fc:bd:f4:73:4e:7e:b1
Signature Algorithm: sha256WithRSAEncryption
Issuer: C = US, ST = California, O = OpenResty, CN = OpenResty Testing Root CA
Validity
Not Before: Mar 13 15:49:00 2022 GMT
Not After : Mar 8 14:49:00 2042 GMT
Subject: C = US, ST = California, O = OpenResty, CN = foo@example.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
00:be:5b:09:4c:94:71:d3:82:54:4a:42:6a:76:aa:
34:5d:28:d9:45:e6:44:9a:74:9f:a6:e6:78:49:9e:
c6:20:75:32:5f:92:3b:ec:6e:4b:7b:b0:75:1c:75:
09:00:05:77:d6:59:ca:55:5b:13:b6:76:3a:c6:18:
dc:37:6a:20:93:e6:26:56:5d:0b:96:8c:01:f2:96:
38:08:08:36:a2:64:12:21:a0:8d:48:cd:9a:26:78:
92:29:b6:63:eb:14:d9:b6:e5:87:f7:d5:55:a4:cc:
53:1c:a3:7c:b8:bd:ad:7c:a4:d4:86:1f:a7:1c:43:
c5:1a:b5:f1:03:bd:fe:19:98:1d:b7:13:2b:93:a2:
2a:0e:21:7e:42:a9:bb:28:69:49:59:e7:89:0e:7d:
5a:ce:fb:d4:0c:20:6a:e1:db:b2:6a:e5:a7:55:e0:
d0:58:4a:e2:08:78:82:b9:06:0c:65:f9:24:06:e6:
8a:13:b2:9a:ef:1b:4a:b2:3a:b4:98:7f:dd:3c:0e:
85:0b:a6:c6:47:2f:63:c2:73:52:41:db:7c:06:c3:
2a:b5:2d:d1:e1:30:d5:c4:79:c9:b9:35:68:46:ad:
c4:45:57:ea:11:88:27:37:ed:ac:49:2d:c4:d6:c6:
a6:74:8d:d3:bc:e0:d9:69:25:0c:0c:b0:e3:b7:cb:
8d:99
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Client Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
22:70:5E:30:8C:4D:66:39:E7:60:C9:29:A2:ED:95:32:34:63:5C:C0
X509v3 Authority Key Identifier:
keyid:F0:D7:4B:14:73:E1:67:00:6B:54:B4:19:20:76:12:9F:9D:8E:C8:09
X509v3 Subject Alternative Name:
email:foo@example.com, email:bar@example.com
Signature Algorithm: sha256WithRSAEncryption
96:e7:2a:fc:2a:56:16:80:e2:d3:79:0c:46:db:c3:88:ab:d3:
ef:39:66:4b:a9:ab:6c:0e:30:08:07:7c:fc:03:6c:f7:dd:fb:
3e:a8:c8:68:28:ab:4e:73:97:80:27:5d:c5:9d:52:00:aa:08:
25:c8:f9:dc:df:64:73:a4:58:5b:bd:5f:1a:53:a4:33:a3:b1:
45:38:2d:be:d7:f3:a4:c4:f4:7a:07:71:44:f1:a2:65:02:e4:
71:84:01:b5:83:4b:de:83:b5:ad:ac:b9:3c:17:42:0c:9a:7d:
eb:7f:ab:26:dd:9b:3a:fd:95:37:55:cc:01:c3:3f:20:df:e5:
ed:49:51:7a:42:ea:f3:8a:3f:da:6e:c1:1a:11:b9:45:4d:6e:
c9:21:f4:e3:4f:31:72:5b:bb:01:92:b6:7f:f1:8a:9e:6c:d0:
7f:96:d7:eb:29:09:53:38:26:41:00:f2:33:04:77:bd:a9:ee:
60:9e:06:b7:7d:26:ae:1c:4f:56:bd:a5:b6:50:40:be:be:84:
2a:54:21:59:47:7d:a5:1e:63:6d:28:36:4d:a6:e4:62:69:9b:
9b:fa:2b:48:e8:64:d7:14:f4:62:a2:26:17:a5:05:58:4a:38:
d2:44:e7:33:90:b9:c1:8c:85:02:99:b8:03:1a:03:d2:cf:ac:
a5:6b:44:98
-----BEGIN CERTIFICATE-----
MIID3DCCAsSgAwIBAgIUGQqjqJzUD9zG+iN7+Py99HNOfrEwDQYJKoZIhvcNAQEL
BQAwWjELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExEjAQBgNVBAoT
CU9wZW5SZXN0eTEiMCAGA1UEAxMZT3BlblJlc3R5IFRlc3RpbmcgUm9vdCBDQTAe
Fw0yMjAzMTMxNTQ5MDBaFw00MjAzMDgxNDQ5MDBaMFAxCzAJBgNVBAYTAlVTMRMw
EQYDVQQIEwpDYWxpZm9ybmlhMRIwEAYDVQQKEwlPcGVuUmVzdHkxGDAWBgNVBAMM
D2Zvb0BleGFtcG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c1NtSlTFUCgYBnV5agrIyzQSex5J0CMWxS
Od362PkGdXEc/8we4F4GnNvSnrm7Uo2jNXmy+zo9mtb1YT43sogXLK4C5e44bz4G
kTuYagqkgdBPb2lihpy3KprHo2+P2JXQfXRFEX9xiN37Fqi/hSUK8R0VNRqO8dbi
ik9nexXzwkiMBxsjvUN2JQKBgFy62FpZ9YTfWVNhEuqtGgCWzrqtwUdKwBBwrVyA
qiNz48Kz/ZPigrlATVF2J5qp4kSLOLRs6OxW65exFl39V2utZgALSbosanDeLk83
4qRRz3h7KJRYjBtIKz3rvX7+va3mtF2rEmk+Jizs7pFlGWTH0Kf0GBeDiwVEU6bA
IZ9hAoGAQTjnRGMjvyhq0aPYP+mRFiMKSkcL1nyXizYInfAnbfbL/uEODH7D+iMf
kak+UgmeD9ce5d/APmZp3/FzYH/M8ivBgG+MnaI+MLVMhmQdLZyMtbSKKaDpiim7
DdN1wCXYbur0HlO2t+wemMZPpQu7wybgEOLlIG7Yj/0OWDcal1c=
-----END RSA PRIVATE KEY-----

View file

@ -1,87 +0,0 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number:
2f:d5:41:13:5a:ff:c7:1c:5b:ce:28:cd:a6:f7:a5:5a:0d:c0:e2:d2
Signature Algorithm: sha256WithRSAEncryption
Issuer: C = US, ST = California, O = OpenResty, CN = OpenResty Testing Root CA
Validity
Not Before: Mar 13 15:49:00 2022 GMT
Not After : Mar 8 14:49:00 2042 GMT
Subject: C = US, ST = California, O = OpenResty, CN = example.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
RSA Public-Key: (2048 bit)
Modulus:
00:d7:03:80:a7:42:7d:06:5a:7b:70:d8:11:96:dd:
63:35:53:07:28:71:52:05:40:55:83:61:a7:14:ac:
cf:4b:9b:ab:b7:4e:9d:79:e9:13:3d:bc:c3:67:8f:
dd:88:d9:8b:c2:31:aa:b8:28:9e:13:70:db:76:b0:
12:1c:f8:35:c6:2e:33:9c:b9:04:e3:47:e0:f9:e4:
7f:a5:55:03:0c:2d:b2:54:17:29:12:dd:61:6e:5c:
33:9f:e5:8f:8a:2b:41:53:dc:e1:98:49:63:df:e3:
00:30:2d:1b:bb:f0:8f:cb:04:ec:c9:98:c4:09:5b:
b4:ba:a9:a0:0a:77:d2:42:76:7c:ac:64:c3:97:85:
50:5d:7d:02:61:2a:00:93:d0:69:5e:87:22:f0:c1:
1e:53:46:02:40:37:c9:55:77:99:7d:9d:3d:35:14:
74:84:e3:73:ca:e7:4a:ab:33:98:26:aa:41:4b:b5:
e6:63:7c:a4:1e:25:6a:88:f4:56:d9:2c:63:dd:89:
19:fa:25:41:44:95:87:40:a7:9b:4e:3a:91:29:32:
79:66:05:f4:2f:68:2c:06:53:df:4d:60:be:ac:09:
20:61:9c:6f:1a:a6:07:5a:e7:41:91:9d:36:77:38:
18:3a:69:7b:67:29:9f:1d:e0:c2:d2:8f:16:5b:14:
e8:e1
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Key Identifier:
16:07:B5:C2:4C:B5:2D:4F:B8:E9:D6:FA:2F:3F:C0:1B:B6:4F:20:E6
X509v3 Authority Key Identifier:
keyid:F0:D7:4B:14:73:E1:67:00:6B:54:B4:19:20:76:12:9F:9D:8E:C8:09
X509v3 Subject Alternative Name:
DNS:example.com
Signature Algorithm: sha256WithRSAEncryption
d9:c0:c0:d6:8b:44:04:26:b3:98:24:2c:12:82:6d:15:79:92:
76:c9:77:94:c1:be:8f:8a:18:78:96:04:68:c9:0a:d1:84:c5:
de:cd:ba:b5:a2:3b:d4:0a:70:be:00:49:19:c0:6e:ca:e9:e5:
8b:b6:e3:a2:39:0d:d8:ee:55:1a:08:73:39:19:d3:07:07:33:
8c:d8:1b:0f:1b:73:0e:84:72:cf:e6:c1:a1:da:39:aa:c0:2e:
3d:b9:a6:8f:ec:98:3a:07:58:34:c2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WzG5pSeuoZI2Ba+oDW
tVZfYQKBgC5phtERR5LKU5Wkzm+uY2j+Nzh4kuKkdLosB9pUW8VnrwFDLZ+r1CxG
L6CxOZ0AylCMIlrFeUXMa91kLDJYch0NUPHuGBkdIBDXi2kqN7GflTdV3Z8uev20
uMjErA93yVOWHTR3Wo8WIHy5mdsNRQgGAPw1RVW7rnYIyXJW/mTs
-----END RSA PRIVATE KEY-----

View file

@ -1,43 +0,0 @@
Following steps require https://github.com/cloudflare/cfssl
Initiate CA by creating root certificate pair:
```
cfssl gencert -initca ca_csr.json | cfssljson -bare ca
```
Continue with intermediate certificate pair for signing:
```
cfssl gencert -ca ca.pem -ca-key ca-key.pem -config=cfssl_config.json -profile=intermediate intermediate_ca_csr.json | cfssljson -bare intermediate_ca
```
Also create OCSP certificate pair to sign OCSP responses:
```
cfssl gencert -ca intermediate_ca.pem -ca-key intermediate_ca-key.pem -config=cfssl_config.json -profile=ocsp ocsp_csr.json | cfssljson -bare ocsp
```
Create a leaf certificate:
```
cfssl gencert -ca intermediate_ca.pem -ca-key intermediate_ca-key.pem -config cfssl_config.json -profile server leaf_csr.json | cfssljson -bare leaf
```
Create an OCSP response for the certificate:
```
cfssl ocspsign -ca intermediate_ca.pem -responder ocsp.pem -responder-key ocsp-key.pem -cert leaf.pem -status good | cfssljson -bare ocsp-response-good
```
Bundle certificate to be installed at Nginx:
```
cat leaf.pem intermediate_ca.pem ca.pem > leaf-bundle.pem
```
Inspect OCSP response to see what is the Next Update:
```
openssl ocsp -text -no_cert_verify -respin t/cert/ocsp/cfssl/ocsp-response-good-response.der | grep "Next Update"
```

View file

@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEA4U+dsu8CAV+Tyhn+z1UFSJ6H7CUQuq7AeGH5df3D8nEyW83N
8NjImED3SJkns8vzwHLP/7/UqPPDWZLu/KlIaI2740W3Zin4Eq4b9Tfbu+HTI+Cf
Vo461WlKMnKGG7nzmElSRA04cQm/M/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XkfRDGMAqTf5o
F4xZQtjubxz4zO3rUZ9nNxCFz9+9GENIgtlJFAeLbV/Xdd6G8Kqqa08mR/RZdV9V
7siSyDAeWoWsMnJOyX/TQdnQCfbnYpRhDtbi4mOkrW2Bf/SMb1uO0LRTec/rpBcC
AwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O
BBYEFOnsOYUW8U3ak+h1LUisz1czYQo+MA0GCSqGSIb3DQEBCwUAA4IBAQDHySN4
lWLHa12vYPvRVLNeWq3RaHQfKc2F2PhHriGCegY4lyZJqfC0XGI4LBnJ5GK//D0B
Hb8jcbGyortGBEwGuqjuOMdv0HOWibqZ7LPZ98GegtAjAJWMp/sQXkIYiRM8hlNC
pl9Vp9vsnUjfCrMaLVkZCC2Nwixc5mhSeH0aYHxxFwqh88oWbXzW7xobcTaYx/1P
kPdCy+jiBMCZII7J1u/e1B0J1VFad+IVJpQW+DzVIzJz9ClNAsJZjx1BBwIJGGEZ
fS1XXw+HgGeH2cVFnThMy0PIvx70b//GxEoXwuJhL2+z/tNhRRBN2eMa2zrZS94k
z+yCDRXP/rDxf+b7
-----END CERTIFICATE-----

View file

@ -1,16 +0,0 @@
{
"CN": "Lua Nginx Root CA",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CA",
"L": "Ottawa",
"O": "Lua Nginx",
"OU": "Lua Nginx Root CA",
"ST": "Ontario"
}
]
}

View file

@ -1,32 +0,0 @@
{
"signing": {
"default": {
"ocsp_url": "https://ocsp-responder.test",
"expiry": "2190000h",
"usages": [
"signing",
"key encipherment",
"client auth"
]
},
"profiles": {
"ocsp": {
"usages": ["digital signature", "ocsp signing"],
"expiry": "876000h"
},
"intermediate": {
"usages": ["cert sign", "crl sign"],
"expiry": "2190000h",
"ca_constraint": {"is_ca": true}
},
"server": {
"usages": ["signing", "key encipherment", "server auth"],
"expiry": "876000h"
},
"client": {
"usages": ["signing", "key encipherment", "client auth"],
"exp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ediate CA",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CA",
"L": "Ottawa",
"O": "Lua Nginx",
"OU": "Lua Nginx Intermediate CA",
"ST": "Ontario"
}
]
}

View file

@ -1,74 +0,0 @@
-----BEGIN CERTIFICATE-----
MIIEYjCCA0qgAwIBAgIUAoYyuXu96S6RvXoSk2udnewBcmMwDQYJKoZIhvcNAQEL
BQAwgYwxCzAJBgNVBAYTAkNBMRAwDgYDVQQIEwdPbnRhcmlvMQ8wDQYDVQQHEwZP
dHRhd2ExEjAQBgNVBAoTCUx1YSBOZ2lueDEiMCAGA1UECxMZTHVhIE5naW54IElu
dGVybWVkaWF0ZSBDQTEiMCAGA1UEAxMZTHVhIE5naW54IEludGVybWVkaWF0ZSBD
QTAgFw0yNDAzMTAxNDI3MDBaGA8yMTI0MDIxNTE0MjcwMFowcjELMAkGA1UEBhMC
VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDVNhbiBGcmFuY2lzY28x
ETAPBgNVBAoTCEN1c3RvbWVyMRAwDgYDVQQLEwdXZWJzaXRlMREwDwYDVQQDEwh0
ZXN0LmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAPbhwznauUQ4
K7smP0GUX7a4toKxMboTr0NNMMDlA+98dKMMWhSe3/eJUqUr0zFF59rFqwA1bWUK
i67zHbIZnlWvfFV8lq2QuXt5CBeUBAT00YHdPb6pdYdWHZ32tSuqJpAVEqtbuya6
K85hBMT37yfxu58LreGSkKvwVOBoKFQzHZVDvYRs+hX8mHBqhAy0AiNfrf3AbdqD
sI1p8YPr2k8varTE6lpUlhcO+dYnZHhyC8mDk5AD0kAgsnH0VvmRZwZPZmcmkeM0
aZJFdi++wmetlSv9DpEDzSVNHRuQaHEyq70jq/WKFJUlGtu6i/GhsGciSHnGfmXD
qWGabXGX3L0CAwEAAaOB0jCBzzAOBgNVHQ8BAf8EBAMCBaAwEwYDVR0lBAwwCgYI
KwYBBQUHAw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25YfUxruvIHaDTcuAK
tO8Q/iO/jybOHau9mwzwBe2aHhlKGYMJyvXlsQrGspcFsoyX8m5oXH3mBQhw1YhK
cjNZGDNq4c8m+2EU2nFmHAQd+/inGg3N4dtBLdiE8jlhb+Cfdaa1l7YRHgD4KafY
Oj5udG6FuOypcRoRerkUmizpgGofErHXmfTo14uo4FNxOhjJ57JPEBpf1Xq61k2L
QTptCbpSij4ElgWMAhNhBRpp11nfg37vP/wbxOInZK4oCzf3s0OAlKvCc01QBvIr
K59xzh9DRxpLjHsXphp9/XcFIlXfwQ==
-----END CERTIFICATE-----

View file

@ -1,20 +0,0 @@
{
"CN": "test.com",
"hosts": [
"test.com",
"www.test.com"
],
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "US",
"L": "San Francisco",
"O": "Customer",
"OU": "Website",
"ST": "California"
}
]
}

View file

@ -1,27 +0,0 @@
-----BEGIN RSA PRIVATE KEY-----
MIIEpAIBAAKCAQEAq3Crdfl19L2Tffp2+1R74p0iR/51RLgX2QGoh8PdWRf7GTo8
Jsho/7FSUaWdfSLmsHSpZCg6eZpXJqCJ67EzZK2I8bm1tv+9m7V6FLUn2mBsEQWB
b8zPIc7dcMhALc1/+9dDJB781ZEt6GiV8vDp8ymErBtb2l2YpJuU7vXX0Kj7bBL2
jx+mn5YGDL3RW4TaFF8Eh6hXHFMKH7STL/XUUyNx4s7H4VDFZULBSLU3g7p37b5w
O0ni8IZIhx2E459vFp8Cpv2Z3jTpXOPAgY+Br9lXBd/yEFN5pkzt6OrfLm5wV+ck
3HHLy4tsY2SMz5V/w6aQJmoeP7Xxoev8/m5GNQIDAQABAoIBAF1phbNBWpkg1oWU
/FGTRfFDBxPNPR5VZIEUWzymZywNWf7z8SR8nGF9v8nHAJnXc3UAC/ALz1jE1Omy
HZQzuDoKKAz10GJG1IxMBJnV30IouZlIs680HERij9vM8NNEHpEdSHMdA0xmz2nL
2rBFvmOE4spYGeNQjkRalXrir1X8aLYBoe3iPY9UzHRF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sGAQUFBwEBBCswKTAnBggrBgEFBQcwAYYbaHR0
cHM6Ly9vY3NwLXJlc3BvbmRlci50ZXN0MA0GCSqGSIb3DQEBCwUAA4IBAQAs3SAT
nif5b+ii4ItnpGIcniA7sYgjv+6hYrTUTj+vWENbmEd6FAJwJYJHrno99qfN2t97
CWNadxkRR/qN0xATxE0dY2gsxBpbwICoA3k8lz/9VBl+p3g9kOqbSQYxrxOEoQov
EvlV/n8zCq8eOjoHU/IwV3IP1Ik0KKj8rAeIGzV/M403LhahyxlZZVF5Qo7MszQ5
8hwPHSfgcbCRh/XSS6Y8N6RDvBVUoHofeikXsy+di7cYfT1PEC2bhdsbLi/0WvDm
ZrotJOHoZrhqEuEgMrMDg5E8s17QLL+Vd078DMSSqG6HDPwMckdjDMhlI+OBZKwc
Dnb4OMHJnL+of2Kh
-----END CERTIFICATE-----

View file

@ -1,16 +0,0 @@
{
"CN": "Lua Nginx OCSP Responder",
"key": {
"algo": "rsa",
"size": 2048
},
"names": [
{
"C": "CA",
"L": "Ottawa",
"O": "Lua Nginx",
"OU": "Lua Nginx OCSP Responder",
"ST": "Ontario"
}
]
}

View file

@ -1,183 +0,0 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4 (0x4)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-2
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=test.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:c7:bd:50:99:71:46:af:93:22:85:ab:74:8b:5b:
19:74:af:3e:ad:d2:e1:17:3e:cb:5b:36:9c:8a:38:
bd:1b:47:2d:8b:92:55:1d:fe:a6:72:92:78:00:de:
30:cb:a3:10:b5:92:aa:b8:e0:7b:44:9a:f5:99:89:
36:f4:84:20:81:e3:5c:76:00:9d:76:e7:b9:41:ab:
74:b6:14:9f:b2:94:b3:b6:48:a8:92:dc:09:e3:3d:
04:e3:5f:0f:5b:50:ad:0c:59:3a:88:06:39:2d:34:
a6:52:2f:58:6f:53:1b:df:9f:98:ea:82:8d:52:60:
b1:ef:6b:e9:f5:ad:29:87:45
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
67:DF:28:25:D1:F8:83:36:28:EE:DB:41:63:E4:E0:3A:32:0D:EA:30
X509v3 Authority Key Identifier:
keyid:B3:0B:F5:7D:51:16:51:7E:28:37:C3:A2:0F:1D:2F:10:C0:51:A3:B3
DirName:/C=US/ST=California/L=Default City/O=OpenResty/CN=signing-ca-1
serial:03
Authority Information Access:
OCSP - URI:http://127.0.0.1:8888/ocsp?foo=1
Signature Algorithm: sha1WithRSAEncryption
37:29:3f:ed:d9:47:9a:51:36:a3:5b:00:85:66:de:51:4d:48:
2d:f8:bc:f1:5e:b4:fd:30:48:f0:25:ee:77:57:9c:f1:4b:0a:
4f:7e:96:1a:f8:48:76:23:46:8d:d6:f2:5e:1e:08:52:12:53:
08:07:9f:75:db:77:22:2e:7e:89:c2:2c:66:85:6b:df:e9:77:
ca:23:6d:9a:af:87:8a:8c:27:37:1e:9e:55:92:8e:8a:a9:93:
24:41:a8:96:01:c0:65:93:8e:3d:7a:6c:bf:ed:c8:2a:f8:26:
cc:00:17:b7:27:ca:85:6c:2e:d5:2a:0a:8d:f3:88:e8:26:48:
e3:e8
-----BEGIN CERTIFICATE-----
MIIDaTCCAtKgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEVMBMGA1UEBxMMRGVmYXVsdCBDaXR5MRIwEAYD
VQQKEwlPcGVuUmVzdHkxFTATBgNVBAMTDHNpZ25pbmctY2EtMjAgFw0xNDEwMTYw
MzI3MDlaGA8yMTE0MDkyMjAzMjcwOVowYDELMAkGA1UEBhMCVVMxEzARBgNVBAgT
CkNhbGlmb3JuaWExFTATBgNVBAcTDERlZmF1bHQgQ2l0eTESMBAGA1UEChMJT3Bl
blJlc3R5MREwDwYDVQQDEwh0ZXN0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEAx71QmXFGr5Mihat0i1sZdK8+rdLhFz7LWzaciji9G0cti5JVHf6mcpJ4
AN4wy6MQtZKquOB7RJr1mYk29IQggeNcdgCddue5Qat0thSfspSztkioktwJ4z0E
418PW1CtDFk6iAY5LTSmUi9Yb1Mb35+Y6oKNUmCx72vp9a0ph0UCAwEAAaOCASsw
ggEnMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVk
IENlcnRpZmljYXRlMB0GA1UdDgQWBBRn3ygl0fiDNiju20Fj5OA6Mg3qMDCBjgYD
VR0jBIGGMIGDgBSzC/V9URZRfig3w6IPHS8QwFGjs6FopGYwZDELMAkGA1UEBhMC
VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFTATBgNVBAcTDERlZmF1bHQgQ2l0eTES
MBAGA1UEChMJT3BlblJlc3R5MRUwEwYDVQQDEwxzaWduaW5nLWNhLTGCAQMwPAYI
KwYBBQUHAQEEMDAuMCwGCCsGAQUFBzABhiBodHRwOi8vMTI3LjAuMC4xOjg4ODgv
b2NzcD9mb289MTANBgkqhkiG9w0BAQUFAAOBgQA3KT/t2UeaUTajWwCFZt5RTUgt
+LzxXrT9MEjwJe53V5zxSwpPfpYa+Eh2I0aN1vJeHghSElMIB59123ciLn6Jwixm
hWvf6XfKI22ar4eKjCc3Hp5Vko6KqZMkQaiWAcBlk449emy/7cgq+CbMABe3J8qF
bC7VKgqN84joJkjj6A==
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 3 (0x3)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-1
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-2
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:d3:24:1c:92:a5:bb:00:d9:b1:fb:2b:1d:7a:32:
a1:6c:49:eb:3c:2d:29:80:d6:65:8b:17:3a:f0:4b:
dc:0c:57:fb:d5:31:68:a5:e4:54:86:55:f9:1b:a8:
d7:7d:32:01:3b:cf:5c:38:2b:f5:bc:d3:8b:c8:b6:
ab:76:65:32:e6:4b:d5:e4:fd:d1:92:c8:33:6a:74:
f3:c7:ec:97:c3:c7:9f:e4:d5:55:75:b8:bd:39:ec:
2d:1f:c6:54:c8:2b:2d:17:e0:05:77:28:44:f7:dd:
e1:6e:f0:59:05:51:f5:b9:b4:fe:be:ad:40:a6:d5:
9a:c1:64:e0:9b:dd:67:e5:f1
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
B3:0B:F5:7D:51:16:51:7E:28:37:C3:A2:0F:1D:2F:10:C0:51:A3:B3
X509v3 Authority Key Identifier:
keyid:D2:30:71:56:50:A6:BC:21:C5:A1:A1:AB:11:A7:08:5B:EB:3A:A4:27
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
0c:61:c0:c7:11:c2:f0:39:f0:76:9d:4f:43:d4:90:54:1f:26:
3d:54:3d:77:5f:c0:b3:4a:c2:1b:b6:18:d2:12:8d:24:4d:76:
f5:07:0b:14:3e:17:2d:42:ee:85:30:db:e3:4d:81:67:59:97:
0a:b3:bb:c5:27:ea:69:c6:ee:99:5c:44:36:53:3e:c4:47:68:
f8:fe:c6:53:38:fb:e7:9a:0c:3c:6c:78:93:29:d2:49:7d:29:
d0:61:6e:81:9b:d6:ec:1a:e2:3e:62:62:41:bc:6d:4d:33:91:
76:20:5e:32:70:08:3e:24:72:fe:b1:8a:83:57:04:19:b5:cb:
99:b7
-----BEGIN CERTIFICATE-----
MIICkDCCAfmgAwIBAgIBAzANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEVMBMGA1UEBxMMRGVmYXVsdCBDaXR5MRIwEAYD
VQQKEwlPcGVuUmVzdHkxFTATBgNVBAMTDHNpZ25pbmctY2EtMTAgFw0xNDEwMTYw
MzI3MDlaGA8yMTE0MDkyMjAzMjcwOVowZDELMAkGA1UEBhMCVVMxEzARBgNVBAgT
CkNhbGlmb3JuaWExFTATBgNVBAcTDERlZmF1bHQgQ2l0eTESMBAGA1UEChMJT3Bl
blJlc3R5MRUwEwYDVQQDEwxzaWduaW5nLWNhLTIwgZ8wDQYJKoZIhvcNAQEBBQAD
gY0AMIGJAoGBANMkHJKluwDZsfsrHXoyoWxJ6zwtKYDWZYsXOvBL3AxX+9UxaKXk
VIZV+Ruo130yATvPXDgr9bzTi8i2q3ZlMuZL1eT90ZLIM2p088fsl8PHn+TVVXW4
vTnsLR/GVMgrLRfgBXcoRPfd4W7wWQVR9bm0/r6tQKbVmsFk4JvdZ+XxAgMBAAGj
UDBOMB0GA1UdDgQWBBSzC/V9URZRfig3w6IPHS8QwFGjszAfBgNVHSMEGDAWgBTS
MHFWUKa8IcWhoasRpwhb6zqkJzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA
A4GBAAxhwMcRwvA58HadT0PUkFQfJj1UPXdfwLNKwhu2GNISjSRNdvUHCxQ+Fy1C
7oUw2+NNgWdZlwqzu8Un6mnG7plcRDZTPsRHaPj+xlM4++eaDDxseJMp0kl9KdBh
boGb1uwa4j5iYkG8bU0zkXYgXjJwCD4kcv6xioNXBBm1y5m3
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 2 (0x2)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=root-ca
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-1
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:a0:3e:1a:4f:6c:b9:3d:ab:0f:02:de:da:82:92:
ee:a2:69:88:80:ed:f2:b6:98:bc:c6:ee:d3:47:82:
4a:e7:d3:7f:55:68:5c:6d:9e:aa:ba:59:e3:5b:7f:
32:4f:79:44:4a:4f:13:e4:2e:3f:1f:98:10:a4:72:
d5:f0:e7:44:8e:d4:a7:b9:fb:54:be:b6:fa:f7:dc:
9c:29:93:d4:9f:a1:5b:18:6e:68:93:91:1b:8c:a0:
4f:02:52:e9:9d:e8:98:f3:fd:67:da:78:4b:4f:d8:
2d:90:83:5c:0b:e5:fe:48:27:e4:ec:bb:99:26:06:
8e:34:fe:93:e4:d2:fc:97:57
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
D2:30:71:56:50:A6:BC:21:C5:A1:A1:AB:11:A7:08:5B:EB:3A:A4:27
X509v3 Authority Key Identifier:
keyid:1D:2F:09:60:EB:E4:EA:B5:0B:52:A9:5C:5E:09:2B:DD:34:70:CF:BA
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
a6:16:2f:fc:13:67:5e:ce:0e:79:cb:b0:91:52:9b:9e:b5:9f:
e1:fa:7d:78:f4:2a:93:f3:94:62:45:17:87:b9:0a:59:b9:a3:
a9:75:51:ca:f0:04:6c:01:d1:3a:a9:dd:66:7d:27:7b:1e:4f:
48:3a:25:ea:a5:01:32:fc:87:4b:08:da:f8:f5:62:88:e8:b9:
94:c7:cb:ee:33:08:ab:2f:52:f4:4a:14:4f:ac:2d:a2:f8:de:
c9:6f:95:b7:91:23:b9:ec:95:90:de:86:21:f5:6f:1b:cf:13:
47:77:78:dd:7a:16:e9:8b:cc:df:3d:45:8a:76:af:15:d1:9a:
37:a2
-----BEGIN CERTIFICATE-----
MIICizCCAfSgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEVMBMGA1UEBxMMRGVmYXVsdCBDaXR5MRIwEAYD
VQQKEwlPcGVuUmVzdHkxEDAOBgNVBAMTB3Jvb3QtY2EwIBcNMTQxMDE2MDMyNzA5
WhgPMjExNDA5MjIwMzI3MDlaMGQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxp
Zm9ybmlhMRUwEwYDVQQHEwxEZWZhdWx0IENpdHkxEjAQBgNVBAoTCU9wZW5SZXN0
eTEVMBMGA1UEAxMMc2lnbmluZy1jYS0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
iQKBgQCgPhpPbLk9qw8C3tqCku6iaYiA7fK2mLzG7tNHgkrn039VaFxtnqq6WeNb
fzJPeURKTxPkLj8fmBCkctXw50SO1Ke5+1S+tvr33Jwpk9SfoVsYbmiTkRuMoE8C
Uumd6Jjz/WfaeEtP2C2Qg1wL5f5IJ+Tsu5kmBo40/pPk0vyXVwIDAQABo1AwTjAd
BgNVHQ4EFgQU0jBxVlCmvCHFoaGrEacIW+s6pCcwHwYDVR0jBBgwFoAUHS8JYOvk
6rULUqlcXgkr3TRwz7owDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCm
Fi/8E2dezg55y7CRUpuetZ/h+n149CqT85RiRReHuQpZuaOpdVHK8ARsAdE6qd1m
fSd7Hk9IOiXqpQEy/IdLCNr49WKI6LmUx8vuMwirL1L0ShRPrC2i+N7Jb5W3kSO5
7JWQ3oYh9W8bzxNHd3jdehbpi8zfPUWKdq8V0Zo3og==
-----END CERTIFICATE-----

View file

@ -1,183 +0,0 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 8 (0x8)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-2
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=revoked-test.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:ca:50:23:9a:59:70:ea:00:47:ff:72:05:29:9b:
5d:6d:4b:73:37:a4:ff:38:20:4b:5b:ac:1f:3b:34:
f5:12:f8:8b:0e:02:bc:bd:14:34:39:6f:7d:5b:1f:
d4:15:e7:64:2e:65:fb:b1:a8:aa:f6:96:d3:e6:2b:
00:0e:f3:8a:ef:99:ab:3e:e6:5d:eb:6d:a6:4a:d0:
aa:ff:a9:d6:9a:41:f0:66:22:0a:38:9c:28:4f:1f:
0d:cf:a2:79:96:f9:fc:3d:1e:83:70:f5:97:6e:07:
cf:a2:17:87:0d:2a:41:19:3a:44:96:89:e7:0d:cb:
88:20:86:e1:de:08:8b:0d:db
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
FB:98:2B:56:90:69:E1:B4:2B:C2:DB:25:7C:13:87:D5:D7:BC:70:B6
X509v3 Authority Key Identifier:
keyid:B3:0B:F5:7D:51:16:51:7E:28:37:C3:A2:0F:1D:2F:10:C0:51:A3:B3
DirName:/C=US/ST=California/L=Default City/O=OpenResty/CN=signing-ca-1
serial:03
Authority Information Access:
OCSP - URI:http://127.0.0.1:8888/ocsp?foo=1
Signature Algorithm: sha1WithRSAEncryption
43:77:33:e9:cc:b1:42:35:94:0a:57:a5:dd:94:21:c0:cc:42:
04:81:bd:b2:ac:4d:10:68:f3:fe:33:0a:8e:b9:3e:e9:f2:44:
aa:1c:e7:3e:e8:e0:57:40:41:ef:4a:b1:32:b0:f2:75:7c:aa:
77:d2:64:9d:ba:a1:12:ea:f9:83:31:ba:9f:83:58:1c:38:e9:
d0:a6:dd:04:72:85:d1:2d:c7:3b:b2:71:ef:e4:f6:57:0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MC4wLAYIKwYBBQUHMAGGIGh0dHA6Ly8xMjcuMC4w
LjE6ODg4OC9vY3NwP2Zvbz0xMA0GCSqGSIb3DQEBBQUAA4GBAEN3M+nMsUI1lApX
pd2UIcDMQgSBvbKsTRBo8/4zCo65PunyRKoc5z7o4FdAQe9KsTKw8nV8qnfSZJ26
oRLq+YMxup+DWBw46dCm3QRyhdEtxzuyce/k9lcMarb85RMtvqbB9EtNyGnMfC4l
wY6AnhnDF7Ihp6/oL/HUu4yjOb5J
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 3 (0x3)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-1
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-2
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:d3:24:1c:92:a5:bb:00:d9:b1:fb:2b:1d:7a:32:
a1:6c:49:eb:3c:2d:29:80:d6:65:8b:17:3a:f0:4b:
dc:0c:57:fb:d5:31:68:a5:e4:54:86:55:f9:1b:a8:
d7:7d:32:01:3b:cf:5c:38:2b:f5:bc:d3:8b:c8:b6:
ab:76:65:32:e6:4b:d5:e4:fd:d1:92:c8:33:6a:74:
f3:c7:ec:97:c3:c7:9f:e4:d5:55:75:b8:bd:39:ec:
2d:1f:c6:54:c8:2b:2d:17:e0:05:77:28:44:f7:dd:
e1:6e:f0:59:05:51:f5:b9:b4:fe:be:ad:40:a6:d5:
9a:c1:64:e0:9b:dd:67:e5:f1
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
B3:0B:F5:7D:51:16:51:7E:28:37:C3:A2:0F:1D:2F:10:C0:51:A3:B3
X509v3 Authority Key Identifier:
keyid:D2:30:71:56:50:A6:BC:21:C5:A1:A1:AB:11:A7:08:5B:EB:3A:A4:27
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
0c:61:c0:c7:11:c2:f0:39:f0:76:9d:4f:43:d4:90:54:1f:26:
3d:54:3d:77:5f:c0:b3:4a:c2:1b:b6:18:d2:12:8d:24:4d:76:
f5:07:0b:14:3e:17:2d:42:ee:85:30:db:e3:4d:81:67:59:97:
0a:b3:bb:c5:27:ea:69:c6:ee:99:5c:44:36:53:3e:c4:47:68:
f8:fe:c6:53:38:fb:e7:9a:0c:3c:6c:78:93:29:d2:49:7d:29:
d0:61:6e:81:9b:d6:ec:1a:e2:3e:62:62:41:bc:6d:4d:33:91:
76:20:5e:32:70:08:3e:24:72:fe:b1:8a:83:57:04:19:b5:cb:
99:b7
-----BEGIN CERTIFICATE-----
MIICkDCCAfmgAwIBAgIBAzANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEVMBMGA1UEBxMMRGVmYXVsdCBDaXR5MRIwEAYD
VQQKEwlPcGVuUmVzdHkxFTATBgNVBAMTDHNpZ25pbmctY2EtMTAgFw0xNDEwMTYw
MzI3MDlaGA8yMTE0MDkyMjAzMjcwOVowZDELMAkGA1UEBhMCVVMxEzARBgNVBAgT
CkNhbGlmb3JuaWExFTATBgNVBAcTDERlZmF1bHQgQ2l0eTESMBAGA1UEChMJT3Bl
blJlc3R5MRUwEwYDVQQDEwxzaWduaW5nLWNhLTIwgZ8wDQYJKoZIhvcNAQEBBQAD
gY0AMIGJAoGBANMkHJKluwDZsfsrHXoyoWxJ6zwtKYDWZYsXOvBL3AxX+9UxaKXk
VIZV+Ruo130yATvPXDgr9bzTi8i2q3ZlMuZL1eT90ZLIM2p088fsl8PHn+TVVXW4
vTnsLR/GVMgrLRfgBXcoRPfd4W7wWQVR9bm0/r6tQKbVmsFk4JvdZ+XxAgMBAAGj
UDBOMB0GA1UdDgQWBBSzC/V9URZRfig3w6IPHS8QwFGjszAfBgNVHSMEGDAWgBTS
MHFWUKa8IcWhoasRpwhb6zqkJzAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA
A4GBAAxhwMcRwvA58HadT0PUkFQfJj1UPXdfwLNKwhu2GNISjSRNdvUHCxQ+Fy1C
7oUw2+NNgWdZlwqzu8Un6mnG7plcRDZTPsRHaPj+xlM4++eaDDxseJMp0kl9KdBh
boGb1uwa4j5iYkG8bU0zkXYgXjJwCD4kcv6xioNXBBm1y5m3
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 2 (0x2)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=root-ca
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-1
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:a0:3e:1a:4f:6c:b9:3d:ab:0f:02:de:da:82:92:
ee:a2:69:88:80:ed:f2:b6:98:bc:c6:ee:d3:47:82:
4a:e7:d3:7f:55:68:5c:6d:9e:aa:ba:59:e3:5b:7f:
32:4f:79:44:4a:4f:13:e4:2e:3f:1f:98:10:a4:72:
d5:f0:e7:44:8e:d4:a7:b9:fb:54:be:b6:fa:f7:dc:
9c:29:93:d4:9f:a1:5b:18:6e:68:93:91:1b:8c:a0:
4f:02:52:e9:9d:e8:98:f3:fd:67:da:78:4b:4f:d8:
2d:90:83:5c:0b:e5:fe:48:27:e4:ec:bb:99:26:06:
8e:34:fe:93:e4:d2:fc:97:57
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
D2:30:71:56:50:A6:BC:21:C5:A1:A1:AB:11:A7:08:5B:EB:3A:A4:27
X509v3 Authority Key Identifier:
keyid:1D:2F:09:60:EB:E4:EA:B5:0B:52:A9:5C:5E:09:2B:DD:34:70:CF:BA
X509v3 Basic Constraints:
CA:TRU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cXgkr3TRwz7owDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCm
Fi/8E2dezg55y7CRUpuetZ/h+n149CqT85RiRReHuQpZuaOpdVHK8ARsAdE6qd1m
fSd7Hk9IOiXqpQEy/IdLCNr49WKI6LmUx8vuMwirL1L0ShRPrC2i+N7Jb5W3kSO5
7JWQ3oYh9W8bzxNHd3jdehbpi8zfPUWKdq8V0Zo3og==
-----END CERTIFICATE-----

View file

@ -1,69 +0,0 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4 (0x4)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-2
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=test.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:c7:bd:50:99:71:46:af:93:22:85:ab:74:8b:5b:
19:74:af:3e:ad:d2:e1:17:3e:cb:5b:36:9c:8a:38:
bd:1b:47:2d:8b:92:55:1d:fe:a6:72:92:78:00:de:
30:cb:a3:10:b5:92:aa:b8:e0:7b:44:9a:f5:99:89:
36:f4:84:20:81:e3:5c:76:00:9d:76:e7:b9:41:ab:
74:b6:14:9f:b2:94:b3:b6:48:a8:92:dc:09:e3:3d:
04:e3:5f:0f:5b:50:ad:0c:59:3a:88:06:39:2d:34:
a6:52:2f:58:6f:53:1b:df:9f:98:ea:82:8d:52:60:
b1:ef:6b:e9:f5:ad:29:87:45
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
67:DF:28:25:D1:F8:83:36:28:EE:DB:41:63:E4:E0:3A:32:0D:EA:30
X509v3 Authority Key Identifier:
keyid:B3:0B:F5:7D:51:16:51:7E:28:37:C3:A2:0F:1D:2F:10:C0:51:A3:B3
DirName:/C=US/ST=California/L=Default City/O=OpenResty/CN=signing-ca-1
serial:03
Authority Information Access:
OCSP - URI:http://127.0.0.1:8888/ocsp?foo=1
Signature Algorithm: sha1WithRSAEncryption
37:29:3f:ed:d9:47:9a:51:36:a3:5b:00:85:66:de:51:4d:48:
2d:f8:bc:f1:5e:b4:fd:30:48:f0:25:ee:77:57:9c:f1:4b:0a:
4f:7e:96:1a:f8:48:76:23:46:8d:d6:f2:5e:1e:08:52:12:53:
08:07:9f:75:db:77:22:2e:7e:89:c2:2c:66:85:6b:df:e9:77:
ca:23:6d:9a:af:87:8a:8c:27:37:1e:9e:55:92:8e:8a:a9:93:
24:41:a8:96:01:c0:65:93:8e:3d:7a:6c:bf:ed:c8:2a:f8:26:
cc:00:17:b7:27:ca:85:6c:2e:d5:2a:0a:8d:f3:88:e8:26:48:
e3:e8
-----BEGIN CERTIFICATE-----
MIIDaTCCAtKgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEVMBMGA1UEBxMMRGVmYXVsdCBDaXR5MRIwEAYD
VQQKEwlPcGVuUmVzdHkxFTATBgNVBAMTDHNpZ25pbmctY2EtMjAgFw0xNDEwMTYw
MzI3MDlaGA8yMTE0MDkyMjAzMjcwOVowYDELMAkGA1UEBhMCVVMxEzARBgNVBAgT
CkNhbGlmb3JuaWExFTATBgNVBAcTDERlZmF1bHQgQ2l0eTESMBAGA1UEChMJT3Bl
blJlc3R5MREwDwYDVQQDEwh0ZXN0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEAx71QmXFGr5Mihat0i1sZdK8+rdLhFz7LWzaciji9G0cti5JVHf6mcpJ4
AN4wy6MQtZKquOB7RJr1mYk29IQggeNcdgCddue5Qat0thSfspSztkioktwJ4z0E
418PW1CtDFk6iAY5LTSmUi9Yb1Mb35+Y6oKNUmCx72vp9a0ph0UCAwEAAaOCASsw
ggEnMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVk
IENlcnRpZmljYXRlMB0GA1UdDgQWBBRn3ygl0fiDNiju20Fj5OA6Mg3qMDCBjgYD
VR0jBIGGMIGDgBSzC/V9URZRfig3w6IPHS8QwFGjs6FopGYwZDELMAkGA1UEBhMC
VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFTATBgNVBAcTDERlZmF1bHQgQ2l0eTES
MBAGA1UEChMJT3BlblJlc3R5MRUwEwYDVQQDEwxzaWduaW5nLWNhLTGCAQMwPAYI
KwYBBQUHAQEEMDAuMCwGCCsGAQUFBzABhiBodHRwOi8vMTI3LjAuMC4xOjg4ODgv
b2NzcD9mb289MTANBgkqhkiG9w0BAQUFAAOBgQA3KT/t2UeaUTajWwCFZt5RTUgt
+LzxXrT9MEjwJe53V5zxSwpPfpYa+Eh2I0aN1vJeHghSElMIB59123ciLn6Jwixm
hWvf6XfKI22ar4eKjCc3Hp5Vko6KqZMkQaiWAcBlk449emy/7cgq+CbMABe3J8qF
bC7VKgqN84joJkjj6A==
-----END CERTIFICATE-----

View file

@ -1,183 +0,0 @@
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 4 (0x4)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-2
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=test.com
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:c7:bd:50:99:71:46:af:93:22:85:ab:74:8b:5b:
19:74:af:3e:ad:d2:e1:17:3e:cb:5b:36:9c:8a:38:
bd:1b:47:2d:8b:92:55:1d:fe:a6:72:92:78:00:de:
30:cb:a3:10:b5:92:aa:b8:e0:7b:44:9a:f5:99:89:
36:f4:84:20:81:e3:5c:76:00:9d:76:e7:b9:41:ab:
74:b6:14:9f:b2:94:b3:b6:48:a8:92:dc:09:e3:3d:
04:e3:5f:0f:5b:50:ad:0c:59:3a:88:06:39:2d:34:
a6:52:2f:58:6f:53:1b:df:9f:98:ea:82:8d:52:60:
b1:ef:6b:e9:f5:ad:29:87:45
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Basic Constraints:
CA:FALSE
Netscape Comment:
OpenSSL Generated Certificate
X509v3 Subject Key Identifier:
67:DF:28:25:D1:F8:83:36:28:EE:DB:41:63:E4:E0:3A:32:0D:EA:30
X509v3 Authority Key Identifier:
keyid:B3:0B:F5:7D:51:16:51:7E:28:37:C3:A2:0F:1D:2F:10:C0:51:A3:B3
DirName:/C=US/ST=California/L=Default City/O=OpenResty/CN=signing-ca-1
serial:03
Authority Information Access:
OCSP - URI:http://127.0.0.1:8888/ocsp?foo=1
Signature Algorithm: sha1WithRSAEncryption
37:29:3f:ed:d9:47:9a:51:36:a3:5b:00:85:66:de:51:4d:48:
2d:f8:bc:f1:5e:b4:fd:30:48:f0:25:ee:77:57:9c:f1:4b:0a:
4f:7e:96:1a:f8:48:76:23:46:8d:d6:f2:5e:1e:08:52:12:53:
08:07:9f:75:db:77:22:2e:7e:89:c2:2c:66:85:6b:df:e9:77:
ca:23:6d:9a:af:87:8a:8c:27:37:1e:9e:55:92:8e:8a:a9:93:
24:41:a8:96:01:c0:65:93:8e:3d:7a:6c:bf:ed:c8:2a:f8:26:
cc:00:17:b7:27:ca:85:6c:2e:d5:2a:0a:8d:f3:88:e8:26:48:
e3:e8
-----BEGIN CERTIFICATE-----
MIIDaTCCAtKgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEVMBMGA1UEBxMMRGVmYXVsdCBDaXR5MRIwEAYD
VQQKEwlPcGVuUmVzdHkxFTATBgNVBAMTDHNpZ25pbmctY2EtMjAgFw0xNDEwMTYw
MzI3MDlaGA8yMTE0MDkyMjAzMjcwOVowYDELMAkGA1UEBhMCVVMxEzARBgNVBAgT
CkNhbGlmb3JuaWExFTATBgNVBAcTDERlZmF1bHQgQ2l0eTESMBAGA1UEChMJT3Bl
blJlc3R5MREwDwYDVQQDEwh0ZXN0LmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAw
gYkCgYEAx71QmXFGr5Mihat0i1sZdK8+rdLhFz7LWzaciji9G0cti5JVHf6mcpJ4
AN4wy6MQtZKquOB7RJr1mYk29IQggeNcdgCddue5Qat0thSfspSztkioktwJ4z0E
418PW1CtDFk6iAY5LTSmUi9Yb1Mb35+Y6oKNUmCx72vp9a0ph0UCAwEAAaOCASsw
ggEnMAkGA1UdEwQCMAAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVk
IENlcnRpZmljYXRlMB0GA1UdDgQWBBRn3ygl0fiDNiju20Fj5OA6Mg3qMDCBjgYD
VR0jBIGGMIGDgBSzC/V9URZRfig3w6IPHS8QwFGjs6FopGYwZDELMAkGA1UEBhMC
VVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFTATBgNVBAcTDERlZmF1bHQgQ2l0eTES
MBAGA1UEChMJT3BlblJlc3R5MRUwEwYDVQQDEwxzaWduaW5nLWNhLTGCAQMwPAYI
KwYBBQUHAQEEMDAuMCwGCCsGAQUFBzABhiBodHRwOi8vMTI3LjAuMC4xOjg4ODgv
b2NzcD9mb289MTANBgkqhkiG9w0BAQUFAAOBgQA3KT/t2UeaUTajWwCFZt5RTUgt
+LzxXrT9MEjwJe53V5zxSwpPfpYa+Eh2I0aN1vJeHghSElMIB59123ciLn6Jwixm
hWvf6XfKI22ar4eKjCc3Hp5Vko6KqZMkQaiWAcBlk449emy/7cgq+CbMABe3J8qF
bC7VKgqN84joJkjj6A==
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 2 (0x2)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=root-ca
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-1
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:a0:3e:1a:4f:6c:b9:3d:ab:0f:02:de:da:82:92:
ee:a2:69:88:80:ed:f2:b6:98:bc:c6:ee:d3:47:82:
4a:e7:d3:7f:55:68:5c:6d:9e:aa:ba:59:e3:5b:7f:
32:4f:79:44:4a:4f:13:e4:2e:3f:1f:98:10:a4:72:
d5:f0:e7:44:8e:d4:a7:b9:fb:54:be:b6:fa:f7:dc:
9c:29:93:d4:9f:a1:5b:18:6e:68:93:91:1b:8c:a0:
4f:02:52:e9:9d:e8:98:f3:fd:67:da:78:4b:4f:d8:
2d:90:83:5c:0b:e5:fe:48:27:e4:ec:bb:99:26:06:
8e:34:fe:93:e4:d2:fc:97:57
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
D2:30:71:56:50:A6:BC:21:C5:A1:A1:AB:11:A7:08:5B:EB:3A:A4:27
X509v3 Authority Key Identifier:
keyid:1D:2F:09:60:EB:E4:EA:B5:0B:52:A9:5C:5E:09:2B:DD:34:70:CF:BA
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
a6:16:2f:fc:13:67:5e:ce:0e:79:cb:b0:91:52:9b:9e:b5:9f:
e1:fa:7d:78:f4:2a:93:f3:94:62:45:17:87:b9:0a:59:b9:a3:
a9:75:51:ca:f0:04:6c:01:d1:3a:a9:dd:66:7d:27:7b:1e:4f:
48:3a:25:ea:a5:01:32:fc:87:4b:08:da:f8:f5:62:88:e8:b9:
94:c7:cb:ee:33:08:ab:2f:52:f4:4a:14:4f:ac:2d:a2:f8:de:
c9:6f:95:b7:91:23:b9:ec:95:90:de:86:21:f5:6f:1b:cf:13:
47:77:78:dd:7a:16:e9:8b:cc:df:3d:45:8a:76:af:15:d1:9a:
37:a2
-----BEGIN CERTIFICATE-----
MIICizCCAfSgAwIBAgIBAjANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTEVMBMGA1UEBxMMRGVmYXVsdCBDaXR5MRIwEAYD
VQQKEwlPcGVuUmVzdHkxEDAOBgNVBAMTB3Jvb3QtY2EwIBcNMTQxMDE2MDMyNzA5
WhgPMjExNDA5MjIwMzI3MDlaMGQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxp
Zm9ybmlhMRUwEwYDVQQHEwxEZWZhdWx0IENpdHkxEjAQBgNVBAoTCU9wZW5SZXN0
eTEVMBMGA1UEAxMMc2lnbmluZy1jYS0xMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB
iQKBgQCgPhpPbLk9qw8C3tqCku6iaYiA7fK2mLzG7tNHgkrn039VaFxtnqq6WeNb
fzJPeURKTxPkLj8fmBCkctXw50SO1Ke5+1S+tvr33Jwpk9SfoVsYbmiTkRuMoE8C
Uumd6Jjz/WfaeEtP2C2Qg1wL5f5IJ+Tsu5kmBo40/pPk0vyXVwIDAQABo1AwTjAd
BgNVHQ4EFgQU0jBxVlCmvCHFoaGrEacIW+s6pCcwHwYDVR0jBBgwFoAUHS8JYOvk
6rULUqlcXgkr3TRwz7owDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCm
Fi/8E2dezg55y7CRUpuetZ/h+n149CqT85RiRReHuQpZuaOpdVHK8ARsAdE6qd1m
fSd7Hk9IOiXqpQEy/IdLCNr49WKI6LmUx8vuMwirL1L0ShRPrC2i+N7Jb5W3kSO5
7JWQ3oYh9W8bzxNHd3jdehbpi8zfPUWKdq8V0Zo3og==
-----END CERTIFICATE-----
Certificate:
Data:
Version: 3 (0x2)
Serial Number: 3 (0x3)
Signature Algorithm: sha1WithRSAEncryption
Issuer: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-1
Validity
Not Before: Oct 16 03:27:09 2014 GMT
Not After : Sep 22 03:27:09 2114 GMT
Subject: C=US, ST=California, L=Default City, O=OpenResty, CN=signing-ca-2
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
00:d3:24:1c:92:a5:bb:00:d9:b1:fb:2b:1d:7a:32:
a1:6c:49:eb:3c:2d:29:80:d6:65:8b:17:3a:f0:4b:
dc:0c:57:fb:d5:31:68:a5:e4:54:86:55:f9:1b:a8:
d7:7d:32:01:3b:cf:5c:38:2b:f5:bc:d3:8b:c8:b6:
ab:76:65:32:e6:4b:d5:e4:fd:d1:92:c8:33:6a:74:
f3:c7:ec:97:c3:c7:9f:e4:d5:55:75:b8:bd:39:ec:
2d:1f:c6:54:c8:2b:2d:17:e0:05:77:28:44:f7:dd:
e1:6e:f0:59:05:51:f5:b9:b4:fe:be:ad:40:a6:d5:
9a:c1:64:e0:9b:dd:67:e5:f1
Exponent: 65537 (0x10001)
X509v3 extensions:
X509v3 Subject Key Identifier:
B3:0B:F5:7D:51:16:51:7E:28:37:C3:A2:0F:1D:2F:10:C0:51:A3:B3
X509v3 Authority Key Identifier:
keyid:D2:30:71:56:50:A6:BC:21:C5:A1:A1:AB:11:A7:08:5B:EB:3A:A4:27
X509v3 Basic Constraints:
CA:TRUE
Signature Algorithm: sha1WithRSAEncryption
0c:61:c0:c7:11:c2:f0:39:f0:76:9d:4f:43:d4:90:54:1f:26:
3d:54:3d:77:5f:c0:b3:4a:c2:1b:b6:18:d2:12:8d:24:4d:76:
f5:07:0b:14:3e:17:2d:42:ee:85:30:db:e3:4d:81:67:59:97:
0a:b3:bb:c5:27:ea:69:c6:ee:99:5c:44:36:53:3e:c4:47:68:
f8:fe:c6:53:38:fb:e7:9a:0c:3c:6c:78:93:29:d2:49:7d:29:
d0:61:6e:81:9b:d6:ec:1a:e2:3e:62:62:41:bc:6d:4d:33:91:
76:20:5e:32:70:08:3e:24:72:fe:b1:8a:83:57:04:19:b5:cb:
99:b7
-----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dLP/PaL+v
twnrNa9r7rIwXnDWxYo3KiGpqEfG2WwW+lJsUzZOi9eI9kYPyvFmNFLugZbHMi+h
ICCb8AQB2thON5X4N7FtP5GVfMR9vIkCAwEAAaNTMFEwHQYDVR0OBBYEFDEy866N
WPHPTJKeL/96VYoczkINMB8GA1UdIwQYMBaAFDEy866NWPHPTJKeL/96VYoczkIN
MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggIBAHJgyS6/OyRqzqwd
+6DnntGV+MTo9WBNvNs/fekJghnrr85oG330GasYENQLi0wF20to7FMan2U9kwgV
cbhDwe70JD0jg8htYof/uXOMBVWT4iZ+eXn60mP3iLsSutwt/drXBBzbxMYbUC12
CIiadkV8aMPIN6oGnF7TLF4AvBqYYp2qAVGXr/ZQm3L7NPB0jkSktSe6obnaq1tO
ug18ImhzAqkn1UGnLRiTADOba5HuKtovwWtLblNBODdnv1E7IK1A6jpqwiYjlbU5
4v9ZzFzEJw+GqYHkTRmJGCA2Uw7HNEUFeno1BTp19Ce9fvrkofTWYmLp/NAvEp6E
aFnBdCjY4tWzI2Iig7IjDIM7F6igGODybeN9ijD7oSyEDtNE7ECLSuXhgekiQJ8c
NYALgbbNPxWx8zJcNiYy1NDYdIjO5vYFOpbn+rQObKVCX/X+Al9fT126ciTT1xAF
fZtkGPpp3Wjgws9UDSzetvWHYt0Rs70m351LFPHyR4tQLHoDFqnA2buG/mSvKZ9U
to0JQ/8QPRIYv0FUJcF0+/xQRYrIqvmjiCpfL2hwJyRViq7f8z0/tmMoLxFlPo/k
GC+gvh3WwTB622h9JEqS48lllcYZIQWOX2mbFtUtNFdzUtSRmZMa8RmcYr5So2OH
9QLIIjC6ntPFjWq+uLJAJ8uazRt7
-----END CERTIFICATE-----

Binary file not shown.

View file

@ -1,52 +0,0 @@
-----BEGIN PRIVATE KEY-----
MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDIvMxucwFzFgHZ
bS4So8qjaU4l1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WqcudDnvnwbyj/Q0pS07at3lXKbhQSgI1Tzhg9Pm3BXXj5
mkLdeGG5ocrj1Q9dhtmZgZeHHQIiynZBhjBu1Y+HPef8jXOWLrCOi8EKiWkJ2qG3
V1KFM/95CcDt0mRLykUXEL3IpUst05SFb9XwiLokB7ypeu3NhgNUHjL6G+ubB4ri
TOUjCW4pEoNHjdC22IiqSncwCVhluYSGhr6ktHKehZMhYIXmL1wmSLdhTlsPXCQl
xvYILQ2vJcKIR1BkeYYPD/OQC6zCZlXIErzfgeZiz2+NTudKYpb9VmsQKsO+R8L7
tZ/fNaR0vk8bbimMHgStAV4acVsC/7WxsqOjMJ8VTq1iqhYPl6N7kRdR3H3kSSOm
cN9T3SrOHDVaHbnWgToaOE4mKFjvFSLIOcWgus0iOHWXmY+SLG+Ndag3oVB6R9oB
cAHX19mq99+GhzA8IV4I0En2UCKQhnGPvkM+9mcCDxhRETlwncDjlMGOHpQ65J9r
eReVPIpnDkvHxPGTtsR3ZHTdWTZb+C0W2N3QIlJKrOzxFmfoj++yG3tMX42aDY0g
DVkrXgcKobiWN0AVrJNAwfG7uObKSCFYgz/0RRMCO4cjXRW99nxdjVDZhyc6R0Te
jzuF04okkOLNb25n2hP+yIULrn+6Nv/uHtFI0j0n3hOzcKh//dNbACSAKgkHni9g
JKDFJXgLJxf+Wc3So0DF9gYMKJJ+WbcdVT9gkC7RyQHlC90Pn7kNXzHr0ZawUsNI
ZxSkL4dMhYAfA4lUBJbOkwbSurv97LinOSRffpM0Nmf7VNw/Ue15eg==
-----END RSA PRIVATE KEY-----

View file

@ -1,45 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 3);
#no_diff();
no_long_string();
run_tests();
__DATA__
=== TEST 1: module size
--- config
location = /re {
access_log off;
content_by_lua_block {
local base = require "resty.core.base"
local n = 0
for _, _ in pairs(base) do
n = n + 1
end
ngx.say("base size: ", n)
}
}
--- request
GET /re
--- stap2
global c
probe process("$LIBLUA_PATH").function("rehashtab") {
c++
printf("rehash: %d\n", c)
}
--- response_body
base size: 20
--- no_error_log
[error]

File diff suppressed because it is too large Load diff

View file

@ -1,225 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 5 - 2);
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: string
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.decode_base64("aGVsbG8=")
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body
hello
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 2: set base64 (nil)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.decode_base64("")
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body eval: "\n"
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 3: set base64 (number)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.decode_base64("My4xNA==")
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body
3.14
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 4: set base64 (boolean)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.decode_base64("dHJ1ZQ==")
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body
true
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 5: string (buf size just smaller than 4096)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.decode_base64(string.rep("a", 5460))
end
if not s then
ngx.say("bad base64 string")
else
ngx.say(string.len(s))
end
}
}
--- request
GET /base64
--- response_body
4095
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 6: string (buf size just a bit bigger than 4096)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.decode_base64(string.rep("a", 5462))
end
if not s then
ngx.say("bad base64 string")
else
ngx.say(string.len(s))
end
}
}
--- request
GET /base64
--- response_body
4096
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 7: decode_base64url
--- config
location = /t {
content_by_lua_block {
local enc = require("ngx.base64")
local function to_hex(str)
return (str:gsub('.', function(c)
return string.format('%02x', string.byte(c))
end))
end
-- RFC 4648 test vectors
ngx.say("decode_base64url(\"\") = \"", enc.decode_base64url(""), "\"")
ngx.say("decode_base64url(\"Zg\") = \"", enc.decode_base64url("Zg"), "\"")
ngx.say("decode_base64url(\"Zm8\") = \"", enc.decode_base64url("Zm8"), "\"")
ngx.say("decode_base64url(\"Zm9v\") = \"", enc.decode_base64url("Zm9v"), "\"")
ngx.say("decode_base64url(\"Zm9vYg\") = \"", enc.decode_base64url("Zm9vYg"), "\"")
ngx.say("decode_base64url(\"Zm9vYmE\") = \"", enc.decode_base64url("Zm9vYmE"), "\"")
ngx.say("decode_base64url(\"Zm9vYmFy\") = \"", enc.decode_base64url("Zm9vYmFy"), "\"")
ngx.say("decode_base64url(\"_w\") = \"\\x", to_hex(enc.decode_base64url("_w")), "\"")
ngx.say("decode_base64url(\"YQBi\") = \"\\x", to_hex(enc.decode_base64url("YQBi")), "\"")
}
}
--- request
GET /t
--- response_body
decode_base64url("") = ""
decode_base64url("Zg") = "f"
decode_base64url("Zm8") = "fo"
decode_base64url("Zm9v") = "foo"
decode_base64url("Zm9vYg") = "foob"
decode_base64url("Zm9vYmE") = "fooba"
decode_base64url("Zm9vYmFy") = "foobar"
decode_base64url("_w") = "\xff"
decode_base64url("YQBi") = "\x610062"
--- no_error_log
[error]
[crit]
=== TEST 8: decode_base64url with invalid input
--- config
location = /t {
content_by_lua_block {
local enc = require("ngx.base64")
local res, err = enc.decode_base64url(" ")
ngx.say("decode_base64url returned: ", res, ", ", err)
}
}
--- request
GET /t
--- response_body
decode_base64url returned: nil, invalid input
--- no_error_log
[error]
-- NYI:

View file

@ -1,236 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 5 - 1);
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: set base64 (string)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.encode_base64("hello")
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body
aGVsbG8=
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 2: set base64 (nil)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.encode_base64(nil)
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body eval: "\n"
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 3: set base64 (number)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.encode_base64(3.14)
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body
My4xNA==
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 4: set base64 (boolean)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.encode_base64(true)
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body
dHJ1ZQ==
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 5: set base64 (buf is a little larger than 4096)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.encode_base64(string.rep("a", 3073))
end
ngx.say(string.len(s))
}
}
--- request
GET /base64
--- response_body
4100
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 6: set base64 (buf is just 4096)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.encode_base64(string.rep("a", 3071))
end
ngx.say(string.len(s))
}
}
--- request
GET /base64
--- response_body
4096
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 7: set base64 (number) without padding (explicitly specified)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 200 do
s = ngx.encode_base64(3.14, true)
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body
My4xNA
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 8: set base64 (number) with padding (explicitly specified)
--- config
location = /base64 {
content_by_lua_block {
local s
for i = 1, 200 do
s = ngx.encode_base64(3.14, false)
end
ngx.say(s)
}
}
--- request
GET /base64
--- response_body
My4xNA==
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
-- NYI:
=== TEST 9: encode_base64url
--- config
location = /t {
content_by_lua_block {
local enc = require("ngx.base64")
-- RFC 4648 test vectors
ngx.say("encode_base64url(\"\") = \"", enc.encode_base64url(""), "\"")
ngx.say("encode_base64url(\"f\") = \"", enc.encode_base64url("f"), "\"")
ngx.say("encode_base64url(\"fo\") = \"", enc.encode_base64url("fo"), "\"")
ngx.say("encode_base64url(\"foo\") = \"", enc.encode_base64url("foo"), "\"")
ngx.say("encode_base64url(\"foob\") = \"", enc.encode_base64url("foob"), "\"")
ngx.say("encode_base64url(\"fooba\") = \"", enc.encode_base64url("fooba"), "\"")
ngx.say("encode_base64url(\"foobar\") = \"", enc.encode_base64url("foobar"), "\"")
ngx.say("encode_base64url(\"\\xff\") = \"", enc.encode_base64url("\xff"), "\"")
ngx.say("encode_base64url(\"a\\0b\") = \"", enc.encode_base64url("a\0b"), "\"")
}
}
--- request
GET /t
--- response_body
encode_base64url("") = ""
encode_base64url("f") = "Zg"
encode_base64url("fo") = "Zm8"
encode_base64url("foo") = "Zm9v"
encode_base64url("foob") = "Zm9vYg"
encode_base64url("fooba") = "Zm9vYmE"
encode_base64url("foobar") = "Zm9vYmFy"
encode_base64url("\xff") = "_w"
encode_base64url("a\0b") = "YQBi"
--- no_error_log
[error]
-- NYI:

View file

@ -1,218 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
log_level('error');
repeat_each(1);
plan tests => repeat_each() * (blocks() * 2 + 5);
add_block_preprocessor(sub {
my $block = shift;
my $http_config = $block->http_config || '';
my $init_by_lua_block = $block->init_by_lua_block || '';
$http_config .= <<_EOC_;
lua_package_path '$t::TestCore::lua_package_path';
init_by_lua_block {
$t::TestCore::init_by_lua_block
$init_by_lua_block
}
_EOC_
$block->set_value("http_config", $http_config);
});
no_long_string();
run_tests();
__DATA__
=== TEST 1: errlog.raw_log with bad log level (ngx.ERROR, -1)
--- config
location /log {
content_by_lua_block {
local errlog = require "ngx.errlog"
errlog.raw_log(ngx.ERROR, "hello, log")
ngx.say("done")
}
}
--- request
GET /log
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
bad log level
=== TEST 2: errlog.raw_log with bad levels (9)
--- config
location /log {
content_by_lua_block {
local errlog = require "ngx.errlog"
errlog.raw_log(9, "hello, log")
ngx.say("done")
}
}
--- request
GET /log
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
bad log level
=== TEST 3: errlog.raw_log with bad log message
--- config
location /log {
content_by_lua_block {
local errlog = require "ngx.errlog"
errlog.raw_log(ngx.ERR, 123)
ngx.say("done")
}
}
--- request
GET /log
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
bad argument #2 to 'raw_log' (must be a string)
=== TEST 4: errlog.raw_log test log-level ERR
--- config
location /log {
content_by_lua_block {
local errlog = require "ngx.errlog"
errlog.raw_log(ngx.ERR, "hello world")
}
}
--- request
GET /log
--- error_log eval
qr/\[error\] \S+: \S+ hello world/
=== TEST 5: errlog.raw_log JITs
--- init_by_lua_block
-- local verbose = true
local verbose = false
local outfile = errlog_file
-- local outfile = "/tmp/v.log"
if verbose then
local dump = require "jit.dump"
dump.on(nil, outfile)
else
local v = require "jit.v"
v.on(outfile)
end
require "resty.core"
-- jit.opt.start("hotloop=1")
-- jit.opt.start("loopunroll=1000000")
-- jit.off()
--- config
location /log {
content_by_lua_block {
local errlog = require "ngx.errlog"
for i = 1, 100 do
errlog.raw_log(ngx.ERR, "hello world")
end
}
}
--- request
GET /log
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):4 loop\]/
=== TEST 6: errlog.raw_log in init_by_lua
--- init_by_lua_block
local errlog = require "ngx.errlog"
errlog.raw_log(ngx.ERR, "hello world from init_by_lua")
--- config
location /t {
return 200;
}
--- request
GET /t
--- grep_error_log chop
hello world from init_by_lua
--- grep_error_log_out eval
["hello world from init_by_lua\n", ""]
=== TEST 7: errlog.raw_log in init_worker_by_lua
--- http_config
init_worker_by_lua_block {
local errlog = require "ngx.errlog"
errlog.raw_log(ngx.ERR, "hello world from init_worker_by_lua")
}
--- config
location /t {
return 200;
}
--- request
GET /t
--- grep_error_log chop
hello world from init_worker_by_lua
--- grep_error_log_out eval
["hello world from init_worker_by_lua\n", ""]
=== TEST 8: errlog.raw_log with \0 in the log message
--- config
location /log {
content_by_lua_block {
local errlog = require "ngx.errlog"
errlog.raw_log(ngx.ERR, "hello\0world")
ngx.say("ok")
}
}
--- request
GET /log
--- response_body
ok
--- error_log eval
"hello\0world, client: "
=== TEST 9: errlog.raw_log is captured by errlog.get_logs()
--- http_config
lua_capture_error_log 4k;
--- config
location /log {
content_by_lua_block {
local errlog = require "ngx.errlog"
errlog.raw_log(ngx.ERR, "hello from raw_log()")
local res, err = errlog.get_logs()
if not res then
error("FAILED " .. err)
end
ngx.say("log lines: ", #res / 3)
}
}
--- request
GET /log
--- response_body
log lines: 1
--- error_log eval
qr/\[error\] .*? hello from raw_log\(\)/
--- skip_nginx: 3: <1.11.2

File diff suppressed because it is too large Load diff

View file

@ -1,171 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
log_level('warn');
repeat_each(120);
#repeat_each(2);
plan tests => repeat_each() * (blocks() * 5);
add_block_preprocessor(sub {
my $block = shift;
my $http_config = $block->http_config || '';
my $init_by_lua_block = $block->init_by_lua_block || '';
$http_config .= <<_EOC_;
lua_package_path '\$prefix/html/?.lua;$t::TestCore::lua_package_path';
init_by_lua_block {
$t::TestCore::init_by_lua_block
$init_by_lua_block
}
_EOC_
$block->set_value("http_config", $http_config);
});
#no_diff();
#no_long_string();
run_tests();
__DATA__
=== TEST 1: sanity
--- config
location = /t {
content_by_lua_block {
ngx.exit(403)
}
}
--- request
GET /t
--- response_body_like: 403 Forbidden
--- error_code: 403
--- no_error_log eval
["[error]",
qr/ -- NYI: (?!FastFunc coroutine.yield)/,
" bad argument"]
=== TEST 2: call ngx.exit() from a custom lua module
--- config
location = /t {
content_by_lua_block {
local foo = require "foo"
foo.go()
}
}
--- user_files
>>> foo.lua
local exit = ngx.exit
local function go()
exit(403)
return
end
return { go = go }
--- request
GET /t
--- response_body_like: 403 Forbidden
--- error_code: 403
--- no_error_log eval
["[error]",
qr/ -- NYI: (?!FastFunc coroutine.yield)/,
" bad argument"]
=== TEST 3: accepts NGX_OK
--- config
location = /t {
content_by_lua_block {
ngx.exit(ngx.OK)
}
}
--- request
GET /t
--- response_body
--- no_error_log eval
["[error]",
qr/ -- NYI: (?!FastFunc coroutine.yield)/,
" bad argument"]
=== TEST 4: accepts NGX_ERROR
--- config
location = /t {
content_by_lua_block {
ngx.exit(ngx.ERROR)
}
}
--- request
GET /t
--- error_code:
--- response_body
--- no_error_log eval
["[error]",
qr/ -- NYI: (?!FastFunc coroutine.yield)/,
" bad argument"]
=== TEST 5: accepts NGX_DECLINED
--- config
location = /t {
content_by_lua_block {
ngx.exit(ngx.DECLINED)
}
}
--- request
GET /t
--- error_code:
--- response_body
--- no_error_log eval
["[error]",
qr/ -- NYI: (?!FastFunc coroutine.yield)/,
" bad argument"]
=== TEST 6: refuses NGX_AGAIN
--- config
location = /t {
content_by_lua_block {
ngx.exit(ngx.AGAIN)
}
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? bad argument to 'ngx.exit': does not accept NGX_AGAIN or NGX_DONE/
--- no_error_log eval
qr/ -- NYI: (?!FastFunc coroutine.yield)/
[crit]
=== TEST 7: refuses NGX_DONE
--- config
location = /t {
content_by_lua_block {
ngx.exit(ngx.DONE)
}
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? bad argument to 'ngx.exit': does not accept NGX_AGAIN or NGX_DONE/
--- no_error_log eval
qr/ -- NYI: (?!FastFunc coroutine.yield)/
[crit]

View file

@ -1,57 +0,0 @@
local _M = {}
local run_lua_with_graceful_shutdown
do
local function set_up_ngx_conf(dir, code)
local conf = [[
error_log stderr error;
master_process off;
daemon off;
events {
worker_connections 64;
}
http {
init_worker_by_lua_block {
ngx.timer.at(0, function ()
]] .. code .. [[
require("ngx.process").signal_graceful_exit()
end)
}
}
]]
assert(os.execute("mkdir -p " .. dir .. "/logs"))
local conf_file = dir .. "/nginx.conf"
local f, err = io.open(conf_file, "w")
if not f then
ngx.log(ngx.ERR, err)
return
end
assert(f:write(conf))
f:close()
return conf_file
end
local function get_ngx_bin_path()
local ffi = require "ffi"
ffi.cdef[[char **ngx_argv;]]
return ffi.string(ffi.C.ngx_argv[0])
end
function run_lua_with_graceful_shutdown(dir, code)
local ngx_pipe = require "ngx.pipe"
local conf_file = set_up_ngx_conf(dir, code)
local nginx = get_ngx_bin_path()
local cmd = nginx .. " -p " .. dir .. " -c " .. conf_file
return ngx_pipe.spawn(cmd)
end
end
_M.run_lua_with_graceful_shutdown = run_lua_with_graceful_shutdown
return _M

View file

@ -1,57 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
#master_on();
repeat_each(2);
plan tests => repeat_each() * (blocks() * 6);
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: sanity
--- config
location = /t {
content_by_lua_block {
local process = require "ngx.process"
local v
local get_pid = process.get_master_pid
for i = 1, 400 do
v = get_pid()
end
local f = assert(io.open(ngx.config.prefix() .. "/logs/nginx.pid", "r"))
local str = assert(f:read("*l"))
local expected = str
if tostring(v) == expected then
ngx.say("ok")
else
ngx.say("expected: ", expected)
end
f:close()
ngx.say("got: ", v, " (", type(v), ")")
}
}
--- request
GET /t
--- response_body_like chop
\Aok
got: \d+ \(number\)
\z
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]/
--- no_error_log
[error]
-- NYI:
stitch
--- skip_nginx: 6: < 1.13.8

View file

@ -1,57 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
master_on();
repeat_each(2);
plan tests => repeat_each() * (blocks() * 6);
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: sanity
--- config
location = /t {
content_by_lua_block {
local process = require "ngx.process"
local v
local get_pid = process.get_master_pid
for i = 1, 400 do
v = get_pid()
end
local f = assert(io.open(ngx.config.prefix() .. "/logs/nginx.pid", "r"))
local str = assert(f:read("*l"))
local expected = str
if tostring(v) == expected then
ngx.say("ok")
else
ngx.say("expected: ", expected)
end
f:close()
ngx.say("got: ", v, " (", type(v), ")")
}
}
--- request
GET /t
--- response_body_like chop
\Aok
got: \d+ \(number\)
\z
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]/
--- no_error_log
[error]
-- NYI:
stitch
--- skip_nginx: 6: < 1.13.8

View file

@ -1,104 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 4);
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: set md5_bin (string)
--- config
location = /md5_bin {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.md5_bin("hello")
end
ngx.say(string.len(s))
}
}
--- request
GET /md5_bin
--- response_body
16
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
=== TEST 2: set md5_bin (nil)
--- config
location = /md5_bin {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.md5_bin(nil)
end
ngx.say(string.len(s))
}
}
--- request
GET /md5_bin
--- response_body
16
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
=== TEST 3: set md5_bin (number)
--- config
location = /md5_bin {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.md5_bin(3.14)
end
ngx.say(string.len(s))
}
}
--- request
GET /md5_bin
--- response_body
16
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
=== TEST 4: set md5_bin (boolean)
--- config
location = /md5_bin {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.md5_bin(true)
end
ngx.say(string.len(s))
}
}
--- request
GET /md5_bin
--- response_body
16
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]

View file

@ -1,104 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 4);
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: set md5 hello
--- config
location = /md5 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.md5("hello")
end
ngx.say(s)
}
}
--- request
GET /md5
--- response_body
5d41402abc4b2a76b9719d911017c592
--- error_log eval
qr/\[TRACE\s+1 content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
=== TEST 2: nil string to ngx.md5
--- config
location = /md5 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.md5(nil)
end
ngx.say(s)
}
}
--- request
GET /md5
--- response_body
d41d8cd98f00b204e9800998ecf8427e
--- error_log eval
qr/\[TRACE\s+1 content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
=== TEST 3: empty string to ngx.md5
--- config
location /md5 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.md5("")
end
ngx.say(s)
}
}
--- request
GET /md5
--- response_body
d41d8cd98f00b204e9800998ecf8427e
--- error_log eval
qr/\[TRACE\s+1 content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]
=== TEST 4: number to ngx.md5
--- config
location /md5 {
content_by_lua_block {
local s
for i = 1, 100 do
s = ngx.md5(3.14)
end
ngx.say(s)
}
}
--- request
GET /md5
--- response_body
4beed3b9c4a886067de0e3a094246f78
--- error_log eval
qr/\[TRACE\s+1 content_by_lua\(nginx\.conf:\d+\):3 loop\]/
--- no_error_log
[error]

View file

@ -1,224 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
log_level('warn');
#repeat_each(120);
repeat_each(2);
plan tests => repeat_each() * (blocks() * 6);
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: ngx.is_subrequest
--- config
location = /t {
return 201;
header_filter_by_lua_block {
local rc
for i = 1, 100 do
rc = ngx.is_subrequest
end
ngx.log(ngx.WARN, "is subrequest: ", rc)
}
}
--- request
GET /t
--- response_body
--- error_code: 201
--- no_error_log
[error]
bad argument
--- error_log eval
["is subrequest: false,",
qr/\[TRACE\s+\d+\s+header_filter_by_lua\(nginx.conf:58\):3 loop\]/
]
=== TEST 2: ngx.headers_sent (false)
--- config
location = /t {
content_by_lua_block {
local rc
for i = 1, 100 do
rc = ngx.headers_sent
end
ngx.say("headers sent: ", rc)
}
}
--- request
GET /t
--- response_body
headers sent: false
--- no_error_log
[error]
-- NYI:
bad argument
--- error_log eval
qr/\[TRACE\s+\d+\s+content_by_lua\(nginx\.conf:\d+\):3 loop\]/
=== TEST 3: ngx.headers_sent (true)
--- config
location = /t {
content_by_lua_block {
ngx.send_headers()
local rc
for i = 1, 100 do
rc = ngx.headers_sent
end
ngx.say("headers sent: ", rc)
}
}
--- request
GET /t
--- response_body
headers sent: true
--- no_error_log
[error]
-- NYI:
bad argument
--- error_log eval
qr/\[TRACE\s+\d+\s+content_by_lua\(nginx\.conf:\d+\):4 loop\]/
=== TEST 4: base.check_subsystem
--- config
location = /t {
content_by_lua_block {
local base = require "resty.core.base"
base.allows_subsystem('http', 'stream')
base.allows_subsystem('http')
ngx.say("ok")
}
}
--- request
GET /t
--- response_body
ok
--- no_error_log
[error]
[crit]
-- NYI:
bad argument
=== TEST 5: base.check_subsystem with non-http subsystem
--- config
location = /t {
content_by_lua_block {
local base = require "resty.core.base"
base.allows_subsystem('stream')
ngx.say("ok")
}
}
--- request
GET /t
--- error_code: 500
--- no_error_log
[alert]
[crit]
-- NYI:
bad argument
--- error_log
unsupported subsystem: http
=== TEST 6: not internal request
--- http_config eval: $::HttpConfig
--- config
location /test {
rewrite ^/test$ /lua last;
}
location /lua {
content_by_lua_block {
if ngx.req.is_internal() then
ngx.say("internal")
else
ngx.say("not internal")
end
}
}
--- request
GET /lua
--- response_body
not internal
--- no_error_log
[error]
[alert]
[crit]
-- NYI:
=== TEST 7: internal request
--- http_config eval: $::HttpConfig
--- config
location /test {
rewrite ^/test$ /lua last;
}
location /lua {
content_by_lua_block {
if ngx.req.is_internal() then
ngx.say("internal")
else
ngx.say("not internal")
end
}
}
--- request
GET /test
--- response_body
internal
--- no_error_log
[error]
[alert]
[crit]
-- NYI:
=== TEST 8: bad context
--- http_config eval: $::HttpConfig
--- config
location /lua {
content_by_lua_block {
local function test()
local ok, err = pcall(ngx.req.is_internal)
package.loaded.bad_context = {ok, err}
end
ngx.timer.at(0, test)
ngx.sleep(0.02)
local ctx = package.loaded.bad_context
ngx.say(ctx[1])
local i = string.find(ctx[2], "API disabled in the current context")
ngx.say(i > 1)
}
}
--- request
GET /lua
--- response_body
false
true
--- no_error_log
[error]
[alert]
[crit]
-- NYI:

View file

@ -1,262 +0,0 @@
use lib '.';
use t::TestCore;
repeat_each(2);
plan tests => repeat_each() * (blocks() * 5 + 4);
add_block_preprocessor(sub {
my $block = shift;
my $http_config = $block->http_config || '';
$http_config .= <<_EOC_;
$t::TestCore::HttpConfig
_EOC_
$block->set_value("http_config", $http_config);
if (!defined $block->error_log) {
my $no_error_log = <<_EOC_;
[error]
[alert]
[emerg]
-- NYI:
stitch
_EOC_
$block->set_value("no_error_log", $no_error_log);
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
});
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: sanity
--- config
location /t {
content_by_lua_block {
local s = ndk.set_var.set_escape_uri(" :")
local r = ndk.set_var.set_unescape_uri("a%20b")
ngx.say(s)
ngx.say(r)
local set_escape_uri = ndk.set_var.set_escape_uri
local set_unescape_uri = ndk.set_var.set_unescape_uri
ngx.say(set_escape_uri(" :"))
ngx.say(set_unescape_uri("a%20b"))
local res
for i = 1, $TEST_NGINX_HOTLOOP * 10 do
res = set_escape_uri(" :")
end
for i = 1, $TEST_NGINX_HOTLOOP * 10 do
res = set_unescape_uri("a%20b")
end
}
}
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):13 loop\]/,
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):17 loop\]/
--- no_error_log
[error]
[alert]
[emerg]
-- NYI:
stitch
--- response_body
%20%3A
a b
%20%3A
a b
=== TEST 2: directive not found
--- config
location /t {
content_by_lua_block {
local s = ndk.set_var.set_escape_uri_blah_blah(" :")
ngx.say(s)
}
}
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
ndk.set_var: directive "set_escape_uri_blah_blah" not found or does not use ndk_set_var_value
=== TEST 3: ndk.set_var initialize ngx_http_variable_value_t variable properly
--- config
location /t {
content_by_lua_block {
local version = '2011.10.13+0000'
local e_version = ndk.set_var.set_encode_base32(version)
local s_version= ndk.set_var.set_quote_sql_str(version)
ngx.say(e_version)
ngx.say(s_version)
}
}
--- response_body
68o32c9e64o2sc9j5co30c1g
'2011.10.13+0000'
=== TEST 4: set directive not allowed
--- config
location /t {
content_by_lua_block {
ndk.set_var.set_escape_uri = "hack it"
}
}
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
not allowed
=== TEST 5: call directive failed
--- config
location /t {
content_by_lua_block {
ndk.set_var.set_decode_hex('a')
}
}
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
calling directive set_decode_hex failed with code -1
=== TEST 6: convert directive type to string
--- config
location /t {
content_by_lua_block {
ndk.set_var[1]()
}
}
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
ndk.set_var: directive "1" not found or does not use ndk_set_var_value
=== TEST 7: convert directive argument to string
--- config
location /t {
content_by_lua_block {
local s = ndk.set_var.set_escape_uri(1)
ngx.say(s)
}
}
--- response_body
1
=== TEST 8: call in set_by_lua
--- config
location /t {
set_by_lua_block $s {
return ndk.set_var.set_escape_uri(" :")
}
echo $s;
}
--- response_body
%20%3A
=== TEST 9: call in timer
--- config
location /t {
content_by_lua_block {
ngx.timer.at(0, function()
local s = ndk.set_var.set_escape_uri(" :")
ngx.log(ngx.WARN, "s = ", s)
end)
ngx.sleep(0.01)
}
}
--- error_log
s = %20%3A
--- no_error_log
[error]
=== TEST 10: call in header_filter_by_lua
--- config
location /t {
content_by_lua_block {
ngx.send_headers()
ngx.say(package.loaded.s)
}
header_filter_by_lua_block {
package.loaded.s = ndk.set_var.set_escape_uri(" :")
}
}
--- response_body
%20%3A
=== TEST 11: call in log_by_lua
--- config
location /t {
echo ok;
log_by_lua_block {
local s = ndk.set_var.set_escape_uri(" :")
ngx.log(ngx.WARN, "s = ", s)
}
}
--- response_body
ok
--- error_log
s = %20%3A
--- no_error_log
[error]
=== TEST 12: call in init_worker_by_lua
--- http_config
init_worker_by_lua_block {
package.loaded.s = ndk.set_var.set_escape_uri(" :")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.s)
}
}
--- response_body
%20%3A
=== TEST 13: cache the function in init_worker_by_lua and call in other phases
--- http_config
init_worker_by_lua_block {
package.loaded.set_escape_uri = ndk.set_var.set_escape_uri
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.set_escape_uri(" :"))
}
}
--- response_body
%20%3A

View file

@ -1,317 +0,0 @@
use lib '.';
use t::TestCore;
repeat_each(2);
plan tests => repeat_each() * (blocks() * 3);
add_block_preprocessor(sub {
my $block = shift;
if (!defined $block->error_log) {
$block->set_value("no_error_log", "[error]");
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
});
no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: ngx_req.add_header (jitted)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
for i = 1, $TEST_NGINX_HOTLOOP * 20 do
ngx_req.add_header("Foo", "bar")
end
}
}
--- error_log eval
qr/\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):4 loop\]/
--- no_error_log
[error]
=== TEST 2: ngx_req.add_header (single value)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
ngx.req.set_header("Foo", "bar")
ngx_req.add_header("Foo", "baz")
ngx_req.add_header("Foo", 2)
ngx.say("Foo: ", table.concat(ngx.req.get_headers()["Foo"], ", "))
}
}
--- response_body
Foo: bar, baz, 2
=== TEST 3: ngx_req.add_header (empty single value)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
ngx.req.set_header("Foo", "bar")
ngx_req.add_header("Foo", "")
ngx.say("Foo: [", table.concat(ngx.req.get_headers()["Foo"], ", "), ']')
}
}
--- response_body
Foo: [bar, ]
=== TEST 4: ngx_req.add_header (non-string single value)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
ngx.req.set_header("Foo", "bar")
ngx_req.add_header("Foo", 123)
ngx.say("Foo: [", table.concat(ngx.req.get_headers()["Foo"], ", "), ']')
}
}
--- response_body
Foo: [bar, 123]
=== TEST 5: ngx_req.add_header (non-string header name)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
ngx_req.add_header(123, 456)
ngx_req.add_header(123, 789)
ngx.say("123: [", table.concat(ngx.req.get_headers()[123], ", "), ']')
}
}
--- response_body
123: [456, 789]
=== TEST 6: ngx_req.add_header (multiple values)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
ngx.req.set_header("Foo", "bar")
ngx_req.add_header("Foo", { "baz", 123 })
ngx.say("Foo: ", table.concat(ngx.req.get_headers()["Foo"], ", "))
}
}
--- response_body
Foo: bar, baz, 123
=== TEST 7: ngx_req.add_header (override builtin header)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
ngx_req.add_header("User-Agent", "Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0")
ngx.say("UA: ", ngx.var.http_user_agent)
}
}
--- response_body
UA: Mozilla/5.0 (Android; Mobile; rv:13.0) Gecko/13.0 Firefox/13.0
=== TEST 8: ngx_req.add_header (added header is inherited by subrequests)
--- config
location = /sub {
content_by_lua_block {
ngx.say("Foo: ", table.concat(ngx.req.get_headers()["Foo"], ", "))
}
}
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
ngx.req.set_header("Foo", "bar")
ngx_req.add_header("Foo", {"baz", 2})
local res = ngx.location.capture("/sub")
ngx.print(res.body)
}
}
--- response_body
Foo: bar, baz, 2
=== TEST 9: ngx_req.add_header (invalid context)
--- http_config
init_worker_by_lua_block {
local ngx_req = require "ngx.req"
ngx_req.add_header("Foo", "baz")
}
--- config
location /t {
return 200;
}
--- response_body
--- error_log
API disabled in the current context
=== TEST 10: ngx_req.add_header (header names edge-cases)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
local function check_invalid_header_name(header_name)
local ok, err = pcall(ngx_req.add_header, header_name, "bar")
if not ok then
ngx.say(err)
else
ngx.say("ok")
end
end
check_invalid_header_name()
check_invalid_header_name("")
check_invalid_header_name({})
}
}
--- response_body
bad 'name' argument: string expected, got nil
ok
ok
=== TEST 11: ngx_req.add_header (invalid header values)
--- config
location = /t {
content_by_lua_block {
local ngx_req = require "ngx.req"
local function check_invalid_header_value(...)
local ok, err = pcall(ngx_req.add_header, "Foo", ...)
if not ok then
ngx.say(err)
else
ngx.say("ok")
end
end
check_invalid_header_value()
check_invalid_header_value(nil)
check_invalid_header_value({})
}
}
--- response_body
bad 'value' argument: string or table expected, got nil
bad 'value' argument: string or table expected, got nil
bad 'value' argument: non-empty table expected
=== TEST 12: ngx_req.add_header (header name with control characters)
--- config
location /bar {
access_by_lua_block {
local ngx_req = require "ngx.req"
ngx_req.add_header("header\r\nabc", "value")
}
proxy_pass http://127.0.0.1:$server_port/foo;
}
location = /foo {
echo $echo_client_request_headers;
}
--- request
GET /bar
--- response_body_like chomp
\bheader%0D%0Aabc: value\r\n
=== TEST 13: ngx_req.add_header (header value with control characters)
--- config
location /bar {
access_by_lua_block {
local ngx_req = require "ngx.req"
ngx_req.add_header("header", "value\r\nabc")
}
proxy_pass http://127.0.0.1:$server_port/foo;
}
location = /foo {
echo $echo_client_request_headers;
}
--- request
GET /bar
--- response_body_like chomp
\bheader: value%0D%0Aabc\r\n
=== TEST 14: ngx_req.add_header (header name with Chinese characters)
--- config
location /bar {
access_by_lua_block {
local ngx_req = require "ngx.req"
ngx_req.add_header("header中文", "value")
}
proxy_pass http://127.0.0.1:$server_port/foo;
}
location = /foo {
echo $echo_client_request_headers;
}
--- request
GET /bar
--- response_body_like chomp
\bheader%E4%B8%AD%E6%96%87: value
=== TEST 15: ngx_req.add_header (header value with Chinese characters)
--- config
location /bar {
access_by_lua_block {
local ngx_req = require "ngx.req"
ngx_req.add_header("header", "value中文")
}
proxy_pass http://127.0.0.1:$server_port/foo;
}
location = /foo {
echo $echo_client_request_headers;
}
--- request
GET /bar
--- response_body_like chomp
\bheader: value中文

View file

@ -1,186 +0,0 @@
use lib '.';
use t::TestCore;
repeat_each(2);
plan tests => repeat_each() * (blocks() * 3 + 4);
add_block_preprocessor(sub {
my $block = shift;
if (!defined $block->error_log) {
$block->set_value("no_error_log", "[error]");
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
});
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: ngx.resp.add_header (single value)
--- config
location = /t {
set $foo hello;
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx_resp.add_header("Foo", "bar")
ngx_resp.add_header("Foo", 2)
ngx.say("Foo: ", table.concat(ngx.header["Foo"], ", "))
}
}
--- response_body
Foo: bar, 2
=== TEST 2: ngx.resp.add_header (nil)
--- config
location = /t {
content_by_lua_block {
local ngx_resp = require "ngx.resp"
local ok, err = pcall(ngx_resp.add_header, "Foo")
if not ok then
ngx.say(err)
else
ngx.say('ok')
end
}
}
--- response_body
invalid header value
=== TEST 3: ngx.resp.add_header (multi-value)
--- config
location = /t {
set $foo hello;
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx_resp.add_header('Foo', {'bar', 'baz'})
local v = ngx.header["Foo"]
ngx.say("Foo: ", table.concat(ngx.header["Foo"], ", "))
}
}
--- response_body
Foo: bar, baz
=== TEST 4: ngx.resp.add_header (append header)
--- config
location = /t {
set $foo hello;
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx.header["fruit"] = "apple"
ngx_resp.add_header("fruit", "banana")
ngx_resp.add_header("fruit", "cherry")
ngx.say("fruit: ", table.concat(ngx.header["fruit"], ", "))
}
}
--- response_body
fruit: apple, banana, cherry
=== TEST 5: ngx.resp.add_header (override builtin header)
--- config
location = /t {
set $foo hello;
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx_resp.add_header("Date", "now")
ngx.say("Date: ", ngx.header["Date"])
}
}
--- response_body
Date: now
=== TEST 6: ngx.resp.add_header (empty table)
--- config
location = /t {
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx.header["Foo"] = "aaa"
local ok, err = pcall(ngx_resp.add_header, "Foo", {})
if not ok then
ngx.say(err)
else
ngx.say("Foo: ", ngx.header["Foo"])
end
}
}
--- response_body
Foo: aaa
=== TEST 7: ngx.resp.add_header (header name with control characters)
--- config
location = /t {
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx_resp.add_header("head\r\n", "value")
ngx.say("OK")
}
}
--- response_body
OK
--- response_headers
head%0D%0A: value
=== TEST 8: ngx.resp.add_header (header value with control characters)
--- config
location = /t {
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx_resp.add_header("head", "value\r\n")
ngx.say("OK")
}
}
--- response_body
OK
--- response_headers
head: value%0D%0A
=== TEST 9: ngx.resp.add_header (header name with Chinese characters)
--- config
location = /t {
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx_resp.add_header("head中文", "value")
ngx.say("OK")
}
}
--- response_body
OK
--- response_headers
head%E4%B8%AD%E6%96%87: value
=== TEST 10: ngx.resp.add_header (header value with Chinese characters)
--- config
location = /t {
content_by_lua_block {
local ngx_resp = require "ngx.resp"
ngx_resp.add_header("head", "value中文")
ngx.say("OK")
}
}
--- response_body
OK
--- response_headers
head: value中文

File diff suppressed because it is too large Load diff

View file

@ -1,170 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
our $SkipReason;
BEGIN {
if ($ENV{TEST_NGINX_CHECK_LEAK}) {
$SkipReason = "unavailable for the hup tests";
} else {
undef $ENV{TEST_NGINX_USE_STAP};
}
}
use lib '.';
use t::TestCore $SkipReason ? (skip_all => $SkipReason) : ();
plan tests => repeat_each() * (blocks() * 4);
add_block_preprocessor(sub {
my $block = shift;
if (!defined $block->error_log) {
$block->set_value("error_log",
qr/\[notice\] .*? \(SIGHUP\) received/);
}
if (!defined $block->no_error_log) {
$block->set_value("no_error_log", "[error]");
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
});
no_shuffle();
use_hup();
$ENV{TEST_NGINX_BAR} = 'old';
$ENV{TEST_NGINX_LUA_PACKAGE_PATH} = "$t::TestCore::lua_package_path";
run_tests();
__DATA__
=== TEST 1: env directive explicit value is visible within init_by_lua*
--- main_config
env FOO=old;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("FOO")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo)
}
}
--- response_body
old
--- error_log
[notice]
=== TEST 2: HUP reload changes env value (1/3)
--- main_config
env FOO=new;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("FOO")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo)
}
}
--- response_body
new
=== TEST 3: HUP reload changes env value (2/3)
--- main_config
env FOO=;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("FOO")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo)
}
}
--- response_body_like chomp
\s
=== TEST 4: HUP reload changes env value (3/3)
--- main_config
env FOO;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("FOO")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo)
}
}
--- response_body
nil
=== TEST 5: HUP reload changes visible environment variable (1/2)
--- main_config
env TEST_NGINX_BAR;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.test_nginx_bar = os.getenv("TEST_NGINX_BAR")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.test_nginx_bar)
}
}
--- response_body
old
=== TEST 6: HUP reload changes visible environment variable (2/2)
--- main_config
env TEST_NGINX_BAR=new;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.test_nginx_bar = os.getenv("TEST_NGINX_BAR")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.test_nginx_bar)
}
}
--- response_body
new

View file

@ -1,252 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
plan tests => repeat_each() * (blocks() * 3 + 1);
add_block_preprocessor(sub {
my $block = shift;
if (!defined $block->error_log) {
$block->set_value("no_error_log", "[error]");
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
});
$ENV{TEST_NGINX_BAR} = 'world';
$ENV{TEST_NGINX_LUA_PACKAGE_PATH} = "$t::TestCore::lua_package_path";
run_tests();
__DATA__
=== TEST 1: env directive explicit value is visible within init_by_lua*
--- main_config
env FOO=hello;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("FOO")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo, "\n", os.getenv("FOO"))
}
}
--- response_body
hello
hello
=== TEST 2: env directive explicit value is visible within init_by_lua* with lua_shared_dict
--- main_config
env FOO=hello;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
lua_shared_dict dogs 24k;
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("FOO")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo, "\n", os.getenv("FOO"))
}
}
--- response_body
hello
hello
=== TEST 3: env directive explicit value is case-sensitive within init_by_lua*
--- main_config
env FOO=hello;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("foo")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo, "\n", os.getenv("foo"))
}
}
--- response_body
nil
nil
=== TEST 4: env directives with no value are ignored
--- main_config
env FOO;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("FOO")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo, "\n", os.getenv("FOO"))
}
}
--- response_body
nil
nil
=== TEST 5: env is visible from environment
--- main_config
env TEST_NGINX_BAR;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("TEST_NGINX_BAR")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo, "\n", os.getenv("TEST_NGINX_BAR"))
}
}
--- response_body
world
world
=== TEST 6: env explicit set vs environment set
--- main_config
env TEST_NGINX_BAR=goodbye;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("TEST_NGINX_BAR")
}
--- config
location /t {
content_by_lua_block {
ngx.say(package.loaded.foo, "\n", os.getenv("TEST_NGINX_BAR"))
}
}
--- response_body
goodbye
goodbye
=== TEST 7: env directive with empty value
--- main_config
env FOO=;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
require "resty.core"
package.loaded.foo = os.getenv("FOO")
}
--- config
location /t {
content_by_lua_block {
ngx.say("in init: ", package.loaded.foo, "\n",
"in content: ", os.getenv("FOO"))
}
}
--- response_body_like
in init:\s+
in content:\s+
=== TEST 8: os.getenv() overwrite is reverted in worker phases
--- main_config
env FOO=hello;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
package.loaded.init_os_getenv = os.getenv
}
--- config
location /t {
content_by_lua_block {
ngx.say("FOO=", os.getenv("FOO"))
if os.getenv ~= package.loaded.init_os_getenv then
ngx.say("os.getenv() overwrite was reverted")
else
ngx.say("os.getenv() overwrite was not reverted")
end
}
}
--- response_body
FOO=hello
os.getenv() overwrite was reverted
=== TEST 9: os.getenv() can be localized after loading resty.core
--- main_config
env FOO=hello;
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
do
local getenv = os.getenv
package.loaded.f = function ()
ngx.log(ngx.NOTICE, "FOO: ", getenv("FOO"))
end
end
require "resty.core"
package.loaded.f()
package.loaded.is_os_getenv = os.getenv == package.loaded.os_getenv
}
--- config
location /t {
content_by_lua_block {
package.loaded.f()
package.loaded.f()
if os.getenv ~= package.loaded.init_os_getenv then
ngx.say("os.getenv() overwrite was reverted")
else
ngx.say("os.getenv() overwrite was not reverted")
end
}
}
--- response_body
os.getenv() overwrite was reverted
--- grep_error_log eval
qr/FOO: [a-z]+/
--- grep_error_log_out
FOO: hello
FOO: hello
FOO: hello

View file

@ -1,66 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
#worker_connections(1014);
#master_process_enabled(1);
#log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 4 + 1);
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: ngx.arg getter in set_by_lua
--- config
location = /t {
# set_by_lua_block doesn't support arguments
set_by_lua $res '
local arg = ngx.arg
local val
for i = 1, 30 do
val = arg[1] + arg[2]
end
return val
' $arg_a $arg_b;
echo $res;
}
--- request
GET /t?a=1&b=2
--- response_body
3
--- error_log eval
qr/\[TRACE\s+\d+ set_by_lua\(nginx\.conf:\d+\):4 loop\]/
--- no_error_log
[error]
-- NYI: (?!return to lower frame)
=== TEST 2: ngx.arg getter in body_filter_by_lua
--- config
location = /t {
echo hello;
body_filter_by_lua_block {
local arg = ngx.arg
local eof
local body = ""
for i = 1, 30 do
body = body .. arg[1]
eof = arg[2]
end
}
}
--- request
GET /t
--- error_log eval
qr/\[TRACE\s+\d+ body_filter_by_lua\(nginx\.conf:\d+\):5 loop\]/
--- no_error_log
[error]
-- NYI: (?!return to lower frame)

View file

@ -1,33 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
repeat_each(2);
plan tests => repeat_each() * (blocks() * 5);
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: get_phase
--- config
location /lua {
content_by_lua_block {
local phase
for i = 1, 100 do
phase = ngx.get_phase()
end
ngx.say(phase)
}
}
--- request
GET /lua
--- response_body
content
--- no_error_log
[error]
-- NYI:
--- error_log eval
qr/\[TRACE\s+\d+\s+content_by_lua\(nginx\.conf:\d+\):3 loop\]/

View file

@ -1,80 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
repeat_each(2);
plan tests => repeat_each() * (blocks() * 3 + 2);
add_block_preprocessor(sub {
my $block = shift;
if (!defined $block->error_log) {
$block->set_value("no_error_log", "[error]\n[alert]\n[emerg]");
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
});
env_to_nginx("PATH");
master_on();
no_long_string();
run_tests();
__DATA__
=== TEST 1: reset the cpu affinity in the sub-process
--- main_config
worker_cpu_affinity 0001;
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local nproc, err = ngx_pipe.spawn({"nproc"})
if not nproc then
ngx.say(err)
return
end
local ncpu, err = nproc:stdout_read_line()
if not ncpu then
ngx.say(err)
return
end
if tonumber(ncpu) < 2 then
-- when ncpu is 1, this test is a smoking test.
-- We could not ensure the affinity is reset, but we could
-- ensure no error occurs.
ngx.say("ok")
return
end
local proc, err = ngx_pipe.spawn({"sleep", 3600})
if not proc then
ngx.say(err)
return
end
-- ensure affinity is already reset before running taskset
ngx.sleep(0.1)
local taskset, err = ngx_pipe.spawn({"taskset", "-pc", proc:pid()})
if not taskset then
ngx.say(err)
return
end
local report, err = taskset:stdout_read_line()
if not report then
ngx.say(err)
return
end
ngx.say(report)
}
}
--- response_body_like
(ok|pid \d+'s current affinity list: 0[-,]\d+)

View file

@ -1,44 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
workers(2);
master_on();
repeat_each(1);
plan tests => repeat_each() * (blocks() * 2);
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: ngx.worker.count
--- http_config
init_worker_by_lua_block {
ngx.timer.at(0, function()
local ngx_pipe = require "ngx.pipe"
local function check_error(...)
local data, err = pcall(...)
if not data then
ngx.log(ngx.ERR, err)
end
end
check_error(ngx_pipe.spawn, {"ls"})
end)
}
--- config
listen $TEST_NGINX_RAND_PORT_1 reuseport;
location = /t {
content_by_lua_block {
ngx.sleep(0.01) -- ensure timer is fired
ngx.say("ok")
}
}
--- request
GET /t
--- no_error_log
failed (9: Bad file descriptor)

View file

@ -1,833 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
use Cwd qw(abs_path realpath cwd);
use File::Basename;
repeat_each(2);
plan tests => repeat_each() * (blocks() * 3 + 5);
add_block_preprocessor(sub {
my $block = shift;
my $http_config = $block->http_config || '';
my $init_by_lua_block = $block->init_by_lua_block || '';
$http_config .= <<_EOC_;
lua_package_path '$t::TestCore::lua_package_path';
init_by_lua_block {
$t::TestCore::init_by_lua_block
$init_by_lua_block
}
_EOC_
$block->set_value("http_config", $http_config);
if (!defined $block->error_log) {
$block->set_value("no_error_log", "[error]");
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
});
$ENV{TEST_NGINX_CERT_DIR} ||= dirname(realpath(abs_path(__FILE__)));
my $port = server_port;
if ($port < 65535) {
$port++;
} else {
$port--;
}
$ENV{TEST_NGINX_SERVER_SSL_PORT} = $port;
$ENV{TEST_NGINX_HTML_DIR} ||= html_dir();
env_to_nginx("PATH");
no_long_string();
run_tests();
__DATA__
=== TEST 1: read stderr, pattern is read line
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello world"})
local data, err = proc:stderr_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
hello world
=== TEST 2: read stderr, pattern is read bytes
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello world"})
local data, err = proc:stderr_read_bytes(5)
if not data then
ngx.say(err)
else
ngx.say(data)
end
data, err = proc:stderr_read_bytes(6)
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
hello
world
=== TEST 3: read stderr, bytes length is zero
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello world"})
local data, err = proc:stderr_read_bytes(0)
if not data then
ngx.say(err)
else
ngx.say("data:", data)
end
}
}
--- response_body
data:
=== TEST 4: read stderr, bytes length is less than zero
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello world"})
local ok, err = pcall(proc.stderr_read_bytes, proc, -1)
if not ok then
ngx.say(err)
end
}
}
--- response_body
bad len argument
=== TEST 5: read stderr, bytes length is more than data
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello world"})
local data, err = proc:stderr_read_bytes(20)
if not data then
ngx.say(err)
else
ngx.say("data:", data)
end
}
}
--- response_body
closed
=== TEST 6: read stderr, pattern is read all
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo -n hello && sleep 0.05 && >&2 echo -n world"})
local data, err = proc:stderr_read_all()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
helloworld
=== TEST 7: read stderr, pattern is read any
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo -n hello && sleep 0.05 && >&2 echo -n world"})
local data, err = proc:stderr_read_any(1024)
if not data then
ngx.say(err)
else
ngx.say(data)
end
data, err = proc:stderr_read_any(1024)
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
hello
world
=== TEST 8: read stderr, pattern is read any, with limited, max <= 0
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo -n hello && sleep 0.05 && >&2 echo -n world"})
local ok, err = pcall(proc.stderr_read_any, proc, 0)
if not ok then
ngx.say(err)
end
}
}
--- response_body
bad max argument
=== TEST 9: read stderr, without yield
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello world"})
ngx.sleep(0.05)
local data, err = proc:stderr_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
hello world
=== TEST 10: read stderr, without yield, pattern is read bytes
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello world"})
ngx.sleep(0.05)
local data, err = proc:stderr_read_bytes(7)
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
hello w
=== TEST 11: read stderr, without yield, pattern is read all
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello && >&2 echo world"})
ngx.sleep(0.05)
local data, err = proc:stderr_read_all()
if not data then
ngx.say(err)
else
ngx.print(data)
end
}
}
--- response_body
hello
world
=== TEST 12: read stderr, without yield, pattern is read any
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo -n hello && sleep 0.01 && >&2 echo -n world"})
ngx.sleep(0.05)
local data, err = proc:stderr_read_any(1024)
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
helloworld
=== TEST 13: read stderr, mix read pattern and stdout/stderr
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local script = [[
echo -n hello
>&2 echo world
>&2 echo -n more
sleep 0.1
>&2 echo -n da
sleep 0.1
>&2 echo ta
echo more
>&2 echo -n data
]]
local proc = ngx_pipe.spawn({"sh", "-c", script})
local function check_call(proc, func, ...)
local data, err = func(proc, ...)
if not data then
ngx.say(err)
ngx.exit(ngx.OK)
end
ngx.say(data)
end
ngx.sleep(0.05)
ngx.say("reading any")
check_call(proc, proc.stderr_read_any, 1024)
ngx.say("reading 3")
check_call(proc, proc.stderr_read_bytes, 3)
ngx.say("reading line")
check_call(proc, proc.stderr_read_line)
ngx.say("reading all")
check_call(proc, proc.stderr_read_all)
}
}
--- response_body
reading any
world
more
reading 3
dat
reading line
a
reading all
data
=== TEST 14: read stderr, timeout
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sleep", "10s"})
proc:set_timeouts(nil, 4000, 100)
local ok, err = proc:stderr_read_line()
if not ok then
ngx.say(err)
else
ngx.say("ok")
end
}
}
--- response_body
timeout
--- no_error_log
[error]
--- error_log
lua pipe add timer for reading: 100(ms)
=== TEST 15: read stderr, aborted by uthread kill
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", "sleep 0.1 && >&2 echo hello"})
local function read()
proc:stderr_read_line()
ngx.log(ngx.ERR, "can't reach here")
end
local th = ngx.thread.spawn(read)
ngx.thread.kill(th)
local data, err = proc:stderr_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
hello
--- no_error_log
[error]
--- error_log
lua pipe read process:
lua pipe proc read stderr cleanup
=== TEST 16: more than one coroutines read stderr of a process
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sh", "-c", "sleep 0.1 && >&2 echo hello && >&2 echo world"})
local function read()
local data, err = proc:stderr_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
end
local th1 = ngx.thread.spawn(read)
local th2 = ngx.thread.spawn(read)
ngx.thread.wait(th1)
ngx.thread.wait(th2)
ngx.thread.spawn(read)
}
}
--- response_body
pipe busy reading
hello
world
=== TEST 17: read stderr while read stdout in other request
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
package.loaded.proc = ngx_pipe.spawn({"sh", "-c", [[
echo hello
>&2 echo world
sleep 0.1
>&2 echo more
echo -n da
sleep 0.1
echo ta
echo -n more
>&2 echo -n data
]]})
local res1, res2 = ngx.location.capture_multi{{"/req1"}, {"/req2"}}
ngx.say("stderr:")
ngx.print(res1.body)
ngx.say("stdout:")
ngx.print(res2.body)
}
}
location = /req1 {
content_by_lua_block {
while true do
local data, err = package.loaded.proc:stderr_read_any(1024)
if data then
ngx.print(data)
else
if err ~= 'closed' then
ngx.say(err)
end
break
end
end
ngx.say('')
}
}
location = /req2 {
content_by_lua_block {
while true do
local data, err = package.loaded.proc:stdout_read_any(1024)
if data then
ngx.print(data)
else
if err ~= 'closed' then
ngx.say(err)
end
break
end
end
ngx.say('')
}
}
--- response_body
stderr:
world
more
data
stdout:
hello
data
more
=== TEST 18: read stderr while read stdout in other request, individual error
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
package.loaded.proc = ngx_pipe.spawn({"sleep", 0.5})
package.loaded.proc:set_timeouts(nil, 100)
local res1, res2 = ngx.location.capture_multi{{"/req1"}, {"/req2"}}
ngx.say("stderr:")
ngx.print(res1.body)
ngx.say("stdout:")
ngx.print(res2.body)
}
}
location = /req1 {
content_by_lua_block {
local data, err = package.loaded.proc:stderr_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
location = /req2 {
content_by_lua_block {
local data, err = package.loaded.proc:stdout_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
stderr:
closed
stdout:
timeout
=== TEST 19: read stderr while read stdout in other request, individual result
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
package.loaded.proc = ngx_pipe.spawn({"sh", "-c", ">&2 echo hello"})
local res1, res2 = ngx.location.capture_multi{{"/req1"}, {"/req2"}}
ngx.say("stderr:")
ngx.print(res1.body)
ngx.say("stdout:")
ngx.print(res2.body)
}
}
location = /req1 {
content_by_lua_block {
local data, err = package.loaded.proc:stderr_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
location = /req2 {
content_by_lua_block {
local data, err = package.loaded.proc:stdout_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
stderr:
hello
stdout:
closed
=== TEST 20: read stdout as stderr, mix read pattern and stdout/stderr, merge_stderr is true
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local script = [[
echo hello
sleep 0.1
>&2 echo world
>&2 echo more
sleep 0.1
>&2 echo -n da
sleep 0.1
>&2 echo ta
echo more
>&2 echo -n data
]]
local proc = ngx_pipe.spawn({"sh", "-c", script}, {merge_stderr = true})
ngx.say("reading stdout all")
local data, err = proc:stdout_read_all()
if not data then
ngx.say(err)
ngx.exit(ngx.OK)
end
ngx.say(data)
proc = ngx_pipe.spawn({"sh", "-c", script}, {merge_stderr = true})
ngx.say("reading any")
local i = 1
while true do
local data, err = proc:stdout_read_any(1024)
i = i + 1
if data then
ngx.print(data)
else
if err ~= 'closed' then
ngx.say(err)
end
break
end
end
ngx.say('')
}
}
--- error_log eval
qr/lua pipe spawn process:[0-9A-F]+ pid:\d+ merge_stderr:1 buffer_size:4096/
--- no_error_log
[error]
--- response_body
reading stdout all
hello
world
more
data
more
data
reading any
hello
world
more
data
more
data
=== TEST 21: read stderr, merge_stderr is true
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local args = {"sh", "-c", ">&2 echo hello world"}
local proc = ngx_pipe.spawn(args, {merge_stderr = true})
local data, err = proc:stderr_read_all()
if not data then
ngx.say(err)
else
ngx.say(data)
end
local data, err = proc:stderr_read_any(1024)
if not data then
ngx.say(err)
else
ngx.say(data)
end
local data, err = proc:stderr_read_bytes(1)
if not data then
ngx.say(err)
else
ngx.say(data)
end
local data, err = proc:stderr_read_line()
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
merged to stdout
merged to stdout
merged to stdout
merged to stdout
=== TEST 22: read stdout as stderr, aborted by uthread kill, merge_stderr is true
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local args = {"sh", "-c", "sleep 0.1 && >&2 echo hello && echo world"}
local proc = ngx_pipe.spawn(args, {merge_stderr = true})
local function read()
proc:stdout_read_line()
ngx.log(ngx.ERR, "can't reach here")
end
local th = ngx.thread.spawn(read)
ngx.thread.kill(th)
local data, err = proc:stdout_read_line()
if not data then
ngx.say("err: ", err)
else
ngx.say(data)
end
local data, err = proc:stdout_read_line()
if not data then
ngx.say("err: ", err)
else
ngx.say(data)
end
}
}
--- response_body
hello
world
=== TEST 23: read stderr, aborted by uthread kill, with graceful shutdown
--- user_files
>>> a.lua
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"bash"})
local function func()
proc:stderr_read_line()
ngx.log(ngx.ERR, "can't reach here")
end
local th = ngx.thread.spawn(func)
ngx.thread.kill(th)
local data, err = proc:kill(9) -- SIGKILL
if not data then
io.stdout:write("proc:kill(9) err: ", err)
else
io.stdout:write("ok")
end
--- config
location = /t {
content_by_lua_block {
local helper = require "helper"
local f = io.open("$TEST_NGINX_HTML_DIR/a.lua")
local code = f:read("*a")
local proc = helper.run_lua_with_graceful_shutdown("$TEST_NGINX_HTML_DIR", code)
proc:set_timeouts(300, 300, 300, 300)
local data, err = proc:stdout_read_all()
if not data then
ngx.say("stdout err: ", err)
else
ngx.say("stdout: ", data)
end
local data, err = proc:stderr_read_any(4096)
if not data then
ngx.say("stderr err: ", err)
else
ngx.say("stderr: ", data)
end
}
}
--- response_body
stdout: ok
stderr err: closed
--- no_error_log
[error]
=== TEST 24: spawn process with stderr_read_timeout option
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"sleep", "10s"}, {
stderr_read_timeout = 100
})
local data, err = proc:stderr_read_line()
if not data then
ngx.say("stderr err: ", err)
else
ngx.say("stderr: ", data)
end
}
}
--- response_body
stderr err: timeout
--- error_log
lua pipe add timer for reading: 100(ms)
--- no_error_log
[error]

View file

@ -1,562 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
repeat_each(2);
plan tests => repeat_each() * (blocks() * 3 + 10);
add_block_preprocessor(sub {
my $block = shift;
my $http_config = $block->http_config || '';
my $init_by_lua_block = $block->init_by_lua_block || '';
$http_config .= <<_EOC_;
lua_package_path '$t::TestCore::lua_package_path';
init_by_lua_block {
$t::TestCore::init_by_lua_block
$init_by_lua_block
}
_EOC_
$block->set_value("http_config", $http_config);
if (!defined $block->error_log) {
$block->set_value("no_error_log", "[error]");
}
if (!defined $block->request) {
$block->set_value("request", "GET /t");
}
});
$ENV{TEST_NGINX_HTML_DIR} ||= html_dir();
env_to_nginx("PATH");
no_long_string();
run_tests();
__DATA__
=== TEST 1: write process
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({'tee'})
local function write(...)
local bytes, err = proc:write(...)
if not bytes then
ngx.say(err)
return
end
ngx.say(bytes)
end
write('')
write('hello')
write(' world')
local data, err = proc:stdout_read_any(1024)
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
0
5
6
hello world
=== TEST 2: write process, bad pipe
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({'echo', 'a'})
ngx.sleep(0.1)
local bytes, err = proc:write("test")
if not bytes then
ngx.say(err)
return
end
ngx.say(bytes)
}
}
--- response_body
closed
--- error_log eval
qr/lua pipe write data error pipe:[0-9A-F]+ \(\d+: Broken pipe\)/
=== TEST 3: write process after waiting
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"echo", "hello world"})
local ok, err = proc:wait()
if not ok then
ngx.say("wait failed: ", err)
return
end
local data, err = proc:write("a")
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
closed
=== TEST 4: write process, timeout
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc, err = ngx_pipe.spawn({"sleep", 1})
if not proc then
ngx.say(err)
return
end
local data = ("1234"):rep(2048)
proc:set_timeouts(100)
local total = 0
local step = #data
while true do
local data, err = proc:write(data)
if not data then
ngx.say(err)
break
end
total = total + step
if total > 64 * step then
break
end
end
ngx.log(ngx.WARN, "total write before timeout:", total)
}
}
--- response_body
timeout
--- no_error_log
[error]
--- error_log
lua pipe add timer for writing: 100(ms)
lua pipe write yielding
=== TEST 5: write process, yield and write again
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc, err = ngx_pipe.spawn({"tee"})
if not proc then
ngx.say(err)
return
end
local data = ("1234"):rep(2048)
proc:set_timeouts(100)
local total = 0
local step = #data
while true do
local data, err = proc:write(data)
if not data then
ngx.say(err)
break
end
total = total + step
if total > 64 * step then
break
end
end
ngx.log(ngx.WARN, "total write before timeout:", total)
local function drain()
local data, err = proc:stdout_read_bytes(#data / 2)
if not data then
ngx.log(ngx.ERR, "drain failed: ", err)
end
end
ngx.thread.spawn(function()
drain()
ngx.sleep(0.1)
drain()
end)
proc:set_timeouts(400)
local bytes, err = proc:write(data)
if not bytes then
ngx.say(err)
else
ngx.say(bytes)
end
}
}
--- response_body
timeout
8192
--- no_error_log
[error]
--- error_log
lua pipe write yielding
=== TEST 6: more than one coroutines write
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc, err = ngx_pipe.spawn({"sleep", 1})
if not proc then
ngx.say(err)
return
end
local data = ("1234"):rep(2048)
proc:set_timeouts(100)
local total = 0
local step = #data
-- make writers blocked later
while true do
local data, err = proc:write(data)
if not data then
ngx.say(err)
break
end
total = total + step
if total > 64 * step then
break
end
end
local function write()
local data, err = proc:write(data)
if not data then
ngx.say(err)
else
ngx.say(data)
end
end
local th1 = ngx.thread.spawn(write)
local th2 = ngx.thread.spawn(write)
ngx.thread.wait(th1)
ngx.thread.wait(th2)
ngx.thread.spawn(write)
}
}
--- response_body
timeout
pipe busy writing
timeout
timeout
--- no_error_log
[error]
--- error_log
lua pipe add timer for writing: 100(ms)
lua pipe write yielding
=== TEST 7: write process, aborted by uthread kill
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc, err = ngx_pipe.spawn({"sleep", 1})
if not proc then
ngx.say(err)
return
end
local data = ("1234"):rep(2048)
proc:set_timeouts(100)
local total = 0
local step = #data
-- make writers blocked later
while true do
local data, err = proc:write(data)
if not data then
ngx.say(err)
break
end
total = total + step
if total > 64 * step then
break
end
end
local function write()
proc:write(data)
ngx.log(ngx.ERR, "can't reach here")
end
local th = ngx.thread.spawn(write)
ngx.thread.kill(th)
local data, err = proc:write(data)
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
timeout
timeout
--- no_error_log
[error]
--- error_log
lua pipe add timer for writing: 100(ms)
lua pipe write yielding
lua pipe proc write cleanup
=== TEST 8: write and read process
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
package.loaded.proc = ngx_pipe.spawn({'tee'})
local res1, res2 = ngx.location.capture_multi{{"/req1"}, {"/req2"}}
ngx.print(res1.body)
ngx.print(res2.body)
}
}
location = /req1 {
content_by_lua_block {
local proc = package.loaded.proc
local data, err = proc:stdout_read_any(1024)
if not data then
ngx.say(err)
end
data, err = proc:write(data)
if not data then
ngx.say(err)
end
}
}
location = /req2 {
content_by_lua_block {
local proc = package.loaded.proc
local data, err = proc:write("payload")
if not data then
ngx.say(err)
end
ngx.sleep(0.2) -- yield to let other req read and write the data
data, err = proc:stdout_read_any(1024)
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
payload
=== TEST 9: write process, support table, number and boolean arguments
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({'tee'})
local function write(...)
local bytes, err = proc:write(...)
if not bytes then
ngx.say(err)
return
end
ngx.say(bytes)
end
write(10)
write({"hello", " ", "world"})
local data, err = proc:stdout_read_any(1024)
if not data then
ngx.say(err)
else
ngx.say(data)
end
}
}
--- response_body
2
11
10hello world
=== TEST 10: write process, throw error if bad argument is written
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({'tee'})
local function write(...)
local ok, err = pcall(proc.write, proc, ...)
if not ok then
ngx.say(err)
return
end
end
write(true)
write(nil)
write(ngx.null)
}
}
--- response_body
bad data arg: string, number, or table expected, got boolean
bad data arg: string, number, or table expected, got nil
bad data arg: string, number, or table expected, got userdata
=== TEST 11: write process, aborted by uthread kill, with graceful shutdown
--- user_files
>>> a.lua
local ngx_pipe = require "ngx.pipe"
local proc = ngx_pipe.spawn({"bash"})
-- make writers blocked later
local data = ("1234"):rep(2048)
proc:set_timeouts(300)
local total = 0
local step = #data
while true do
local data, err = proc:write(data)
if not data then
ngx.log(ngx.ERR, "proc write error: ", err)
break
end
total = total + step
if total > 64 * step then
break
end
end
local function func()
proc:write("blah blah")
end
local th = ngx.thread.spawn(func)
ngx.thread.kill(th)
local data, err = proc:kill(9)
if not data then
io.stdout:write("proc:kill(9) err: ", err)
else
io.stdout:write("ok")
end
--- config
location = /t {
content_by_lua_block {
local helper = require "helper"
local spawn = helper.run_lua_with_graceful_shutdown
local f = io.open("$TEST_NGINX_HTML_DIR/a.lua")
local code = f:read("*a")
local proc = spawn("$TEST_NGINX_HTML_DIR", code)
proc:set_timeouts(nil, 1000, 1000)
local data, err = proc:stdout_read_all()
if not data then
ngx.say("stdout err: ", err)
else
ngx.say("stdout: ", data)
end
local data, err = proc:stderr_read_any(4096)
if not data then
ngx.say("stderr err: ", err)
else
ngx.say("stderr: ", data)
end
}
}
--- response_body
stdout: ok
stderr err: closed
--- no_error_log
[error]
=== TEST 12: spawn process with write_timeout option
--- config
location = /t {
content_by_lua_block {
local ngx_pipe = require "ngx.pipe"
local proc, err = ngx_pipe.spawn({"sleep", 1}, {
write_timeout = 100
})
local data = ("1234"):rep(2048)
local total = 0
local step = #data
while true do
local data, err = proc:write(data)
if not data then
ngx.say(err)
break
end
total = total + step
if total > 64 * step then
break
end
end
}
}
--- response_body
timeout
--- error_log
lua pipe add timer for writing: 100(ms)
lua pipe write yielding
--- no_error_log
[error]

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,77 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
BEGIN {
undef $ENV{TEST_NGINX_USE_STAP};
}
use lib '.';
use t::TestCore;
#worker_connections(1014);
master_on();
#log_level('info');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 5);
our $HttpConfig = <<_EOC_;
proxy_cache_path /tmp/proxy_cache_dir keys_zone=cache_one:200m;
$t::TestCore::HttpConfig
init_worker_by_lua_block {
local base = require "resty.core.base"
local v
local typ = (require "ngx.process").type
for i = 1, 400 do
v = typ()
end
if v == "helper" then
ngx.log(ngx.WARN, "process type: ", v)
end
}
_EOC_
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: sanity
--- http_config eval: $::HttpConfig
--- config
location = /t {
content_by_lua_block {
ngx.sleep(0.1)
local v
local typ = (require "ngx.process").type
for i = 1, 200 do
v = typ()
end
ngx.say("type: ", v)
}
}
--- request
GET /t
--- response_body
type: worker
--- grep_error_log eval
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d loop\]/
--- grep_error_log_out eval
[
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):\d+ loop\]
/,
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):\d+ loop\]
/
]
--- no_error_log
[error]
-- NYI:
--- skip_nginx: 5: < 1.11.2
--- wait: 0.2

View file

@ -1,88 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
our $SkipReason;
BEGIN {
if ($ENV{TEST_NGINX_CHECK_LEAK}) {
$SkipReason = "unavailable for the hup tests";
} else {
$ENV{TEST_NGINX_USE_HUP} = 1;
undef $ENV{TEST_NGINX_USE_STAP};
}
}
use lib '.';
use t::TestCore $SkipReason ? (skip_all => $SkipReason) : ();
use Cwd qw(cwd);
#worker_connections(1014);
master_process_enabled(1);
log_level('warn');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 4);
my $pwd = cwd();
our $HttpConfig = <<_EOC_;
lua_package_path '$t::TestCore::lua_package_path';
init_by_lua_block {
$t::TestCore::init_by_lua_block
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent()
if not ok then
ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err)
end
}
init_worker_by_lua_block {
local base = require "resty.core.base"
local typ = require "ngx.process".type
if typ() == "privileged agent" then
ngx.log(ngx.WARN, "process type: ", typ())
end
}
_EOC_
#no_diff();
no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: sanity
--- http_config eval: $::HttpConfig
--- config
location = /t {
content_by_lua_block {
local typ = require "ngx.process".type
local f, err = io.open(ngx.config.prefix() .. "/logs/nginx.pid", "r")
if not f then
ngx.say("failed to open nginx.pid: ", err)
return
end
local pid = f:read()
-- ngx.say("master pid: [", pid, "]")
f:close()
ngx.say("type: ", typ())
os.execute("kill -HUP " .. pid)
}
}
--- request
GET /t
--- response_body
type: worker
--- error_log
init_worker_by_lua(nginx.conf:48):6: process type: privileged
--- no_error_log
[error]
--- skip_nginx: 4: < 1.11.2

View file

@ -1,67 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
BEGIN {
undef $ENV{TEST_NGINX_USE_STAP};
}
use lib '.';
use t::TestCore;
use Cwd qw(cwd);
repeat_each(2);
plan tests => repeat_each() * (blocks() * 5);
my $pwd = cwd();
our $HttpConfig = <<_EOC_;
lua_package_path "$t::TestCore::lua_package_path";
init_by_lua_block {
$t::TestCore::init_by_lua_block
local v
local typ = (require "ngx.process").type
for i = 1, 400 do
v = typ()
end
package.loaded.process_type = v
}
_EOC_
#worker_connections(1014);
master_on();
#log_level('error');
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: sanity
--- http_config eval: $::HttpConfig
--- config
location = /t {
content_by_lua_block {
ngx.say("process type: ", package.loaded.process_type)
}
}
--- request
GET /t
--- response_body
process type: master
--- grep_error_log eval
qr/\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]/
--- grep_error_log_out eval
[
qr/\A\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]
\z/,
qr/\A\[TRACE\s+\d+ init_by_lua\(nginx.conf:\d+\):\d+ loop\]
\z/
]
--- no_error_log
[error]
-- NYI:
--- skip_nginx: 5: < 1.11.2

View file

@ -1,301 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
use lib '.';
use t::TestCore;
master_process_enabled(1);
repeat_each(1);
plan tests => repeat_each() * (blocks() * 5);
$ENV{TEST_NGINX_LUA_PACKAGE_PATH} = $t::TestCore::lua_package_path;
$ENV{TEST_NGINX_RANDOM_PORT} = Test::Nginx::Util::server_port();
run_tests();
__DATA__
=== TEST 1: specify connections to enable_privileged_agent
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent(10)
if not ok then
ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err)
end
}
init_worker_by_lua_block {
local base = require "resty.core.base"
local typ = (require "ngx.process").type()
if typ == "privileged agent" then
ngx.log(ngx.WARN, "process type: ", typ)
ngx.timer.at(0, function()
local tcpsock = ngx.socket.tcp()
local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT)
if ok then
ngx.log(ngx.INFO, "connect ok ")
else
ngx.log(ngx.INFO, "connect failed " .. tostring(err))
end
end)
end
}
--- config
location = /t {
content_by_lua_block {
ngx.sleep(0.1)
local typ = require "ngx.process".type()
ngx.say("type: ", typ)
}
}
--- request
GET /t
--- response_body
type: worker
--- error_log
connect ok
--- no_error_log
connect failed
enable_privileged_agent failed
--- skip_nginx: 5: < 1.11.2
--- wait: 0.2
=== TEST 2: connections exceed limit
the real connections you can create is always less than you set.
timer will take fake connections.
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent(10)
if not ok then
ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err)
end
}
init_worker_by_lua_block {
local base = require "resty.core.base"
local typ = (require "ngx.process").type()
if typ == "privileged agent" then
ngx.log(ngx.WARN, "process type: ", typ)
ngx.timer.at(0, function()
for i = 1, 10 do
local tcpsock = ngx.socket.tcp()
local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT)
if ok then
ngx.log(ngx.INFO, "connect ok ")
else
ngx.log(ngx.INFO, "connect failed " .. tostring(err))
end
end
end)
end
}
--- config
location = /t {
content_by_lua_block {
ngx.sleep(0.1)
local typ = require "ngx.process".type()
ngx.say("type: ", typ)
}
}
--- request
GET /t
--- response_body
type: worker
--- error_log
connect failed
worker_connections are not enough
--- no_error_log
enable_privileged_agent failed
--- skip_nginx: 5: < 1.11.2
--- wait: 0.2
=== TEST 3: enable_privileged_agent with bad connections
connections < 0
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent(-1)
if not ok then
ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err)
end
}
init_worker_by_lua_block {
local base = require "resty.core.base"
local typ = (require "ngx.process").type()
if typ == "privileged agent" then
ngx.log(ngx.WARN, "process type: ", typ)
ngx.timer.at(0, function()
for i = 1, 10 do
local tcpsock = ngx.socket.tcp()
local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT)
if ok then
ngx.log(ngx.INFO, "connect ok ")
else
ngx.log(ngx.INFO, "connect failed " .. tostring(err))
end
end
end)
end
}
--- config
location = /t {
content_by_lua_block {
ngx.sleep(0.1)
local typ = require "ngx.process".type()
ngx.say("type: ", typ)
}
}
--- request
GET /t
--- response_body
type: worker
--- error_log
enable_privileged_agent failed: bad 'connections' argument
--- no_error_log
connect ok
connect failed
--- skip_nginx: 5: < 1.11.2
--- wait: 0.2
=== TEST 4: enable_privileged_agent with bad connections
connections is not a number
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent("10")
if not ok then
ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err)
end
}
init_worker_by_lua_block {
local base = require "resty.core.base"
local typ = (require "ngx.process").type()
if typ == "privileged agent" then
ngx.log(ngx.WARN, "process type: ", typ)
ngx.timer.at(0, function()
for i = 1, 10 do
local tcpsock = ngx.socket.tcp()
local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT)
if ok then
ngx.log(ngx.INFO, "connect ok ")
else
ngx.log(ngx.INFO, "connect failed " .. tostring(err))
end
end
end)
end
}
--- config
location = /t {
content_by_lua_block {
ngx.sleep(0.1)
local typ = require "ngx.process".type()
ngx.say("type: ", typ)
}
}
--- request
GET /t
--- response_body
type: worker
--- error_log
enable_privileged_agent failed: bad 'connections' argument
--- no_error_log
connect ok
connect failed
--- skip_nginx: 5: < 1.11.2
--- wait: 0.2
=== TEST 5: enable_privileged_agent with bad connections
connections = 0
--- http_config
lua_package_path "$TEST_NGINX_LUA_PACKAGE_PATH";
init_by_lua_block {
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent(0)
if not ok then
ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err)
end
}
init_worker_by_lua_block {
local base = require "resty.core.base"
local typ = (require "ngx.process").type()
if typ == "privileged agent" then
ngx.log(ngx.WARN, "process type: ", typ)
ngx.timer.at(0, function()
for i = 1, 10 do
local tcpsock = ngx.socket.tcp()
local ok, err = tcpsock:connect("127.0.0.1", $TEST_NGINX_RANDOM_PORT)
if ok then
ngx.log(ngx.INFO, "connect ok ")
else
ngx.log(ngx.INFO, "connect failed " .. tostring(err))
end
end
end)
end
}
--- config
location = /t {
content_by_lua_block {
ngx.sleep(0.1)
local typ = require "ngx.process".type()
ngx.say("type: ", typ)
}
}
--- request
GET /t
--- response_body
type: worker
--- error_log
0 worker_connection is not enough, privileged agent process cannot be spawned
--- no_error_log
process type: privileged agent
connect ok
--- skip_nginx: 5: < 1.11.2
--- wait: 0.2

View file

@ -1,176 +0,0 @@
# vim:set ft= ts=4 sw=4 et fdm=marker:
BEGIN {
undef $ENV{TEST_NGINX_USE_STAP};
}
use lib '.';
use t::TestCore;
$ENV{TEST_NGINX_RANDOM_PORT} = Test::Nginx::Util::server_port();
#worker_connections(1014);
master_process_enabled(1);
#log_level('error');
repeat_each(2);
plan tests => repeat_each() * (blocks() * 5 - 5);
add_block_preprocessor(sub {
my $block = shift;
my $http_config = $block->http_config || '';
my $init_by_lua_block = $block->init_by_lua_block || '';
$http_config .= <<_EOC_;
lua_package_path '$t::TestCore::lua_package_path';
init_by_lua_block {
$t::TestCore::init_by_lua_block
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent(8)
if not ok then
ngx.log(ngx.ERR, "enable_privileged_agent failed: ", err)
end
}
init_worker_by_lua_block {
local base = require "resty.core.base"
local v
local typ = (require "ngx.process").type
for i = 1, 400 do
v = typ()
end
if v == "privileged agent" then
ngx.log(ngx.WARN, "process type: ", v)
ngx.timer.at(0, function()
for i = 1, 4 do
local tcpsock = ngx.socket.tcp()
local ok, err = tcpsock:connect("127.0.0.1", $ENV{TEST_NGINX_RANDOM_PORT})
if ok then
ngx.log(ngx.INFO, "connect ok ")
else
ngx.log(ngx.INFO, "connect not ok " .. tostring(err))
end
end
end)
end
}
_EOC_
$block->set_value("http_config", $http_config);
});
#no_diff();
#no_long_string();
check_accum_error_log();
run_tests();
__DATA__
=== TEST 1: sanity
--- config
location = /t {
content_by_lua_block {
ngx.sleep(0.1)
local v
local typ = require "ngx.process".type
for i = 1, 200 do
v = typ()
end
ngx.say("type: ", v)
}
}
--- request
GET /t
--- response_body
type: worker
--- grep_error_log eval
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]|\[TRACE\s+\d+ content_by_lua\(nginx\.conf:\d+\):\d+ loop\]|init_worker_by_lua\(nginx.conf:\d+\):\d+: process type: \w+/
--- grep_error_log_out eval
[
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
(?:\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
)?\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):\d+ loop\]
init_worker_by_lua\(nginx.conf:\d+\):10: process type: privileged
/,
qr/\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
(?:\[TRACE\s+\d+ init_worker_by_lua\(nginx.conf:\d+\):\d+ loop\]
)?\[TRACE\s+\d+ content_by_lua\(nginx.conf:\d+\):\d+ loop\]
init_worker_by_lua\(nginx.conf:\d+\):10: process type: privileged
/
]
--- no_error_log
[error]
-- NYI:
--- skip_nginx: 5: < 1.11.2
--- wait: 0.2
=== TEST 2: `enable_privileged_agent` disabled
--- config
location = /t {
content_by_lua_block {
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent()
if not ok then
error(err)
end
}
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log eval
qr/\[error\] .*? API disabled in the current context/
--- skip_nginx: 3: < 1.11.2
=== TEST 3: `enable_privileged_agent` not patched
--- config
location = /t {
content_by_lua_block {
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent()
if not ok then
error(err)
end
}
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
missing privileged agent process patch in the nginx core
API disabled in the current context
--- skip_nginx: 4: >= 1.11.2
=== TEST 4: connections exceed limits
--- config
location = /t {
content_by_lua_block {
local process = require "ngx.process"
local ok, err = process.enable_privileged_agent()
if not ok then
error(err)
end
}
}
--- request
GET /t
--- response_body_like: 500 Internal Server Error
--- error_code: 500
--- error_log
worker_connections are not enough
--- skip_nginx: 3: < 1.11.2

Some files were not shown because too many files have changed in this diff Show more