diff options
author | Andreas <agralius@gmail.com> | 2014-08-13 12:10:38 -0400 |
---|---|---|
committer | Andreas <agralius@gmail.com> | 2014-08-28 13:20:25 -0400 |
commit | e6a8e256ca73e7596d9f8b7b3a3b00d8c08f6554 (patch) | |
tree | cc5ca0887015b6c8d09bdc932756faaac8df3c24 /jstests/auth | |
parent | ca6a26760c2150736562f49201fcb7b4de5e53f1 (diff) | |
download | mongo-e6a8e256ca73e7596d9f8b7b3a3b00d8c08f6554.tar.gz |
SERVER-7596 Native SCRAM-SHA-1 server side support
Diffstat (limited to 'jstests/auth')
-rw-r--r-- | jstests/auth/auth_helpers.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/jstests/auth/auth_helpers.js b/jstests/auth/auth_helpers.js index 3db73977811..3f796409977 100644 --- a/jstests/auth/auth_helpers.js +++ b/jstests/auth/auth_helpers.js @@ -8,26 +8,26 @@ var admin = conn.getDB('admin'); admin.createUser({user:'andy', pwd: 'a', roles: jsTest.adminUserRoles}); admin.auth({user: 'andy', pwd: 'a'}); -// Find out if this build supports the authenticationMechanisms startup parameter. If it does, -// restart with MONGODB-CR and CRAM-MD5 mechanisms enabled. -var cmdOut = conn.getDB('admin').runCommand({getParameter: 1, authenticationMechanisms: 1}) -if (cmdOut.ok) { - MongoRunner.stopMongod(conn); - conn = MongoRunner.runMongod({ restart: conn, - setParameter: "authenticationMechanisms=MONGODB-CR,CRAM-MD5" }); +// Attempt to start with CRAM-MD5 enabled +// If this fails the build only supports default auth mechanisms +MongoRunner.stopMongod(conn); +var restartedConn = MongoRunner.runMongod({ restart: conn, + setParameter: "authenticationMechanisms=MONGODB-CR,CRAM-MD5" }); +if (restartedConn != null) { mechanisms = [ "MONGODB-CR", "CRAM-MD5" ]; hasMongoCR = true; hasCramMd5 = true; print("test info: Enabling non-default authentication mechanisms."); } else { + restartedConn = MongoRunner.runMongod({ restart: conn }); mechanisms = [ "MONGODB-CR" ]; hasMongoCR = true; hasCramMd5 = false; print("test info: Using only default authentication mechanism, MONGODB-CR."); } -admin = conn.getDB('admin'); +admin = restartedConn.getDB('admin'); var testedSomething = false; // If the server supports them MONGODB-CR, try all the ways to call db.auth that use MONGODB-CR. |