summaryrefslogtreecommitdiff
path: root/jstests/auth/commands_builtin_roles_sharded.js
blob: ab3e1505100848590560ab76b34ed4ee2d37d85d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
 * Exhaustive test for authorization of commands with builtin roles.
 *
 * Runs tests on a sharded cluster.
 *
 * The test logic implemented here operates on the test cases defined
 * in jstests/auth/lib/commands_lib.js
 *
 * @tags: [requires_sharding]
 */

(function() {
'use strict';

load('jstests/auth/lib/commands_builtin_roles.js');

const dbPath = MongoRunner.toRealDir("$dataDir/commands_built_in_roles_sharded/");
mkdir(dbPath);
const opts = {
    auth: "",
    enableExperimentalStorageDetailsCmd: "",
    setParameter: "trafficRecordingDirectory=" + dbPath
};
// run all tests sharded
const conn = new ShardingTest({
    shards: 1,
    mongos: 1,
    config: 1,
    keyFile: "jstests/libs/key1",
    other:
        {shardOptions: opts, mongosOptions: {setParameter: "trafficRecordingDirectory=" + dbPath}}
});
runAllCommandsBuiltinRoles(conn);
conn.stop();
})();