summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorSara Golemon <sara.golemon@mongodb.com>2019-01-04 21:51:18 +0000
committerSara Golemon <sara.golemon@mongodb.com>2019-01-11 16:46:56 +0000
commit573ebb251784aa7665b978ca386b60799d74c878 (patch)
treef02218d08d17d902cab4f41142a59a88842af935 /jstests
parentbbf28648de0d8695c502e13922a8d9e5ca1b51e8 (diff)
downloadmongo-573ebb251784aa7665b978ca386b60799d74c878.tar.gz
SERVER-35393 Flush asio output and limit SecureTransport out buffer
Diffstat (limited to 'jstests')
-rw-r--r--jstests/ssl/ssl_fragment.js51
1 files changed, 35 insertions, 16 deletions
diff --git a/jstests/ssl/ssl_fragment.js b/jstests/ssl/ssl_fragment.js
index a3800ea616b..6d08da8e834 100644
--- a/jstests/ssl/ssl_fragment.js
+++ b/jstests/ssl/ssl_fragment.js
@@ -4,25 +4,44 @@
(function() {
'use strict';
- const conn = MongoRunner.runMongod({
- sslMode: "requireSSL",
- sslPEMKeyFile: "jstests/libs/server.pem",
- networkMessageCompressors: 'disabled',
- });
+ function runTest(conn) {
+ // SSL packets have a max size of ~16 kb so to test packet fragmentation support, create a
+ // string larger then 16kb.
+ const chunk = 'E$%G^56w4v5v54Vv$V@#t2#%t56u7B$ub%6 NU@ Y3qv4Yq%yq4C%yx$%zh'; // random data
+ let s = '';
+ while (s.length < (8 * 1024 * 1024)) {
+ s += chunk;
+ }
+
+ const ssl_frag = conn.getCollection('test.ssl_frag');
+ assert.writeOK(ssl_frag.insert({_id: "large_str", foo: s}));
- // SSL packets have a max size of ~16 kb so to test packet fragmentation support, create a
- // string larger then 16kb.
- const chunk = 'E$%G^56w4v5v54Vv$V@#t2#%t56u7B$ub%6 NU@ Y3qv4Yq%yq4C%yx$%zh'; // random data
- let s = '';
- while (s.length < (8 * 1024 * 1024)) {
- s += chunk;
+ const read = ssl_frag.find({_id: "large_str"}).toArray()[0].foo;
+ assert.eq(s, read, "Did not receive value written");
}
- const ssl_frag = conn.getCollection('test.ssl_frag');
- assert.writeOK(ssl_frag.insert({_id: "large_str", foo: s}));
+ const options = {
+ sslMode: "requireSSL",
+ sslPEMKeyFile: "jstests/libs/server.pem",
+ networkMessageCompressors: 'disabled',
+ };
- const read = ssl_frag.find({_id: "large_str"}).toArray()[0].foo;
- assert.eq(s, read, "Did not receive value written");
+ const mongod = MongoRunner.runMongod(options);
+ runTest(mongod);
+ MongoRunner.stopMongod(mongod);
- MongoRunner.stopMongod(conn);
+ // TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed.
+ const st = new ShardingTest({
+ shards: 3,
+ mongos: 1,
+ config: 1,
+ other: {
+ configOptions: options,
+ mongosOptions: options,
+ shardOptions: options,
+ shardAsReplicaSet: false,
+ }
+ });
+ runTest(st.s0);
+ st.stop();
})();