diff options
| author | Antonin Kral <a.kral@bobek.cz> | 2012-08-29 20:54:51 +0200 |
|---|---|---|
| committer | Antonin Kral <a.kral@bobek.cz> | 2012-08-29 20:54:51 +0200 |
| commit | 83957b73f9177f6e38bd5375bd93ca1f6a47188c (patch) | |
| tree | f20b7d6ac9a9c64ff5bb6b5910a24abbb356b1d5 /jstests/replsets/replsetadd.js | |
| parent | 5071d203970edd4c995493d810abe20987e76fe9 (diff) | |
Imported Upstream version 2.2.0upstream/2.2.0
Diffstat (limited to 'jstests/replsets/replsetadd.js')
| -rw-r--r-- | jstests/replsets/replsetadd.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/jstests/replsets/replsetadd.js b/jstests/replsets/replsetadd.js index 44ef7c61fdf..711a173931b 100644 --- a/jstests/replsets/replsetadd.js +++ b/jstests/replsets/replsetadd.js @@ -22,7 +22,9 @@ doTest = function( signal ) { return result['ok'] == 1; }); - replTest.getMaster(); + db = replTest.getMaster().getDB( "test"); + db.foo.insert( { x : 1} ); + db.foo.ensureIndex( { x : 1 } ); // Start a second node var second = replTest.add(); @@ -50,8 +52,16 @@ doTest = function( signal ) { print("trying reconfig that shouldn't work"); var result = master.getDB("admin").runCommand({replSetReconfig: config}); - assert.eq(result.ok, 0); - assert.eq(result.assertionCode, 13645); + assert.eq(result.ok, 0, tojson(result)); + assert.eq(result.code, 13645, tojson(result)); + + replTest.awaitReplication(); + + hashes = replTest.getHashes( "test" ); + printjson( hashes ); + for ( i=0; i<hashes.slaves.length; i++ ) { + assert.eq( hashes.master.collections.foo , hashes.slaves[i].collections.foo ); + } replTest.stopSet( signal ); } |
