summaryrefslogtreecommitdiffhomepage
path: root/test/unit (follow)
AgeCommit message (Collapse)AuthorFilesLines
2024-09-10tests: Suppress cargo-component outputAndrew Clayton1-1/+4
Suppress the output from cargo-component when we first run it to check if it's available, otherwise you may see the following $ pytest test/test_wasm-wasi-component.py which: no go in (/home/andrew/.local/bin:/home/andrew/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin) error: no such command: `component` View all installed commands with `cargo --list` Find a package to install `component` with `cargo search cargo-component Note: This didn't stop the tests from working, just an aesthetic issue. Closes: https://github.com/nginx/unit/issues/1410 Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-09-07java: Update third-party componentsSergey A. Osokin1-1/+1
[ Tweaked subject - Andrew ] Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-08-28test/wasm-wc: Target wasm32-wasip1Andrew Clayton1-1/+1
Changes are afoot... wasm32-wasi has been renamed wasm32-wasip1, there is also a wasm32-wasip2 (seems not yet fully realised) and wasm32-wasi is being kept clear for an eventual WASI 1.0 release. cargo-component targets wasm32-wasip1 by default and adapts the module to the preview2 version of WASI supported by the component model. This means that the component is now found under target/wasm32-wasip1/... Link: <https://doc.rust-lang.org/nightly/rustc/platform-support/wasm32-wasip1.html> Link: <https://github.com/bytecodealliance/cargo-component/blob/main/README.md#wasi-support> Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-08-28tests: Fix `/status' endpoint to cater for listsAndrew Clayton1-1/+1
We can now get list objects from the /status endpoint in the case of having different versions of the same language module. That led to this error > return d1 - d2 E TypeError: unsupported operand type(s) for -: 'list' and 'list' We already cover a similar case for when we have simple strings so add this to that. Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-08-20Tests: initial "wasm-wasi-component" testAndrei Zeliankou3-1/+67
2024-07-12tests: Fix `/status' endpoint tests for new 'modules' sectionAndrei Zeliankou1-5/+8
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>
2024-06-24Tests: chunked request bodyAndrei Zeliankou1-1/+1
2024-05-08java: Update third-party componentsSergey A. Osokin1-1/+1
[ Tweaked subject - Andrew ] Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-04-10Tests: compatibility with OpenSSL 3.2.0Andrei Zeliankou1-1/+5
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>
2024-02-22Update third-party java components to their recent versionsSergey A. Osokin1-1/+1
Acked-by: Timo Stark <t.stark@nginx.com> [ Remove trailing '.' from subject line - Andrew ] Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
2024-02-21Tests: check for the AddressSanitizer flag during discoveryAndrei Zeliankou2-0/+3
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.
2024-01-15Tests: pathlib used where appropriateAndrei Zeliankou11-36/+35
Also fixed various pylint errors and style issues.
2023-11-29Update third-party components for the Java module.Sergey A. Osokin1-1/+1
2023-11-08Tests: 8XXX used as default port range.Andrei Zeliankou11-17/+17
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.
2023-10-17Update third-party components for the Java module.Sergey A. Osokin1-1/+1
2023-10-10Update third-party components for the Java module.Sergey A. Osokin1-1/+1
2023-10-06Update third-party components for the Java module.Sergey A. Osokin1-1/+1
2023-07-07Update third-party components for Unit's Java module.Sergey A. Osokin1-1/+1
2023-06-14Tests: get rid of classes in test files.Andrei Zeliankou18-57/+66
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-12Tests: prerequisites checking reworked.Andrei Zeliankou13-65/+185
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-05-29Tests: more fixtures.Andrei Zeliankou3-35/+6
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-29Tests: Log reworked.Andrei Zeliankou2-11/+81
All log-related code moved to the log.py.
2023-05-25Tests: removed unused variables.Andrei Zeliankou3-8/+7
2023-03-27Tests: relaxed jar glob.Konstantin Pavlov1-1/+1
We install jars with names like websocket-api-${NXT_JAVA_MODULE}-$NXT_VERSION.jar, which translates to versioned NXT_JAVA_MODULE in the packaging system, e.g. websocket-api-java11-1.30.0.jar.
2023-02-21Tests: switched to using f-strings.Andrei Zeliankou17-137/+127
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-21Tests: removed list usage as default argument.Andrei Zeliankou1-1/+3
Mutable types as default arguments is bad practice since they are evaluated only once when the function is defined.
2022-12-14Python: Added "prefix" to configuration.OutOfFocus41-0/+1
This patch gives users the option to set a `"prefix"` attribute for Python applications, either at the top level or for specific `"target"`s. If the attribute is present, the value of `"prefix"` must be a string beginning with `"/"`. If the value of the `"prefix"` attribute is longer than 1 character and ends in `"/"`, the trailing `"/"` is stripped. The purpose of the `"prefix"` attribute is to set the `SCRIPT_NAME` context value for WSGI applications and the `root_path` context value for ASGI applications, allowing applications to properly route requests regardless of the path that the server uses to expose the application. The context value is only set if the request's URL path begins with the value of the `"prefix"` attribute. In all other cases, the `SCRIPT_NAME` or `root_path` values are not set. In addition, for WSGI applications, the value of `"prefix"` will be stripped from the beginning of the request's URL path before it is sent to the application. Reviewed-by: Andrei Zeliankou <zelenkov@nginx.com> Reviewed-by: Artem Konev <artem.konev@nginx.com> Signed-off-by: Alejandro Colomar <alx@nginx.com>
2022-12-14Java: upgrading third-party components.Sergey A. Osokin1-1/+1
2022-12-12Tests: stop execution if can't unmount any filesystem.Andrei Zeliankou1-2/+9
2022-12-12Tests: pretty output.Andrei Zeliankou2-5/+5
Hide expected alerts by default. Silence succesfull "go build" information.
2022-12-09Tests: fixed tests to run as privileged user.Andrei Zeliankou1-2/+8
2022-11-29Tests: NJS.Andrei Zeliankou2-1/+9
2022-11-15Tests: features and options checks improved.Andrei Zeliankou2-14/+8
Now version output evaluates only once. OpenSSL checks more carefully.
2022-10-11Tests: don't try to return response when "no_recv" is True.Andrei Zeliankou2-2/+4
2022-09-05Tests: added tests for basic statistics.Andrei Zeliankou1-0/+45
2022-08-25Tests: added tests with abstract UNIX sockets.Andrei Zeliankou2-1/+26
2022-07-28Tests: added flags to search functions in proto.py.Andrei Zeliankou2-9/+7
Also removed unnesessary re.compile() calls.
2022-06-30Tests: minor improvements.Andrei Zeliankou2-1/+6
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-04-11Tests: style.Andrei Zeliankou4-14/+11
2022-01-31Tests: removed TestApplicationTLS.get_server_certificate().Andrei Zeliankou1-15/+0
distutils.version is replaced by packaging.version. Also minor style fixes.
2022-01-10Tests: using modules in Go.Max Romanov2-42/+37
2021-11-15Tests: refactored working with processes.Andrei Zeliankou4-14/+20
2021-11-09Tests: PHP shared opcache test added.Max Romanov1-9/+18
2021-11-02Tests: removed unused imports.Andrei Zeliankou2-2/+0
2021-10-18Tests: style.Andrei Zeliankou3-3/+2
2021-08-12Java: upgrading third-party components.Max Romanov1-1/+1
2021-08-09Java: upgrading third-party components.Max Romanov1-1/+1
2021-07-29Application restart introduced.Max Romanov1-0/+1
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-23Tests: added SNI test without hostname in request.Andrei Zeliankou1-1/+1
2021-07-02Tests: Ruby hooks.Oisin Canty3-22/+46