diff options
author | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-11-25 11:20:43 -0500 |
---|---|---|
committer | Kaloian Manassiev <kaloian.manassiev@mongodb.com> | 2015-12-08 13:05:00 -0500 |
commit | 3ed6635a5fb26c354046d275a1217c4526b2fe02 (patch) | |
tree | f40aa20b5e62996843ce3df0f47b82042dd683a7 /jstests/ssl | |
parent | 4f24dc58f48cb087db8a4832421d298e9e2633a0 (diff) | |
download | mongo-3ed6635a5fb26c354046d275a1217c4526b2fe02.tar.gz |
SERVER-21050 Cleanup ReplSetTest
This is just a cleanup work to hide some of the private state of
ReplSetTest so it is easier to encapsulate and add new logic. Also enables
strict mode.
Diffstat (limited to 'jstests/ssl')
-rw-r--r-- | jstests/ssl/initial_sync1_x509.js | 4 | ||||
-rw-r--r-- | jstests/ssl/upgrade_to_ssl.js | 6 | ||||
-rw-r--r-- | jstests/ssl/upgrade_to_x509_ssl.js | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/jstests/ssl/initial_sync1_x509.js b/jstests/ssl/initial_sync1_x509.js index f767dba0dde..9674056eba9 100644 --- a/jstests/ssl/initial_sync1_x509.js +++ b/jstests/ssl/initial_sync1_x509.js @@ -16,7 +16,7 @@ function runInitialSyncTest() { var conns = replTest.startSet(); replTest.initiate(); - var master = replTest.getMaster(); + var master = replTest.getPrimary(); var foo = master.getDB("foo"); var admin = master.getDB("admin"); @@ -40,7 +40,7 @@ function runInitialSyncTest() { replTest.awaitReplication(); print("5. Insert some stuff"); - master = replTest.getMaster(); + master = replTest.getPrimary(); bulk = foo.bar.initializeUnorderedBulkOp(); for (var i = 0; i < 100; i++) { bulk.insert({ date: new Date(), x: i, str: "all the talk on the market" }); diff --git a/jstests/ssl/upgrade_to_ssl.js b/jstests/ssl/upgrade_to_ssl.js index 802e99d9eeb..0c4a2caf222 100644 --- a/jstests/ssl/upgrade_to_ssl.js +++ b/jstests/ssl/upgrade_to_ssl.js @@ -19,14 +19,14 @@ var rst = new ReplSetTest({ name: 'sslSet', nodes: 3, nodeOptions : opts }); rst.startSet(); rst.initiate(); -var rstConn1 = rst.getMaster(); +var rstConn1 = rst.getPrimary(); rstConn1.getDB("test").a.insert({a:1, str:"TESTTESTTEST"}); assert.eq(1, rstConn1.getDB("test").a.count(), "Error interacting with replSet"); print("===== UPGRADE allowSSL -> preferSSL ====="); opts.sslMode = "preferSSL"; rst.upgradeSet(opts); -var rstConn2 = rst.getMaster(); +var rstConn2 = rst.getPrimary(); rstConn2.getDB("test").a.insert({a:2, str:"CHECKCHECK"}); assert.eq(2, rstConn2.getDB("test").a.count(), "Error interacting with replSet"); @@ -37,7 +37,7 @@ assert.eq(0, canConnectNoSSL, "non-SSL Connection attempt failed when it should print("===== UPGRADE preferSSL -> requireSSL ====="); opts.sslMode = "requireSSL"; rst.upgradeSet(opts); -var rstConn3 = rst.getMaster(); +var rstConn3 = rst.getPrimary(); rstConn3.getDB("test").a.insert({a:3, str:"GREENEGGSANDHAM"}); assert.eq(3, rstConn3.getDB("test").a.count(), "Error interacting with replSet"); diff --git a/jstests/ssl/upgrade_to_x509_ssl.js b/jstests/ssl/upgrade_to_x509_ssl.js index a7f8b571d29..2fef4e3c149 100644 --- a/jstests/ssl/upgrade_to_x509_ssl.js +++ b/jstests/ssl/upgrade_to_x509_ssl.js @@ -26,7 +26,7 @@ rst.startSet(); rst.initiate(); // Connect to master and do some basic operations -var rstConn1 = rst.getMaster(); +var rstConn1 = rst.getPrimary(); print("Performing basic operations on master."); rstConn1.getDB("admin").createUser({user:"root", pwd:"pwd", roles:["root"]}, {w: NUM_NODES}); rstConn1.getDB("admin").auth("root", "pwd"); @@ -43,7 +43,7 @@ rst.upgradeSet({sslMode:"preferSSL", sslPEMKeyFile: SERVER_CERT, sslCAFile: CA_CERT}, "root", "pwd"); // The upgradeSet call restarts the nodes so we need to reauthenticate. authAllNodes(); -var rstConn3 = rst.getMaster(); +var rstConn3 = rst.getPrimary(); rstConn3.getDB("test").a.insert({a:3, str:"TESTTESTTEST"}); assert.eq(3, rstConn3.getDB("test").a.count(), "Error interacting with replSet"); rst.awaitReplication(); @@ -57,6 +57,6 @@ rst.upgradeSet({sslMode:"requireSSL", sslPEMKeyFile: SERVER_CERT, clusterAuthMode:"x509", keyFile: KEYFILE, sslCAFile: CA_CERT}, "root", "pwd"); authAllNodes(); -var rstConn4 = rst.getMaster(); +var rstConn4 = rst.getPrimary(); rstConn4.getDB("test").a.insert({a:4, str:"TESTTESTTEST"}); assert.eq(4, rstConn4.getDB("test").a.count(), "Error interacting with replSet"); |