nginx.yml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. name: nginx Tests
  2. on:
  3. workflow_call:
  4. jobs:
  5. build_wolfssl:
  6. name: Build wolfSSL
  7. # Just to keep it the same as the testing target
  8. runs-on: ubuntu-latest
  9. # This should be a safe limit for the tests to run.
  10. timeout-minutes: 4
  11. steps:
  12. - if: ${{ runner.debug }}
  13. name: Enable wolfSSL debug logging
  14. run: |
  15. # We don't use --enable-debug since it makes the logs too loud
  16. echo "wolf_debug_flags= CFLAGS='-g3 -O0'" >> $GITHUB_ENV
  17. - name: Build wolfSSL
  18. uses: wolfSSL/actions-build-autotools-project@v1
  19. with:
  20. path: wolfssl
  21. configure: --enable-nginx ${{ env.wolf_debug_flags }}
  22. install: true
  23. - name: Upload built lib
  24. uses: actions/upload-artifact@v3
  25. with:
  26. name: wolf-install-nginx
  27. path: build-dir
  28. retention-days: 1
  29. nginx_check:
  30. strategy:
  31. fail-fast: false
  32. matrix:
  33. include:
  34. # in general we want to pass all tests that match *ssl*
  35. - ref: 1.25.0
  36. test-ref: 5b2894ea1afd01a26c589ce11f310df118e42592
  37. # Following tests pass with sanitizer on
  38. sanitize-ok: >-
  39. h2_ssl_proxy_cache.t h2_ssl.t h2_ssl_variables.t h2_ssl_verify_client.t
  40. mail_imap_ssl.t mail_ssl_conf_command.t mail_ssl_session_reuse.t
  41. mail_ssl.t proxy_ssl_certificate_empty.t proxy_ssl_certificate.t
  42. proxy_ssl_certificate_vars.t proxy_ssl_conf_command.t proxy_ssl_name.t
  43. ssl_certificate_chain.t ssl_certificate_perl.t ssl_certificates.t
  44. ssl_certificate.t ssl_client_escaped_cert.t ssl_conf_command.t
  45. ssl_crl.t ssl_curve.t ssl_engine_keys.t ssl_ocsp.t ssl_password_file.t
  46. ssl_proxy_protocol.t ssl_proxy_upgrade.t ssl_reject_handshake.t
  47. ssl_session_reuse.t ssl_session_ticket_key.t ssl_sni_reneg.t
  48. ssl_sni_sessions.t ssl_sni.t ssl_stapling.t ssl.t ssl_verify_client.t
  49. ssl_verify_depth.t stream_proxy_ssl_certificate.t stream_proxy_ssl_certificate_vars.t
  50. stream_proxy_ssl_conf_command.t stream_proxy_ssl_name_complex.t
  51. stream_proxy_ssl_name.t stream_ssl_certificate.t stream_ssl_conf_command.t
  52. stream_ssl_preread_alpn.t stream_ssl_preread_protocol.t stream_ssl_preread.t
  53. stream_ssl_realip.t stream_ssl_session_reuse.t stream_ssl.t stream_ssl_variables.t
  54. stream_ssl_verify_client.t stream_upstream_zone_ssl.t upstream_zone_ssl.t
  55. uwsgi_ssl_certificate.t uwsgi_ssl_certificate_vars.t uwsgi_ssl.t
  56. uwsgi_ssl_verify.t
  57. # Following tests do not pass with sanitizer on (with OpenSSL too)
  58. sanitize-not-ok: >-
  59. grpc_ssl.t h2_proxy_request_buffering_ssl.t h2_proxy_ssl.t
  60. proxy_request_buffering_ssl.t proxy_ssl_keepalive.t proxy_ssl.t
  61. proxy_ssl_verify.t stream_proxy_protocol_ssl.t stream_proxy_ssl.t
  62. stream_proxy_ssl_verify.t stream_ssl_alpn.t
  63. name: ${{ matrix.ref }}
  64. runs-on: ubuntu-latest
  65. # This should be a safe limit for the tests to run.
  66. timeout-minutes: 6
  67. needs: build_wolfssl
  68. steps:
  69. - name: Download lib
  70. uses: actions/download-artifact@v3
  71. with:
  72. name: wolf-install-nginx
  73. path: build-dir
  74. - name: Install dependencies
  75. run: |
  76. sudo cpan -iT Proc::Find Net::SSLeay IO::Socket::SSL
  77. - name: Checkout wolfssl-nginx
  78. uses: actions/checkout@v3
  79. with:
  80. repository: wolfssl/wolfssl-nginx
  81. path: wolfssl-nginx
  82. - name: Checkout nginx
  83. uses: actions/checkout@v3
  84. with:
  85. repository: nginx/nginx
  86. path: nginx
  87. ref: release-${{ matrix.ref }}
  88. - name: Apply nginx patch
  89. working-directory: nginx
  90. run: patch -p1 < ../wolfssl-nginx/nginx-${{ matrix.ref }}-wolfssl.patch
  91. - if: ${{ runner.debug }}
  92. name: Apply nginx debug patch
  93. working-directory: nginx
  94. run: patch -p1 < ../wolfssl-nginx/nginx-${{ matrix.ref }}-wolfssl-debug.patch
  95. - name: Checkout nginx-tests
  96. uses: actions/checkout@v3
  97. with:
  98. repository: nginx/nginx-tests
  99. path: nginx-tests
  100. ref: ${{ matrix.test-ref }}
  101. - name: Apply nginx-tests patch
  102. working-directory: nginx-tests
  103. run: patch -p1 < ../wolfssl-nginx/nginx-tests-patches/*${{ matrix.test-ref }}.patch
  104. - name: Build nginx without sanitizer
  105. working-directory: nginx
  106. run: |
  107. ./auto/configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-http_ssl_module \
  108. --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \
  109. --with-http_v2_module --with-mail --with-mail_ssl_module
  110. make -j
  111. - name: Confirm nginx built with wolfSSL
  112. working-directory: nginx
  113. run: ldd objs/nginx | grep wolfssl
  114. - if: ${{ runner.debug }}
  115. name: Run nginx-tests without sanitizer (debug)
  116. working-directory: nginx-tests
  117. run: |
  118. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
  119. TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y \
  120. TEST_NGINX_BINARY=../nginx/objs/nginx prove -v ${{ matrix.sanitize-not-ok }}
  121. - if: ${{ !runner.debug }}
  122. name: Run nginx-tests without sanitizer
  123. working-directory: nginx-tests
  124. run: |
  125. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
  126. TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_BINARY=../nginx/objs/nginx \
  127. prove ${{ matrix.sanitize-not-ok }}
  128. - if: ${{ runner.debug }}
  129. name: Enable wolfSSL debug logging
  130. run: |
  131. echo "nginx_c_flags=-O0" >> $GITHUB_ENV
  132. - name: Build nginx with sanitizer
  133. working-directory: nginx
  134. run: |
  135. ./auto/configure --with-wolfssl=$GITHUB_WORKSPACE/build-dir --with-http_ssl_module \
  136. --with-stream --with-stream_ssl_module --with-stream_ssl_preread_module \
  137. --with-http_v2_module --with-mail --with-mail_ssl_module \
  138. --with-cc-opt='-fsanitize=address -DNGX_DEBUG_PALLOC=1 -g3 ${{ env.nginx_c_flags }}' \
  139. --with-ld-opt='-fsanitize=address ${{ env.nginx_c_flags }}'
  140. make -j
  141. - name: Confirm nginx built with wolfSSL
  142. working-directory: nginx
  143. run: ldd objs/nginx | grep wolfssl
  144. - if: ${{ runner.debug }}
  145. name: Run nginx-tests with sanitizer (debug)
  146. working-directory: nginx-tests
  147. run: |
  148. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
  149. TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_VERBOSE=y TEST_NGINX_CATLOG=y \
  150. TEST_NGINX_BINARY=../nginx/objs/nginx prove -v ${{ matrix.sanitize-ok }}
  151. - if: ${{ !runner.debug }}
  152. name: Run nginx-tests with sanitizer
  153. working-directory: nginx-tests
  154. run: |
  155. LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/build-dir/lib \
  156. TMPDIR=$GITHUB_WORKSPACE TEST_NGINX_BINARY=../nginx/objs/nginx \
  157. prove ${{ matrix.sanitize-ok }}