mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
31 lines
1016 B
JavaScript
31 lines
1016 B
JavaScript
|
|
t = db.dbadmin;
|
|
t.save( { x : 1 } );
|
|
|
|
before = db._adminCommand( "serverStatus" )
|
|
if ( before.mem.supported ){
|
|
cmdres = db._adminCommand( "closeAllDatabases" );
|
|
after = db._adminCommand( "serverStatus" );
|
|
assert( before.mem.mapped > after.mem.mapped , "closeAllDatabases does something before:" + tojson( before.mem ) + " after:" + tojson( after.mem ) + " cmd res:" + tojson( cmdres ) );
|
|
print( before.mem.mapped + " -->> " + after.mem.mapped );
|
|
}
|
|
else {
|
|
print( "can't test serverStatus on this machine" );
|
|
}
|
|
|
|
t.save( { x : 1 } );
|
|
|
|
res = db._adminCommand( "listDatabases" );
|
|
assert( res.databases && res.databases.length > 0 , "listDatabases 1 " + tojson(res) );
|
|
|
|
x = db._adminCommand( "ismaster" );
|
|
assert( x.ismaster , "ismaster failed: " + tojson( x ) )
|
|
|
|
before = db.runCommand( "serverStatus" )
|
|
sleep( 5000 )
|
|
after = db.runCommand( "serverStatus" )
|
|
assert.lt( 3 , after.uptimeEstimate , "up1" )
|
|
assert.gt( after.uptimeEstimate , before.uptimeEstimate , "up2" )
|
|
|
|
// TODO: add more tests here
|