Commit Graph

45 Commits

Author SHA1 Message Date
Andrei Zeliankou
5a8337933d Tests: pathlib used where appropriate
Also fixed various pylint errors and style issues.
2024-01-15 15:48:58 +00:00
Andrei Zeliankou
0b85fe29f7 Tests: 8XXX used as default port range.
After the launch of the project, the testing infrastructure was shared with
nginx project in some cases.  To avoid port overlap, a decision was made
to shift the port range for Unit tests.  This problem was resolved a long time
ago and is no longer relevant, so it is now safe to use port 8XXX range as the
default, as it is more appropriate for testing purposes.
2023-11-08 18:37:02 +00:00
Andrei Zeliankou
c183bd8749 Tests: get rid of classes in test files.
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-14 18:20:09 +01:00
Andrei Zeliankou
ce2405ec3d Tests: prerequisites checking reworked.
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-06-12 14:16:59 +01:00
Andrei Zeliankou
31ff94add9 Tests: more fixtures.
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-29 16:45:49 +01:00
Andrei Zeliankou
3e4fa1e202 Tests: removed unused variables. 2023-05-25 14:26:12 +01:00
Andrei Zeliankou
5f8d58d2a4 Tests: added tests for "server_version" option. 2023-05-19 18:27:41 +01:00
Andrei Zeliankou
b24257c8f6 Tests: added tests for the "log_route" option. 2023-03-21 19:20:23 +00:00
Andrei Zeliankou
7934dcabbc Tests: switched to using f-strings.
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.
2023-02-21 17:21:29 +00:00
Andrei Zeliankou
6313cffd26 Tests: added tests for the large header buffer settings.
Added tests for the "large_header_buffer_size" and
"large_header_buffers" configuration options.
2022-12-13 14:51:11 +00:00
Andrei Zeliankou
8e1e047191 Tests: don't try to return response when "no_recv" is True. 2022-10-11 13:49:10 +01:00
Andrei Zeliankou
0f72534660 Tests: style. 2022-04-11 21:05:14 +01:00
Andrei Zeliankou
39adb292d5 Tests: style. 2021-10-18 01:10:11 +01:00
Andrei Zeliankou
39c0fda24c Tests: added additional check in tests with timeouts. 2021-05-24 22:28:23 +01:00
Andrei Zeliankou
1154ede862 Tests: test_settings_send_timeout improved.
Data length adjusts depending on socket buffer size when it's possible.
2021-05-24 05:26:15 +01:00
Andrei Zeliankou
6c97a1a069 Tests: style. 2021-04-05 14:03:05 +01:00
Andrei Zeliankou
6dc9c47ccd Tests: style. 2021-01-13 06:22:43 +00:00
Andrei Zeliankou
3278253d51 Tests: added a test for "body_buffer_size" option. 2020-11-12 00:07:08 +00:00
Andrei Zeliankou
54837759f3 Tests: fixed unit.log print. 2020-10-19 22:25:29 +01:00
Andrei Zeliankou
6ec0ff3596 Tests: minor fixes. 2020-10-07 23:18:43 +01:00
Andrei Zeliankou
4de6ffa63f Tests: tuned delay in test_settings_idle_timeout_2. 2020-09-27 23:46:31 +01:00
Andrei Zeliankou
39008c1f05 Tests: added test for "idle_timeout" with empty payload. 2020-09-21 21:24:42 +01:00
Andrei Zeliankou
d5e9159340 Tests: migrated to the pytest. 2020-09-16 21:31:15 +01:00
Andrei Zeliankou
ce4a2bbd05 Tests: style. 2020-05-15 04:20:56 +01:00
Andrei Zeliankou
6a9a4fe0d4 Tests: introduced module version specification in prerequisites. 2020-04-24 05:08:56 +01:00
Andrei Zeliankou
fcca366392 Tests: more tests with "max_body_size". 2020-02-20 20:33:49 +00:00
Andrey Zelenkov
65ca2d7b19 Tests: refactored prerequisites model. 2019-09-14 14:44:35 +03:00
Andrey Zelenkov
90c5d3f5c0 Tests: adjusted skipping tests. 2019-05-30 16:46:04 +03:00
Andrey Zelenkov
29b4e4431f Tests: speed up tests. 2019-04-09 20:59:35 +03:00
Andrey Zelenkov
af24e4dec4 Tests: simplified module checking. 2019-04-09 16:14:42 +03:00
Andrey Zelenkov
19eba1730a Tests: unit module refactoring. 2019-03-28 18:43:13 +03:00
Andrey Zelenkov
281899fcef Tests: style. 2019-03-26 23:38:30 +03:00
Andrey Zelenkov
bd77c9a4d2 Tests: read_timeout option introduced.
Also, increased default select() timeout from 1s to 5s.
2019-02-27 19:43:14 +03:00
Andrey Zelenkov
4de2c8b567 Tests: added "Host" and "Connetion" headers where necessary.
Also minor header organizing.
2019-02-27 19:15:02 +03:00
Andrey Zelenkov
7ce9f61cb6 Tests: minor fixes. 2019-02-14 16:09:19 +03:00
Andrey Zelenkov
eff760bd2b Tests: added command line arguments parsing in tests.
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-11-15 21:26:15 +03:00
Andrey Zelenkov
8065ba84aa Tests: test_settings_header_read_timeout_update adjusted. 2018-09-17 19:07:29 +03:00
Andrey Zelenkov
511a0fa760 Tests: used relative path for configuration. 2018-09-06 20:18:33 +03:00
Andrey Zelenkov
58d23eb5b4 Tests: fixed test_settings_header_read_timeout_update. 2018-09-04 02:30:27 +03:00
Andrey Zelenkov
dea7e0dc87 Tests: more timeout tests. 2018-08-21 20:49:23 +03:00
Andrey Zelenkov
a4e75be524 Tests: typo. 2018-08-21 20:41:36 +03:00
Andrey Zelenkov
b6ce2da65c Tests: expectedFailure removed from test_settings_idle_timeout.
Fix committed in f04b28aa6e02.
2018-07-30 20:07:31 +03:00
Andrey Zelenkov
7f57b6d984 Tests: fixed test_settings_idle_timeout. 2018-07-30 17:01:14 +03:00
Andrey Zelenkov
a458f50d59 Tests: fixed header value char tests.
Use byte strings to avoid problems with encoding.
2018-07-30 16:40:52 +03:00
Andrey Zelenkov
cfe91315eb Tests: HTTP settings. 2018-07-13 20:15:50 +03:00