summaryrefslogtreecommitdiff
path: root/jstests/auth
diff options
context:
space:
mode:
authorShane Harvey <shane.harvey@mongodb.com>2016-04-14 13:44:53 -0400
committerShane Harvey <shane.harvey@mongodb.com>2016-04-18 14:11:13 -0400
commit8432d0bb4809e6547338771a365f3b5340b79024 (patch)
tree2e20ba57da8e3232647e3f19ee0d57b8fdfaaa81 /jstests/auth
parente96fc394af9d694a86e6e5d5081bd3f9b4698bae (diff)
downloadmongo-8432d0bb4809e6547338771a365f3b5340b79024.tar.gz
SERVER-6823 Rename --tryClusterAuth to --transitionToAuth
Diffstat (limited to 'jstests/auth')
-rw-r--r--jstests/auth/copyauth.js48
-rw-r--r--jstests/auth/upgrade_noauth_to_keyfile.js12
-rw-r--r--jstests/auth/upgrade_noauth_to_keyfile_with_sharding.js20
3 files changed, 41 insertions, 39 deletions
diff --git a/jstests/auth/copyauth.js b/jstests/auth/copyauth.js
index 2ba4466dac6..f9baf5dee79 100644
--- a/jstests/auth/copyauth.js
+++ b/jstests/auth/copyauth.js
@@ -14,8 +14,8 @@ var baseName = "jstests_clone_copyauth";
*
* clusterType - type of cluster to start. Options are "sharded", "repl", or "single".
* startWithAuth - whether to start the cluster with authentication.
- * startWithTryClusterAuth - whether to start the cluster with --tryClusterAuth (startWithAuth must
- *also be true).
+ * startWithTransitionToAuth - whether to start the cluster with --transitionToAuth (startWithAuth
+ * must also be true).
*
* Member variables:
*
@@ -28,12 +28,12 @@ var baseName = "jstests_clone_copyauth";
*
* stop() - stop and cleanup whatever nodes the helper spawned when it was created.
*/
-function ClusterSpawnHelper(clusterType, startWithAuth, startWithTryClusterAuth) {
+function ClusterSpawnHelper(clusterType, startWithAuth, startWithTransitionToAuth) {
var singleNodeConfig = {};
if (startWithAuth) {
singleNodeConfig.keyFile = "jstests/libs/key1";
- if (startWithTryClusterAuth) {
- singleNodeConfig.tryClusterAuth = "";
+ if (startWithTransitionToAuth) {
+ singleNodeConfig.transitionToAuth = "";
}
}
if (clusterType === "sharded") {
@@ -105,8 +105,8 @@ function copydbBetweenClustersTest(configObj) {
'isSourceUsingAuth',
'targetClusterType',
'isTargetUsingAuth',
- 'isSourceUsingTryClusterAuth',
- 'isTargetUsingTryClusterAuth'
+ 'isSourceUsingTransitionToAuth',
+ 'isTargetUsingTransitionToAuth'
];
var i;
@@ -118,7 +118,7 @@ function copydbBetweenClustersTest(configObj) {
// 1. Get a connection to the source database, insert data and setup auth if applicable
source = new ClusterSpawnHelper(configObj.sourceClusterType,
configObj.isSourceUsingAuth,
- configObj.isSourceUsingTryClusterAuth);
+ configObj.isSourceUsingTransitionToAuth);
if (configObj.isSourceUsingAuth) {
// Create a super user so we can create a regular user and not be locked out afterwards
@@ -139,8 +139,8 @@ function copydbBetweenClustersTest(configObj) {
var readWhenLoggedOut = function() {
source.conn.getDB(baseName)[baseName].findOne();
};
- if (configObj.isSourceUsingTryClusterAuth) {
- // tryClusterAuth does not turn on access control
+ if (configObj.isSourceUsingTransitionToAuth) {
+ // transitionToAuth does not turn on access control
assert.doesNotThrow(readWhenLoggedOut);
} else {
assert.throws(readWhenLoggedOut);
@@ -154,7 +154,7 @@ function copydbBetweenClustersTest(configObj) {
// 2. Get a connection to the target database, and set up auth if necessary
target = new ClusterSpawnHelper(configObj.targetClusterType,
configObj.isTargetUsingAuth,
- configObj.isTargetUsingTryClusterAuth);
+ configObj.isTargetUsingTransitionToAuth);
if (configObj.isTargetUsingAuth) {
target.conn.getDB("admin")
@@ -163,8 +163,8 @@ function copydbBetweenClustersTest(configObj) {
var readWhenLoggedOut = function() {
target.conn.getDB(baseName)[baseName].findOne();
};
- if (configObj.isTargetUsingTryClusterAuth) {
- // tryClusterAuth does not turn on access control
+ if (configObj.isTargetUsingTransitionToAuth) {
+ // transitionToAuth does not turn on access control
assert.doesNotThrow(readWhenLoggedOut);
} else {
assert.throws(readWhenLoggedOut);
@@ -199,10 +199,10 @@ function copydbBetweenClustersTest(configObj) {
var sourceClusterTypeValues = ["single", "repl", "sharded"];
var isSourceUsingAuthValues = [true, false];
- var isSourceUsingTryClusterAuthValues = [true, false];
+ var isSourceUsingTransitionToAuthValues = [true, false];
var targetClusterTypeValues = ["single", "repl", "sharded"];
var isTargetUsingAuthValues = [true, false];
- var isTargetUsingTryClusterAuthValues = [true, false];
+ var isTargetUsingTransitionToAuthValues = [true, false];
for (var i = 0; i < sourceClusterTypeValues.length; i++) {
for (var j = 0; j < isSourceUsingAuthValues.length; j++) {
for (var k = 0; k < targetClusterTypeValues.length; k++) {
@@ -230,16 +230,16 @@ function copydbBetweenClustersTest(configObj) {
continue;
}
- for (var m = 0; m < isSourceUsingTryClusterAuthValues.length; m++) {
- if (isSourceUsingTryClusterAuthValues[m] === true &&
+ for (var m = 0; m < isSourceUsingTransitionToAuthValues.length; m++) {
+ if (isSourceUsingTransitionToAuthValues[m] === true &&
isSourceUsingAuthValues[j] === false) {
- // tryClusterAuth requires auth parameters
+ // transitionToAuth requires auth parameters
continue;
}
- for (var n = 0; n < isTargetUsingTryClusterAuthValues.length; n++) {
- if (isTargetUsingTryClusterAuthValues[n] === true &&
+ for (var n = 0; n < isTargetUsingTransitionToAuthValues.length; n++) {
+ if (isTargetUsingTransitionToAuthValues[n] === true &&
isTargetUsingAuthValues[l] === false) {
- // tryClusterAuth requires auth parameters
+ // transitionToAuth requires auth parameters
continue;
}
var testCase = {
@@ -247,8 +247,10 @@ function copydbBetweenClustersTest(configObj) {
'isSourceUsingAuth': isSourceUsingAuthValues[j],
'targetClusterType': targetClusterTypeValues[k],
'isTargetUsingAuth': isTargetUsingAuthValues[l],
- 'isSourceUsingTryClusterAuth': isSourceUsingTryClusterAuthValues[m],
- 'isTargetUsingTryClusterAuth': isTargetUsingTryClusterAuthValues[n]
+ 'isSourceUsingTransitionToAuth':
+ isSourceUsingTransitionToAuthValues[m],
+ 'isTargetUsingTransitionToAuth':
+ isTargetUsingTransitionToAuthValues[n]
};
print("Running copydb with auth test:");
printjson(testCase);
diff --git a/jstests/auth/upgrade_noauth_to_keyfile.js b/jstests/auth/upgrade_noauth_to_keyfile.js
index 780acc9e6a6..372ae61af2b 100644
--- a/jstests/auth/upgrade_noauth_to_keyfile.js
+++ b/jstests/auth/upgrade_noauth_to_keyfile.js
@@ -17,16 +17,16 @@ load('jstests/multiVersion/libs/multi_rs.js');
};
// Undefine the flags we're replacing, otherwise upgradeSet will keep old values.
- var tryClusterAuthOptions = {
+ var transitionToAuthOptions = {
noauth: undefined,
clusterAuthMode: 'keyFile',
keyFile: keyFilePath,
- tryClusterAuth: ''
+ transitionToAuth: ''
};
var keyFileOptions = {
clusterAuthMode: 'keyFile',
keyFile: keyFilePath,
- tryClusterAuth: undefined
+ transitionToAuth: undefined
};
var rst = new ReplSetTest({name: 'noauthSet', nodes: 3, nodeOptions: noAuthOptions});
@@ -41,13 +41,13 @@ load('jstests/multiVersion/libs/multi_rs.js');
rstConn1.getDB('test').a.insert({a: 1, str: 'TESTTESTTEST'});
assert.eq(1, rstConn1.getDB('test').a.count(), 'Error interacting with replSet');
- print('=== UPGRADE noauth -> tryClusterAuth/keyFile ===');
- rst.upgradeSet(tryClusterAuthOptions);
+ print('=== UPGRADE noauth -> transitionToAuth/keyFile ===');
+ rst.upgradeSet(transitionToAuthOptions);
var rstConn2 = rst.getPrimary();
rstConn2.getDB('test').a.insert({a: 1, str: 'TESTTESTTEST'});
assert.eq(2, rstConn2.getDB('test').a.count(), 'Error interacting with replSet');
- print('=== UPGRADE tryClusterAuth/keyFile -> keyFile ===');
+ print('=== UPGRADE transitionToAuth/keyFile -> keyFile ===');
rst.upgradeSet(keyFileOptions, 'root', 'root');
// upgradeSet leaves its connections logged in as root
diff --git a/jstests/auth/upgrade_noauth_to_keyfile_with_sharding.js b/jstests/auth/upgrade_noauth_to_keyfile_with_sharding.js
index f36c545f551..f6ecfec9abb 100644
--- a/jstests/auth/upgrade_noauth_to_keyfile_with_sharding.js
+++ b/jstests/auth/upgrade_noauth_to_keyfile_with_sharding.js
@@ -10,26 +10,26 @@ load('jstests/ssl/libs/ssl_helpers.js');
var noAuthOptions = {
noauth: ''
};
- var tryClusterAuthOptions = {
+ var transitionToAuthOptions = {
clusterAuthMode: 'keyFile',
keyFile: KEYFILE,
- tryClusterAuth: ''
+ transitionToAuth: ''
};
var keyFileOptions = {
clusterAuthMode: 'keyFile',
keyFile: KEYFILE
};
- print('=== Testing no-auth/tryClusterAuth cluster ===');
- mixedShardTest(noAuthOptions, tryClusterAuthOptions, true);
- mixedShardTest(tryClusterAuthOptions, noAuthOptions, true);
+ print('=== Testing no-auth/transitionToAuth cluster ===');
+ mixedShardTest(noAuthOptions, transitionToAuthOptions, true);
+ mixedShardTest(transitionToAuthOptions, noAuthOptions, true);
- print('=== Testing tryClusterAuth/tryClusterAuth cluster ===');
- mixedShardTest(tryClusterAuthOptions, tryClusterAuthOptions, true);
+ print('=== Testing transitionToAuth/transitionToAuth cluster ===');
+ mixedShardTest(transitionToAuthOptions, transitionToAuthOptions, true);
- print('=== Testing tryClusterAuth/keyFile cluster ===');
- mixedShardTest(keyFileOptions, tryClusterAuthOptions, true);
- mixedShardTest(tryClusterAuthOptions, keyFileOptions, true);
+ print('=== Testing transitionToAuth/keyFile cluster ===');
+ mixedShardTest(keyFileOptions, transitionToAuthOptions, true);
+ mixedShardTest(transitionToAuthOptions, keyFileOptions, true);
print('=== Testing no-auth/keyFile cluster fails ===');
mixedShardTest(noAuthOptions, keyFileOptions, false);