summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Midvidy <amidvidy@gmail.com>2014-11-06 13:54:02 -0500
committerBenety Goh <benety@mongodb.com>2014-11-06 14:11:24 -0500
commit491a9728d381328ad2e0604eb31cec1590418755 (patch)
treed28ba4b2a9d443ddf87642cd96a38500c22b4eeb
parent88ef4861b03af893e59e7339297eea4b9a14bea5 (diff)
downloadmongo-491a9728d381328ad2e0604eb31cec1590418755.tar.gz
SERVER-15979 remove even more mmap_v1isms
Closes #866 Signed-off-by: Benety Goh <benety@mongodb.com>
-rw-r--r--jstests/tool/restorewithauth.js30
1 files changed, 20 insertions, 10 deletions
diff --git a/jstests/tool/restorewithauth.js b/jstests/tool/restorewithauth.js
index afad147c9a9..bcf37d95b2e 100644
--- a/jstests/tool/restorewithauth.js
+++ b/jstests/tool/restorewithauth.js
@@ -61,15 +61,19 @@ admin.auth( "admin" , "admin" );
var foo = conn.getDB( "foo" )
// make sure no collection with the same name exists
-assert.eq(foo.system.namespaces.count( {name: "foo.bar"}), 0);
-assert.eq(foo.system.namespaces.count( {name: "foo.baz"}), 0);
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "bar"}}).collections.length, 0 )
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "baz"}}).collections.length, 0 )
// now try to restore dump
x = runMongoProgram( "mongorestore", "-h", "127.0.0.1:" + port, "--dir" , dumpdir, "-vvvvv" );
// make sure that the collection isn't restored
-assert.eq(foo.system.namespaces.count({name: "foo.bar"}), 0);
-assert.eq(foo.system.namespaces.count({name: "foo.baz"}), 0);
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "bar"}}).collections.length, 0 )
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "baz"}}).collections.length, 0 )
// now try to restore dump with correct credentials
x = runMongoProgram( "mongorestore",
@@ -82,8 +86,10 @@ x = runMongoProgram( "mongorestore",
"-vvvvv");
// make sure that the collection was restored
-assert.eq(foo.system.namespaces.count({name: "foo.bar"}), 1);
-assert.eq(foo.system.namespaces.count({name: "foo.baz"}), 1);
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "bar"}}).collections.length, 1 )
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "baz"}}).collections.length, 1 )
// make sure the collection has 4 documents
assert.eq(foo.bar.count(), 4);
@@ -92,8 +98,10 @@ assert.eq(foo.baz.count(), 4);
foo.dropDatabase();
// make sure that the collection is empty
-assert.eq(foo.system.namespaces.count({name: "foo.bar"}), 0);
-assert.eq(foo.system.namespaces.count({name: "foo.baz"}), 0);
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "bar"}}).collections.length, 0 )
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "baz"}}).collections.length, 0 )
foo.createUser({user: 'user', pwd: 'password', roles: jsTest.basicUserRoles});
@@ -107,8 +115,10 @@ x = runMongoProgram("mongorestore",
"-vvvvv");
// make sure that the collection was restored
-assert.eq(foo.system.namespaces.count({name: "foo.bar"}), 1);
-assert.eq(foo.system.namespaces.count({name: "foo.baz"}), 1);
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "bar"}}).collections.length, 1 )
+assert.eq( foo.runCommand({"listCollections": 1,
+ "filter": {"name": "baz"}}).collections.length, 1 )
assert.eq(foo.bar.count(), 4);
assert.eq(foo.baz.count(), 4);
assert.eq(foo.bar.getIndexes().length, 2);