diff options
Diffstat (limited to 'jstests/dbcase.js')
-rw-r--r-- | jstests/dbcase.js | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/jstests/dbcase.js b/jstests/dbcase.js index 21854d8..25c0bca 100644 --- a/jstests/dbcase.js +++ b/jstests/dbcase.js @@ -1,6 +1,5 @@ +// Check db name duplication constraint SERVER-2111 -/* -TODO SERVER-2111 a = db.getSisterDB( "dbcasetest_dbnamea" ) b = db.getSisterDB( "dbcasetest_dbnameA" ) @@ -15,11 +14,16 @@ b.foo.save( { x : 1 } ) z = db.getLastErrorObj(); assert.eq( 13297 , z.code || 0 , "B : " + tojson(z) ) -print( db.getMongo().getDBNames() ) +assert.neq( -1, db.getMongo().getDBNames().indexOf( a.getName() ) ); +assert.eq( -1, db.getMongo().getDBNames().indexOf( b.getName() ) ); +printjson( db.getMongo().getDBs().databases ); a.dropDatabase(); b.dropDatabase(); -print( db.getMongo().getDBNames() ) -*/ - +ai = db.getMongo().getDBNames().indexOf( a.getName() ); +bi = db.getMongo().getDBNames().indexOf( b.getName() ); +// One of these dbs may exist if there is a slave active, but they must +// not both exist. +assert( ai == -1 || bi == -1 ); +printjson( db.getMongo().getDBs().databases ); |