diff options
Diffstat (limited to 'src/mongo/gotools/src/github.com/mongodb/mongo-tools/test/qa-tests/jstests/restore/empty_users_and_roles.js')
-rw-r--r-- | src/mongo/gotools/src/github.com/mongodb/mongo-tools/test/qa-tests/jstests/restore/empty_users_and_roles.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mongo/gotools/src/github.com/mongodb/mongo-tools/test/qa-tests/jstests/restore/empty_users_and_roles.js b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/test/qa-tests/jstests/restore/empty_users_and_roles.js new file mode 100644 index 00000000000..090dd746043 --- /dev/null +++ b/src/mongo/gotools/src/github.com/mongodb/mongo-tools/test/qa-tests/jstests/restore/empty_users_and_roles.js @@ -0,0 +1,33 @@ +(function() { + + if (typeof getToolTest === 'undefined') { + load('jstests/configs/plain_28.config.js'); + } + + if (dump_targets === "archive") { + print('skipping test incompatable with archiving'); + return assert(true); + } + + // Tests running mongorestore with --restoreDbUsersAndRoles, with + // no users or roles in the dump. + + jsTest.log('Testing running mongorestore with --restoreDbUsersAndRoles with'+ + ' no users or roles in the dump'); + + var toolTest = getToolTest('empty_users_and_roles'); + var commonToolArgs = getCommonToolArguments(); + + // run the restore with no users or roles. it should succeed, but create no + // users or roles + var ret = toolTest.runTool.apply(toolTest, ['restore', + '--db', 'test', + '--restoreDbUsersAndRoles'] + .concat(getRestoreTarget('jstests/restore/testdata/blankdb')) + .concat(commonToolArgs)); + assert.eq(0, ret); + + // success + toolTest.stop(); + +}()); |