Skip to content

Commit c807a8f

Browse files
author
A. Jesse Jiryu Davis
committed
Hard-code the X509 username in tests.
1 parent 2bdfcae commit c807a8f

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

test/test_ssl.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
SIMPLE_SSL = False
4141
CERT_SSL = False
4242
SERVER_IS_RESOLVABLE = False
43-
MONGODB_X509_USERNAME = os.environ.get('MONGODB_X509_USERNAME')
43+
MONGODB_X509_USERNAME = (
44+
"CN=client,OU=kerneluser,O=10Gen,L=New York City,ST=New York,C=US")
4445

4546
# To fully test this start a mongod instance (built with SSL support) like so:
4647
# mongod --dbpath /path/to/data/directory --sslOnNormalPorts \
@@ -406,14 +407,9 @@ def test_mongodb_x509_auth(self):
406407
# --sslCAFile=jstests/libs/ca.pem
407408
# --sslCRLFile=jstests/libs/crl.pem
408409
# --auth
409-
#
410-
# Set the MONGODB_X509_USERNAME environment variable to:
411-
# "CN=client,OU=kerneluser,O=10Gen,L=New York City,ST=New York,C=US"
412-
if not MONGODB_X509_USERNAME:
413-
raise SkipTest("MONGODB_X509_USERNAME "
414-
"must be set to test MONGODB-X509")
415410
if not CERT_SSL:
416411
raise SkipTest("No mongod available over SSL with certs")
412+
417413
client = MongoClient(host, port, ssl=True, ssl_certfile=CLIENT_PEM)
418414
if not version.at_least(client, (2, 5, 3, -1)):
419415
raise SkipTest("MONGODB-X509 tests require MongoDB 2.5.3 or newer")

0 commit comments

Comments
 (0)