summaryrefslogtreecommitdiff
path: root/jstests/sharding/auth.js
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2016-06-07 16:01:44 -0400
committerMax Hirschhorn <max.hirschhorn@mongodb.com>2016-06-07 16:01:44 -0400
commit01dfe61a6c03307f0384406bfbde486f8de15425 (patch)
tree907e50e42f26e987af8b7a792d0b628ef2728264 /jstests/sharding/auth.js
parent032424437d50eceafc5eb7c9b2c24c73da6ff1fc (diff)
downloadmongo-01dfe61a6c03307f0384406bfbde486f8de15425.tar.gz
SERVER-23741 Use MongoRunner.runMongoTool() to run tools from JS tests.
Changes all usages of runMongoProgram(<mongo tool>, ...) to MongoRunner.runMongoTool(<mongo tool>, {...}) to take advantage of the --dialTimeout command line option supported by the mongo tools. Adds support for specifying positional arguments to MongoRunner.runMongoTool() in order to support all invocations of the bsondump and mongofiles tools.
Diffstat (limited to 'jstests/sharding/auth.js')
-rw-r--r--jstests/sharding/auth.js20
1 files changed, 8 insertions, 12 deletions
diff --git a/jstests/sharding/auth.js b/jstests/sharding/auth.js
index f3fe71a5950..e8521a3b0d8 100644
--- a/jstests/sharding/auth.js
+++ b/jstests/sharding/auth.js
@@ -280,18 +280,14 @@
assert.commandWorked(res);
// Check that dump doesn't get stuck with auth
- var x = runMongoProgram("mongodump",
- "--host",
- s.s.host,
- "-d",
- testUser.db,
- "-u",
- testUser.username,
- "-p",
- testUser.password,
- "--authenticationMechanism",
- "SCRAM-SHA-1");
- print("result: " + x);
+ var exitCode = MongoRunner.runMongoTool("mongodump", {
+ host: s.s.host,
+ db: testUser.db,
+ username: testUser.username,
+ password: testUser.password,
+ authenticationMechanism: "SCRAM-SHA-1",
+ });
+ assert.eq(0, exitCode, "mongodump failed to run with authentication enabled");
// Test read only users
print("starting read only tests");