mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
30 lines
891 B
JavaScript
30 lines
891 B
JavaScript
// 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/);
|
|
})();
|