Commit Graph

55 Commits

Author SHA1 Message Date
Bernie Hackett
87580b188b PYTHON-934 - Add another simple URI test. 2015-06-15 13:18:58 -07:00
Bernie Hackett
16d22915ea PYTHON-874 - Support wincertstore as ca_certs fallback on Windows. 2015-04-03 13:39:11 -07:00
Bernie Hackett
fbeca92430 PYTHON-874 - Support certifi as ca_certs fallback on old pythons. 2015-04-03 09:46:18 -07:00
Bernie Hackett
f42422a310 PYTHON-872 - Test ConfigurationError. 2015-04-01 15:43:39 -07:00
Bernie Hackett
5dca43758e PYTHON-872 - Can't test loading system CA certs on Windows. 2015-04-01 15:43:39 -07:00
Bernie Hackett
330e6c8e04 PYTHON-872 - Add tests. 2015-04-01 15:43:39 -07:00
Bernie Hackett
d396068e6a PYTHON-872 - Default to ssl.CERT_REQUIRED when ssl=True.
If ssl=True is passed as a keyword arg (or ssl=true in the URI)
but no value for ssl_cert_reqs or ssl_ca_certs has been provided,
assume ssl.CERT_REQUIRED for cert_reqs and attempt to load
system provided CA certificates. Raise ConfigurationError if
the necessary SSLContext methods don't exist.
2015-04-01 15:43:39 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
0b104af222 PYTHON-842 - SSL URI config support.
Credit for the ideas in this patch go to Len Buckens (buckensl)
from https://github.com/mongodb/mongo-python-driver/pull/253.
2015-03-20 17:41:13 -07:00
aherlihy
70c06d11a9 PYTHON-813 Removed client_knobs where no longer needed 2015-03-11 13:03:59 -07:00
aherlihy
fa1466179f PYTHON-813 Added support for serverSelectionTimeoutMS 2015-03-09 12:38:24 -07:00
Bernie Hackett
761c630d4d PYTHON-834 - Add option to disable match_hostname. 2015-03-05 14:03:49 -08:00
Bernie Hackett
8f0bd0a6d4 PYTHON-850 - Change some uses of ConfigurationError to Type/ValueError. 2015-02-26 16:02:25 -08:00
Bernie Hackett
30af616009 PYTHON-821 - Migrate most tests to new the CRUD API. 2015-02-13 08:46:43 -08:00
A. Jesse Jiryu Davis
301bf8066c Replace more tearDowns with addCleanup. 2015-01-26 16:38:16 -05:00
A. Jesse Jiryu Davis
5c1a31c1ae Update test_cert_ssl_validation_hostname_fail for replica set in 3.0-dev. 2014-11-24 10:08:06 -05:00
A. Jesse Jiryu Davis
3c9fd60fed PYTHON-525 Use MongoClient in replica set tests.
Connect the MongoClient to the replica set if one is running,
otherwise connect it to the standalone. Only continue to use
MongoReplicaSetClient when testing the specific behavior of
that deprecated class.

Also suppress some warnings when running tests, and better
determine whether to test IPv6.
2014-09-20 08:42:23 -04:00
A. Jesse Jiryu Davis
324d1de030 PYTHON-525 Update test_ssl for new MongoClient. 2014-09-03 17:38:30 -04:00
A. Jesse Jiryu Davis
20dd80e5f2 PYTHON-525 Skip SSL tests quickly if SSL is disabled.
Don't wait 5 seconds to determine that an SSL-enabled server is unavailable.
2014-09-03 17:32:24 -04:00
A. Jesse Jiryu Davis
2f9d24ade6 PYTHON-525 Reimplement MongoClient to use Cluster.
Replace MongoClient with an implementation that relies on Cluster and Server. The new MongoClient takes over MongoReplicaSetClient's responsibilities.

Authentication, secondary-pinning, and Mongos high-availability are broken and will be reimplemented in a future commit. RS tests are temporarily disabled.
2014-08-28 16:57:57 -04:00
A. Jesse Jiryu Davis
6bdce59b08 Allow certificate-validation tests to run. 2014-07-29 08:43:20 -04:00
Bernie Hackett
709601f022 Clean up SSL support. 2014-07-09 07:22:54 -07:00
Bernie Hackett
80a789e167 PYTHON-718 - Use SSLContext when available.
This commit also introduces a fake SSLContext class
for use in python versions that don't provide one.
2014-06-25 16:09:55 -07:00
Luke Lovett
26fb43cf78 PYTHON-681 Reuse MongoClient whenever possible in the tests 2014-05-21 20:41:18 +00:00
Luke Lovett
141200083e PYTHON-680 Stop using nose in favor of pure unittest/unittest2 2014-04-25 22:57:33 +00:00
Luke Lovett
4d6d1e067b PYTHON-676 python 2/3 single-source for the test module 2014-04-23 18:37:02 +00:00
Luke Lovett
9bb7b73390 added failure cases for x509 auth tests 2014-02-25 12:34:42 -08:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
A. Jesse Jiryu Davis
349f4f08ea MongoClient() should raise CertificateError when appropriate, not AutoReconnect. 2013-12-24 11:08:47 -06:00
A. Jesse Jiryu Davis
7075d4c7d1 Don’t always skip SSL cert tests. 2013-12-24 11:08:47 -06:00
A. Jesse Jiryu Davis
c807a8fd92 Hard-code the X509 username in tests. 2013-12-24 11:08:47 -06:00
A. Jesse Jiryu Davis
2bdfcaeaca Grammar 2013-12-24 11:08:47 -06:00
A. Jesse Jiryu Davis
09fd305fcd Spelling. 2013-12-24 11:08:47 -06:00
A. Jesse Jiryu Davis
0efd663b0c Pass replicaSet parameter where required. 2013-12-24 11:08:47 -06:00
A. Jesse Jiryu Davis
7d4bf1ece4 No bare except clauses in test_ssl. 2013-12-24 11:08:47 -06:00
A. Jesse Jiryu Davis
90027f8723 Update test_ssl. 2013-12-24 11:08:46 -06:00
Bernie Hackett
0cb632784a Skip auth tests if auth not enabled PYTHON-556
This change does a few things:

1. In anticipation of the server defaulting to a "disabled" mode for
auth, only run authentication related tests if auth is enabled.
2. Attempt to clean up users in a finally block, even if tests failed.
3. Look for auth settings in "parsed" from getCmdLineOpts in case the
cluster was started with config files.
4. Remove useless remove_all_users calls at the beginning of tests - if
users were added in a previous test and we forgot to clean them up
these are going to fail no matter what when auth is enabled.
2013-11-05 09:10:00 -08:00
Bernie Hackett
afadf40632 Minor ssl test fix. 2013-10-29 11:55:08 -07:00
Bernie Hackett
43e4ca91de Fix tests to support the latest MongoDB nightly. 2013-10-15 15:25:10 -07:00
behackett
7d8f4cbb7d Update user manipulation code and tests PYTHON-552
Due to server changes:

removeUser -> dropUser
removeUsersFromDatabase -> dropUsersFromDatabase
source -> db
2013-10-07 15:19:02 -07:00
behackett
d06a48ccb3 Fix MONGODB-X509 tests for MongoDB >=2.5.3-pre- PYTHON-535 2013-09-30 11:18:57 -07:00
behackett
2225032d84 Better MONGODB-X509 tests PYTHON-535 2013-07-25 16:36:58 -07:00
Bernie Hackett
9307c1d56c Support MONGODB-X509 PYTHON-535 2013-07-25 16:02:07 -07:00
Ross Lawley
4b7cc70f7f Don't mask invalid hostname certificate errors. PYTHON-478 2013-02-28 10:50:54 +00:00
behackett
40f241d2b4 Fix exception handling when ssl isn't available. 2013-02-22 12:58:35 -08:00
behackett
dd14d3544e Fix up SSL tests.
Tests shouldn't fail if python doesn't have an ssl
module. Other changes include:

- Document how to test all this (i.e. how to start the server for
  these tests to run)
- Don't do requirements testing in setUp since it's run before every
  method.
- Move the "no ssl module" test into it's own test class
2013-02-19 21:00:17 -08:00
Ross Lawley
48046b2efd SSL certificate verification PYTHON-466 2013-02-19 15:45:57 +00:00
A. Jesse Jiryu Davis
d35bec12e5 Tests use MongoClient instead of Connection PYTHON-451 2013-02-11 20:57:17 -05:00
behackett
e52d669f29 Skip SSL tests on broken old python 3 versions. 2013-01-09 17:03:25 -08:00
behackett
c03d023d5c Minor skiptest message changes. 2012-08-27 19:51:23 -07:00