Enhance SSL Testing Support for OpenGauss in Python GaussDB Driver#18
Merged
liubao68 merged 41 commits intoHuaweiCloudDeveloper:masterfrom Sep 2, 2025
Merged
Enhance SSL Testing Support for OpenGauss in Python GaussDB Driver#18liubao68 merged 41 commits intoHuaweiCloudDeveloper:masterfrom
liubao68 merged 41 commits intoHuaweiCloudDeveloper:masterfrom
Conversation
added 30 commits
August 31, 2025 17:45
…tions and skip slow tests under SSL mode
…n and SSL setup sections
…nd config files in SSL tests workflow
…SL tests workflow
…undant chown commands in SSL tests workflow
…cation in SSL tests workflow
…nd add debug step
…ebugging in tests-ssl.yml
… in tests-ssl.yml
…ermissions in container for tests-ssl.yml
…or SSL certificates in CI workflow
…ation directories
…ation directories
added 11 commits
September 1, 2025 22:17
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request introduces comprehensive SSL testing support for the Python GaussDB driver, focusing on OpenGauss database integration. It adds a new SSL-enabled test workflow, updates configuration files, and enhances documentation for SSL setup. The changes ensure robust testing of SSL connections with
requireandverify-camodes, improve certificate management, and skip timing-sensitive tests under SSL to maintain test reliability.Changes Made
.github/workflows/tests-ssl.ymlto define a new GitHub Actions workflow for SSL-enabled tests onubuntu-22.04.GAUSSDB_TEST_DSNto includesslmode=verify-ca, client certificates, and keys..github/workflows/tests.ymltoTests without SSLto distinguish it from the new SSL workflow.tests/test_sslmode.pyto test database connections and operations underrequireandverify-caSSL modes.tests/conftest.pyto skip timing-sensitive tests (marked withtimingorslow) when SSL is enabled.tests/fix_proxy.pyto ensuresslmode=disableis set if not specified, maintaining compatibility.tests/pq/test_pgconn.pyfor SSL modes to avoid irrelevant failures.certs/ca.crt,certs/ca.key,certs/client.crt,certs/client.key,certs/server.crt,certs/server.key,certs/san.cnf,certs/ca.srl) for SSL testing.certs/readme.txtwith instructions for generating CA, server, and client certificates.README.rstwith detailed instructions for running OpenGauss with SSL, including certificate generation, configuration, and Docker setup.README.rstandtest_sslmode.py.postgresql.confandpg_hba.conffor SSL support withhostsslandcertauthentication.ubuntu-22.04for better compatibility and removed redundant OpenSSL 1.1.1f installation.certsdirectory and removed unnecessary volume mounts.Why
These changes are necessary to ensure the Python GaussDB driver supports secure SSL connections with OpenGauss, which is critical for production environments requiring encrypted communication. The new SSL test workflow validates the driver's behavior under different SSL modes, ensuring reliability and compatibility. Documentation updates provide clear guidance for developers, and workflow optimizations improve test efficiency and maintainability. Skipping timing-sensitive tests under SSL prevents flaky test results due to SSL handshake overhead.
Testing
pytest -s -vwithGAUSSDB_TEST_DSNconfigured forsslmode=requireandsslmode=verify-cato verify connection and table operations.certs/readme.txt.tests-ssl.ymlworkflow in GitHub Actions to ensure all steps (certificate setup, configuration, test execution) complete successfully.Tests without SSLworkflow remains unaffected for non-SSL test cases.gsqlcommands to confirmssl=onand correct certificate paths.GAUSSDB_TEST_DSNlacks SSL parameters, ensuring tests are skipped appropriately.