diff options
author | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-09-01 16:19:57 -0400 |
---|---|---|
committer | Charlie Swanson <charlie.swanson@mongodb.com> | 2015-09-09 13:14:48 -0400 |
commit | c15f4bb96d2ee86874582d45d1865e9358168e7e (patch) | |
tree | 92c788863ae91a8b9c5801e1d536d7ef1a02ec05 /jstests/ssl/set_parameter_ssl.js | |
parent | f5e063d4785b0460ab41de8cc4b537e5e2151338 (diff) | |
download | mongo-c15f4bb96d2ee86874582d45d1865e9358168e7e.tar.gz |
SERVER-18272 Update jstests to use allocatePort() instead of hard coding ports
Diffstat (limited to 'jstests/ssl/set_parameter_ssl.js')
-rw-r--r-- | jstests/ssl/set_parameter_ssl.js | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/jstests/ssl/set_parameter_ssl.js b/jstests/ssl/set_parameter_ssl.js index 801d4e15b72..98a4065b8a0 100644 --- a/jstests/ssl/set_parameter_ssl.js +++ b/jstests/ssl/set_parameter_ssl.js @@ -1,16 +1,15 @@ -// Test changing the --sslMode and --clusterAuthMode -// parameters using setParameter +// Test changing the --sslMode and --clusterAuthMode parameters using setParameter var SERVER_CERT = "jstests/libs/server.pem" var CA_CERT = "jstests/libs/ca.pem" -port = allocatePorts(1)[0]; function testSSLTransition(oldMode, newMode, shouldSucceed) { - var conn = MongoRunner.runMongod({port: port, - sslMode: oldMode, - sslPEMKeyFile: SERVER_CERT, - sslCAFile: CA_CERT}); - + var conn = MongoRunner.runMongod({ + sslMode: oldMode, + sslPEMKeyFile: SERVER_CERT, + sslCAFile: CA_CERT + }); + var adminDB = conn.getDB("admin"); adminDB.createUser({user: "root", pwd: "pwd", roles: ['root']}); adminDB.auth("root", "pwd"); @@ -18,16 +17,17 @@ function testSSLTransition(oldMode, newMode, shouldSucceed) { "sslMode" : newMode }); assert(res["ok"] == shouldSucceed, tojson(res)); - MongoRunner.stopMongod(port); + MongoRunner.stopMongod(conn.port); } function testAuthModeTransition(oldMode, newMode, sslMode, shouldSucceed) { - var conn = MongoRunner.runMongod({port: port, - sslMode: sslMode, - sslPEMKeyFile: SERVER_CERT, - sslCAFile: CA_CERT, - clusterAuthMode: oldMode}); - + var conn = MongoRunner.runMongod({ + sslMode: sslMode, + sslPEMKeyFile: SERVER_CERT, + sslCAFile: CA_CERT, + clusterAuthMode: oldMode + }); + var adminDB = conn.getDB("admin"); adminDB.createUser({user: "root", pwd: "pwd", roles: ['root']}); adminDB.auth("root", "pwd"); @@ -35,7 +35,7 @@ function testAuthModeTransition(oldMode, newMode, sslMode, shouldSucceed) { "clusterAuthMode" : newMode }); assert(res["ok"] == shouldSucceed, tojson(res)); - MongoRunner.stopMongod(port); + MongoRunner.stopMongod(conn.port); } testSSLTransition("allowSSL", "invalid", false); |