diff options
author | Antonin Kral <a.kral@bobek.cz> | 2010-01-31 08:32:52 +0100 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2010-01-31 08:32:52 +0100 |
commit | 4eefaf421bfeddf040d96a3dafb12e09673423d7 (patch) | |
tree | cb2e5ccc7f98158894f977ff131949da36673591 /jstests/dbadmin.js | |
download | mongodb-4eefaf421bfeddf040d96a3dafb12e09673423d7.tar.gz |
Imported Upstream version 1.3.1
Diffstat (limited to 'jstests/dbadmin.js')
-rw-r--r-- | jstests/dbadmin.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/jstests/dbadmin.js b/jstests/dbadmin.js new file mode 100644 index 0000000..c7b7bc8 --- /dev/null +++ b/jstests/dbadmin.js @@ -0,0 +1,22 @@ + +t = db.dbadmin; +t.save( { x : 1 } ); + +before = db._adminCommand( "serverStatus" ) +if ( before.mem.supported ){ + db._adminCommand( "closeAllDatabases" ); + after = db._adminCommand( "serverStatus" ); + assert( before.mem.mapped > after.mem.mapped , "closeAllDatabases does something before:" + tojson( before ) + " after:" + tojson( after ) ); +} +else { + print( "can't test serverStatus on this machine" ); +} + +t.save( { x : 1 } ); + +res = db._adminCommand( "listDatabases" ); +assert( res.databases.length > 0 , "listDatabases 1" ); + +print( "BEFORE: " + tojson( before ) ); +print( "AFTER : " + tojson( after ) ); +// TODO: add more tests here |