summaryrefslogtreecommitdiff
path: root/src/mongo/shell
diff options
context:
space:
mode:
authorBen Caimano <ben.caimano@10gen.com>2021-02-17 17:42:20 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-18 17:01:33 +0000
commit5a76da986da7166226cc3da2eed081bc5263bfe6 (patch)
treef0b99b3a5055f9d6d5484d9a0493ec41fc7e3ccf /src/mongo/shell
parentf35a8a1cf31e5589f27012cf6df05c0adfe0b978 (diff)
downloadmongo-5a76da986da7166226cc3da2eed081bc5263bfe6.tar.gz
SERVER-54136 Make the authenticate command respect enforceUserClusterSeparation
Diffstat (limited to 'src/mongo/shell')
-rw-r--r--src/mongo/shell/shardingtest.js39
1 files changed, 23 insertions, 16 deletions
diff --git a/src/mongo/shell/shardingtest.js b/src/mongo/shell/shardingtest.js
index 2087653e897..d19ed6bdad9 100644
--- a/src/mongo/shell/shardingtest.js
+++ b/src/mongo/shell/shardingtest.js
@@ -393,6 +393,27 @@ var ShardingTest = function(params) {
}
};
+ this.stopAllConfigServers = function(opts) {
+ if (this.configRS) {
+ this.configRS.stopSet(undefined, undefined, opts);
+ } else {
+ // Old style config triplet
+ for (var i = 0; i < this._configServers.length; i++) {
+ this.stopConfigServer(i, opts);
+ }
+ }
+ };
+
+ this.stopAllShards = function(opts) {
+ for (var i = 0; i < this._connections.length; i++) {
+ if (this._rs[i]) {
+ this._rs[i].test.stopSet(15, undefined, opts);
+ } else {
+ this.stopMongod(i, opts);
+ }
+ }
+ };
+
this.stopAllMongos = function(opts) {
for (var i = 0; i < this._mongos.length; i++) {
this.stopMongos(i, opts);
@@ -415,25 +436,11 @@ var ShardingTest = function(params) {
this.stopAllMongos(opts);
let startTime = new Date(); // Measure the execution time of shutting down shards.
- for (var i = 0; i < this._connections.length; i++) {
- if (this._rs[i]) {
- this._rs[i].test.stopSet(15, undefined, opts);
- } else {
- this.stopMongod(i, opts);
- }
- }
+ this.stopAllShards(opts);
print("ShardingTest stopped all shards, took " + (new Date() - startTime) + "ms for " +
this._connections.length + " shards.");
- if (this.configRS) {
- this.configRS.stopSet(undefined, undefined, opts);
- } else {
- // Old style config triplet
- for (var i = 0; i < this._configServers.length; i++) {
- this.stopConfigServer(i, opts);
- }
- }
-
+ this.stopAllConfigServers(opts);
if (!opts.noCleanData) {
print("ShardingTest stop deleting all dbpaths");
for (var i = 0; i < _alldbpaths.length; i++) {