diff options
author | Randolph Tan <randolph@10gen.com> | 2014-03-03 11:27:18 -0500 |
---|---|---|
committer | Randolph Tan <randolph@10gen.com> | 2014-03-14 12:05:05 -0400 |
commit | eb41492c6f1228077b92239524e4a607b70cd8e3 (patch) | |
tree | c90485d43753aa756063d0a6e8f67b8843931bba /jstests/replsets/tags_with_reconfig.js | |
parent | e44682821c37fdf3d4fd8cb58dcf5c34181ddbde (diff) | |
download | mongo-eb41492c6f1228077b92239524e4a607b70cd8e3.tar.gz |
SERVER-13190 migrate replset jstest suite to use write commands api
Diffstat (limited to 'jstests/replsets/tags_with_reconfig.js')
-rw-r--r-- | jstests/replsets/tags_with_reconfig.js | 30 |
1 files changed, 8 insertions, 22 deletions
diff --git a/jstests/replsets/tags_with_reconfig.js b/jstests/replsets/tags_with_reconfig.js index 8de023f5d4e..755fd744de5 100644 --- a/jstests/replsets/tags_with_reconfig.js +++ b/jstests/replsets/tags_with_reconfig.js @@ -27,18 +27,11 @@ replTest.awaitReplication(); master = replTest.getMaster(); var db = master.getDB("test"); -// Insert a document and getLastError with write concern : anydc -db.foo.insert( {x:1} ); -var result = db.runCommand( {getLastError:1, w:"anydc", wtimeout:20000} ); -printjson (result) -assert.eq (result.err, null); - -// Insert a document and getLastError with write concern : alldc -db.foo.insert( {x:2} ); -var result = db.runCommand( {getLastError:1, w:"alldc", wtimeout:20000} ); -printjson (result) -assert.eq (result.err, null); +// Insert a document with write concern : anydc +assert.writeOK(db.foo.insert({ x: 1 }, { writeConcern: { w: 'anydc', wtimeout: 20000 }})); +// Insert a document with write concern : alldc +assert.writeOK(db.foo.insert({ x: 2 }, { writeConcern: { w: 'alldc', wtimeout: 20000 }})); // Add a new tag to the replica set var config = master.getDB("local").system.replset.findOne(); @@ -64,17 +57,10 @@ printjson(config); master = replTest.getMaster(); var db = master.getDB("test"); -// Insert a document and getLastError with write concern : anydc -db.foo.insert( {x:3} ); -var result = db.runCommand( {getLastError:1, w:"anydc", wtimeout:20000} ); -printjson (result) -assert.eq (result.err, null); - -// Insert a document and getLastError with write concern : alldc -db.foo.insert( {x:4} ); -var result = db.runCommand( {getLastError:1, w:"alldc", wtimeout:20000} ); -printjson (result) -assert.eq (result.err, null); +// Insert a document with write concern : anydc +assert.writeOK(db.foo.insert({ x: 3 }, { writeConcern: { w: 'anydc', wtimeout: 20000 }})); +// Insert a document with write concern : alldc +assert.writeOK(db.foo.insert({ x: 4 }, { writeConcern: { w: 'alldc', wtimeout: 20000 }})); replTest.stopSet(); |