summaryrefslogtreecommitdiff
path: root/jstests/sharding/addshard1.js
diff options
context:
space:
mode:
authorRandolph Tan <randolph@10gen.com>2014-03-04 17:41:56 -0500
committerRandolph Tan <randolph@10gen.com>2014-04-21 16:53:25 -0400
commit7acafe85d9bdd63122c19ba1cca86a7f55174941 (patch)
tree234effd8e5a5b6c63d8b12c74de2d9acb78a7509 /jstests/sharding/addshard1.js
parente87b42c4f13e48078f5c4aefba3caf18dcfba072 (diff)
downloadmongo-7acafe85d9bdd63122c19ba1cca86a7f55174941.tar.gz
SERVER-13425 migrate sharding jstest suite to use write commands api
Diffstat (limited to 'jstests/sharding/addshard1.js')
-rw-r--r--jstests/sharding/addshard1.js9
1 files changed, 3 insertions, 6 deletions
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";