Commit graph

55 commits

Author SHA1 Message Date
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
b034bf6703 Tests: assertion related fixes. 2023-05-25 16:56:14 +01:00
Andrei Zeliankou
3e4fa1e202 Tests: removed unused variables. 2023-05-25 14:26:12 +01: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
c65e04682e Tests: minor fixes. 2022-09-07 01:11:04 +01:00
Max Romanov
900828cc4b Fixing isolated process PID manipulation.
Registering an isolated PID in the global PID hash is wrong
because it can be duplicated.  Isolated processes are stored only
in the children list until the response for the WHOAMI message is
processed and the global PID is discovered.

To remove isolated siblings, a pointer to the children list is
introduced in the nxt_process_init_t struct.

This closes #633 issue on GitHub.
2022-08-11 13:33:46 +01:00
Andrei Zeliankou
69e690affe Tests: added flags to search functions in proto.py.
Also removed unnesessary re.compile() calls.
2022-07-28 14:12:19 +01:00
Andrei Zeliankou
a3699557a3 Tests: minor improvements.
Added "go" availability check before trying to build an application.

update_action() method used were possible and fixed bug with
the relative path determination in test_static_chroot.py.

Templates optimization and style fixes.
2022-06-30 14:40:17 +01:00
Andrei Zeliankou
03a7701133 Tests: added more tests with reconfiguration. 2022-05-09 10:14:29 +01:00
Andrei Zeliankou
0f72534660 Tests: style. 2022-04-11 21:05:14 +01:00
Andrei Zeliankou
170752e96f Tests: added test with long certificate chain. 2022-02-15 21:43:02 +00:00
Andrei Zeliankou
e53ce40c58 Tests: removed TestApplicationTLS.get_server_certificate().
distutils.version is replaced by packaging.version.  Also minor style fixes.
2022-01-31 23:10:30 +00:00
Andrei Zeliankou
ae03585238 Tests: refactored working with processes. 2021-11-15 12:13:54 +00:00
Max Romanov
506ec2b825 Tests: app prototype related fixes. 2021-11-09 15:48:44 +03:00
Andrei Zeliankou
39adb292d5 Tests: style. 2021-10-18 01:10:11 +01:00
Max Romanov
cfba69781a Fixing multiple TLS-enabled listeners initialization.
Because of the incorrect 'last' field assignment, multiple listeners with
a TLS certificate did not initialize properly, which caused a router crash
while establishing a connection.

Test with multiple TLS listeners added.

The issue was introduced in the c548e46fe516 commit.

This closes #561 issue on GitHub.
2021-07-01 13:56:40 +03:00
Andrei Zeliankou
753ce145f7 Tests: added TLS test without close notify. 2021-05-26 21:47:12 +01:00
Andrei Zeliankou
25603eae9f Tests: added test for TLS with IP in SAN. 2021-05-12 14:37:25 +01:00
Andrei Zeliankou
a17f7e03d4 Tests: added test for TLS with empty Subject field. 2021-05-07 17:42:48 +01:00
Max Romanov
74b1b1fc17 Tests: preserving unit.log when run without restart.
Introducing "unit.log.Log" class for "unit.log" file management.
Moving "findall()" function into TestApplicationProto.
Using "os.kill()" to send signals.
2021-04-08 19:11:11 +03:00
Andrei Zeliankou
6c97a1a069 Tests: style. 2021-04-05 14:03:05 +01:00
Andrei Zeliankou
4404097e05 Tests: added "--restart" option.
Now Unit do not restart after each test by default.
2021-02-08 23:32:27 +00:00
Andrei Zeliankou
d43a84139d Tests: added missing checks for configuration results. 2021-01-14 03:04:20 +00:00
Andrei Zeliankou
6dc9c47ccd Tests: style. 2021-01-13 06:22:43 +00:00
Andrei Zeliankou
b2e767819f Tests: skip_alert() converted to the fixture. 2020-12-08 14:37:33 +00:00
Andrei Zeliankou
07789a23e9 Tests: options moved to the separate class.
This change is necessary to separate the logic
and prevent possible circular dependency.
2020-12-06 16:01:59 +00:00
Max Romanov
567f0a7b30 Tests: fixing tests interrupt in terminal.
KeyboardInterrupt re-raised.
2020-11-16 20:37:01 +03: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
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
0bfa09dfa0 Tests: minor fixes and style. 2020-04-14 02:35:04 +01:00
Andrei Zeliankou
f36f0f2461 Tests: redirect tests output to the stdout. 2020-03-10 18:10:42 +00:00
Tiago Natel de Moura
12e15ba43b Tests: added test for uploading files with SSL.
* * *
[mq]: multipart
2020-02-05 13:29:41 +00:00
Andrey Zelenkov
65ca2d7b19 Tests: refactored prerequisites model. 2019-09-14 14:44:35 +03:00
Andrey Zelenkov
b097476824 Tests: TestApplicationTLS.openssl_conf() introduced. 2019-07-14 23:49:37 +03:00
Andrey Zelenkov
ff5413f109 Tests: removed unnecessary initialization.
That could leads to the incorrect behaviour in test_tls_application_respawn.
2019-07-14 23:47:49 +03:00
Andrey Zelenkov
ee1f0365d2 Tests: removed unused import. 2019-07-14 23:47:07 +03:00
Andrey Zelenkov
d7516e5f4e Tests: made openssl certificates more strong to avoid errors. 2019-07-08 20:46:06 +03:00
Andrey Zelenkov
90c5d3f5c0 Tests: adjusted skipping tests. 2019-05-30 16:46:04 +03:00
Valentin Bartenev
c1a3b06d03 Tests: using "pass" option instead of deprecated "application". 2019-04-22 18:20:53 +03:00
Andrey Zelenkov
29b4e4431f Tests: speed up tests. 2019-04-09 20:59:35 +03:00
Andrey Zelenkov
549f0873c2 Tests: wait_for_record() introduced. 2019-04-09 16:14:42 +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
Max Romanov
452ce0789e Adjusting request schema value according to connection tls state.
This closes #223 issue on GitHub.
2019-03-21 13:55:57 +03:00