2018-08-13 21:58:28 +02:00
|
|
|
// Test config file expansion using EXEC.
|
|
|
|
|
|
|
|
(function() {
|
2019-07-27 00:20:35 +02:00
|
|
|
'use strict';
|
2018-08-13 21:58:28 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
load('jstests/noPassthrough/libs/configExpand/lib.js');
|
2018-08-13 21:58:28 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
// Unexpected elements.
|
|
|
|
configExpandFailure({
|
|
|
|
setParameter: {
|
|
|
|
scramIterationCount: {__exec: makeReflectionCmd('12345'), foo: 'bar'},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
/expansion block must contain only '__exec'/);
|
2018-08-13 21:58:28 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
const sicReflect = {
|
|
|
|
setParameter: {scramIterationCount: {__exec: makeReflectionCmd('12345')}}
|
|
|
|
};
|
2018-08-13 21:58:28 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
// Positive test just to be sure this works in a basic case before testing negatives.
|
|
|
|
configExpandSuccess(sicReflect);
|
2018-08-13 21:58:28 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
// Expansion not enabled.
|
|
|
|
configExpandFailure(sicReflect, /__exec support has not been enabled/, {configExpand: 'none'});
|
2018-08-13 21:58:28 +02:00
|
|
|
|
2019-07-27 00:20:35 +02:00
|
|
|
// Expansion enabled, but not recursively.
|
|
|
|
configExpandFailure({__exec: makeReflectionCmd(jsToYaml(sicReflect)), type: 'yaml'},
|
|
|
|
/__exec support has not been enabled/);
|
2018-08-13 21:58:28 +02:00
|
|
|
})();
|