summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2016-05-04 11:21:46 -0400
committerJames Wahlin <james.wahlin@10gen.com>2016-05-04 15:46:37 -0400
commit7a014ed60bf96ee11ce11acfa931268422030ca3 (patch)
treed3ad9680a5388f7aecb20a192ade993aa76abd2c
parentc3d8b4c75543a770c64697f18bc76c311201d169 (diff)
downloadmongo-7a014ed60bf96ee11ce11acfa931268422030ca3.tar.gz
SERVER-24044 apitest_db.js should not assume MMAPv1 under 64bit
-rw-r--r--jstests/core/apitest_db.js15
1 files changed, 4 insertions, 11 deletions
diff --git a/jstests/core/apitest_db.js b/jstests/core/apitest_db.js
index 996d5c73c42..2713a6cfd24 100644
--- a/jstests/core/apitest_db.js
+++ b/jstests/core/apitest_db.js
@@ -1,8 +1,5 @@
/**
* Tests for the db object enhancement
- *
- * This test requires mmapv1.
- * @tags: [requires_mmapv1]
*/
assert("test" == db, "wrong database currently not test");
@@ -99,16 +96,12 @@ assert.commandFailed(
'configured a storage engine with invalid options');
// Tests that a non-active storage engine can be configured so long as it is registered.
-if (db.serverBuildInfo().bits === 64) {
- // wiredTiger is not a registered storage engine on 32-bit systems.
+var alternateStorageEngine =
+ db.serverBuildInfo().storageEngines.find(engine => engine !== storageEngineName);
+if (alternateStorageEngine) {
var indexOptions = {
- storageEngine: {}
+ storageEngine: {[alternateStorageEngine]: {}}
};
- if (storageEngineName === 'wiredTiger') {
- indexOptions.storageEngine.mmapv1 = {};
- } else {
- indexOptions.storageEngine.wiredTiger = {};
- }
assert.commandWorked(db.createCollection('idxOptions', {indexOptionDefaults: indexOptions}),
'should have been able to configure a non-active storage engine');
assert(db.idxOptions.drop());