summaryrefslogtreecommitdiff
path: root/jstests/tool
diff options
context:
space:
mode:
authorJonathan <jonathan@mongodb.com>2014-06-13 14:25:20 -0400
committerBenety Goh <benety@mongodb.com>2014-06-13 18:31:08 -0400
commit2f0c61885405df346808365dfd2bae70769a9f7e (patch)
tree14176fbbc1fa92b6ff84ac1dd7e38ae6cde2fb8c /jstests/tool
parent83f2b119dfbd527c73ce0f63d3c6dcb586edb33f (diff)
downloadmongo-2f0c61885405df346808365dfd2bae70769a9f7e.tar.gz
SERVER-14249 Add mongodump tests with --dbpath
Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'jstests/tool')
-rw-r--r--jstests/tool/tool_replset.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/jstests/tool/tool_replset.js b/jstests/tool/tool_replset.js
index b38dcb95806..e8788431b48 100644
--- a/jstests/tool/tool_replset.js
+++ b/jstests/tool/tool_replset.js
@@ -82,6 +82,18 @@ print("running mongooplog to replay the oplog")
assert.eq(101, master.getDB("foo").getCollection("bar").count(), "count after running mongooplog " +
"was not 101 as expected")
+// Dump local oplog with --dbpath option (SERVER-14249)
+replTest.stop(0);
+var dataDir = MongoRunner.dataDir + "/tool_replset-0/";
+data = MongoRunner.dataDir + "/tool_replset-dump-dbpath/";
+print("dump oplog with --dbpath");
+runMongoProgram("mongodump", "--dbpath", dataDir, "--out", data + "oplog", "-d", "local");
+assert.isnull(rawMongoProgramOutput().match(/assert/));
+// mongodump with --dbpath -d local & -c oplog.rs
+runMongoProgram("mongodump", "--dbpath", dataDir, "--out", data + "oplog", "-d", "local",
+ "-c", "oplog.rs");
+assert.isnull(rawMongoProgramOutput().match(/assert/));
+
print("all tests successful, stopping replica set")
replTest.stopSet();