From 4eefaf421bfeddf040d96a3dafb12e09673423d7 Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Sun, 31 Jan 2010 08:32:52 +0100 Subject: Imported Upstream version 1.3.1 --- jstests/dbadmin.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 jstests/dbadmin.js (limited to 'jstests/dbadmin.js') 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 -- cgit v1.2.3