Commit Graph

589 Commits

Author SHA1 Message Date
Andrei Zeliankou
8c253631d9 Tests: added "requirements.txt". 2021-11-04 18:13:19 +00:00
Andrei Zeliankou
bc95fcc324 Tests: added migration test for "share". 2021-11-04 13:05:53 +00:00
Andrei Zeliankou
2359c4056c Tests: added pyOpenSSL module check were necessary. 2021-11-02 18:39:03 +00:00
Andrei Zeliankou
c27d0fe7bd Tests: removed unused imports. 2021-11-02 17:53:28 +00:00
Andrei Zeliankou
bd9da8bc8c Tests: added tests for TLS session tickets. 2021-10-28 18:30:37 +01:00
Andrei Zeliankou
e428f2cf7a Tests: added tests for TLS sessions. 2021-10-28 17:15:38 +01:00
Andrei Zeliankou
39adb292d5 Tests: style. 2021-10-18 01:10:11 +01:00
Andrei Zeliankou
5c20d43eff Tests: added tests for variables in "chroot". 2021-10-05 12:43:05 +01:00
Andrei Zeliankou
a59557ccd7 Tests: added tests for variables in "share". 2021-10-05 12:42:41 +01:00
Andrei Zeliankou
22028549c6 Tests: added tests for "share" option with arrays. 2021-10-05 03:24:56 +01:00
Zhidao HONG
c5220944d2 Static: variables in the "share" option.
This commit supports variable in the "share" option, the finding path to
file serve is the value from "share". An example:
{
    "share": "/www/data/static$uri"
}
2021-09-30 22:17:28 +08:00
Max Romanov
c07f3d3ff6 Fixed WebSocket connection hang issue after listener reconfigure.
Because the configuration values were read from the listener's configuration,
an established WebSocket connection was unable to work properly (i. e. stuck)
if the listener was removed.  The correct source of configuration values is the
request config joint.

This is related to issue #581 on GitHub.
2021-09-20 09:01:08 +03:00
Max Romanov
b586707c86 Java: upgrading third-party components. 2021-08-12 14:55:51 +03:00
Oisin Canty
039d032dd6 Tests: client IP address replacement. 2021-08-12 08:23:23 +00:00
Max Romanov
9988569bea Tests: initialising log params before first _print_log(). 2021-08-11 19:01:16 +03:00
Max Romanov
5f67d30ec7 Tests: retrying directory remove if resource is busy. 2021-08-11 19:01:04 +03:00
Max Romanov
1a85ad378f Java: upgrading third-party components. 2021-08-09 10:14:57 +03:00
Oisin Canty
60cf139961 Router: fixed crash when matching an empty address pattern array.
A crash would occur when the router tried to match an
against an empty address pattern array.

The following configuration was used to reproduce the
issue:

{
    "listeners": {
        "127.0.0.1:8082": {
            "pass": "routes"
        }
    },
    "routes": [
        {
            "match": {
                "source": []
            },
            "action": {
                "return": 200
            }
        }
    ]
}
2021-08-05 16:00:01 +00:00
Zhidao HONG
d16cf04167 Router: fixed segmentation fault.
In the case that routes or upstreams is empty and the pass option is a variable.
If the resolved pass is routes or upstreams, a segment error occurred.
2021-08-02 12:30:38 +08:00
Max Romanov
fa9fb29be2 Application restart introduced.
When processing a restart request, the router sends a QUIT message to all
existing processes of the application.  Then, a new shared application port is
created to ensure that new requests won't be handled by the old processes of
the application.
2021-07-29 19:50:39 +03:00
Andrei Zeliankou
960ffc9967 Tests: added SNI test without hostname in request. 2021-07-23 15:37:03 +01:00
Oisin Canty
1f2ba4dca8 Tests: use mutex with multitthreaded Ruby hooks.
This commit fixes a rare crash that can occur when File.write is
called by many threads.
2021-07-21 14:53:33 +00:00
Andrei Zeliankou
4f94df6a71 Tests: print_log_on_assert() decorator introduced. 2021-07-06 12:22:10 +01:00
Andrei Zeliankou
bc84992075 Tests: address configuration tests reworked. 2021-07-03 19:15:04 +01:00
Oisin Canty
8c83652c2a Tests: Ruby hooks. 2021-07-02 13:00:57 +00:00
Oisin Canty
6c14d5d7b1 Tests: run Ruby applications inside temporary directory. 2021-07-02 13:00:04 +00:00
Max Romanov
210c8bbd81 Tests: fixing racing condition in respawn tests.
A race may occur between the router process restart and the main process
sending a notification to the running controller.  For example, a test script
detects the new process and starts performing a smoke test, but the controller
has not yet received the 'remove PID' notification, so the connection to the
router is broken and any attempt to update the configuration will cause an
error.

The solution is to perform several attempts to reconfigure Unit with a short
delay between failures.
2021-07-01 16:22:08 +03: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
b86891c4ef Tests: renamed share to static.
Also minor style changes.
2021-06-28 22:05:40 +01:00
Andrei Zeliankou
72420358be Tests: chroot test with permissions skipped under root. 2021-06-24 04:01:15 +01:00
Andrei Zeliankou
f91fe4ce9e Tests: added tests for TLS "conf_commands" option. 2021-05-27 13:30:51 +01:00
Andrei Zeliankou
753ce145f7 Tests: added TLS test without close notify. 2021-05-26 21:47:12 +01:00
Oisin Canty
d67a0c8711 Static: handled unknown MIME types when MIME-filtering active. 2021-05-26 16:48:11 +00:00
Max Romanov
155e22da05 Go: fixing tests for Go 1.16.
In Go 1.16, the module-aware mode is enabled by default; to fall back to
previous behavior, the GO111MODULE environment variable should be set to
'auto'.

Details: https://golang.org/doc/go1.16
2021-05-25 18:00:59 +03: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
Oisin Canty
c160ea11e4 Node.js: renamed "require_shim" to "loader". 2021-05-24 09:01:42 +00:00
Andrei Zeliankou
d643900237 Tests: minor fixes. 2021-05-24 04:33:42 +01:00
Oisin Canty
e50bb120e2 Tests: Python targets. 2021-05-20 13:03:12 +00:00
Andrei Zeliankou
2f0cca2e2b Tests: added test to check port release. 2021-05-18 16:35:54 +01:00
Andrei Zeliankou
1198118b3b Tests: fixed incorrect "--restart" mode performing. 2021-05-17 15:39:15 +01:00
Andrei Zeliankou
25603eae9f Tests: added test for TLS with IP in SAN. 2021-05-12 14:37:25 +01:00
Oisin Canty
a0c083af20 Node.js: a shim for overriding "http" and "websocket" modules.
Also added stubs for Server.address()
This was done to prevent crashes in some popular frameworks like express

Supports both CommonJS and the new ES Modules system syntax e.g:

app.js:
const http = require('http')

app.mjs:
import http from "http"

Usage on Node 14.16.x and higher:
{
    "type": "external",
    "processes": {"spare": 0},
    "working_directory": '/project',
    "executable": "/usr/bin/env",
    "arguments": [
        "node",
        "--loader",
        "unit-http/require_shim.mjs"
        "--require",
        "unit-http/require_shim",
        "app.js"
    ]
}

Usage on Node 14.15.x and lower:
{
    "type": "external",
    "processes": {"spare": 0},
    "working_directory": '/project',
    "executable": "/usr/bin/env",
    "arguments": [
        "node",
        "--require",
        "unit-http/require_shim",
        "app.js"
    ]
}
2021-05-12 09:26:55 +00:00
Andrei Zeliankou
07c6bf165d Tests: temporary dir removed after tests execution. 2021-05-11 15:30:12 +01:00
Andrei Zeliankou
a17f7e03d4 Tests: added test for TLS with empty Subject field. 2021-05-07 17:42:48 +01:00
Andrei Zeliankou
b9e8d8073c Tests: PHP test with getting variable before the script is loaded. 2021-05-07 16:55:42 +01:00
Oisin Canty
6703b68ed0 Tests: MIME filtering 2021-05-06 14:22:36 +00:00
Andrei Zeliankou
e0a061955b Tests: added tests for openat2() features. 2021-05-05 12:36:57 +01:00
Andrei Zeliankou
5b332cae83 Tests: fixed "skip" descriptors check flag for controller. 2021-04-14 15:56:03 +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