Commit Graph

70 Commits

Author SHA1 Message Date
Max Romanov 1a85ad378f Java: upgrading third-party components. 2021-08-09 10:14:57 +03: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
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 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
Oisin Canty c160ea11e4 Node.js: renamed "require_shim" to "loader". 2021-05-24 09:01:42 +00:00
Oisin Canty e50bb120e2 Tests: Python targets. 2021-05-20 13:03:12 +00: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
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 e8577afc21 Tests: SNI. 2021-03-26 21:06:23 +00:00
Sergey A. Osokin 175ef1c1db Java: upgrading third-party components. 2021-03-22 17:15:12 +03:00
Andrei Zeliankou 11f7d833a9 Tests: increased timeout in wait_for_record(). 2021-02-10 16:34:37 +00:00
Tiago Natel de Moura 03436d2ec2 Tests: introduced a separate cache directory for Go builds.
The Go compiler can't detect changes to C header files when
compiling CGO applications, and then this leads to Go test
samples being linked with wrong libunit.

This patch creates a new cache directory reused throughout
the test suite.
2020-12-21 11:00:46 +00:00
Andrei Zeliankou 8f91628563 Tests: utils module introduced. 2020-12-08 14:37:25 +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
Max Romanov 5fd2933d2e Python: supporting ASGI legacy protocol.
Introducing manual protocol selection for 'universal' apps and frameworks.
2020-11-10 22:27:08 +03:00
Max Romanov a8a9d80f8d Tests: supporting instant app parameters in load(). 2020-11-10 22:27:08 +03:00
Andrei Zeliankou 5182d2c398 Tests: force applications to build for JVM 8.
This change is made to avoid situations when an application
is compiled for a version newer than the Java module used.
2020-11-03 01:31:05 +00:00
Max Romanov 4ba9e1d005 Java: upgrading 3rd-party components. 2020-11-02 21:05:04 +03:00
Tiago Natel de Moura 0390cb3a61 Isolation: mounting of procfs by default when using "rootfs". 2020-10-29 20:30:53 +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
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
Max Romanov d97e3a3296 Tests: added ASGI WebSocket. 2020-10-01 23:55:35 +03: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
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
Andrei Zeliankou d5e9159340 Tests: migrated to the pytest. 2020-09-16 21:31:15 +01:00
Andrei Zeliankou dc1377dc48 Tests: style. 2020-07-28 03:09:50 +01:00
Tiago Natel de Moura 08b765ae42 Tests: Added rootfs tests. 2020-05-28 14:59:52 +01:00
Andrei Zeliankou ce4a2bbd05 Tests: style. 2020-05-15 04:20:56 +01:00
Valentin Bartenev 0174c971b5 Configuration: URI encoding in the "pass" option.
This is useful to escape "/" in path fragments.  For example, in order
to reference the application named "foo/bar":

  {
      "pass": "applications/foo%2Fbar"
  }
2020-05-14 13:15:00 +03:00
Andrei Zeliankou d7aa514d6a Tests: added notification on "read_timeout" expiration. 2020-04-03 01:46:59 +01:00
Andrei Zeliankou 5f2d07019c Tests: increase default "read_timeout" to 60s in message_read(). 2020-03-27 15:48:39 +00:00
Andrei Zeliankou 48ad88ee72 Tests: increase default "read_timeout" value to 60s.
This change is necessary to avoid errors on slow hosts.

Also slightly reworked argument passing to the recvall() function.
2020-03-23 19:18:26 +00:00
Andrei Zeliankou f36f0f2461 Tests: redirect tests output to the stdout. 2020-03-10 18:10:42 +00:00
Tiago Natel de Moura 80763b3e64 Tests: chdir() and open() for PHP module.
These tests ensure optimizations in the chdir calls don't break
SAPI semantics.
2020-03-03 18:53:26 +00:00
Max Romanov a427ecd4c5 Go: installing go module for tests into build directory. 2019-12-24 17:59:48 +03:00
Tiago Natel abbad122bb Tests: added support for testing "user" and "group". 2019-11-11 14:35:29 +00:00
Tiago Natel 19b974674c Tests: fixed tests to run as root.
- The mode of testdir was changed to allow reading from other users/groups.
- The java multipart test now uploads the file into an app writable dir.
- The build directory was made readable for other users.
- The python environment test now uses the HOME env var instead of PWD
  because the latter is not set by the root shell (/bin/sh) by default.
- The node `node_modules` directory now is copied into the `testdir` instead
  of using symlinks.
2019-11-09 20:14:52 +00:00
Andrei Zeliankou 5452ee458d Tests: fixed websocket tests. 2019-11-13 18:11:24 +03:00
Andrey Zelenkov 47436e9be5 Tests: improved handshake for websocket tests. 2019-10-23 16:26:06 +03:00
Andrey Zelenkov d82f125368 Tests: fixed hanging of Go tests.
This closes #319 issue on GitHub.
2019-09-25 19:21:42 +03:00
Andrey Zelenkov 65ca2d7b19 Tests: refactored prerequisites model. 2019-09-14 14:44:35 +03:00
Andrey Zelenkov 962cdb6659 Tests: prepare_env() introduced. 2019-09-16 15:37:32 +03:00