summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/configExpand_exec_noexpand.js
blob: 4b07036b9c61a29174236dd648e3c0e4fd756990 (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
// Test config file expansion using EXEC.

(function() {
'use strict';

load('jstests/noPassthrough/libs/configExpand/lib.js');

// Unexpected elements.
configExpandFailure({
    setParameter: {
        scramIterationCount: {__exec: makeReflectionCmd('12345'), foo: 'bar'},
    }
},
                    /expansion block must contain only '__exec'/);

const sicReflect = {
    setParameter: {scramIterationCount: {__exec: makeReflectionCmd('12345')}}
};

// Positive test just to be sure this works in a basic case before testing negatives.
configExpandSuccess(sicReflect);

// Expansion not enabled.
configExpandFailure(sicReflect, /__exec support has not been enabled/, {configExpand: 'none'});

// Expansion enabled, but not recursively.
configExpandFailure({__exec: makeReflectionCmd(jsToYaml(sicReflect)), type: 'yaml'},
                    /__exec support has not been enabled/);
})();