summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/configExpand_rest_wholeconfig.js
blob: 9be592e5eff9e18bbf0fa1990c568b4834680705 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Test config file expansion using REST at top level.
// @tags: [requires_http_client]

(function() {
    'use strict';

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

    const web = new ConfigExpandRestServer();
    web.start();

    const yamlConfig = jsToYaml({setParameter: {scramIterationCount: 12345}});
    configExpandSuccess(
        {__rest: web.getURL() + '/reflect/yaml?yaml=' + encodeURI(yamlConfig), type: 'yaml'},
        function(admin) {
            const response =
                assert.commandWorked(admin.runCommand({getParameter: 1, scramIterationCount: 1}));
            assert.eq(response.scramIterationCount, 12345, "Incorrect derived config value");
        });

    web.stop();
})();