From 7acafe85d9bdd63122c19ba1cca86a7f55174941 Mon Sep 17 00:00:00 2001 From: Randolph Tan Date: Tue, 4 Mar 2014 17:41:56 -0500 Subject: SERVER-13425 migrate sharding jstest suite to use write commands api --- jstests/sharding/addshard1.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'jstests/sharding/addshard1.js') diff --git a/jstests/sharding/addshard1.js b/jstests/sharding/addshard1.js index 0ca6a832a49..42342351d8a 100644 --- a/jstests/sharding/addshard1.js +++ b/jstests/sharding/addshard1.js @@ -9,10 +9,9 @@ conn1 = startMongodTest( 29000 ); db1 = conn1.getDB( "testDB" ); numObjs = 0; for (i=0; i<3; i++){ - db1.foo.save( { a : i } ); + assert.writeOK(db1.foo.save( { a : i } )); numObjs++; } -db1.getLastError() newShard = "myShard"; assert( s.admin.runCommand( { addshard: "localhost:29000" , name: newShard } ).ok, "did not accepted non-duplicated shard" ); @@ -20,11 +19,9 @@ assert( s.admin.runCommand( { addshard: "localhost:29000" , name: newShard } ).o // a mongod with an existing database name should not be allowed to become a shard conn2 = startMongodTest( 29001 ); db2 = conn2.getDB( "otherDB" ); -db2.foo.save( {a:1} ); -db2.getLastError() +assert.writeOK(db2.foo.save({ a: 1 })); db3 = conn2.getDB( "testDB" ); -db3.foo.save( {a:1} ); -db3.getLastError() +assert.writeOK(db3.foo.save({ a: 1 } )); s.config.databases.find().forEach( printjson ) rejectedShard = "rejectedShard"; -- cgit v1.2.1