fluent / fluent-bit-test-suite

Test framework for Fluent Bit
Apache License 2.0
0 stars 1 forks source link

scenarios: http_downstream/tests: missing certificate #5

Open edsiper opened 3 months ago

edsiper commented 3 months ago

when running a specific test it's failing because a missing certificate:

pytest scenarios/http_downstream/tests/logic_http_downstream_001.py::test_splunk_on_http2_on_keepalive_on_tls_on

it fails with:

        if cafile or capath or cadata:
>           context.load_verify_locations(cafile, capath, cadata)
E           FileNotFoundError: [Errno 2] No such file or directory

/usr/lib/python3.12/ssl.py:708: FileNotFoundError
--------------------------------------------------------------- Captured log call ----------------------------------------------------------------
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:42 config path /home/edsiper/c/fluent-bit-test-suite/scenarios/http_downstream/config/splunk_on_http2_on_keepalive_on_tls_on.yaml
INFO     logic_http_downstream_001:logic_http_downstream_001.py:135 Fluent Bit listener port: 45000
INFO     logic_http_downstream_001:logic_http_downstream_001.py:141 test suite http port: 50000
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:64 Fluent Bit info
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:65  version    : v3.1.7
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:66  path       : /home/edsiper/c/fluent-bit/build/bin/fluent-bit
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:67  config file: /home/edsiper/c/fluent-bit-test-suite/scenarios/http_downstream/config/splunk_on_http2_on_keepalive_on_tls_on.yaml
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:68  logfile    : results/fluent_bit_results_20240816_183802/fluent_bit.log
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:69  http port  : 40000
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:86 Running command ['fluent-bit', '-c', '/home/edsiper/c/fluent-bit-test-suite/scenarios/http_downstream/config/splunk_on_http2_on_keepalive_on_tls_on.yaml', '-l', 'results/fluent_bit_results_20240816_183802/fluent_bit.log']
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:90 Fluent Bit started (pid: 462277)
ERROR    utils.fluent_bit_manager:fluent_bit_manager.py:143 Fluent Bit did not start within the timeout period
ERROR    logic_http_downstream_001:logic_http_downstream_001.py:117 An error occurred: [Errno 2] No such file or directory
INFO     utils.fluent_bit_manager:fluent_bit_manager.py:103 Fluent Bit stopped (pid: 462277)
================================================================ warnings summary ================================================================
<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.

<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.ScalarMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================================================ short test summary info =============================================================
FAILED scenarios/http_downstream/tests/logic_http_downstream_001.py::test_splunk_on_http2_on_keepalive_on_tls_on - FileNotFoundError: [Errno 2] No such file or directory

Fluent Bit log:

 cat results/fluent_bit_results_20240816_183802/fluent_bit.log
[2024/08/16 18:38:02] [ info] [fluent bit] version=3.1.7, commit=1af833c506, pid=462277
[2024/08/16 18:38:02] [ info] [storage] ver=1.5.2, type=memory, sync=normal, checksum=off, max_chunks_up=128
[2024/08/16 18:38:02] [ info] [cmetrics] version=0.9.4
[2024/08/16 18:38:02] [ info] [ctraces ] version=0.5.5
[2024/08/16 18:38:02] [error] [input splunk.0] error initializing TLS context (certificate file missing)
[2024/08/16 18:38:02] [error] [engine] input initialization failed
edsiper commented 3 months ago

cc: @odonata

odonata commented 3 months ago

The certificate is indeed loaded, I tested it, and this is the trace log

INFO test_http_downstream_001:test_http_downstream_001.py:115 certificate path: /Users/flowcollective/Documents/DESARROLLO/Python/Utilitarios/fluent-bit-test-suite/scenarios/http_downstream/tests/../certificate/certificate.pem INFO test_http_downstream_001:test_http_downstream_001.py:11 Certificate loaded... INFO test_http_downstream_001:test_http_downstream_001.py:169 connection = <http.client.HTTPSConnection object at 0x107395760>

odonata commented 3 months ago

It seems that the version you downloaded is outdated. Look at the file:

pytest scenarios/http_downstream/tests/logic_http_downstream_001.py:

It’s no longer called that; it’s now called:

test_http_downstream_001.py

I changed the names to the standard test naming convention, added parameterizations in the certificate files, so your repo needs to be updated with my changes.

odonata commented 1 month ago

This issue is resolved.