diff options
author | Benety Goh <benety@mongodb.com> | 2014-09-29 12:11:18 -0400 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2014-09-29 12:29:38 -0400 |
commit | 195113534141890f15b1db931c7dfa5162dc6049 (patch) | |
tree | 75e07d719aa2c78261acb2085c4c1d917dc69c7e /jstests | |
parent | 070596dd59e3af7bd0ac23071a97ebcfcecc62d7 (diff) | |
download | mongo-195113534141890f15b1db931c7dfa5162dc6049.tar.gz |
SERVER-5520 SERVER-15096 do not check exit code for mongoshim in normal operation
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/tool/shim1.js | 51 |
1 files changed, 23 insertions, 28 deletions
diff --git a/jstests/tool/shim1.js b/jstests/tool/shim1.js index b811f615ff5..26203e0ed4f 100644 --- a/jstests/tool/shim1.js +++ b/jstests/tool/shim1.js @@ -93,20 +93,19 @@ var doc = collection.findOne(); stopServer(); // "read" mode - read collection with single document and write results to file. -assert.eq(0, runMongoProgram('mongoshim', '--dbpath', dbPath, - '--db', dbName, '--collection', collectionName, - '--out', externalFile), - 'failed to run mongoshim in "read" mode on ' + collectionName); +// XXX: Do not check tool exit code. See SERVER-5520 +runMongoProgram('mongoshim', '--dbpath', dbPath, + '--db', dbName, '--collection', collectionName, + '--out', externalFile); assert.eq(Object.bsonsize(doc), fileSize(externalBaseName), 'output BSON file size does not match size of document returned from find()'); // "insert" mode - insert document from file into collection. resetDbpath(dbPath); -assert.eq(0, runMongoProgram('mongoshim', '--dbpath', dbPath, - '--db', dbName, '--collection', collectionName, - '--mode', 'insert', - '--in', externalFile), - 'failed to run mongoshim in "insert" mode'); +runMongoProgram('mongoshim', '--dbpath', dbPath, + '--db', dbName, '--collection', collectionName, + '--mode', 'insert', + '--in', externalFile); mongod = startServer(); collection = mongod.getDB(dbName).getCollection(collectionName); assert.eq(1, collection.count(), 'test document was not added to collection'); @@ -117,12 +116,11 @@ stopServer(); // "upsert" mode - upsert document from file into collection. // Since document already exists in collection, this upsert operation will // have no effect. -assert.eq(0, runMongoProgram('mongoshim', '--dbpath', dbPath, - '--db', dbName, '--collection', collectionName, - '--mode', 'upsert', - '--upsertFields', 'a', - '--inputDocuments', tojson({in: [{a: 1, b: 1}]})), - 'failed to run mongoshim in "upsert" mode'); +runMongoProgram('mongoshim', '--dbpath', dbPath, + '--db', dbName, '--collection', collectionName, + '--mode', 'upsert', + '--upsertFields', 'a', + '--inputDocuments', tojson({in: [{a: 1, b: 1}]})); mongod = startServer(); collection = mongod.getDB(dbName).getCollection(collectionName); assert.eq(1, collection.count(), 'test document was not added to collection'); @@ -132,10 +130,9 @@ stopServer(); // "remove" mode - remove documents from collection. resetDbpath(dbPath); -assert.eq(0, runMongoProgram('mongoshim', '--dbpath', dbPath, - '--db', dbName, '--collection', collectionName, - '--mode', 'remove'), - 'failed to run mongoshim in "remove" mode'); +runMongoProgram('mongoshim', '--dbpath', dbPath, + '--db', dbName, '--collection', collectionName, + '--mode', 'remove'); mongod = startServer(); collection = mongod.getDB(dbName).getCollection(collectionName); assert.eq(0, collection.count(), 'test document was not removed from collection'); @@ -150,18 +147,16 @@ var operationsCollection = mongod.getDB(dbName).getCollection(operationsCollecti operationsCollection.save({op: 'i', ns: collectionFullName, o: {_id: 1, a: 1 }}); collection.drop(); stopServer(); -assert.eq(0, runMongoProgram('mongoshim', '--dbpath', dbPath, - '--db', dbName, '--collection', operationsCollectionName, - '--out', externalOperationsFile), - 'failed to run mongoshim in "read" mode on ' + operationsCollectionName); +runMongoProgram('mongoshim', '--dbpath', dbPath, + '--db', dbName, '--collection', operationsCollectionName, + '--out', externalOperationsFile); // Apply operations in BSON file. // If operation was applied successfully, we should see a document in // 'collectionName' collection (not 'operationsCollectionName'). -assert.eq(0, runMongoProgram('mongoshim', '--dbpath', dbPath, - '--db', dbName, '--collection', operationsCollectionName, - '--mode', 'applyOps', - '--in', externalOperationsFile), - 'failed to run mongoshim in "applyOps" mode'); +runMongoProgram('mongoshim', '--dbpath', dbPath, + '--db', dbName, '--collection', operationsCollectionName, + '--mode', 'applyOps', + '--in', externalOperationsFile); mongod = startServer(); collection = mongod.getDB(dbName).getCollection(collectionName); assert.eq({_id: 1, a: 1 }, collection.findOne(), |