diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2016-11-29 20:01:18 -0500 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2016-12-08 10:44:05 -0500 |
commit | d55eb9d186f3039695a4d710116e79ad04536409 (patch) | |
tree | d7eeb820a9365d9266f926969177c05a9413e300 /src/mongo/client/replica_set_monitor_test.cpp | |
parent | e91795212e7f274db6eb66efd5bbad8f144cdf32 (diff) | |
download | mongo-d55eb9d186f3039695a4d710116e79ad04536409.tar.gz |
SERVER-27210 Allow shell to connect to replicasets with ssl=true in URI
Diffstat (limited to 'src/mongo/client/replica_set_monitor_test.cpp')
-rw-r--r-- | src/mongo/client/replica_set_monitor_test.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mongo/client/replica_set_monitor_test.cpp b/src/mongo/client/replica_set_monitor_test.cpp index 8720176b183..403e03a985a 100644 --- a/src/mongo/client/replica_set_monitor_test.cpp +++ b/src/mongo/client/replica_set_monitor_test.cpp @@ -77,6 +77,24 @@ TEST(ReplicaSetMonitor, InitialState) { } } +TEST(ReplicaSetMonitor, InitialStateMongoURI) { + auto uri = MongoURI::parse("mongodb://a,b,c/?replicaSet=name"); + ASSERT_OK(uri.getStatus()); + SetStatePtr state = std::make_shared<SetState>(uri.getValue()); + ASSERT_EQUALS(state->name, "name"); + ASSERT(state->seedNodes == basicSeedsSet); + ASSERT(state->lastSeenMaster.empty()); + ASSERT_EQUALS(state->nodes.size(), basicSeeds.size()); + for (size_t i = 0; i < basicSeeds.size(); i++) { + Node* node = state->findNode(basicSeeds[i]); + ASSERT(node); + ASSERT_EQUALS(node->host.toString(), basicSeeds[i].toString()); + ASSERT(!node->isUp); + ASSERT(!node->isMaster); + ASSERT(node->tags.isEmpty()); + } +} + TEST(ReplicaSetMonitor, IsMasterBadParse) { BSONObj ismaster = BSON("hosts" << BSON_ARRAY("mongo.example:badport")); IsMasterReply imr(HostAndPort("mongo.example:27017"), -1, ismaster); |