nginx/nginx-tests
GitHub: nginx/nginx-tests
nginx 官方测试套件,通过自动启动实例并使用 Perl 的 prove 框架对 nginx 功能和模块进行端到端验证。
Stars: 133 | Forks: 113
nginx 测试套件。
像运行 perl 测试一样,使用 prove 来运行测试。也可以运行单个测试。
注意:测试运行时会启动 nginx(以及需要时的后台守护进程)监听 localhost,并可能使用 8000 到 8999 范围内的各种端口。
用法:
```
$ TEST_NGINX_BINARY=/path/to/nginx prove .
```
默认情况下,测试期望 nginx 二进制文件位于 ../nginx/objs/nginx。
环境变量:
TEST_NGINX_BINARY
```
Sets path to nginx binary to be tested, defaults to "../nginx/objs/nginx".
```
TEST_NGINX_MODULES
```
Sets path to modules directory, defaults to dirname of TEST_NGINX_BINARY.
```
TEST_NGINX_VERBOSE
```
Be a bit more verbose (in particular, print requests sent and responses
got from nginx). Note that this requires prove -v (or HARNESS_VERBOSE).
```
TEST_NGINX_LEAVE
```
If set, temporary directory with configs and logs won't be deleted on test
completion. Useful for debugging.
```
TEST_NGINX_CATLOG
```
Cat error log to stdout after test completion. Useful for debugging.
```
TEST_NGINX_UNSAFE
```
Run unsafe tests.
```
TEST_NGINX_GLOBALS
```
Sets additional directives in main context.
```
TEST_NGINX_GLOBALS_HTTP
```
Sets additional directives in http context.
```
TEST_NGINX_GLOBALS_STREAM
```
Sets additional directives in stream context.
```
祝测试愉快!
标签:Nginx, Perl, Web服务器, 测试套件, 系统集成测试