|
| 1 | +=== TEST 51: aio threads Set LINK_FUNC_TEST_1 |
| 2 | +--- main_config eval: $::main_conf |
| 3 | +--- config |
| 4 | +aio threads=my_thread_pool; |
| 5 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 6 | +location = /testLinkFunGreeting { |
| 7 | + ngx_link_func_call "my_app_simple_get_greeting"; |
| 8 | +} |
| 9 | +--- request |
| 10 | +GET /testLinkFunGreeting |
| 11 | +--- error_code: 200 |
| 12 | +--- response_headers |
| 13 | +Content-Type: text/plain |
| 14 | +--- response_body_like eval |
| 15 | +qr/greeting from ngx_link_func testing$/ |
| 16 | + |
| 17 | + |
| 18 | +=== TEST 52: aio threads Set LINK_FUNC_TEST_ARGS |
| 19 | +--- main_config eval: $::main_conf |
| 20 | +--- config |
| 21 | +aio threads=my_thread_pool; |
| 22 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 23 | +location = /testLinkFunARGS { |
| 24 | + ngx_link_func_call "my_app_simple_get_args"; |
| 25 | +} |
| 26 | +--- request |
| 27 | +GET /testLinkFunARGS?greeting=hello_nginx?id=129310923 |
| 28 | +--- error_code: 200 |
| 29 | +--- response_headers |
| 30 | +Content-Type: text/plain |
| 31 | +--- response_body_like eval |
| 32 | +qr/greeting=hello_nginx\?id=129310923$/ |
| 33 | + |
| 34 | + |
| 35 | +=== TEST 53: aio threads Set LINK_FUNC_TEST_POST_NONE |
| 36 | +--- main_config eval: $::main_conf |
| 37 | +--- config |
| 38 | +aio threads=my_thread_pool; |
| 39 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 40 | +location = /testLinkFunPOSTBody { |
| 41 | + ngx_link_func_call "my_app_simple_post"; |
| 42 | +} |
| 43 | +--- request |
| 44 | +POST /testLinkFunPOSTBody |
| 45 | +" " |
| 46 | +--- error_code: 202 |
| 47 | +--- response_headers |
| 48 | +Content-Type: text/plain |
| 49 | +--- response_body_like eval |
| 50 | +qr/\s/ |
| 51 | + |
| 52 | + |
| 53 | +=== TEST 54: aio threads Set LINK_FUNC_TEST_GET_TOKEN |
| 54 | +--- main_config eval: $::main_conf |
| 55 | +--- config |
| 56 | +aio threads=my_thread_pool; |
| 57 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 58 | +location = /testLinkFunCVerifyToken { |
| 59 | + ngx_link_func_call "my_app_simple_get_token_args"; |
| 60 | +} |
| 61 | +--- request |
| 62 | +GET /testLinkFunCVerifyToken?token=QVNKS0pDQVNLTEpDS0xBU0pXbGtlandrbGplIGpka2FqbGthc2tsZGtqbHNrICBrZGpha2xzZGphc2Rhcw== |
| 63 | +--- error_code: 401 |
| 64 | +--- response_headers |
| 65 | +Content-Type: text/plain |
| 66 | +--- response_body_like eval |
| 67 | +qr/QVNKS0pDQVNLTEpDS0xBU0pXbGtlandrbGplIGpka2FqbGthc2tsZGtqbHNrICBrZGpha2xzZGphc2Rhcw==$/ |
| 68 | + |
| 69 | + |
| 70 | +=== TEST 55: aio threads Set LINK_FUNC_TEST_GET_ERROR_RESP |
| 71 | +--- main_config eval: $::main_conf |
| 72 | +--- config |
| 73 | +aio threads=my_thread_pool; |
| 74 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 75 | +location = /testLinkFuncERRORRESP { |
| 76 | + error_log /dev/null; |
| 77 | + ngx_link_func_call "my_app_simple_get_no_resp"; |
| 78 | +} |
| 79 | +--- request |
| 80 | +GET /testLinkFuncERRORRESP?token=QVNKS0pDQVNLTEpDS0xBU0pXbGtlandrbGplIGpka2FqbGthc2tsZGtqbHNrICBrZGpha2xzZGphc2Rhcw== |
| 81 | +--- error_code: 404 |
| 82 | +--- response_headers |
| 83 | +Content-Type: text/html |
| 84 | + |
| 85 | + |
| 86 | +=== TEST 56: aio threads Set LINK_FUNC_TEST_GET_CALLOC_FROM_POOL |
| 87 | +--- main_config eval: $::main_conf |
| 88 | +--- config |
| 89 | +aio threads=my_thread_pool; |
| 90 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 91 | +location = /testLinkFuncCallocFromPool { |
| 92 | + ngx_link_func_call "my_app_simple_get_calloc_from_pool"; |
| 93 | +} |
| 94 | +--- request |
| 95 | +GET /testLinkFuncCallocFromPool |
| 96 | +--- error_code: 200 |
| 97 | +--- response_headers |
| 98 | +Content-Type: text/plain |
| 99 | +--- response_body_like eval |
| 100 | +qr/This is the message calloc from pool$/ |
| 101 | + |
| 102 | + |
| 103 | +=== TEST 57: aio threads Set LINK_FUNC_TEST_POST_BODY |
| 104 | +--- main_config eval: $::main_conf |
| 105 | +--- config |
| 106 | +aio threads=my_thread_pool; |
| 107 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 108 | +location = /testLinkFunPOSTBody { |
| 109 | + ngx_link_func_call "my_app_simple_post"; |
| 110 | +} |
| 111 | +--- request |
| 112 | +POST /testLinkFunPOSTBody |
| 113 | +greeting=enjoy-http-link-function-testing |
| 114 | +--- error_code: 202 |
| 115 | +--- response_headers |
| 116 | +Content-Type: text/plain |
| 117 | +--- response_body_like eval |
| 118 | +qr/greeting=enjoy-http-link-function-testing$/ |
| 119 | + |
| 120 | + |
| 121 | +=== TEST 58: aio threads Set LINK_FUNC_TEST_CACHE |
| 122 | +--- main_config eval: $::main_conf |
| 123 | +--- config |
| 124 | +aio threads=my_thread_pool; |
| 125 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 126 | +location = /testLinkFunGetCache { |
| 127 | + ngx_link_func_call "my_app_simple_get_cache"; |
| 128 | +} |
| 129 | +location = /testLinkFunSetCache { |
| 130 | + ngx_link_func_call "my_app_simple_set_cache"; |
| 131 | +} |
| 132 | +--- pipelined_requests eval |
| 133 | +["POST /testLinkFunSetCache", "GET /testLinkFunGetCache"] |
| 134 | +--- response_body eval |
| 135 | +["OK", "This is cache value"] |
| 136 | + |
| 137 | + |
| 138 | +=== TEST 59: aio threads output headers |
| 139 | +--- main_config eval: $::main_conf |
| 140 | +--- config |
| 141 | +aio threads=my_thread_pool; |
| 142 | +ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so"; |
| 143 | +location = /ext_header_foo { |
| 144 | + ngx_link_func_call "my_simple_extra_foo_header_output"; |
| 145 | +} |
| 146 | +--- request |
| 147 | +GET /ext_header_foo |
| 148 | +--- error_code: 200 |
| 149 | +--- response_headers |
| 150 | +foo: foovalue |
| 151 | + |
| 152 | + |
0 commit comments