Skip to content

Commit 806a8fa

Browse files
committed
update test case
1 parent deebfa3 commit 806a8fa

5 files changed

+25
-24
lines changed

build_test_resources/sanity_test_aio_parse.t

+9-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--- main_config eval: $::main_conf
33
--- config
44
aio threads=my_thread_pool;
5-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
5+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
66
location = /testLinkFunGreeting {
77
ngx_link_func_call "my_app_simple_get_greeting";
88
}
@@ -19,7 +19,7 @@ qr/greeting from ngx_link_func testing$/
1919
--- main_config eval: $::main_conf
2020
--- config
2121
aio threads=my_thread_pool;
22-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
22+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
2323
location = /testLinkFunARGS {
2424
ngx_link_func_call "my_app_simple_get_args";
2525
}
@@ -36,7 +36,7 @@ qr/greeting=hello_nginx\?id=129310923$/
3636
--- main_config eval: $::main_conf
3737
--- config
3838
aio threads=my_thread_pool;
39-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
39+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
4040
location = /testLinkFunPOSTBody {
4141
ngx_link_func_call "my_app_simple_post";
4242
}
@@ -54,7 +54,7 @@ qr/\s/
5454
--- main_config eval: $::main_conf
5555
--- config
5656
aio threads=my_thread_pool;
57-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
57+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
5858
location = /testLinkFunCVerifyToken {
5959
ngx_link_func_call "my_app_simple_get_token_args";
6060
}
@@ -71,7 +71,7 @@ qr/QVNKS0pDQVNLTEpDS0xBU0pXbGtlandrbGplIGpka2FqbGthc2tsZGtqbHNrICBrZGpha2xzZGphc
7171
--- main_config eval: $::main_conf
7272
--- config
7373
aio threads=my_thread_pool;
74-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
74+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
7575
location = /testLinkFuncERRORRESP {
7676
error_log /dev/null;
7777
ngx_link_func_call "my_app_simple_get_no_resp";
@@ -87,7 +87,7 @@ Content-Type: text/html
8787
--- main_config eval: $::main_conf
8888
--- config
8989
aio threads=my_thread_pool;
90-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
90+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
9191
location = /testLinkFuncCallocFromPool {
9292
ngx_link_func_call "my_app_simple_get_calloc_from_pool";
9393
}
@@ -104,7 +104,7 @@ qr/This is the message calloc from pool$/
104104
--- main_config eval: $::main_conf
105105
--- config
106106
aio threads=my_thread_pool;
107-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
107+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
108108
location = /testLinkFunPOSTBody {
109109
ngx_link_func_call "my_app_simple_post";
110110
}
@@ -122,7 +122,7 @@ qr/greeting=enjoy-http-link-function-testing$/
122122
--- main_config eval: $::main_conf
123123
--- config
124124
aio threads=my_thread_pool;
125-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
125+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
126126
location = /testLinkFunGetCache {
127127
ngx_link_func_call "my_app_simple_get_cache";
128128
}
@@ -139,7 +139,7 @@ location = /testLinkFunSetCache {
139139
--- main_config eval: $::main_conf
140140
--- config
141141
aio threads=my_thread_pool;
142-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
142+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
143143
location = /ext_header_foo {
144144
ngx_link_func_call "my_simple_extra_foo_header_output";
145145
}

build_test_resources/sanity_test_raw_parse.t

+9-9
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ __DATA__
1818
1919
=== TEST 1: Set LINK_FUNC_TEST_1
2020
--- config
21-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
21+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
2222
location = /testLinkFunGreeting {
2323
ngx_link_func_call "my_app_simple_get_greeting";
2424
}
@@ -33,7 +33,7 @@ qr/greeting from ngx_link_func testing$/
3333
3434
=== TEST 2: Set LINK_FUNC_TEST_ARGS
3535
--- config
36-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
36+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
3737
location = /testLinkFunARGS {
3838
ngx_link_func_call "my_app_simple_get_args";
3939
}
@@ -48,7 +48,7 @@ qr/greeting=hello_nginx\?id=129310923$/
4848
4949
=== TEST 3: Set LINK_FUNC_TEST_POST_NONE
5050
--- config
51-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
51+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
5252
location = /testLinkFunPOSTBody {
5353
ngx_link_func_call "my_app_simple_post";
5454
}
@@ -64,7 +64,7 @@ qr/\s/
6464
6565
=== TEST 4: Set LINK_FUNC_TEST_GET_TOKEN
6666
--- config
67-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
67+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
6868
location = /testLinkFunCVerifyToken {
6969
ngx_link_func_call "my_app_simple_get_token_args";
7070
}
@@ -79,7 +79,7 @@ qr/QVNKS0pDQVNLTEpDS0xBU0pXbGtlandrbGplIGpka2FqbGthc2tsZGtqbHNrICBrZGpha2xzZGphc
7979
8080
=== TEST 5: Set LINK_FUNC_TEST_GET_ERROR_RESP
8181
--- config
82-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
82+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
8383
location = /testLinkFuncERRORRESP {
8484
error_log /dev/null;
8585
ngx_link_func_call "my_app_simple_get_no_resp";
@@ -93,7 +93,7 @@ Content-Type: text/html
9393
9494
=== TEST 6: Set LINK_FUNC_TEST_GET_CALLOC_FROM_POOL
9595
--- config
96-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
96+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
9797
location = /testLinkFuncCallocFromPool {
9898
ngx_link_func_call "my_app_simple_get_calloc_from_pool";
9999
}
@@ -108,7 +108,7 @@ qr/This is the message calloc from pool$/
108108
109109
=== TEST 7: Set LINK_FUNC_TEST_POST_BODY
110110
--- config
111-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
111+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
112112
location = /testLinkFunPOSTBody {
113113
ngx_link_func_call "my_app_simple_post";
114114
}
@@ -124,7 +124,7 @@ qr/greeting=enjoy-http-link-function-testing$/
124124
125125
=== TEST 8: Set LINK_FUNC_TEST_CACHE
126126
--- config
127-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
127+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
128128
location = /testLinkFunGetCache {
129129
ngx_link_func_call "my_app_simple_get_cache";
130130
}
@@ -139,7 +139,7 @@ location = /testLinkFunSetCache {
139139
140140
=== TEST 9: Test output headers
141141
--- config
142-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
142+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
143143
location = /ext_header_foo {
144144
ngx_link_func_call "my_simple_extra_foo_header_output";
145145
}

build_test_resources/sanity_test_subrequest_aio_parse.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--- main_config eval: $::main_conf
33
--- config
44
aio threads=my_thread_pool;
5-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
5+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
66
location /backend {
77
return 200 "Welcome ${arg_userName}";
88
}
@@ -30,7 +30,7 @@ qr/Welcome foo$/
3030
--- main_config eval: $::main_conf
3131
--- config
3232
aio threads=my_thread_pool;
33-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
33+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
3434
location /backend {
3535
return 200 "Welcome ${arg_userName}";
3636
}

build_test_resources/sanity_test_subrequest_parse.t

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
=== TEST 101: sub request with nginx link function header
22
--- config
3-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
3+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
44
location /backend {
55
return 200 "Welcome ${arg_userName}";
66
}
@@ -26,7 +26,7 @@ qr/Welcome foo$/
2626

2727
=== TEST 102: sub request with nginx link function header
2828
--- config
29-
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH/liblinkfuntest.so";
29+
ngx_link_func_lib "NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH";
3030
location /backend {
3131
return 200 "Welcome ${arg_userName}";
3232
}

config

+3-2
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ if [ $USE_THREADS = YES ]; then
4343
cat $ngx_addon_dir/build_test_resources/sanity_test_subrequest_aio_parse.t >> $ngx_addon_dir/t/sanity.t
4444
fi
4545
fi
46+
ABSOLUTE_NGX_LINKFUNC_CURRENT_PATH="$( cd "$ngx_addon_dir" ; pwd -P )"
4647
if [ "$NGX_SYSTEM" = "Darwin" ]; then
4748
clang -dynamiclib -o $ngx_addon_dir/t/liblinkfuntest.dylib -fPIC $ngx_addon_dir/build_test_resources/linkfuntest.c -Wl,-undefined,dynamic_lookup
49+
sed -i '' "s@NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH@$ABSOLUTE_NGX_LINKFUNC_CURRENT_PATH/t/liblinkfuntest.dylib@g" $ngx_addon_dir/t/sanity.t
4850
else
4951
if [ "$NGX_PLATFORM" != win32 ]; then
5052
cc -shared -o $ngx_addon_dir/t/liblinkfuntest.so -fPIC $ngx_addon_dir/build_test_resources/linkfuntest.c
53+
sed -i '' "s@NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH@$ABSOLUTE_NGX_LINKFUNC_CURRENT_PATH/t/liblinkfuntest.so@g" $ngx_addon_dir/t/sanity.t
5154
fi
5255
fi
53-
ABSOLUTE_NGX_LINKFUNC_CURRENT_PATH="$( cd "$ngx_addon_dir" ; pwd -P )"
54-
sed -i "s@NGINX_HTTP_LINK_FUNC_TEST_LIB_PATH@$ABSOLUTE_NGX_LINKFUNC_CURRENT_PATH/t@g" $ngx_addon_dir/t/sanity.t
5556
fi
5657

5758
# with OPENSSL feature, NGX_SSL had done verification

0 commit comments

Comments
 (0)