diff options
author | Judah Schvimer <judah@mongodb.com> | 2015-11-10 09:52:53 -0500 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2015-11-10 09:52:53 -0500 |
commit | 904c99891b47935ff7c0856f4456303f32c04f11 (patch) | |
tree | aa2759fd498a09d0ef3b52ddafb8a533d9017e5d /jstests/concurrency/fsm_libs/parse_config.js | |
parent | c836472353e736424c9bb87868508c9e633b892d (diff) | |
download | mongo-904c99891b47935ff7c0856f4456303f32c04f11.tar.gz |
SERVER-21310 Inject iterations and threadCount into data object in fsm workloads
Diffstat (limited to 'jstests/concurrency/fsm_libs/parse_config.js')
-rw-r--r-- | jstests/concurrency/fsm_libs/parse_config.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/jstests/concurrency/fsm_libs/parse_config.js b/jstests/concurrency/fsm_libs/parse_config.js index d1aef30c545..1b53f42841c 100644 --- a/jstests/concurrency/fsm_libs/parse_config.js +++ b/jstests/concurrency/fsm_libs/parse_config.js @@ -24,13 +24,15 @@ function parseConfig(config) { '; valid parameters are: ' + tojson(allowedKeys)); }); - assert.eq('number', typeof config.threadCount); - // TODO: assert that the thread count is positive - // TODO: assert that the thread count is an integer + assert(Number.isInteger(config.threadCount), + 'expected number of threads to be an integer'); + assert.gt(config.threadCount, 0, + 'expected number of threads to be positive'); - assert.eq('number', typeof config.iterations); - // TODO: assert that the number of iterations is positive - // TODO: assert that the number of iterations is an integer + assert(Number.isInteger(config.iterations), + 'expected number of iterations to be an integer'); + assert.gt(config.iterations, 0, + 'expected number of iterations to be positive'); config.startState = config.startState || 'init'; assert.eq('string', typeof config.startState); @@ -78,7 +80,12 @@ function parseConfig(config) { config.data = config.data || {}; assert.eq('object', typeof config.data); - // TODO: assert that 'tid' is not a key of 'config.data' + assert.eq(false, config.data.hasOwnProperty('tid'), + 'data object cannot redefine "tid"'); + assert.eq(false, config.data.hasOwnProperty('iterations'), + 'data object cannot redefine "iterations"'); + assert.eq(false, config.data.hasOwnProperty('threadCount'), + 'data object cannot redefine "threadCount"'); config.passConnectionCache = config.passConnectionCache || false; assert.eq('boolean', typeof config.passConnectionCache); |