Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scenarios: http_downstream/tests: missing certificate #5

Open
edsiper opened this issue Aug 17, 2024 · 4 comments
Open

scenarios: http_downstream/tests: missing certificate #5

edsiper opened this issue Aug 17, 2024 · 4 comments

Comments

@edsiper
Copy link
Member

edsiper commented Aug 17, 2024

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
Copy link
Member Author

edsiper commented Aug 17, 2024

cc: @odonata

@odonata
Copy link
Contributor

odonata commented Aug 19, 2024

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
Copy link
Contributor

odonata commented Aug 19, 2024

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
Copy link
Contributor

odonata commented Oct 10, 2024

This issue is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants