0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00
mongodb/jstests/dbadmin.js

22 lines
682 B
JavaScript
Raw Normal View History

t = db.dbadmin;
t.save( { x : 1 } );
2010-01-02 14:41:12 +01:00
before = db._adminCommand( "serverStatus" )
2010-01-11 02:22:17 +01:00
if ( before.mem.supported ){
2010-02-04 16:52:59 +01:00
cmdres = db._adminCommand( "closeAllDatabases" );
2010-01-02 16:10:40 +01:00
after = db._adminCommand( "serverStatus" );
2010-02-05 18:45:05 +01:00
assert( before.mem.mapped > after.mem.mapped , "closeAllDatabases does something before:" + tojson( before.mem ) + " after:" + tojson( after.mem ) + " cmd res:" + tojson( cmdres ) );
2010-02-04 18:12:01 +01:00
print( before.mem.mapped + " -->> " + after.mem.mapped );
2010-01-02 16:10:40 +01:00
}
else {
print( "can't test serverStatus on this machine" );
}
t.save( { x : 1 } );
res = db._adminCommand( "listDatabases" );
assert( res.databases.length > 0 , "listDatabases 1" );
2010-01-11 02:22:17 +01:00
2010-01-02 14:41:12 +01:00
// TODO: add more tests here