-
Notifications
You must be signed in to change notification settings - Fork 504
How to run test case?
Xiaochen Wang edited this page Jul 3, 2021
·
10 revisions
This is an informal wiki page, just used to record the test methods of the developer Xiaochen. However, this page may help those who want to redevelop and test this project.
Test nginx and ngx_http_proxy_connect_module in ubuntu 20. which is installed in Windows 10 - WSL 1.0.
configure error:
./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using —without–http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using —with–pcre=...
then:
$ sudo apt-get install libpcre3-dev
WINDOWS-V0HQ9PG pc $ ls
nginx-1.21.0 nginx-1.21.0.tar.gz ngx_http_proxy_connect_module
^-- nginx source directory
WINDOWS-V0HQ9PG pc $ git clone https://github.com/nginx/nginx-tests
Cloning into 'nginx-tests'...
remote: Enumerating objects: 7543, done.
remote: Counting objects: 100% (620/620), done.
remote: Compressing objects: 100% (418/418), done.
remote: Total 7543 (delta 353), reused 389 (delta 189), pack-reused 6923
Receiving objects: 100% (7543/7543), 3.90 MiB | 4.27 MiB/s, done.
Resolving deltas: 100% (5034/5034), done.
- modify some path variables of runtest.sh
WINDOWS-V0HQ9PG pc $ pwd
/home/xiaochen/pc
WINDOWS-V0HQ9PG pc $ vim ngx_http_proxy_connect_module/t/runtest.sh #<<< modify runtest.sh
WINDOWS-V0HQ9PG pc $ cat ngx_http_proxy_connect_module/t/runtest.sh
# get it from https://github.com/nginx/nginx-tests
nginx_tests_lib_path=/home/xiaochen/pc/nginx-tests/lib
# compiled nginx binary
nginx_binary=/home/xiaochen/pc/nginx-1.21.0/objs/nginx
# path of test cases
proxy_connect_test_cases=/home/xiaochen/pc/ngx_http_proxy_connect_module/t
TEST_NGINX_UNSAFE=yes \
TEST_NGINX_BINARY=$nginx_binary \
prove -v -I $nginx_tests_lib_path $proxy_connect_test_cases
- running test case failed and install some PERL test lib
ERROR:
...Can't locate Net/DNS/Nameserver.pm in @INC (you may need to install the Net::DNS::Nameserver module) ...
WINDOWS-V0HQ9PG pc $ perl -MCPAN -e "install Net::DNS"
- run test case