summaryrefslogtreecommitdiff
path: root/jstests/ssl
diff options
context:
space:
mode:
authorjannaerin <golden.janna@gmail.com>2018-02-07 17:38:49 -0500
committerjannaerin <golden.janna@gmail.com>2018-03-09 00:40:40 -0500
commitda1e0304e8eb91711ea1c78eb8f62538b53680e7 (patch)
treee55d32a40a76a39e01d8848c5a17d97ad640b18e /jstests/ssl
parent0d5370783beeb4936a181dd2f69387da4b5e816c (diff)
downloadmongo-da1e0304e8eb91711ea1c78eb8f62538b53680e7.tar.gz
SERVER-32052 Update ShardingTest to default to starting shard servers as replica sets
Diffstat (limited to 'jstests/ssl')
-rw-r--r--jstests/ssl/libs/ssl_helpers.js10
-rw-r--r--jstests/ssl/sharding_with_x509.js4
-rw-r--r--jstests/ssl/ssl_without_ca.js8
-rw-r--r--jstests/ssl/x509_client.js2
4 files changed, 18 insertions, 6 deletions
diff --git a/jstests/ssl/libs/ssl_helpers.js b/jstests/ssl/libs/ssl_helpers.js
index ee5d4f05a92..23703683aa4 100644
--- a/jstests/ssl/libs/ssl_helpers.js
+++ b/jstests/ssl/libs/ssl_helpers.js
@@ -109,11 +109,12 @@ function mixedShardTest(options1, options2, shouldSucceed) {
// Start ShardingTest with enableBalancer because ShardingTest attempts to turn
// off the balancer otherwise, which it will not be authorized to do if auth is enabled.
// Once SERVER-14017 is fixed the "enableBalancer" line can be removed.
+ // TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed.
var st = new ShardingTest({
mongos: [options1],
config: [options1],
shards: [options1, options2],
- other: {enableBalancer: true}
+ other: {enableBalancer: true, shardAsReplicaSet: false}
});
// Create admin user in case the options include auth
@@ -131,8 +132,8 @@ function mixedShardTest(options1, options2, shouldSucceed) {
var r = st.adminCommand({enableSharding: "test"});
assert.eq(r, true, "error enabling sharding for this configuration");
- st.ensurePrimaryShard("test", "shard0000");
- r = st.adminCommand({movePrimary: 'test', to: 'shard0001'});
+ st.ensurePrimaryShard("test", st.shard0.shardName);
+ r = st.adminCommand({movePrimary: 'test', to: st.shard1.shardName});
assert.eq(r, true, "error movePrimary failed for this configuration");
var db1 = st.getDB("test");
@@ -150,7 +151,8 @@ function mixedShardTest(options1, options2, shouldSucceed) {
assert.eq(128, db1.col.count(), "error retrieving documents from cluster");
// Test shards talking to each other
- r = st.getDB('test').adminCommand({moveChunk: 'test.col', find: {_id: 0}, to: 'shard0000'});
+ r = st.getDB('test').adminCommand(
+ {moveChunk: 'test.col', find: {_id: 0}, to: st.shard0.shardName});
assert(r.ok, "error moving chunks: " + tojson(r));
db1.col.remove({});
diff --git a/jstests/ssl/sharding_with_x509.js b/jstests/ssl/sharding_with_x509.js
index 621bfb1468a..e1dc5ca822d 100644
--- a/jstests/ssl/sharding_with_x509.js
+++ b/jstests/ssl/sharding_with_x509.js
@@ -15,6 +15,7 @@
// Start ShardingTest with enableBalancer because ShardingTest attempts to turn off the balancer
// otherwise, which it will not be authorized to do. Once SERVER-14017 is fixed the
// "enableBalancer" line could be removed.
+ // TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed.
var st = new ShardingTest({
shards: 2,
mongos: 1,
@@ -23,7 +24,8 @@
configOptions: x509_options,
mongosOptions: x509_options,
rsOptions: x509_options,
- shardOptions: x509_options
+ shardOptions: x509_options,
+ shardAsReplicaSet: false
}
});
diff --git a/jstests/ssl/ssl_without_ca.js b/jstests/ssl/ssl_without_ca.js
index cbc3aaa37f1..93658ef5ca8 100644
--- a/jstests/ssl/ssl_without_ca.js
+++ b/jstests/ssl/ssl_without_ca.js
@@ -42,11 +42,17 @@ assert.isnull(conn, "server started with x509 clusterAuthMode but no CA file");
jsTest.log("Assert mongos doesn\'t start with CA file missing and clusterAuthMode=x509.");
+// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed.
assert.throws(function() {
new ShardingTest({
shards: 1,
mongos: 1,
verbose: 2,
- other: {configOptions: sslParams, mongosOptions: sslParams, shardOptions: sslParams}
+ other: {
+ configOptions: sslParams,
+ mongosOptions: sslParams,
+ shardOptions: sslParams,
+ shardAsReplicaSet: false
+ }
});
}, [], "mongos started with x509 clusterAuthMode but no CA file");
diff --git a/jstests/ssl/x509_client.js b/jstests/ssl/x509_client.js
index e6d6899c07e..09c546e2cb9 100644
--- a/jstests/ssl/x509_client.js
+++ b/jstests/ssl/x509_client.js
@@ -92,6 +92,7 @@ MongoRunner.stopMongod(mongo);
print("2. Testing x.509 auth to mongos");
+// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed.
var st = new ShardingTest({
shards: 1,
mongos: 1,
@@ -101,6 +102,7 @@ var st = new ShardingTest({
mongosOptions: x509_options,
shardOptions: x509_options,
useHostname: false,
+ shardAsReplicaSet: false
}
});