summaryrefslogtreecommitdiff
path: root/jstests/disk/repair3.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/disk/repair3.js')
-rw-r--r--jstests/disk/repair3.js33
1 files changed, 22 insertions, 11 deletions
diff --git a/jstests/disk/repair3.js b/jstests/disk/repair3.js
index 6b4997cc83c..12c5356a2d6 100644
--- a/jstests/disk/repair3.js
+++ b/jstests/disk/repair3.js
@@ -17,15 +17,19 @@ if ( !doIt ) {
doIt = false;
}
-if ( doIt ) {
-
- port = allocatePorts( 1 )[ 0 ];
- dbpath = MongoRunner.dataPath + baseName + "/";
+if (doIt) {
+ var dbpath = MongoRunner.dataPath + baseName + "/";
resetDbpath( dbpath );
resetDbpath( repairpath );
- m = startMongoProgram( "mongod", "--nssize", "8", "--noprealloc", "--smallfiles", "--port", port, "--dbpath", dbpath, "--repairpath", repairpath, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
+ var m = MongoRunner.runMongod({
+ nssize: 8,
+ noprealloc: "",
+ smallfiles: "",
+ dbpath: dbpath,
+ repairpath: repairpath,
+ });
db = m.getDB( baseName );
db[ baseName ].save( {} );
assert.commandWorked( db.runCommand( {repairDatabase:1, backupOriginalFiles:false} ) );
@@ -39,14 +43,21 @@ if ( doIt ) {
}
check();
- MongoRunner.stopMongod( port );
+ MongoRunner.stopMongod( m.port );
resetDbpath( repairpath );
- rc = runMongoProgram( "mongod", "--nssize", "8", "--noprealloc", "--smallfiles", "--repair", "--port", port, "--dbpath", dbpath, "--repairpath", repairpath, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
+ var rc = runMongoProgram("mongod", "--nssize", "8", "--noprealloc", "--smallfiles", "--repair",
+ "--port", m.port, "--dbpath", dbpath, "--repairpath", repairpath);
assert.eq.automsg( "0", "rc" );
- m = startMongoProgram( "mongod", "--nssize", "8", "--noprealloc", "--smallfiles", "--port", port, "--dbpath", dbpath, "--repairpath", repairpath, "--nohttpinterface", "--bind_ip", "127.0.0.1" );
+ m = MongoRunner.runMongod({
+ nssize: 8,
+ noprealloc: "",
+ smallfiles: "",
+ port: m.port,
+ dbpath: dbpath,
+ repairpath: repairpath,
+ });
db = m.getDB( baseName );
check();
- MongoRunner.stopMongod( port );
-
-} \ No newline at end of file
+ MongoRunner.stopMongod( m.port );
+}