diff options
author | Antonin Kral <a.kral@bobek.cz> | 2010-09-24 19:01:03 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2010-09-24 19:01:03 +0200 |
commit | 0ad0c09511a04ebe837f2acb859d47f2aa4e038a (patch) | |
tree | 109babcb556f6c5884b77853120717f0617c7a1e /jstests/replsets/randomcommands1.js | |
parent | 03e58f81cad8dd4cfcd1530f327116f0cff6ceb3 (diff) | |
download | mongodb-0ad0c09511a04ebe837f2acb859d47f2aa4e038a.tar.gz |
Imported Upstream version 1.6.3
Diffstat (limited to 'jstests/replsets/randomcommands1.js')
-rw-r--r-- | jstests/replsets/randomcommands1.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/jstests/replsets/randomcommands1.js b/jstests/replsets/randomcommands1.js new file mode 100644 index 0000000..c451e74 --- /dev/null +++ b/jstests/replsets/randomcommands1.js @@ -0,0 +1,29 @@ + +replTest = new ReplSetTest( {name: 'randomcommands1', nodes: 3} ); + +nodes = replTest.startSet(); +replTest.initiate(); + +master = replTest.getMaster(); +slaves = replTest.liveNodes.slaves; +printjson(replTest.liveNodes); + +db = master.getDB("foo") +t = db.foo + +ts = slaves.map( function(z){ z.setSlaveOk(); return z.getDB( "foo" ).foo; } ) + +t.save({a: 1000}); +t.ensureIndex( { a : 1 } ) + +db.getLastError( 3 , 30000 ) + +ts.forEach( function(z){ assert.eq( 2 , z.getIndexKeys().length , "A " + z.getMongo() ); } ) + +t.reIndex() + +db.getLastError( 3 , 30000 ) +ts.forEach( function(z){ assert.eq( 2 , z.getIndexKeys().length , "A " + z.getMongo() ); } ) + +replTest.stopSet( 15 ) + |