diff options
author | Robert Guo <robert.guo@10gen.com> | 2016-03-22 13:20:14 -0400 |
---|---|---|
committer | Robert Guo <robert.guo@10gen.com> | 2016-05-18 13:47:18 -0400 |
commit | f2f6163b0b26f1b18951c3d4d0f88a833c344523 (patch) | |
tree | 6d5a4b8b8d9bcfdec12f5b34ce2afd0bede5b5bb /jstests/hooks/run_validate_collections.js | |
parent | 756d6ee26bcc3e219892475868ca145564559205 (diff) | |
download | mongo-f2f6163b0b26f1b18951c3d4d0f88a833c344523.tar.gz |
SERVER-22860 allow resmoke.py to run JS hooks
Diffstat (limited to 'jstests/hooks/run_validate_collections.js')
-rw-r--r-- | jstests/hooks/run_validate_collections.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/jstests/hooks/run_validate_collections.js b/jstests/hooks/run_validate_collections.js new file mode 100644 index 00000000000..1e910b3e6cf --- /dev/null +++ b/jstests/hooks/run_validate_collections.js @@ -0,0 +1,16 @@ +// Runner for validateCollections that runs full validation on all collections when loaded into +// the mongo shell. +'use strict'; + +(function() { + assert.eq(typeof db, 'object', 'Invalid `db` object, is the shell connected to a mongod?'); + load('jstests/hooks/validate_collections.js'); // For validateCollections + + var dbNames = db.getMongo().getDBNames(); + + for (var dbName of dbNames) { + if (!validateCollections(db.getSiblingDB(dbName), {full: true})) { + throw new Error('Collection validation failed'); + } + } +})();
\ No newline at end of file |