diff options
author | mike o'brien <mpobrien005@gmail.com> | 2014-11-21 20:47:55 -0500 |
---|---|---|
committer | Ernie Hershey <ernie.hershey@10gen.com> | 2014-11-21 20:52:32 -0500 |
commit | 609a1492d2895ea55a9202815590636d1934a9ca (patch) | |
tree | bbfcbe8c5dbe5ce1e615f8c56e82b39767eb7ebe /jstests/tool | |
parent | 0a02891e3f155e5a187ee14c774d42cbdb290652 (diff) | |
download | mongo-609a1492d2895ea55a9202815590636d1934a9ca.tar.gz |
TOOLS-327 fix tests relying on --w to use --writeConcern
Diffstat (limited to 'jstests/tool')
-rw-r--r-- | jstests/tool/dumprestore10.js | 2 | ||||
-rw-r--r-- | jstests/tool/dumprestore7.js | 2 | ||||
-rw-r--r-- | jstests/tool/dumprestoreWithNoOptions.js | 6 | ||||
-rw-r--r-- | jstests/tool/dumprestore_auth2.js | 4 | ||||
-rw-r--r-- | jstests/tool/dumprestore_auth3.js | 12 |
5 files changed, 13 insertions, 13 deletions
diff --git a/jstests/tool/dumprestore10.js b/jstests/tool/dumprestore10.js index 72eff8ed154..f59b131bb05 100644 --- a/jstests/tool/dumprestore10.js +++ b/jstests/tool/dumprestore10.js @@ -48,7 +48,7 @@ runMongoProgram( "mongodump", "--host", "127.0.0.1:"+replTest.ports[0], "--out", step("try mongorestore with write concern"); -runMongoProgram( "mongorestore", "--w", "2", "--host", "127.0.0.1:"+replTest.ports[0], "--dir", data ); +runMongoProgram( "mongorestore", "--writeConcern", "2", "--host", "127.0.0.1:"+replTest.ports[0], "--dir", data ); var x = 0; diff --git a/jstests/tool/dumprestore7.js b/jstests/tool/dumprestore7.js index 9df6ce2cc86..a9225dd7044 100644 --- a/jstests/tool/dumprestore7.js +++ b/jstests/tool/dumprestore7.js @@ -52,7 +52,7 @@ MongoRunner.runMongoTool( "mongodump", step("try mongorestore from $timestamp"); -runMongoProgram( "mongorestore", "--host", "127.0.0.1:"+port, "--dir", data, "--w", 1); +runMongoProgram( "mongorestore", "--host", "127.0.0.1:"+port, "--dir", data, "--writeConcern", 1); var x = 9; x = conn.getDB("local").getCollection("oplog.rs").count(); diff --git a/jstests/tool/dumprestoreWithNoOptions.js b/jstests/tool/dumprestoreWithNoOptions.js index 5c363c50cb1..01aaf21b2d8 100644 --- a/jstests/tool/dumprestoreWithNoOptions.js +++ b/jstests/tool/dumprestoreWithNoOptions.js @@ -40,7 +40,7 @@ db.dropDatabase(); assert.eq( 0, db.capped.count(), "capped not dropped"); assert.eq( 0, db.capped.getIndexes().length, "indexes not dropped" ); -t.runTool( "restore" , "--dir" , t.ext , "--noOptionsRestore", "--w=1"); +t.runTool( "restore" , "--dir" , t.ext , "--noOptionsRestore", "--writeConcern=1"); assert.eq( 1, db.capped.count() , "wrong number of docs restored to capped" ); assert(true !== db.capped.stats().capped, "restore options were not ignored"); @@ -67,7 +67,7 @@ db.dropDatabase(); assert.eq( 0, db.capped.count(), "capped not dropped"); assert.eq( 0, db.capped.getIndexes().length, "indexes not dropped" ); -t.runTool( "restore" , "-d", dbname2, "--dir" , dumppath + dbname, "--noOptionsRestore", "--w=1"); +t.runTool( "restore" , "-d", dbname2, "--dir" , dumppath + dbname, "--noOptionsRestore", "--writeConcern=1"); db = db.getSiblingDB(dbname2); @@ -99,7 +99,7 @@ db.dropDatabase(); assert.eq( 0, db.capped.count(), "capped not dropped"); assert.eq( 0, db.capped.getIndexes().length, "indexes not dropped" ); -t.runTool( "restore", "-d", dbname, "--drop", "--noOptionsRestore", dumppath + dbname, "--w=1"); +t.runTool( "restore", "-d", dbname, "--drop", "--noOptionsRestore", dumppath + dbname, "--writeConcern=1"); db = db.getSiblingDB(dbname); diff --git a/jstests/tool/dumprestore_auth2.js b/jstests/tool/dumprestore_auth2.js index 90b2dcd4b10..fcc912f06db 100644 --- a/jstests/tool/dumprestore_auth2.js +++ b/jstests/tool/dumprestore_auth2.js @@ -56,7 +56,7 @@ assert.eq(0, coll.count(), "didn't drop foo coll"); // This test depends on W=0 to mask unique index violations. // This should be fixed once we implement TOOLS-341 -t.runTool("restore", "--dir", t.ext, "--username", "restore", "--password", "pass", "--w", "0"); +t.runTool("restore", "--dir", t.ext, "--username", "restore", "--password", "pass", "--writeConcern", "0"); assert.soon("admindb.system.users.findOne()", "no data after restore"); assert.eq(4, admindb.system.users.count(), "didn't restore users"); @@ -80,7 +80,7 @@ admindb.createRole({role: "customRole2", roles: [], privileges:[]}); admindb.dropUser("root"); admindb.logout(); -t.runTool("restore", "--dir", t.ext, "--username", "restore", "--password", "pass", "--drop", "--w", "0"); +t.runTool("restore", "--dir", t.ext, "--username", "restore", "--password", "pass", "--drop", "--writeConcern", "0"); admindb.auth("root", "pass"); assert.soon("1 == admindb.system.users.find({user:'root'}).count()", "didn't restore users 2"); diff --git a/jstests/tool/dumprestore_auth3.js b/jstests/tool/dumprestore_auth3.js index 5a4d2abdbe5..731fb5c272d 100644 --- a/jstests/tool/dumprestore_auth3.js +++ b/jstests/tool/dumprestore_auth3.js @@ -58,7 +58,7 @@ db.dropAllRoles(); jsTestLog("Restore foo database from dump that doesn't contain user data "); // This test depends on W=0 to mask unique index violations. // This should be fixed once we implement TOOLS-341 -runTool("mongorestore", mongod, {dir: dumpDir + "foo/", db: 'foo', restoreDbUsersAndRoles: "", w: "0"}); +runTool("mongorestore", mongod, {dir: dumpDir + "foo/", db: 'foo', restoreDbUsersAndRoles: "", writeConcern: "0"}); db = mongod.getDB('foo'); @@ -90,7 +90,7 @@ assert.eq(0, db.getRoles().length, "didn't drop roles"); assert.eq(0, db.bar.count(), "didn't drop 'bar' collection"); jsTestLog("Restore foo database without restoring user data, even though it's in the dump"); -runTool("mongorestore", mongod, {dir: dumpDir + "foo/", db: 'foo', w: "0"}); +runTool("mongorestore", mongod, {dir: dumpDir + "foo/", db: 'foo', writeConcern: "0"}); db = mongod.getDB('foo'); assert.soon(function() { return db.bar.findOne(); }, "no data after restore"); @@ -99,7 +99,7 @@ assert.eq(0, db.getUsers().length, "Restored users even though it shouldn't have assert.eq(0, db.getRoles().length, "Restored roles even though it shouldn't have"); jsTestLog("Restore foo database *with* user data"); -runTool("mongorestore", mongod, {dir: dumpDir + "foo/", db: 'foo', restoreDbUsersAndRoles: "", w: "0"}); +runTool("mongorestore", mongod, {dir: dumpDir + "foo/", db: 'foo', restoreDbUsersAndRoles: "", writeConcern: "0"}); db = mongod.getDB('foo'); admindb = mongod.getDB('admin'); @@ -121,7 +121,7 @@ db.createRole({role: 'role2', roles: [], privileges:[]}); jsTestLog("Restore foo database (and user data) with --drop so it overrides the changes made"); // Restore with --drop to override the changes to user data runTool("mongorestore", mongod, - {dir: dumpDir + "foo/", db: 'foo', drop: "", restoreDbUsersAndRoles: "", w: "0"}); + {dir: dumpDir + "foo/", db: 'foo', drop: "", restoreDbUsersAndRoles: "", writeConcern: "0"}); db = mongod.getDB('foo'); admindb = mongod.getDB('admin'); @@ -152,7 +152,7 @@ db.getSiblingDB('bar').createUser({user: "user2", pwd: 'pwd', roles: []}); db.getSiblingDB('admin').dropAllUsers(); jsTestLog("Restore just the admin database. User data should be restored by default"); -runTool("mongorestore", mongod, {dir: dumpDir + "admin/", db: 'admin', drop: "", w: "0"}); +runTool("mongorestore", mongod, {dir: dumpDir + "admin/", db: 'admin', drop: "", writeConcern: "0"}); db = mongod.getDB('foo'); var otherdb = db.getSiblingDB('bar'); var admindb = db.getSiblingDB('admin'); @@ -186,7 +186,7 @@ assert.eq(0, db.getRoles().length, "didn't drop roles"); assert.eq(0, db.bar.count(), "didn't drop 'bar' collection"); jsTestLog("Restore all databases"); -runTool("mongorestore", mongod, {dir: dumpDir, w: "0"}); +runTool("mongorestore", mongod, {dir: dumpDir, writeConcern: "0"}); db = mongod.getDB('foo'); assert.soon(function() { return db.bar.findOne(); }, "no data after restore"); |