Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
Now that the `/status` endpoint returns a list of loaded language
modules, e.g
{
"modules": {
"python": {
"version": "3.12.2",
"lib": "/opt/unit/modules/python.unit.so"
},
...
...
}
This broke 'test/test_status.py' in a number of ways
1) The check for all the object values being 0 at startup is no longer
true with the modules section.
2) The find_diffs() check broke trying to subtract strings from
strings.
So don't include the 'modules' section in the check_zeros() check and in
the find_diffs() check, if we're dealing with strings do a basic
compare returning that value instead.
[ Commit message - Andrew ]
Co-developed-by: Andrew Clayton <a.clayton@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Add the following tests cases:
1. When "factory" key is used inside the "targets" option.
2. When "factory" key is used at the root level of python application
config.
3. When factory returns invalid callable or When factory is invalid
callable
Link: <https://github.com/nginx/unit/pull/1336>
[ Commit subject & message formatting tweaks - Andrew ]
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
|
|
|
|
Otherwise string will be printed as:
"Could not unmount filesystems in tmpdir ({temporary_dir})"
|
|
|
|
|
|
[ Tweaked subject - Andrew ]
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
For more information please see https://github.com/nginx/unit/pull/1191
|
|
OpenSSL 3.2.0 generates X.509v3 certificates by default. These
certificates, even self-signed, cannot sign other certificates unless
"CA:TRUE" is explicitly set in the basicConstraints extension.
As a result, tests attempting this are currently failing.
Fix is to provide "CA:TRUE" in the basicConstraints for self-signed root
certificates used in "openssl ca" commands.
Closes: https://github.com/nginx/unit/issues/1202
Tested-by: Andrew Clayton <a.clayton@nginx.com>
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
|
|
This patch consist of 3 tests:
1. Ensure that $request_uri won't change while proxying the request.
2. Same as 1, but modifying the request using the "rewrite" directive.
3. Same as 2, but with rewrite containing a percent-encoded string.
|
|
Reproduces issue https://github.com/nginx/unit/issues/1169.
|
|
Acked-by: Timo Stark <t.stark@nginx.com>
[ Remove trailing '.' from subject line - Andrew ]
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
|
|
Python applications are used only to generate responses here and can be
replaced by applications written in any other language. While the
"_python" prefix is used to indicate that the file contains tests
specific to the Python module.
|
|
These tests cause router crash when run with AddressSanitizer:
=================================================================
==77196==ERROR: AddressSanitizer: heap-use-after-free on address 0x60c000079340 at pc 0x55d56b132d4b bp 0x7f8cc7f346b0 sp 0x7f8cc7f346a0
READ of size 1 at 0x60c000079340 thread T1
#0 0x55d56b132d4a in nxt_openssl_conn_io_shutdown src/nxt_openssl.c:1466
#1 0x55d56b0f6a25 in nxt_h1p_closing src/nxt_h1proto.c:2069
#2 0x55d56b1009a6 in nxt_h1p_shutdown src/nxt_h1proto.c:2038
#3 0x55d56b1014c3 in nxt_h1p_request_close src/nxt_h1proto.c:1718
#4 0x55d56b1045c0 in nxt_http_request_close_handler src/nxt_http_request.c:864
#5 0x55d56b104988 in nxt_http_request_done src/nxt_http_request.c:795
#6 0x55d56b0ba0c3 in nxt_event_engine_start src/nxt_event_engine.c:542
#7 0x55d56b0dcac2 in nxt_router_thread_start src/nxt_router.c:3645
#8 0x55d56b0b421b in nxt_thread_trampoline src/nxt_thread.c:126
#9 0x7f8ccab95ac2 (/lib/x86_64-linux-gnu/libc.so.6+0x94ac2)
#10 0x7f8ccac2784f (/lib/x86_64-linux-gnu/libc.so.6+0x12684f)
|
|
This flag is necessary to either run or skip certain tests that have
specific behavior depending on whether AddressSanitizer is enabled.
For instance, some tests may fail only when the binary is compiled
with AddressSanitizer.
|
|
It can fail with reporting following alert:
[alert] 137462#137462 mount("none", "/tmp/unit-test-636e0uh8/proc", "proc", 2097162, "") (16: Device or resource busy)
|
|
@filiphanes requested support for bytearray
and memoryview in the request body here:
<https://github.com/nginx/unit/issues/648>
This patch implements bytearray body support only.
Memoryview body still need to be implemented.
|
|
|
|
* Take options as well as requestListener
Unit-http have not kept up with the signature of nodejs's http package
development. Nodejs allows an optional `options` object to be passed to
the `createServer` function, we didn't. This resulted in function
signature errors when user code that did make use of the options arg
tried to call unit's replaced function.
This change changes the signature to be more in line with how nodejs
does it discarding it and printing a message to stdout.
* Add test file to start node application with options
* Add changes to docs/changes.xml
Closes: https://github.com/nginx/unit/issues/1043
|
|
Conditional access logging was introduced here:
https://github.com/nginx/unit/commit/4c91bebb50d06b28e369d68b23022caa072cf62d
|
|
According to the Node.js documenation this variable
should only include numbering scheme.
Thanks to @dbit-xia.
Closes: https://github.com/nginx/unit/issues/1085
|
|
|
|
Also fixed various pylint errors and style issues.
|
|
|
|
|
|
For more information see:
https://github.com/rack/rack/commit/42aff22f708123839ba706cbe659d108b47c40c7
|
|
This closes #1006 issue on GitHub.
Reviewed-by: Andrew Clayton <a.clayton@nginx.com>
|
|
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.
|
|
This variable contains a string that is formed using random data and
can be used as a unique request identifier.
This closes #714 issue on GitHub.
|
|
|
|
This test reproduces https://github.com/nginx/unit/issues/964.
|
|
|
|
|
|
This test reproduce https://github.com/nginx/unit/issues/923.
|
|
Starting from Node.js 15.0.0 the chunk parameter of the response.write()
can be a Uint8Array.
This closes #870 issue on GitHub.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
All log-related code moved to the log.py.
|
|
|