openresty / test-nginx

Data-driven test scaffold for Nginx C module and OpenResty Lua library development
http://search.cpan.org/dist/Test-Nginx
438 stars 105 forks source link

How to check final error_log for pipelined_requests #164

Closed huysuper closed 8 months ago

huysuper commented 8 months ago

I want to test the proxy_ssl_session_reuse with the config below

--- http_config
server {
    listen $TEST_NGINX_RAND_PORT_1 ssl;
    server_name $TEST_NGINX_SERVER_NAME;

    ssl_certificate_key $TEST_NGINX_SSL_CERT_DIR/$TEST_NGINX_SERVER_NAME.key;
    ssl_certificate $TEST_NGINX_SSL_CERT_DIR/$TEST_NGINX_SERVER_NAME.crt;
    ssl_session_cache builtin;

    location ^~ / {
        add_header X-Session $ssl_session_reused;
        add_header X-Protocol $ssl_protocol;
        return 200 "hello";
    }
}
--- config
location = /t {
    proxy_pass https://127.0.0.1:$TEST_NGINX_RAND_PORT_1;
    proxy_ssl_session_reuse on;
}
--- pipelined_requests eval
["POST /t
hello",
"POST /t
hello",
"POST /t
hello"]
--- error_log
X-Session: r
--- response_body eval
["hello",
"hello",
"hello"]

And I want to check the log file contains X-Session: r in two times But the error_log only matched the first request and failed in the other Do you know how I can resolve it? Thanks Here is the test log test.log

huysuper commented 8 months ago

I also try the

--- check_accum_error_log

but it not working

huysuper commented 8 months ago

I also try the

--- check_accum_error_log

but it not working

Ah, need to input to the perl source code check_accum_error_log();

huysuper commented 8 months ago

It can working now, Thanks