diff options
author | Andreas Nilsson <andreas.nilsson@10gen.com> | 2013-09-25 16:42:45 -0400 |
---|---|---|
committer | Andreas Nilsson <andreas.nilsson@10gen.com> | 2013-09-30 14:10:54 -0400 |
commit | 625e971353db40be3a3c91aa1c1d708af9705693 (patch) | |
tree | 71ed77f10e876e4bc72e37c01dc8cf9c4b5f756d /src/mongo/shell/servers_misc.js | |
parent | 10870bd2798db3c257d35a905985a066a8df82ec (diff) | |
download | mongo-625e971353db40be3a3c91aa1c1d708af9705693.tar.gz |
SERVER-7455 x.509 cluster auth tests and expanded use-ssl passthrough
Diffstat (limited to 'src/mongo/shell/servers_misc.js')
-rw-r--r-- | src/mongo/shell/servers_misc.js | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/mongo/shell/servers_misc.js b/src/mongo/shell/servers_misc.js index f34a5c48cea..cb4e953fd2c 100644 --- a/src/mongo/shell/servers_misc.js +++ b/src/mongo/shell/servers_misc.js @@ -163,6 +163,19 @@ ReplTest.prototype.getOptions = function( master , extra , putBinaryFirst, norep a.push( jsTestOptions().keyFile ) } + if( jsTestOptions().useSSL ) { + a.push( "--sslOnNormalPorts" ) + a.push( "--sslPEMKeyFile" ) + a.push( "jstests/libs/server.pem" ) + a.push( "--sslCAFile" ) + a.push( "jstests/libs/ca.pem" ) + a.push( "--sslWeakCertificateValidation" ) + } + if( jsTestOptions().useX509 ) { + a.push( "--clusterAuthMode" ) + a.push( "x509" ) + } + if ( !norepl ) { if ( master ){ a.push( "--master" ); @@ -190,12 +203,11 @@ ReplTest.prototype.start = function( master , options , restart, norepl ){ removeFile( lockFile ); var o = this.getOptions( master , options , restart, norepl ); - if (restart) { return startMongoProgram.apply(null, o); } else { var conn = startMongod.apply(null, o); - if (jsTestOptions().keyFile || jsTestOptions().auth) { + if (jsTestOptions().keyFile || jsTestOptions().auth || jsTestOptions().useX509) { if (master) { jsTest.addAuth(conn); } @@ -290,6 +302,14 @@ function startParallelShell( jsCode, port ){ args.push(db.getMongo().host); } + if( jsTestOptions().useSSL ) { + args.push( "--ssl" ) + args.push( "--sslPEMKeyFile" ) + args.push( "jstests/libs/client.pem" ) + args.push( "--sslCAFile" ) + args.push( "jstests/libs/ca.pem" ) + } + x = startMongoProgramNoConnect.apply(null, args); return function(){ waitProgram( x ); |