summaryrefslogtreecommitdiff
path: root/jstests/auth/auth1.js
diff options
context:
space:
mode:
authorMathias Stearn <redbeard0531@gmail.com>2012-03-06 13:57:51 -0500
committerMathias Stearn <redbeard0531@gmail.com>2012-03-08 19:48:51 -0500
commit5cf72997e3bb116d90f7d9969c6f6b4028a5f8f0 (patch)
treecb287ce92fa0ef3a28e2bdcbf8a60aa0e1ae26f4 /jstests/auth/auth1.js
parent2d91311153e841bc66be1c600966da5663e2cc57 (diff)
downloadmongo-5cf72997e3bb116d90f7d9969c6f6b4028a5f8f0.tar.gz
Features cmd no longer has readlock field
Prep for SERVER-4692 readlock field removed in commit 35031d43d717dda19b0b62ab6f97af275717ad30
Diffstat (limited to 'jstests/auth/auth1.js')
-rw-r--r--jstests/auth/auth1.js63
1 files changed, 30 insertions, 33 deletions
diff --git a/jstests/auth/auth1.js b/jstests/auth/auth1.js
index 3959004d2b4..06d2d2237f4 100644
--- a/jstests/auth/auth1.js
+++ b/jstests/auth/auth1.js
@@ -52,37 +52,34 @@ initial: { count: 0 }
assert.eq( 1000, t.group( p ).length , "A5" );
-if ( db.runCommand( "features" ).readlock ){
- print( "doing readonly test" );
- assert( db.auth( "guest", "guest" ), "auth failed 2" );
-
- assert.eq( 1000, t.count() , "B1" );
- assert.eq( 1000, t.find().toArray().length , "B2" ); // make sure we have a getMore in play
- assert.commandWorked( db.runCommand( {ismaster:1} ) , "B3" );
-
- assert( !db.getLastError() , "B4" );
- t.save( {} ); // fail
- assert( db.getLastError() , "B5: " + tojson( db.getLastErrorObj() ) );
- assert.eq( 1000, t.count() , "B6" );
-
- assert.eq( 2, db.system.users.count() , "B7" );
- assert( !db.getLastError() , "B8" );
- db.addUser( "a", "b" );
- assert( db.getLastError() , "B9" );
- assert.eq( 2, db.system.users.count() , "B10");
-
- assert.eq( 1000, db.eval( function() { return db[ "jstests_auth_auth1" ].count(); } ) , "C1" );
- assert.eq( 1000, db.eval( function() { return db[ "jstests_auth_auth1" ].find().toArray().length; } ) , "C2" );
- db.eval( function() { db[ "jstests_auth_auth1" ].save( {i:1} ) } , "C3" );
- assert.eq( 1000, db.eval( function() { return db[ "jstests_auth_auth1" ].count(); } ) , "C4" );
-
- assert.eq( 1000, t.group( p ).length , "C5" );
-
- var p = { key : { i : true } ,
- reduce : function(obj,prev) { db.jstests_auth_auth1.save( {i:10000} ); prev.count++; },
- initial: { count: 0 }
- };
-
- assert.throws( function() { return t.group( p ) }, null , "write reduce didn't fail" );
-}
+assert( db.auth( "guest", "guest" ), "auth failed 2" );
+
+assert.eq( 1000, t.count() , "B1" );
+assert.eq( 1000, t.find().toArray().length , "B2" ); // make sure we have a getMore in play
+assert.commandWorked( db.runCommand( {ismaster:1} ) , "B3" );
+
+assert( !db.getLastError() , "B4" );
+t.save( {} ); // fail
+assert( db.getLastError() , "B5: " + tojson( db.getLastErrorObj() ) );
+assert.eq( 1000, t.count() , "B6" );
+
+assert.eq( 2, db.system.users.count() , "B7" );
+assert( !db.getLastError() , "B8" );
+db.addUser( "a", "b" );
+assert( db.getLastError() , "B9" );
+assert.eq( 2, db.system.users.count() , "B10");
+
+assert.eq( 1000, db.eval( function() { return db[ "jstests_auth_auth1" ].count(); } ) , "C1" );
+assert.eq( 1000, db.eval( function() { return db[ "jstests_auth_auth1" ].find().toArray().length; } ) , "C2" );
+db.eval( function() { db[ "jstests_auth_auth1" ].save( {i:1} ) } , "C3" );
+assert.eq( 1000, db.eval( function() { return db[ "jstests_auth_auth1" ].count(); } ) , "C4" );
+
+assert.eq( 1000, t.group( p ).length , "C5" );
+
+var p = { key : { i : true } ,
+ reduce : function(obj,prev) { db.jstests_auth_auth1.save( {i:10000} ); prev.count++; },
+ initial: { count: 0 }
+ };
+
+assert.throws( function() { return t.group( p ) }, null , "write reduce didn't fail" );