summaryrefslogtreecommitdiffhomepage
path: root/test/test_configuration.py (follow)
AgeCommit message (Collapse)AuthorFilesLines
2023-06-14Tests: get rid of classes in test files.Andrei Zeliankou1-361/+388
Class usage came from the unittest framework and it was always redundant after migration to the pytest. This commit removes classes from files containing tests to make them more readable and understandable.
2023-06-12Tests: prerequisites checking reworked.Andrei Zeliankou1-5/+5
Prerequisites check moved to the module level to simplify class structure. Discovery and prerequisites checks functions moved to the separate files. Introduced "require" fixture to provide per-test requirements check.
2023-05-29Tests: more fixtures.Andrei Zeliankou1-3/+2
Common methods from applications/proto.py converted to the fixtures. sysctl check moved to the specific file where it is using. Some options moved to the constructor to have early access.
2023-05-25Tests: removed unused variables.Andrei Zeliankou1-3/+3
2023-02-21Tests: switched to using f-strings.Andrei Zeliankou1-6/+4
Previously, it was necessary to support older versions of Python for compatibility. F-strings were released in Python 3.6. Python 3.5 was marked as unsupported by the end of 2020, so now it's possible to start using f-strings safely for better readability and performance.
2022-12-14Python: Added "prefix" to configuration.OutOfFocus41-0/+86
This patch gives users the option to set a `"prefix"` attribute for Python applications, either at the top level or for specific `"target"`s. If the attribute is present, the value of `"prefix"` must be a string beginning with `"/"`. If the value of the `"prefix"` attribute is longer than 1 character and ends in `"/"`, the trailing `"/"` is stripped. The purpose of the `"prefix"` attribute is to set the `SCRIPT_NAME` context value for WSGI applications and the `root_path` context value for ASGI applications, allowing applications to properly route requests regardless of the path that the server uses to expose the application. The context value is only set if the request's URL path begins with the value of the `"prefix"` attribute. In all other cases, the `SCRIPT_NAME` or `root_path` values are not set. In addition, for WSGI applications, the value of `"prefix"` will be stripped from the beginning of the request's URL path before it is sent to the application. Reviewed-by: Andrei Zeliankou <zelenkov@nginx.com> Reviewed-by: Artem Konev <artem.konev@nginx.com> Signed-off-by: Alejandro Colomar <alx@nginx.com>
2022-09-07Tests: minor fixes.Andrei Zeliankou1-9/+3
2022-08-25Tests: added tests with abstract UNIX sockets.Andrei Zeliankou1-0/+16
2021-10-18Tests: style.Andrei Zeliankou1-1/+0
2021-07-03Tests: address configuration tests reworked.Andrei Zeliankou1-58/+21
2021-06-28Tests: renamed share to static.Andrei Zeliankou1-1/+2
Also minor style changes.
2021-05-18Tests: added test to check port release.Andrei Zeliankou1-0/+28
2021-04-05Tests: style.Andrei Zeliankou1-0/+1
2021-01-13Tests: style.Andrei Zeliankou1-1/+0
2020-12-08Tests: skip_alert() converted to the fixture.Andrei Zeliankou1-2/+1
2020-10-07Tests: minor fixes.Andrei Zeliankou1-4/+4
2020-09-16Tests: migrated to the pytest.Andrei Zeliankou1-252/+166
2020-08-13Tests: set root by unprivilaged user.Tiago Natel de Moura1-0/+27
2020-08-11Tests: reducing the number of generated applications.Max Romanov1-1/+3
Each application initializes a shared port with 2 file descriptors, so the test fails because the router reaches the open files limit.
2020-05-15Tests: style.Andrei Zeliankou1-0/+1
2020-04-24Tests: introduced module version specification in prerequisites.Andrei Zeliankou1-1/+1
2020-03-25Tests: added tests for comments in JSON.Andrei Zeliankou1-0/+61
2020-03-25Tests: UTF-8 BOM test.Andrei Zeliankou1-0/+19
2019-10-08Tests: default port number used.Andrey Zelenkov1-1/+1
2019-09-14Tests: refactored prerequisites model.Andrey Zelenkov1-1/+1
2019-05-30Tests: adjusted skipping tests.Andrey Zelenkov1-33/+4
2019-04-22Tests: using "pass" option instead of deprecated "application".Valentin Bartenev1-8/+8
2019-04-09Tests: simplified module checking.Andrey Zelenkov1-2/+1
2019-03-28Tests: unit module refactoring.Andrey Zelenkov1-4/+4
2019-03-26Tests: style.Andrey Zelenkov1-165/+235
2019-03-25Turning off port read event state after main process fork.Max Romanov1-2/+0
Master port stores two file descriptors and works as a read port on the master process side. After a fork, the port switches into write mode and the read socket closes, but the same event structure is used for the write socket. However, the inherited structure remained in read state, telling the epoll engine to use MOD operation instead of ADD. The patch resets read event state, so the engine may write using proper ADD operation.
2019-03-05Introducing one more large config test, but without sockets.Max Romanov1-0/+25
2019-03-01Tests: skip more alerts.Andrey Zelenkov1-2/+2
2019-02-20Tests: one more alert skipped in test_json_application_many.Andrey Zelenkov1-0/+1
2019-02-20Tests: skip sendmsg()/recvmsg() alerts for all tests.Andrey Zelenkov1-1/+0
Currently, these alerts may appear in the log when any application exits.
2019-02-20Tests: fixed ports range.Andrey Zelenkov1-2/+2
2019-01-28Tests: large configuration tests.Andrey Zelenkov1-0/+47
2018-11-15Tests: added command line arguments parsing in tests.Andrey Zelenkov1-1/+1
Added the following command line arguments: -d, --detailed: Show detailed output for tests Usage examples: ./test/run.py --detailed python3 test/test_access_log.py --detailed python3 test/test_access_log.py -d TestUnitAccessLog.test_access_log_ipv6 -l, --log: Save unit.log after the test execution Usage examples: ./test/run.py -l python3 test/test_access_log.py -l python3 test/test_access_log.py --log TestUnitAccessLog.test_access_log_ipv6
2018-09-06Tests: used relative path for configuration.Andrey Zelenkov1-15/+15
2018-07-11Tests: empty configuration.Andrey Zelenkov1-0/+3
2018-04-02Tests: change alert skip in test_listeners_empty after RPC fixes.Andrey Zelenkov1-1/+1
2018-03-06Tests: detect alerts and Sanitizer errors.Andrey Zelenkov1-0/+19
2018-02-26Tests: more configuration tests.Andrey Zelenkov1-10/+12
2018-02-14Tests: removed unused code in unit.py.Andrey Zelenkov1-4/+1
2018-02-05Tests: adjusted check_version()'s.Andrey Zelenkov1-1/+4
2018-01-29Introducing extended app process management.Max Romanov1-16/+14
- Pre-fork 'processes.spare' application processes; - fork more processes to keep 'processes.spare' idle processes; - fork on-demand up to 'processes.max' count; - scale down idle application processes above 'processes.spare' after 'processes.idle_timeout'; - number of concurrently started application processes also limited by 'processes.spare' (or 1, if spare is 0).
2018-01-30Tests: added methods to manage unit configuration.Andrey Zelenkov1-110/+94
2018-01-30Tests: small fixes.Andrey Zelenkov1-2/+2
2018-01-30Tests: fixed test for listener without port.Andrey Zelenkov1-2/+2
Broken after 879868522dbf.
2018-01-24Tests: using "expectedFailure" decorator instead of assertTry().Andrey Zelenkov1-59/+128