summaryrefslogtreecommitdiff
path: root/jstests/sharding/auth_no_config_primary.js
diff options
context:
space:
mode:
authorMike Grundy <michael.grundy@10gen.com>2016-03-17 14:41:31 -0400
committerMike Grundy <michael.grundy@10gen.com>2016-03-18 17:10:31 -0400
commit1be713cebbb9411d2977ec9996931a4508252af0 (patch)
treea199db2a273ebb5ca4289158ee5f63066cb3926a /jstests/sharding/auth_no_config_primary.js
parentd82956a6fe2e7d5dd6216e66e95900d73dbf2e0c (diff)
downloadmongo-1be713cebbb9411d2977ec9996931a4508252af0.tar.gz
SERVER-23067 Final round of JS linting and formatting
Diffstat (limited to 'jstests/sharding/auth_no_config_primary.js')
-rw-r--r--jstests/sharding/auth_no_config_primary.js57
1 files changed, 28 insertions, 29 deletions
diff --git a/jstests/sharding/auth_no_config_primary.js b/jstests/sharding/auth_no_config_primary.js
index 4c6d04d8b1e..a4be8806f66 100644
--- a/jstests/sharding/auth_no_config_primary.js
+++ b/jstests/sharding/auth_no_config_primary.js
@@ -6,45 +6,44 @@
* @tags: [requires_persistence]
*/
(function() {
-"use strict";
+ "use strict";
-var st = new ShardingTest({ shards: 1, keyFile: 'jstests/libs/key1' });
+ var st = new ShardingTest({shards: 1, keyFile: 'jstests/libs/key1'});
-st.s.getDB('admin').createUser({ user: 'root', pwd: 'pass', roles: ['root']});
-st.s.getDB('admin').auth('root', 'pass');
-var testDB = st.s.getDB('test');
-testDB.user.insert({ hello: 'world' });
+ st.s.getDB('admin').createUser({user: 'root', pwd: 'pass', roles: ['root']});
+ st.s.getDB('admin').auth('root', 'pass');
+ var testDB = st.s.getDB('test');
+ testDB.user.insert({hello: 'world'});
-// Kill all secondaries, forcing the current primary to step down.
-st.configRS.getSecondaries().forEach(function(secondaryConn) {
- MongoRunner.stopMongod(secondaryConn.port);
-});
+ // Kill all secondaries, forcing the current primary to step down.
+ st.configRS.getSecondaries().forEach(function(secondaryConn) {
+ MongoRunner.stopMongod(secondaryConn.port);
+ });
-// Test authenticate through a fresh connection.
-var newConn = new Mongo(st.s.host);
+ // Test authenticate through a fresh connection.
+ var newConn = new Mongo(st.s.host);
-assert.commandFailedWithCode(newConn.getDB('test').runCommand({ find: 'user' }),
- ErrorCodes.Unauthorized);
+ assert.commandFailedWithCode(newConn.getDB('test').runCommand({find: 'user'}),
+ ErrorCodes.Unauthorized);
-newConn.getDB('admin').auth('root', 'pass');
+ newConn.getDB('admin').auth('root', 'pass');
-var res = newConn.getDB('test').user.findOne();
-assert.neq(null, res);
-assert.eq('world', res.hello);
+ var res = newConn.getDB('test').user.findOne();
+ assert.neq(null, res);
+ assert.eq('world', res.hello);
-// Test authenticate through new mongos.
-var otherMongos = MongoRunner.runMongos({ keyFile : "jstests/libs/key1",
- configdb : st.s.savedOptions.configdb });
+ // Test authenticate through new mongos.
+ var otherMongos = MongoRunner.runMongos(
+ {keyFile: "jstests/libs/key1", configdb: st.s.savedOptions.configdb});
-assert.commandFailedWithCode(otherMongos.getDB('test').runCommand({ find: 'user' }),
- ErrorCodes.Unauthorized);
+ assert.commandFailedWithCode(otherMongos.getDB('test').runCommand({find: 'user'}),
+ ErrorCodes.Unauthorized);
-otherMongos.getDB('admin').auth('root', 'pass');
+ otherMongos.getDB('admin').auth('root', 'pass');
-var res = otherMongos.getDB('test').user.findOne();
-assert.neq(null, res);
-assert.eq('world', res.hello);
+ var res = otherMongos.getDB('test').user.findOne();
+ assert.neq(null, res);
+ assert.eq('world', res.hello);
-st.stop();
+ st.stop();
})();
-