Commit Graph

384 Commits

Author SHA1 Message Date
Tiago Natel de Moura
417f5d911d Tests: added new ruby isolation test without namespaces. 2020-10-29 14:31:37 +00:00
Max Romanov
6a00bab41e Tests: improving get_application_type() and fixing its name.
This patch also enables multiversion tests running for Java.
2020-10-28 00:01:46 +03:00
Andrei Zeliankou
8956e668cc Tests: fixed isolation detection. 2020-10-27 04:09:52 +00:00
Andrei Zeliankou
54837759f3 Tests: fixed unit.log print. 2020-10-19 22:25:29 +01:00
Valentin Bartenev
2821b3347c PHP: compatibility with 8.0.0 RC1.
This closes #474 PR on GitHub.
2020-10-06 18:12:05 +03:00
Andrei Zeliankou
6ec0ff3596 Tests: minor fixes. 2020-10-07 23:18:43 +01:00
Valentin Bartenev
645683f432 Tests: fixed loading selected module version.
Previously, for PHP, Ruby, and Perl the latest version was always loaded
in multi-version tests.
2020-10-07 22:04:54 +03:00
Valentin Bartenev
3f513f434f Router: fixed "not empty" pattern matching.
The "!" pattern should be opposite to "", i.e. match only non-empty values.
But after 3c00af54b937 it was equal to "!*", which is wrong.
2020-10-07 20:06:30 +03:00
Andrei Zeliankou
37390d2a3b Tests: fixed tests to run as root. 2020-10-06 20:30:51 +01:00
Max Romanov
481e950b86 Tests: pretty versions output for multi-version tests. 2020-10-05 13:26:35 +03:00
Andrei Zeliankou
58cc73994f Tests: added websocket test with long length. 2020-10-05 11:05:19 +01:00
Andrei Zeliankou
152ad526f4 Tests: added ASGI Lifespan. 2020-10-05 11:05:00 +01:00
Max Romanov
12f225a43a Tests: added ASGI HTTP applications. 2020-10-01 23:55:43 +03:00
Max Romanov
d97e3a3296 Tests: added ASGI WebSocket. 2020-10-01 23:55:35 +03:00
Tiago Natel de Moura
c2eb245b32 PHP: fixed "rootfs" isolation dependency on system mounts. 2020-09-09 19:28:44 +01:00
Andrei Zeliankou
d491527555 Tests: minor fixes.
Fixed temporary dir removing.
Fixed printing path to log.
Module checks moved to the separate file.
2020-10-01 10:17:00 +01:00
Andrei Zeliankou
1fe1518ab1 Tests: fixed test_static_space_in_name. 2020-09-30 22:45:58 +01:00
Andrei Zeliankou
4de6ffa63f Tests: tuned delay in test_settings_idle_timeout_2. 2020-09-27 23:46:31 +01:00
Andrei Zeliankou
4095454946 Tests: added pytest.ini. 2020-09-27 23:27:19 +01:00
Max Romanov
efe65dee4d Tests: prerequisites check improved by using callable.
This is required for more flexible Python version check since ASGI works
for Python 3.5+.  Version check via 'startswith()' function removed as
not consistent.
2020-09-24 09:47:27 +03:00
Max Romanov
1fc51cf140 Tests: introduced module name configuration.
Also fixed problem with "/" in application name.
2020-09-22 19:53:19 +03:00
Max Romanov
dc49c561e2 Tests: improved response receiving while upgrade.
The patch required to process non-101 response.
2020-09-22 12:40:35 +03:00
Max Romanov
767c4cb508 Tests: using dict.get() method with default value.
No functional changes.  Only code readability improved.
2020-09-22 12:40:18 +03:00
Andrei Zeliankou
98c86c415c Tests: added variable test with nonexistent upstream. 2020-09-21 21:29:34 +01:00
Andrei Zeliankou
39008c1f05 Tests: added test for "idle_timeout" with empty payload. 2020-09-21 21:24:42 +01:00
Max Romanov
449652afa1 Tests: added multiple headers concatenation test. 2020-09-21 21:18:13 +03:00
Max Romanov
af964488ba Tests: changing Python application callable name. 2020-09-21 10:32:14 +03:00
hongzhidao
806135f1c9 Router: fixed "pass" to upstreams.
Messed up return values in nxt_upstream_find() caused error in applying any
configuration with a valid "pass" value in router configuration pointing to
upstream.  That wasn't the case in "listeners" objects, where the return value
wasn't checked.

Also, it caused segfault in cases where the "pass" option was configured with
variables and resulting value was pointing to a non-existent upstream.

Added missing return checks as well to catch possible memory allocation errors.

The bug was introduced in d32bc428f46b.

This closes #472 issue on GitHub.
2020-08-28 00:53:36 -04:00
Andrei Zeliankou
d5e9159340 Tests: migrated to the pytest. 2020-09-16 21:31:15 +01:00
Andrei Zeliankou
df374057f7 Tests: $host varaible test.
Also added few tests for $uri and minor style fixes.
2020-08-31 03:14:02 +01:00
Tiago Natel de Moura
d1bdaf98ba Tests: disable of language_deps. 2020-08-25 15:27:51 +01:00
Tiago Natel de Moura
244ffb2829 Tests: PHP extension mounts. 2020-08-25 13:48:33 +01:00
Tiago Natel de Moura
10738c3fe2 Tests: default tmpfs in rootfs. 2020-08-20 15:53:20 +01:00
Tiago Natel de Moura
479fdff39d Tests: set root by unprivilaged user. 2020-08-13 12:17:15 +01:00
Andrei Zeliankou
8032686a57 Tests: added test with error on loading application. 2020-08-13 13:17:27 +01:00
Andrei Zeliankou
c40e45344f Tests: added variables tests. 2020-08-13 13:17:01 +01:00
Max Romanov
496f41c134 Tests: reducing the number of generated applications.
Each application initializes a shared port with 2 file descriptors, so the test
fails because the router reaches the open files limit.
2020-08-11 19:20:25 +03:00
Max Romanov
bab4a9e9f2 Tests: skipping idle zero timeout.
This is a temporary solution after the 'shared port' patch.  The application
process becomes idle immediately after creation.  Even if it starts processing
a request (without acknowledging it yet), it is stopped by the router because
an 'out-of-idle-time' event occurs.
2020-08-11 19:20:23 +03:00
Andrei Zeliankou
f1e445bdef Tests: added PHP test with time check in error log messages. 2020-07-28 04:53:40 +01:00
Andrei Zeliankou
355ed9697d Tests: fixed double stop() call for some tests. 2020-07-28 04:53:32 +01:00
Andrei Zeliankou
dc1377dc48 Tests: style. 2020-07-28 03:09:50 +01:00
Max Romanov
661c223eda Tests: switching stdout to blocking before printing log.
This is another attempt to fix the following error message:
BlockingIOError: [Errno 11] write could not complete without blocking
2020-07-22 10:05:10 +03:00
Axel Duch
b6792b00ae Router: route patterns multi wildcards fix.
Matching 'start' and 'end' position now adjusted to avoid false matching.

This is related to #434 issue on Github.
Thanks to 洪志道 (Hong Zhi Dao).
2020-07-10 10:28:53 +01:00
Axel Duch
a9a21f6fe4 Router: route patterns multi wildcards support. 2020-07-04 03:24:07 +01:00
Andrei Zeliankou
9bd6baefae Tests: fixed opcache detection.
opcache_get_status() returns array, so square brackets
should be used to access "opcache_enabled" value.
2020-06-26 04:23:47 +01:00
Andrei Zeliankou
6e55f03dcd Tests: added chunked tests. 2020-06-24 04:11:09 +01:00
Tiago Natel de Moura
08b765ae42 Tests: Added rootfs tests. 2020-05-28 14:59:52 +01:00
Tiago Natel de Moura
e9e5ddd5a5 Refactor of process management.
The process abstraction has changed to:

  setup(task, process)
  start(task, process_data)
  prefork(task, process, mp)

The prefork() occurs in the main process right before fork.

The file src/nxt_main_process.c is completely free of process
specific logic.

The creation of a process now supports a PROCESS_CREATED state.  The
The setup() function of each process can set its state to either
created or ready.  If created, a MSG_PROCESS_CREATED is sent to main
process, where external setup can be done (required for rootfs under
container).

The core processes (discovery, controller and router) doesn't need
external setup, then they all proceeds to their start() function
straight away.

In the case of applications, the load of the module happens at the
process setup() time and The module's init() function has changed
to be the start() of the process.

The module API has changed to:

  setup(task, process, conf)
  start(task, data)

As a direct benefit of the PROCESS_CREATED message, the clone(2) of
processes using pid namespaces now doesn't need to create a pipe
to make the child block until parent setup uid/gid mappings nor it
needs to receive the child pid.
2020-03-09 16:28:25 +00:00
Andrei Zeliankou
fa4d4b6120 Tests: print unit.log in case of errors.
Thanks to hongzhidao.
2020-05-20 23:06:56 +01:00
Andrei Zeliankou
82471c1dd3 Tests: added tests for "targets" option. 2020-05-15 04:21:25 +01:00