diff options
Diffstat (limited to 'src/mongo/gotools/test/qa-tests/jstests/files/mongofiles_version.js')
-rw-r--r-- | src/mongo/gotools/test/qa-tests/jstests/files/mongofiles_version.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mongo/gotools/test/qa-tests/jstests/files/mongofiles_version.js b/src/mongo/gotools/test/qa-tests/jstests/files/mongofiles_version.js new file mode 100644 index 00000000000..3c2c3a6d959 --- /dev/null +++ b/src/mongo/gotools/test/qa-tests/jstests/files/mongofiles_version.js @@ -0,0 +1,29 @@ +// mongofiles_version.js; ensure that getting the version works without error +var testName = 'mongofiles_version'; +load('jstests/files/util/mongofiles_common.js'); +(function() { + jsTest.log('Testing mongofiles --version option'); + + var runTests = function(topology, passthrough) { + var t = topology.init(passthrough); + var conn = t.connection(); + + jsTest.log('Testing --version with ' + passthrough.name + ' passthrough'); + + // ensure tool runs without error + assert.eq(runMongoProgram.apply(this, ['mongofiles', + '--port', conn.port, + '--version'] + .concat(passthrough.args)), + 0, '--version failed'); + + t.stop(); + }; + + // run with plain and auth passthroughs + passthroughs.forEach(function(passthrough) { + runTests(standaloneTopology, passthrough); + runTests(replicaSetTopology, passthrough); + runTests(shardedClusterTopology, passthrough); + }); +}()); |