Skip to content

Commit 55f12c6

Browse files
authored
PYTHON-4112 Revert to testing with pymongocrypt@master and update mock KMS ports (#1492)
1 parent 0615df4 commit 55f12c6

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.evergreen/run-tests.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ if [ -n "$TEST_ENCRYPTION" ] || [ -n "$TEST_FLE_AZURE_AUTO" ] || [ -n "$TEST_FLE
136136
exit 1
137137
fi
138138
export PYMONGOCRYPT_LIB
139+
140+
# TODO: Test with 'pip install pymongocrypt'
141+
if [ ! -d "libmongocrypt_git" ]; then
142+
git clone https://github.com/mongodb/libmongocrypt.git libmongocrypt_git
143+
fi
144+
python -m pip install ./libmongocrypt_git/bindings/python
139145
python -c "import pymongocrypt; print('pymongocrypt version: '+pymongocrypt.__version__)"
140146
python -c "import pymongocrypt; print('libmongocrypt version: '+pymongocrypt.libmongocrypt_version())"
141147
# PATH is updated by PREPARE_SHELL for access to mongocryptd.

test/test_encryption.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ def test_invalid_hostname_in_kms_certificate(self):
20242024
# Some examples:
20252025
# certificate verify failed: IP address mismatch, certificate is not valid for '127.0.0.1'. (_ssl.c:1129)"
20262026
# hostname '127.0.0.1' doesn't match 'wronghost.com'
2027-
# 127.0.0.1:8001: ('Certificate does not contain any `subjectAltName`s.',)
2027+
# 127.0.0.1:9001: ('Certificate does not contain any `subjectAltName`s.',)
20282028
with self.assertRaisesRegex(
20292029
EncryptionError, "IP address mismatch|wronghost|IPAddressMismatch|Certificate"
20302030
):
@@ -2093,12 +2093,12 @@ def setUp(self):
20932093
# 4, Test named KMS providers.
20942094
providers = {
20952095
"aws:no_client_cert": AWS_CREDS,
2096-
"azure:no_client_cert": {"identityPlatformEndpoint": "127.0.0.1:8002", **AZURE_CREDS},
2097-
"gcp:no_client_cert": {"endpoint": "127.0.0.1:8002", **GCP_CREDS},
2096+
"azure:no_client_cert": {"identityPlatformEndpoint": "127.0.0.1:9002", **AZURE_CREDS},
2097+
"gcp:no_client_cert": {"endpoint": "127.0.0.1:9002", **GCP_CREDS},
20982098
"kmip:no_client_cert": KMIP_CREDS,
20992099
"aws:with_tls": AWS_CREDS,
2100-
"azure:with_tls": {"identityPlatformEndpoint": "127.0.0.1:8002", **AZURE_CREDS},
2101-
"gcp:with_tls": {"endpoint": "127.0.0.1:8002", **GCP_CREDS},
2100+
"azure:with_tls": {"identityPlatformEndpoint": "127.0.0.1:9002", **AZURE_CREDS},
2101+
"gcp:with_tls": {"endpoint": "127.0.0.1:9002", **GCP_CREDS},
21022102
"kmip:with_tls": KMIP_CREDS,
21032103
}
21042104
no_cert = {"tlsCAFile": CA_PEM}
@@ -2137,7 +2137,7 @@ def test_01_aws(self):
21372137
# Some examples:
21382138
# certificate verify failed: IP address mismatch, certificate is not valid for '127.0.0.1'. (_ssl.c:1129)"
21392139
# hostname '127.0.0.1' doesn't match 'wronghost.com'
2140-
# 127.0.0.1:8001: ('Certificate does not contain any `subjectAltName`s.',)
2140+
# 127.0.0.1:9001: ('Certificate does not contain any `subjectAltName`s.',)
21412141
key["endpoint"] = "127.0.0.1:9001"
21422142
with self.assertRaisesRegex(
21432143
EncryptionError, "IP address mismatch|wronghost|IPAddressMismatch|Certificate"
@@ -2208,7 +2208,7 @@ def test_06_named_kms_providers_apply_tls_options_aws(self):
22082208
key = {
22092209
"region": "us-east-1",
22102210
"key": "arn:aws:kms:us-east-1:579766882180:key/89fcc2c4-08b0-4bd9-9f25-e30687b580d0",
2211-
"endpoint": "127.0.0.1:8002",
2211+
"endpoint": "127.0.0.1:9002",
22122212
}
22132213
# Missing client cert error.
22142214
with self.assertRaisesRegex(EncryptionError, self.cert_error):

0 commit comments

Comments
 (0)