Skip to content

Conversation

@eramongodb
Copy link
Contributor

This is a followup to CDRIVER-3927, which disabled CSE tests on RHEL due to inability to register the CA certificate required by KMS TLS tests on the system. This PR re-enables CSE tests on RHEL and proposes a workaround that selectively disables KMS TLS tests on CA certificate registration failure via the MONGOC_TEST_SKIP_KMS_TLS_TESTS environment variable.

This PR comes in five parts:

  1. Enable skipping of KMS TLS tests via MONGOC_TEST_SKIP_KMS_TLS_TESTS.

This is done via the test_framework_skip_kms_tls_tests() function which checks for the presence and value of the MONGOC_TEST_SKIP_KMS_TLS_TESTS environment variable. This variable is also documented in CONTRIBUTING.md.

  1. Add condition for skipping KMS TLS tests on CA cert register failure.

CA certificate registration routines on Linux now define the MONGOC_TEST_SKIP_KMS_TLS_TESTS environment variable if it detects that the certificate could not be registered. This primarily applies to RHEL variants, which are awaiting resolution of BUILD-14068.

  1. Add CA certificate registration routines for MacOS.

MacOS was overlooked during implementation and testing of CDRIVER-3927.

  1. Add routine to wait for mock KMS server startup completion.

It is possible for tests to run before the mock KMS servers, which are started in the background, have had time to completed their startup procedures. This can lead to false-positive KMS TLS tests failures. The wait_for_kms_server function gives the mock KMS servers up to 60 seconds before aborting the script/task.

  1. Re-enable CSE tests on RHEL variants.

This undoes the changes made in 33c8d31 in variants.py.

@eramongodb eramongodb requested a review from kevinAlbs October 18, 2021 20:44
@eramongodb eramongodb self-assigned this Oct 18, 2021
Copy link
Collaborator

@kevinAlbs kevinAlbs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I plan to use wait_for_kms_server to wait for the local KMIP server to start up.

@eramongodb eramongodb merged commit 48fcc98 into mongodb:master Oct 19, 2021
@eramongodb eramongodb deleted the cdriver-4183 branch October 19, 2021 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants