Skip to content

4. Testing Deployment

Gary Archer edited this page Nov 18, 2024 · 4 revisions

1. Deploying the Module

Once a build has completed, the module can be deployed to Docker and tested.
The deployment automation makes some HTTP requests, then runs a memory test using the valgrind tool.

export LICENSE_FILE_PATH=~/Desktop/license.json
export LINUX_DISTRO='ubuntu22'
export NGINX_VERSION='1.25.5'
./testing/integration/deploy.sh

2. Dockerfiles

A number of custom Dockerfiles are used, in the Integration Resources.
These follow the instructions from NGINX Linux Packages document.

3. HTTP Tests

The deploy.sh script makes multiple HTTP requests to call the module and verify expected behavior.
In the event of errors the cause is reported to a response file and execution stops.

4. Memory Report

At the end of testing, the run.sh script outputs the valgrind results.
Healthy output should indicate no memory leaks for the deployed system.

--8-- REDIR: 0x611eb70 (libc.so.6:memmove) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x611de80 (libc.so.6:strncpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x611ee50 (libc.so.6:strcasecmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x611d8d0 (libc.so.6:strcat) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x611deb0 (libc.so.6:rindex) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x61205a0 (libc.so.6:rawmemchr) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x611ece0 (libc.so.6:mempcpy) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x611eb10 (libc.so.6:bcmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x611de40 (libc.so.6:strncmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)
--8-- REDIR: 0x611d940 (libc.so.6:strcmp) redirected to 0x4a2c6e0 (_vgnU_ifunc_wrapper)

5. Certifying a Release

To certify that a build is compatible with NGINX+, a shared library needs to be built and it must be tested with NGINX's certification test suite. For some background on this, refer to the NGINX Plus Certified Modules Program documentation. As described there:

  1. A module must be built for each supported platform (see below).
  2. NGINX+ must be installed on each of these platforms as well.
  3. The certification test suite and its dependencies must be installed.
  4. With the NGINX+ service stopped, run the test suite, like this for example:
sudo -u nginx \
    TEST_NGINX_BINARY=/usr/sbin/nginx \
    TEST_NGINX_GLOBALS="load_module /tmp/modules/ngx_curity_http_phantom_token_module.so;" \
    TEST_NGINX_GLOBALS_HTTP="phantom_token off;" \
    prove -v . > ../nginx-plus-module-prove-test-verbose 2>&1

If all certification tests and the phantom-token specific tests (see below) pass, the build can be certified. Also, it should be released on GitHub.

Clone this wiki locally