diff options
Diffstat (limited to 'jstests')
67 files changed, 219 insertions, 316 deletions
diff --git a/jstests/auth/access_control_with_unreachable_configs.js b/jstests/auth/access_control_with_unreachable_configs.js index a75d583e6f0..69cb9140720 100644 --- a/jstests/auth/access_control_with_unreachable_configs.js +++ b/jstests/auth/access_control_with_unreachable_configs.js @@ -4,14 +4,13 @@ // there are. // @tags: [requires_sharding] -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. var st = new ShardingTest({ shards: 1, mongos: 1, config: 1, keyFile: 'jstests/libs/key1', useHostname: false, // Needed when relying on the localhost exception - other: {mongosOptions: {verbose: 1}, shardAsReplicaSet: false} + other: {mongosOptions: {verbose: 1}} }); var mongos = st.s; var config = st.config0; diff --git a/jstests/auth/auth_mechanism_discovery.js b/jstests/auth/auth_mechanism_discovery.js index 78b150ec1aa..d17d1ddb03b 100644 --- a/jstests/auth/auth_mechanism_discovery.js +++ b/jstests/auth/auth_mechanism_discovery.js @@ -43,13 +43,8 @@ runTest(m); MongoRunner.stopMongod(m); // Test sharded. -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({ - shards: 1, - mongos: 1, - config: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} -}); +const st = + new ShardingTest({shards: 1, mongos: 1, config: 1, other: {keyFile: 'jstests/libs/key1'}}); runTest(st.s0); st.stop(); })(); diff --git a/jstests/auth/authentication_restrictions.js b/jstests/auth/authentication_restrictions.js index 172db043770..456fe1465e1 100644 --- a/jstests/auth/authentication_restrictions.js +++ b/jstests/auth/authentication_restrictions.js @@ -194,7 +194,6 @@ testConnection(rst.getPrimary(), rst.getSecondary(), awaitReplication, awaitRepl rst.stopSet(); print("Testing sharded cluster"); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. var st = new ShardingTest({ mongos: 2, config: 3, @@ -203,8 +202,7 @@ var st = new ShardingTest({ other: { mongosOptions: {bind_ip_all: "", auth: null}, configOptions: {auth: null}, - shardOptions: {auth: null}, - shardAsReplicaSet: false + shardOptions: {auth: null} } }); testConnection(st.s0, diff --git a/jstests/auth/authentication_restrictions_role.js b/jstests/auth/authentication_restrictions_role.js index 70256fba7f5..d71c788ac2f 100644 --- a/jstests/auth/authentication_restrictions_role.js +++ b/jstests/auth/authentication_restrictions_role.js @@ -380,7 +380,6 @@ testRolesInfoCommand(rst.getPrimary()); rst.stopSet(); print("Testing sharded cluster"); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. var st = new ShardingTest({ mongos: 2, config: 3, @@ -389,8 +388,7 @@ var st = new ShardingTest({ other: { mongosOptions: {bind_ip_all: "", auth: null}, configOptions: {auth: null}, - shardOptions: {auth: null}, - shardAsReplicaSet: false + shardOptions: {auth: null} } }); testRestrictionCreationAndEnforcement( diff --git a/jstests/auth/authz_modifications_access_control.js b/jstests/auth/authz_modifications_access_control.js index f660e861908..a8592e2cd1b 100644 --- a/jstests/auth/authz_modifications_access_control.js +++ b/jstests/auth/authz_modifications_access_control.js @@ -299,8 +299,6 @@ runTest(conn); MongoRunner.stopMongod(conn); jsTest.log('Test sharding'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 2, config: 3, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1'}); runTest(st.s); st.stop(); diff --git a/jstests/auth/basic_role_auth.js b/jstests/auth/basic_role_auth.js index 6f481afc2e6..ff487bebbd9 100644 --- a/jstests/auth/basic_role_auth.js +++ b/jstests/auth/basic_role_auth.js @@ -518,9 +518,7 @@ runTests(conn); MongoRunner.stopMongod(conn); jsTest.log('Test sharding'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = - new ShardingTest({shards: 1, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 1, keyFile: 'jstests/libs/key1'}); runTests(st.s); st.stop(); diff --git a/jstests/auth/clac_system_colls.js b/jstests/auth/clac_system_colls.js index d9a6912e0ea..066b6e6c727 100644 --- a/jstests/auth/clac_system_colls.js +++ b/jstests/auth/clac_system_colls.js @@ -54,8 +54,6 @@ runTest(conn.getDB("admin")); MongoRunner.stopMongod(conn); jsTest.log('Test sharding'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 2, config: 3, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1'}); runTest(st.s.getDB("admin")); st.stop(); diff --git a/jstests/auth/commands_builtin_roles.js b/jstests/auth/commands_builtin_roles.js index 4b0c803a771..637634df83b 100644 --- a/jstests/auth/commands_builtin_roles.js +++ b/jstests/auth/commands_builtin_roles.js @@ -162,7 +162,8 @@ authCommandsLib.runTests(conn, impls); MongoRunner.stopMongod(conn); // run all tests sharded -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. +// TODO: SERVER-43897 Make commands_user_defined_roles.js and commands_builtin_roles.js start shards +// as replica sets. conn = new ShardingTest({ shards: 2, mongos: 1, diff --git a/jstests/auth/commands_user_defined_roles.js b/jstests/auth/commands_user_defined_roles.js index f1b5730eb94..4cc910f35ed 100644 --- a/jstests/auth/commands_user_defined_roles.js +++ b/jstests/auth/commands_user_defined_roles.js @@ -211,7 +211,8 @@ authCommandsLib.runTests(conn, impls); MongoRunner.stopMongod(conn); // run all tests sharded -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. +// TODO: SERVER-43897 Make commands_user_defined_roles.js and commands_builtin_roles.js start shards +// as replica sets. conn = new ShardingTest({ shards: 2, mongos: 1, diff --git a/jstests/auth/currentop_cursors_auth.js b/jstests/auth/currentop_cursors_auth.js index 70ee354273a..5b1cf3255c2 100644 --- a/jstests/auth/currentop_cursors_auth.js +++ b/jstests/auth/currentop_cursors_auth.js @@ -8,9 +8,6 @@ load("jstests/libs/fixture_helpers.js"); // For isMongos. -// TODO SERVER-32672: remove the 'skipGossipingClusterTime' flag. -TestData.skipGossipingClusterTime = true; - // Create a new sharded cluster for testing and enable auth. const key = "jstests/libs/key1"; const st = new ShardingTest({name: jsTestName(), keyFile: key, shards: 1}); diff --git a/jstests/auth/deleted_recreated_user.js b/jstests/auth/deleted_recreated_user_base.js index d668b47fced..c64b2e4126f 100644 --- a/jstests/auth/deleted_recreated_user.js +++ b/jstests/auth/deleted_recreated_user_base.js @@ -1,10 +1,8 @@ -// Test that sessions can not be resumed by deleted and recreated user. - -(function() { 'use strict'; const kInvalidationIntervalSecs = 5; +// Test that sessions cannot be resumed by deleted and recreated user. function runTest(s0, s1) { assert(s0); assert(s1); @@ -51,24 +49,3 @@ function runTest(s0, s1) { assert.throws(() => admin.mycoll.find({}).toArray(), [], "Able to find after recreate"); assert.eq(thrown.code, ErrorCodes.Unauthorized, "Threw something other than unauthorized"); } - -const mongod = MongoRunner.runMongod({auth: ''}); -runTest(mongod, mongod); -MongoRunner.stopMongod(mongod); - -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({ - shards: 1, - mongos: 2, - config: 1, - other: { - keyFile: 'jstests/libs/key1', - shardAsReplicaSet: false, - mongosOptions: { - setParameter: 'userCacheInvalidationIntervalSecs=' + kInvalidationIntervalSecs, - }, - }, -}); -runTest(st.s0, st.s1); -st.stop(); -})(); diff --git a/jstests/auth/deleted_recreated_user_mongod.js b/jstests/auth/deleted_recreated_user_mongod.js new file mode 100644 index 00000000000..c033a916263 --- /dev/null +++ b/jstests/auth/deleted_recreated_user_mongod.js @@ -0,0 +1,12 @@ +/* + * Test that sessions on mongods cannot be resumed by deleted and recreated user. + */ +(function() { +'use strict'; + +load("jstests/auth/deleted_recreated_user_base.js"); + +const mongod = MongoRunner.runMongod({auth: ''}); +runTest(mongod, mongod); +MongoRunner.stopMongod(mongod); +})(); diff --git a/jstests/auth/deleted_recreated_user_sharded_cluster.js b/jstests/auth/deleted_recreated_user_sharded_cluster.js new file mode 100644 index 00000000000..58976b3f8c6 --- /dev/null +++ b/jstests/auth/deleted_recreated_user_sharded_cluster.js @@ -0,0 +1,23 @@ +/* + * Test that sessions on sharded clusters cannot be resumed by deleted and recreated user. + * @tags: [requires_sharding] + */ +(function() { +'use strict'; + +load("jstests/auth/deleted_recreated_user_base.js"); + +const st = new ShardingTest({ + shards: 1, + mongos: 2, + config: 1, + other: { + keyFile: 'jstests/libs/key1', + mongosOptions: { + setParameter: 'userCacheInvalidationIntervalSecs=' + kInvalidationIntervalSecs, + }, + }, +}); +runTest(st.s0, st.s1); +st.stop(); +})(); diff --git a/jstests/auth/getMore.js b/jstests/auth/getMore.js index c593a35957d..26ec6a2783a 100644 --- a/jstests/auth/getMore.js +++ b/jstests/auth/getMore.js @@ -329,13 +329,8 @@ runTest(conn); MongoRunner.stopMongod(conn); // Run the test on a sharded cluster. -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -let cluster = new ShardingTest({ - shards: 1, - mongos: 1, - keyFile: "jstests/libs/key1", - other: {shardOptions: {auth: ""}, shardAsReplicaSet: false} -}); +let cluster = new ShardingTest( + {shards: 1, mongos: 1, keyFile: "jstests/libs/key1", other: {shardOptions: {auth: ""}}}); runTest(cluster); cluster.stop(); }()); diff --git a/jstests/auth/kill_cursors.js b/jstests/auth/kill_cursors.js index 893c7139c79..bb31721e860 100644 --- a/jstests/auth/kill_cursors.js +++ b/jstests/auth/kill_cursors.js @@ -162,13 +162,8 @@ const mongod = MongoRunner.runMongod({auth: ""}); runTest(mongod); MongoRunner.stopMongod(mongod); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({ - shards: 1, - mongos: 1, - config: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} -}); +const st = + new ShardingTest({shards: 1, mongos: 1, config: 1, other: {keyFile: 'jstests/libs/key1'}}); runTest(st.s0); st.stop(); })(); diff --git a/jstests/auth/killop_own_ops.js b/jstests/auth/killop_own_ops.js index dbb1689708c..2d851f02697 100644 --- a/jstests/auth/killop_own_ops.js +++ b/jstests/auth/killop_own_ops.js @@ -145,9 +145,7 @@ var conn = MongoRunner.runMongod({auth: ""}); runTest(conn, "setYieldAllLocksHang"); MongoRunner.stopMongod(conn); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = - new ShardingTest({shards: 1, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 1, keyFile: 'jstests/libs/key1'}); // Use a different failpoint in the sharded version, since the mongos does not have a // setYieldAlllocksHang failpoint. runTest(st.s, "waitInFindBeforeMakingBatch"); diff --git a/jstests/auth/list_all_local_sessions.js b/jstests/auth/list_all_local_sessions.js index 92363515a00..3efe32fc3e1 100644 --- a/jstests/auth/list_all_local_sessions.js +++ b/jstests/auth/list_all_local_sessions.js @@ -49,13 +49,8 @@ const mongod = MongoRunner.runMongod({auth: ""}); runListAllLocalSessionsTest(mongod); MongoRunner.stopMongod(mongod); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({ - shards: 1, - mongos: 1, - config: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} -}); +const st = + new ShardingTest({shards: 1, mongos: 1, config: 1, other: {keyFile: 'jstests/libs/key1'}}); runListAllLocalSessionsTest(st.s0); st.stop(); })(); diff --git a/jstests/auth/list_databases.js b/jstests/auth/list_databases_base.js index 2e374e54fd6..c275cfabc3b 100644 --- a/jstests/auth/list_databases.js +++ b/jstests/auth/list_databases_base.js @@ -1,8 +1,6 @@ -// Auth tests for the listDatabases command. - -(function() { 'use strict'; +// Auth test the listDatabases command. function runTest(mongod) { const admin = mongod.getDB('admin'); admin.createUser({user: 'admin', pwd: 'pass', roles: jsTest.adminUserRoles}); @@ -148,20 +146,3 @@ function runTest(mongod) { admin.logout(); }); } - -const mongod = MongoRunner.runMongod({auth: ""}); -runTest(mongod); -MongoRunner.stopMongod(mongod); - -if (jsTest.options().storageEngine !== "mobile") { - // TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. - const st = new ShardingTest({ - shards: 1, - mongos: 1, - config: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} - }); - runTest(st.s0); - st.stop(); -} -})(); diff --git a/jstests/auth/list_databases_mongod.js b/jstests/auth/list_databases_mongod.js new file mode 100644 index 00000000000..4131c8f8691 --- /dev/null +++ b/jstests/auth/list_databases_mongod.js @@ -0,0 +1,12 @@ +/* + * Auth test for the listDatabases command on mongods. + */ +(function() { +'use strict'; + +load("jstests/auth/list_databases_base.js"); + +const mongod = MongoRunner.runMongod({auth: ""}); +runTest(mongod); +MongoRunner.stopMongod(mongod); +})(); diff --git a/jstests/auth/list_databases_sharded_cluster.js b/jstests/auth/list_databases_sharded_cluster.js new file mode 100644 index 00000000000..29eb53dfc7e --- /dev/null +++ b/jstests/auth/list_databases_sharded_cluster.js @@ -0,0 +1,14 @@ +/* + * Auth test for the listDatabases command on sharded clusters. + * @tags: [requires_sharding] + */ +(function() { +'use strict'; + +load("jstests/auth/list_databases_base.js"); + +const st = + new ShardingTest({shards: 1, mongos: 1, config: 1, other: {keyFile: 'jstests/libs/key1'}}); +runTest(st.s0); +st.stop(); +})(); diff --git a/jstests/auth/list_local_sessions.js b/jstests/auth/list_local_sessions_base.js index 3c16df48b8e..1901bd50914 100644 --- a/jstests/auth/list_local_sessions.js +++ b/jstests/auth/list_local_sessions_base.js @@ -1,6 +1,3 @@ -// All tests for the $listLocalSessions aggregation stage. - -(function() { 'use strict'; load('jstests/aggregation/extras/utils.js'); @@ -8,6 +5,7 @@ load('jstests/aggregation/extras/utils.js'); // implicit sessions. TestData.disableImplicitSessions = true; +// All tests for the $listLocalSessions aggregation stage. function runListLocalSessionsTest(mongod) { assert(mongod); const admin = mongod.getDB('admin'); @@ -58,18 +56,3 @@ function runListLocalSessionsTest(mongod) { [{'$listLocalSessions': {users: [{user: "user1", db: "test"}]}}], ErrorCodes.Unauthorized); } - -const mongod = MongoRunner.runMongod({auth: ""}); -runListLocalSessionsTest(mongod); -MongoRunner.stopMongod(mongod); - -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({ - shards: 1, - mongos: 1, - config: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} -}); -runListLocalSessionsTest(st.s0); -st.stop(); -})(); diff --git a/jstests/auth/list_local_sessions_mongod.js b/jstests/auth/list_local_sessions_mongod.js new file mode 100644 index 00000000000..76522521e65 --- /dev/null +++ b/jstests/auth/list_local_sessions_mongod.js @@ -0,0 +1,12 @@ +/* + * Auth test for the $listLocalSessions aggregation stage on mongods. + */ +(function() { +'use strict'; + +load("jstests/auth/list_local_sessions_base.js"); + +const mongod = MongoRunner.runMongod({auth: ""}); +runListLocalSessionsTest(mongod); +MongoRunner.stopMongod(mongod); +})(); diff --git a/jstests/auth/list_local_sessions_sharded_cluster.js b/jstests/auth/list_local_sessions_sharded_cluster.js new file mode 100644 index 00000000000..1c331b9e5f6 --- /dev/null +++ b/jstests/auth/list_local_sessions_sharded_cluster.js @@ -0,0 +1,14 @@ +/* + * Auth test for the $listLocalSessions aggregation stage on sharded clusters. + * @tags: [requires_sharding] + */ +(function() { +'use strict'; + +load("jstests/auth/list_local_sessions_base.js"); + +const st = + new ShardingTest({shards: 1, mongos: 1, config: 1, other: {keyFile: 'jstests/libs/key1'}}); +runListLocalSessionsTest(st.s0); +st.stop(); +})(); diff --git a/jstests/auth/list_sessions.js b/jstests/auth/list_sessions.js index f91218d22e4..8ee24319bd5 100644 --- a/jstests/auth/list_sessions.js +++ b/jstests/auth/list_sessions.js @@ -76,13 +76,8 @@ const mongod = MongoRunner.runMongod({auth: ""}); runListSessionsTest(mongod); MongoRunner.stopMongod(mongod); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({ - shards: 1, - mongos: 1, - config: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} -}); +const st = + new ShardingTest({shards: 1, mongos: 1, config: 1, other: {keyFile: 'jstests/libs/key1'}}); runListSessionsTest(st.s0); st.stop(); })(); diff --git a/jstests/auth/listcommands_preauth.js b/jstests/auth/listcommands_preauth_base.js index fae33cf65db..01cabf04d64 100644 --- a/jstests/auth/listcommands_preauth.js +++ b/jstests/auth/listcommands_preauth_base.js @@ -1,8 +1,6 @@ -// Make sure that listCommands doesn't require authentication. - -(function() { 'use strict'; +// Make sure that listCommands doesn't require authentication. function runTest(conn) { const admin = conn.getDB('admin'); @@ -19,18 +17,3 @@ function runTest(conn) { // listCommands should STILL work, because it does not require auth. assert.commandWorked(admin.runCommand({listCommands: 1}), "listCommands should work pre-auth"); } - -const mongod = MongoRunner.runMongod({auth: ""}); -runTest(mongod); -MongoRunner.stopMongod(mongod); - -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({ - shards: 1, - mongos: 1, - config: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} -}); -runTest(st.s0); -st.stop(); -})(); diff --git a/jstests/auth/listcommands_preauth_mongod.js b/jstests/auth/listcommands_preauth_mongod.js new file mode 100644 index 00000000000..f049e75de7a --- /dev/null +++ b/jstests/auth/listcommands_preauth_mongod.js @@ -0,0 +1,12 @@ +/* + * Make sure that listCommands on mongods doesn't require authentication. + */ +(function() { +'use strict'; + +load("jstests/auth/listcommands_preauth_base.js"); + +const mongod = MongoRunner.runMongod({auth: ""}); +runTest(mongod); +MongoRunner.stopMongod(mongod); +})();
\ No newline at end of file diff --git a/jstests/auth/listcommands_preauth_sharded_cluster.js b/jstests/auth/listcommands_preauth_sharded_cluster.js new file mode 100644 index 00000000000..76115d26f5e --- /dev/null +++ b/jstests/auth/listcommands_preauth_sharded_cluster.js @@ -0,0 +1,14 @@ +/* + * Make sure that listCommands on sharded clusters doesn't require authentication. + * @tags: [requires_sharding] + */ +(function() { +'use strict'; + +load("jstests/auth/listcommands_preauth_base.js"); + +const st = + new ShardingTest({shards: 1, mongos: 1, config: 1, other: {keyFile: 'jstests/libs/key1'}}); +runTest(st.s0); +st.stop(); +})();
\ No newline at end of file diff --git a/jstests/auth/mongos_cache_invalidation.js b/jstests/auth/mongos_cache_invalidation.js index 8e8e706d76a..fd7ef98e4f9 100644 --- a/jstests/auth/mongos_cache_invalidation.js +++ b/jstests/auth/mongos_cache_invalidation.js @@ -10,7 +10,6 @@ var hasAuthzError = function(result) { assert.eq(authzErrorCode, result.code); }; -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. var st = new ShardingTest({ shards: 2, config: 3, @@ -19,8 +18,7 @@ var st = new ShardingTest({ {setParameter: "userCacheInvalidationIntervalSecs=5"}, {setParameter: "userCacheInvalidationIntervalSecs=600"} ], - keyFile: 'jstests/libs/key1', - other: {shardAsReplicaSet: false} + keyFile: 'jstests/libs/key1' }); st.s1.getDB('admin').createUser({user: 'root', pwd: 'pwd', roles: ['root']}); diff --git a/jstests/auth/pseudo_commands.js b/jstests/auth/pseudo_commands.js index 29134f8bca7..392be3df9bf 100644 --- a/jstests/auth/pseudo_commands.js +++ b/jstests/auth/pseudo_commands.js @@ -17,6 +17,8 @@ function runTest(conn) { admin.createUser({user: 'spencer', pwd: 'pwd', roles: ['myRole']}); var db = conn.getDB('admin'); + db.auth('admin', 'pwd'); + var arbitraryShard = db.getSiblingDB("config").shards.findOne(); db.auth('spencer', 'pwd'); /** @@ -115,7 +117,7 @@ function runTest(conn) { try { var opid; if (isMongos(db)) { // opid format different between mongos and mongod - opid = "shard0000:1234"; + opid = arbitraryShard._id + ":1234"; } else { opid = 1234; } @@ -191,8 +193,6 @@ runTest(conn); MongoRunner.stopMongod(conn); jsTest.log('Test sharding'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 2, config: 3, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1'}); runTest(st.s); st.stop(); diff --git a/jstests/auth/resource_pattern_matching.js b/jstests/auth/resource_pattern_matching.js index ccefb8f51f5..3a8fe24c957 100644 --- a/jstests/auth/resource_pattern_matching.js +++ b/jstests/auth/resource_pattern_matching.js @@ -243,17 +243,12 @@ rst.stopSet(); print('--- done with the rs tests ---'); print('--- sharding test ---'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. var st = new ShardingTest({ mongos: 2, shard: 1, keyFile: keyfile, - other: { - mongosOptions: {'auth': null}, - configOptions: {'auth': null}, - shardOptions: {'auth': null}, - shardAsReplicaSet: false - } + other: + {mongosOptions: {'auth': null}, configOptions: {'auth': null}, shardOptions: {'auth': null}} }); run_tests(st.s0.getDB('admin'), st.s1.getDB('admin')); st.stop(); diff --git a/jstests/auth/role_management_commands_edge_cases.js b/jstests/auth/role_management_commands_edge_cases.js index 023f01df95e..9ec4ca77461 100644 --- a/jstests/auth/role_management_commands_edge_cases.js +++ b/jstests/auth/role_management_commands_edge_cases.js @@ -376,8 +376,6 @@ runTest(conn); MongoRunner.stopMongod(conn); jsTest.log('Test sharding'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 2, config: 3, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1'}); runTest(st.s); st.stop(); diff --git a/jstests/auth/role_management_commands_sharded_wc_1.js b/jstests/auth/role_management_commands_sharded_wc_1.js index 9e7e3482d76..e054d7820d6 100644 --- a/jstests/auth/role_management_commands_sharded_wc_1.js +++ b/jstests/auth/role_management_commands_sharded_wc_1.js @@ -5,14 +5,7 @@ load('jstests/auth/role_management_commands_lib.js'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest({ - shards: 2, - config: 3, - keyFile: 'jstests/libs/key1', - useHostname: false, - other: {shardAsReplicaSet: false} -}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1', useHostname: false}); runAllRoleManagementCommandsTests(st.s, {w: 1}); st.stop(); })(); diff --git a/jstests/auth/role_management_commands_sharded_wc_majority.js b/jstests/auth/role_management_commands_sharded_wc_majority.js index 155aa931feb..857176a28fa 100644 --- a/jstests/auth/role_management_commands_sharded_wc_majority.js +++ b/jstests/auth/role_management_commands_sharded_wc_majority.js @@ -7,14 +7,7 @@ load('jstests/auth/role_management_commands_lib.js'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest({ - shards: 2, - config: 3, - keyFile: 'jstests/libs/key1', - useHostname: false, - other: {shardAsReplicaSet: false} -}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1', useHostname: false}); runAllRoleManagementCommandsTests(st.s, {w: 'majority', wtimeout: 60 * 1000}); st.stop(); })(); diff --git a/jstests/auth/user_defined_roles.js b/jstests/auth/user_defined_roles.js index ba9d2aba87f..db976bea63d 100644 --- a/jstests/auth/user_defined_roles.js +++ b/jstests/auth/user_defined_roles.js @@ -145,8 +145,6 @@ runTest(conn); MongoRunner.stopMongod(conn); jsTest.log('Test sharding'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 2, config: 3, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1'}); runTest(st.s); st.stop(); diff --git a/jstests/auth/user_management_commands_edge_cases.js b/jstests/auth/user_management_commands_edge_cases.js index d197d0105b2..a690b65c1b1 100644 --- a/jstests/auth/user_management_commands_edge_cases.js +++ b/jstests/auth/user_management_commands_edge_cases.js @@ -280,8 +280,6 @@ runTest(conn); MongoRunner.stopMongod(conn); jsTest.log('Test sharding'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 2, config: 3, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1'}); runTest(st.s); st.stop(); diff --git a/jstests/auth/user_management_commands_sharded_wc_1.js b/jstests/auth/user_management_commands_sharded_wc_1.js index 675efba731a..6287315efa6 100644 --- a/jstests/auth/user_management_commands_sharded_wc_1.js +++ b/jstests/auth/user_management_commands_sharded_wc_1.js @@ -7,9 +7,7 @@ load('jstests/auth/user_management_commands_lib.js'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 2, config: 3, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1'}); runAllUserManagementCommandsTests(st.s, {w: 1}); st.stop(); })(); diff --git a/jstests/auth/user_management_commands_sharded_wc_majority.js b/jstests/auth/user_management_commands_sharded_wc_majority.js index d9e0a75d543..6df88a66903 100644 --- a/jstests/auth/user_management_commands_sharded_wc_majority.js +++ b/jstests/auth/user_management_commands_sharded_wc_majority.js @@ -5,9 +5,7 @@ load('jstests/auth/user_management_commands_lib.js'); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 2, config: 3, keyFile: 'jstests/libs/key1', other: {shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 2, config: 3, keyFile: 'jstests/libs/key1'}); runAllUserManagementCommandsTests(st.s, {w: 'majority', wtimeout: 60 * 1000}); st.stop(); })(); diff --git a/jstests/auth/usersInfo.js b/jstests/auth/usersInfo_base.js index 81b9b4ee870..5be6aae182c 100644 --- a/jstests/auth/usersInfo.js +++ b/jstests/auth/usersInfo_base.js @@ -1,7 +1,6 @@ -// Test behavior and edge cases in usersInfo -(function() { 'use strict'; +// Test behavior and edge cases in usersInfo function runTest(conn) { let db = conn.getDB("test"); let emptyDB = conn.getDB("test2"); @@ -34,13 +33,3 @@ function runTest(conn) { const allInfo = assert.commandWorked(db.runCommand({usersInfo: {forAllDBs: true}})); assert.eq(userCount + 1, allInfo.users.length); } - -const m = MongoRunner.runMongod(); -runTest(m); -MongoRunner.stopMongod(m); - -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({shards: 1, mongos: 1, config: 1, other: {shardAsReplicaSet: false}}); -runTest(st.s0); -st.stop(); -}()); diff --git a/jstests/auth/usersInfo_mongod.js b/jstests/auth/usersInfo_mongod.js new file mode 100644 index 00000000000..4a367681060 --- /dev/null +++ b/jstests/auth/usersInfo_mongod.js @@ -0,0 +1,13 @@ +/* + * Test behavior and edge cases in usersInfo on mongods. + */ + +(function() { +'use strict'; + +load("jstests/auth/usersInfo_base.js"); + +const m = MongoRunner.runMongod(); +runTest(m); +MongoRunner.stopMongod(m); +}()); diff --git a/jstests/auth/usersInfo_sharded_cluster.js b/jstests/auth/usersInfo_sharded_cluster.js new file mode 100644 index 00000000000..6235dd95e03 --- /dev/null +++ b/jstests/auth/usersInfo_sharded_cluster.js @@ -0,0 +1,13 @@ +/* + * Test behavior and edge cases in usersInfo on sharded clusters. + * @tags: [requires_sharding] + */ +(function() { +'use strict'; + +load("jstests/auth/usersInfo_base.js"); + +const st = new ShardingTest({shards: 1, mongos: 1, config: 1}); +runTest(st.s0); +st.stop(); +}()); diff --git a/jstests/auth/views_authz.js b/jstests/auth/views_authz.js index f510912f3fe..eaab62647cb 100644 --- a/jstests/auth/views_authz.js +++ b/jstests/auth/views_authz.js @@ -133,13 +133,8 @@ runTest(mongod); MongoRunner.stopMongod(mongod); // Run the test on a sharded cluster. -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -let cluster = new ShardingTest({ - shards: 1, - mongos: 1, - keyFile: "jstests/libs/key1", - other: {shardOptions: {auth: ""}, shardAsReplicaSet: false} -}); +let cluster = new ShardingTest( + {shards: 1, mongos: 1, keyFile: "jstests/libs/key1", other: {shardOptions: {auth: ""}}}); runTest(cluster); cluster.stop(); }()); diff --git a/jstests/noPassthrough/auth_reject_mismatching_logical_times.js b/jstests/noPassthrough/auth_reject_mismatching_logical_times.js index 13b971c7bc5..00b16f739ab 100644 --- a/jstests/noPassthrough/auth_reject_mismatching_logical_times.js +++ b/jstests/noPassthrough/auth_reject_mismatching_logical_times.js @@ -32,12 +32,8 @@ function assertAcceptsValidLogicalTime(db) { } // Start the sharding test with auth on. -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest({ - mongos: 1, - manualAddShard: true, - other: {keyFile: "jstests/libs/key1", shardAsReplicaSet: false} -}); +const st = + new ShardingTest({mongos: 1, manualAddShard: true, other: {keyFile: "jstests/libs/key1"}}); // Create admin user and authenticate as them. st.s.getDB("admin").createUser({user: "foo", pwd: "bar", roles: jsTest.adminUserRoles}); @@ -47,7 +43,6 @@ st.s.getDB("admin").auth("foo", "bar"); const rst = new ReplSetTest({nodes: 2}); rst.startSet({keyFile: "jstests/libs/key1", shardsvr: ""}); -// TODO: Wait for stable recovery timestamp when SERVER-32672 is fixed. rst.initiateWithAnyNodeAsPrimary( null, "replSetInitiate", {doNotWaitForStableRecoveryTimestamp: true}); assert.commandWorked(st.s.adminCommand({addShard: rst.getURL()})); diff --git a/jstests/noPassthrough/cross_user_getmore_has_no_side_effects.js b/jstests/noPassthrough/cross_user_getmore_has_no_side_effects.js index 1fe50111a8e..d89128a9249 100644 --- a/jstests/noPassthrough/cross_user_getmore_has_no_side_effects.js +++ b/jstests/noPassthrough/cross_user_getmore_has_no_side_effects.js @@ -4,9 +4,7 @@ // @tags: [requires_sharding] (function() { -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -const st = new ShardingTest( - {shards: 2, config: 1, other: {keyFile: "jstests/libs/key1", shardAsReplicaSet: false}}); +const st = new ShardingTest({shards: 2, config: 1, other: {keyFile: "jstests/libs/key1"}}); const kDBName = "test"; const adminDB = st.s.getDB('admin'); const testDB = st.s.getDB(kDBName); diff --git a/jstests/noPassthrough/logical_session_cursor_checks.js b/jstests/noPassthrough/logical_session_cursor_checks.js index f2af849ab68..ed12132276d 100644 --- a/jstests/noPassthrough/logical_session_cursor_checks.js +++ b/jstests/noPassthrough/logical_session_cursor_checks.js @@ -76,13 +76,8 @@ Standalone.prototype.getConn = function() { }; function Sharding() { - // TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. - this.st = new ShardingTest({ - shards: 1, - config: 1, - mongos: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} - }); + this.st = + new ShardingTest({shards: 1, config: 1, mongos: 1, other: {keyFile: 'jstests/libs/key1'}}); } Sharding.prototype.stop = function() { diff --git a/jstests/noPassthrough/unsupported_change_stream_deployments.js b/jstests/noPassthrough/unsupported_change_stream_deployments.js index 6bfa8d1fc33..a8f2e02ab66 100644 --- a/jstests/noPassthrough/unsupported_change_stream_deployments.js +++ b/jstests/noPassthrough/unsupported_change_stream_deployments.js @@ -36,7 +36,6 @@ assertChangeStreamNotSupportedOnConnection(conn); assert.eq(0, MongoRunner.stopMongod(conn)); // Test a sharded cluster with standalone shards. -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. const clusterWithStandalones = new ShardingTest({ shards: 2, other: {shardOptions: {enableMajorityReadConcern: ""}}, diff --git a/jstests/sharding/advance_cluster_time_action_type.js b/jstests/sharding/advance_cluster_time_action_type.js index 1fff92c5e1d..fb3f1184e84 100644 --- a/jstests/sharding/advance_cluster_time_action_type.js +++ b/jstests/sharding/advance_cluster_time_action_type.js @@ -8,14 +8,7 @@ // TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. TestData.disableImplicitSessions = true; -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -let st = new ShardingTest({ - mongos: 1, - config: 1, - shards: 1, - keyFile: 'jstests/libs/key1', - other: {shardAsReplicaSet: false} -}); +let st = new ShardingTest({mongos: 1, config: 1, shards: 1, keyFile: 'jstests/libs/key1'}); let adminDB = st.s.getDB('admin'); diff --git a/jstests/sharding/aggregation_currentop.js b/jstests/sharding/aggregation_currentop.js index 78b15dfb55b..f3b6ac3be5c 100644 --- a/jstests/sharding/aggregation_currentop.js +++ b/jstests/sharding/aggregation_currentop.js @@ -31,8 +31,6 @@ load("jstests/libs/namespace_utils.js"); // For getCollectionNameFromFullNamesp // briefly authenticates as __system and recieves clusterTime metadata then will fail trying to // gossip that time later in setup. // -// TODO SERVER-32672: remove this flag. -TestData.skipGossipingClusterTime = true; const key = "jstests/libs/key1"; diff --git a/jstests/sharding/auth.js b/jstests/sharding/auth.js index 5131c512271..0bf917135ef 100644 --- a/jstests/sharding/auth.js +++ b/jstests/sharding/auth.js @@ -16,8 +16,6 @@ load("jstests/replsets/rslib.js"); // briefly authenticates as __system and recieves clusterTime metadata then will fail trying to // gossip that time later in setup. // -// TODO SERVER-32672: remove this flag. -TestData.skipGossipingClusterTime = true; var adminUser = {db: "admin", username: "foo", password: "bar"}; diff --git a/jstests/sharding/auth2.js b/jstests/sharding/auth2.js index d1d6cb20156..8a763f54569 100644 --- a/jstests/sharding/auth2.js +++ b/jstests/sharding/auth2.js @@ -1,11 +1,9 @@ (function() { 'use strict'; -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. var st = new ShardingTest({ shards: 2, - other: - {chunkSize: 1, useHostname: true, keyFile: 'jstests/libs/key1', shardAsReplicaSet: false}, + other: {chunkSize: 1, useHostname: true, keyFile: 'jstests/libs/key1'}, }); var mongos = st.s; diff --git a/jstests/sharding/authCommands.js b/jstests/sharding/authCommands.js index 2692bc9bc42..6c3f905f266 100644 --- a/jstests/sharding/authCommands.js +++ b/jstests/sharding/authCommands.js @@ -15,8 +15,6 @@ load("jstests/replsets/rslib.js"); // briefly authenticates as __system and recieves clusterTime metadata then will fail trying to // gossip that time later in setup. // -// TODO SERVER-32672: remove this flag. -TestData.skipGossipingClusterTime = true; var st = new ShardingTest({ shards: 2, diff --git a/jstests/sharding/authConnectionHook.js b/jstests/sharding/authConnectionHook.js index 73e81393d44..08e1d60db28 100644 --- a/jstests/sharding/authConnectionHook.js +++ b/jstests/sharding/authConnectionHook.js @@ -16,11 +16,8 @@ TestData.skipCheckingUUIDsConsistentAcrossCluster = true; (function() { 'use strict'; -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest({ - shards: 2, - other: {keyFile: 'jstests/libs/key1', useHostname: true, chunkSize: 1, shardAsReplicaSet: false} -}); +var st = new ShardingTest( + {shards: 2, other: {keyFile: 'jstests/libs/key1', useHostname: true, chunkSize: 1}}); var mongos = st.s; var adminDB = mongos.getDB('admin'); @@ -31,7 +28,7 @@ adminDB.createUser({user: 'admin', pwd: 'password', roles: jsTest.adminUserRoles adminDB.auth('admin', 'password'); adminDB.runCommand({enableSharding: "test"}); -st.ensurePrimaryShard('test', 'shard0001'); +st.ensurePrimaryShard('test', st.shard1.shardName); adminDB.runCommand({shardCollection: "test.foo", key: {x: 1}}); for (var i = 0; i < 100; i++) { @@ -45,8 +42,8 @@ adminDB.runCommand({moveChunk: "test.foo", find: {x: 25}, to: otherShard, _waitF st.printShardingStatus(); -MongoRunner.stopMongod(st.shard0); -st.shard0 = MongoRunner.runMongod({restart: st.shard0}); +st.rs0.stopSet(undefined, true); +st.rs0.startSet({}, true); // May fail the first couple times due to socket exceptions assert.soon(function() { diff --git a/jstests/sharding/auth_add_shard.js b/jstests/sharding/auth_add_shard.js index 6c3c298b373..b2c0c870b09 100644 --- a/jstests/sharding/auth_add_shard.js +++ b/jstests/sharding/auth_add_shard.js @@ -14,9 +14,7 @@ function login(userObj) { var adminUser = {db: "admin", username: "foo", password: "bar"}; // set up a 2 shard cluster with keyfile -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 1, mongos: 1, other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 1, mongos: 1, other: {keyFile: 'jstests/libs/key1'}}); var mongos = st.s0; var admin = mongos.getDB("admin"); @@ -34,6 +32,7 @@ login(adminUser); assert.eq(1, st.config.shards.count(), "initial server count wrong"); // start a mongod with NO keyfile +// TODO: SERVER-43921 Make auth_add_shard.js start shards as replica sets. var conn = MongoRunner.runMongod({shardsvr: ""}); print(conn); @@ -46,9 +45,11 @@ MongoRunner.stopMongod(conn); //--------------- Test 2 -------------------- // start mongod again, this time with keyfile +// TODO: SERVER-43921 Make auth_add_shard.js start shards as replica sets. var conn = MongoRunner.runMongod({keyFile: "jstests/libs/key1", shardsvr: ""}); // try adding the new shard -assert.commandWorked(admin.runCommand({addShard: conn.host})); +var addShardRes = admin.runCommand({addShard: conn.host}); +assert.commandWorked(addShardRes); // Add some data var db = mongos.getDB("foo"); @@ -56,7 +57,7 @@ var collA = mongos.getCollection("foo.bar"); // enable sharding on a collection assert.commandWorked(admin.runCommand({enableSharding: "" + collA.getDB()})); -st.ensurePrimaryShard("foo", "shard0000"); +st.ensurePrimaryShard("foo", st.shard0.shardName); assert.commandWorked(admin.runCommand({shardCollection: "" + collA, key: {_id: 1}})); @@ -67,7 +68,8 @@ for (var i = 0; i < 4; i++) { } // move a chunk -assert.commandWorked(admin.runCommand({moveChunk: "foo.bar", find: {_id: 1}, to: "shard0001"})); +assert.commandWorked( + admin.runCommand({moveChunk: "foo.bar", find: {_id: 1}, to: addShardRes.shardAdded})); // verify the chunk was moved admin.runCommand({flushRouterConfig: 1}); diff --git a/jstests/sharding/auth_no_config_primary.js b/jstests/sharding/auth_no_config_primary.js index 57d6f2109b0..a9ed9a5c21a 100644 --- a/jstests/sharding/auth_no_config_primary.js +++ b/jstests/sharding/auth_no_config_primary.js @@ -14,9 +14,7 @@ TestData.skipCheckDBHashes = true; (function() { 'use strict'; -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = - new ShardingTest({shards: 1, other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 1, other: {keyFile: 'jstests/libs/key1'}}); st.s.getDB('admin').createUser({user: 'root', pwd: 'pass', roles: ['root']}); st.s.getDB('admin').auth('root', 'pass'); diff --git a/jstests/sharding/auth_sharding_cmd_metadata.js b/jstests/sharding/auth_sharding_cmd_metadata.js index d4474a26da7..8744e6dded6 100644 --- a/jstests/sharding/auth_sharding_cmd_metadata.js +++ b/jstests/sharding/auth_sharding_cmd_metadata.js @@ -5,7 +5,7 @@ "use strict"; -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. +// TODO: SERVER-43938 Make auth_sharding_cmd_metadata.js start shards as replica sets. var st = new ShardingTest({shards: 1, other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false}}); diff --git a/jstests/sharding/auth_slaveok_routing.js b/jstests/sharding/auth_slaveok_routing.js index 480d0c4318b..8eff7833c9b 100644 --- a/jstests/sharding/auth_slaveok_routing.js +++ b/jstests/sharding/auth_slaveok_routing.js @@ -19,8 +19,6 @@ load("jstests/replsets/rslib.js"); // briefly authenticates as __system and recieves clusterTime metadata then will fail trying to // gossip that time later in setup. // -// TODO SERVER-32672: remove this flag. -TestData.skipGossipingClusterTime = true; /** * Checks if a query to the given collection will be routed to the secondary. Returns true if @@ -39,9 +37,7 @@ function doesRouteToSec(coll, query) { } var rsOpts = {oplogSize: 50}; -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest( - {shards: 1, rs: rsOpts, other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false}}); +var st = new ShardingTest({shards: 1, rs: rsOpts, other: {keyFile: 'jstests/libs/key1'}}); var mongos = st.s; var replTest = st.rs0; diff --git a/jstests/sharding/authmr.js b/jstests/sharding/authmr.js index 9b0fbe240ce..e3c80f3ad55 100644 --- a/jstests/sharding/authmr.js +++ b/jstests/sharding/authmr.js @@ -27,13 +27,8 @@ function assertInsert(collection, obj) { assert.commandWorked(collection.insert(obj)); } -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var cluster = new ShardingTest({ - name: "authmr", - shards: 1, - mongos: 1, - other: {keyFile: "jstests/libs/key1", shardAsReplicaSet: false} -}); +var cluster = + new ShardingTest({name: "authmr", shards: 1, mongos: 1, other: {keyFile: "jstests/libs/key1"}}); // Set up the test data. (function() { diff --git a/jstests/sharding/authwhere.js b/jstests/sharding/authwhere.js index e9b338801bf..bd0d4721f85 100644 --- a/jstests/sharding/authwhere.js +++ b/jstests/sharding/authwhere.js @@ -27,13 +27,8 @@ function assertInsert(collection, obj) { assert.commandWorked(collection.insert(obj)); } -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var cluster = new ShardingTest({ - name: "authwhere", - shards: 1, - mongos: 1, - other: {keyFile: 'jstests/libs/key1', shardAsReplicaSet: false} -}); +var cluster = new ShardingTest( + {name: "authwhere", shards: 1, mongos: 1, other: {keyFile: 'jstests/libs/key1'}}); // Set up the test data. (function() { diff --git a/jstests/sharding/cleanup_orphaned_auth.js b/jstests/sharding/cleanup_orphaned_auth.js index a54030fbf12..8b0fac00f5d 100644 --- a/jstests/sharding/cleanup_orphaned_auth.js +++ b/jstests/sharding/cleanup_orphaned_auth.js @@ -23,11 +23,7 @@ function assertUnauthorized(res, msg) { doassert(finalMsg); } -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. -var st = new ShardingTest({ - auth: true, - other: {keyFile: 'jstests/libs/key1', useHostname: false, shardAsReplicaSet: false} -}); +var st = new ShardingTest({auth: true, other: {keyFile: 'jstests/libs/key1', useHostname: false}}); var shardAdmin = st.shard0.getDB('admin'); shardAdmin.createUser({user: 'admin', pwd: 'x', roles: ['clusterAdmin', 'userAdminAnyDatabase']}); diff --git a/jstests/sharding/localhostAuthBypass.js b/jstests/sharding/localhostAuthBypass.js index c2f9a8a75ad..6dd8a9d6d62 100644 --- a/jstests/sharding/localhostAuthBypass.js +++ b/jstests/sharding/localhostAuthBypass.js @@ -178,7 +178,6 @@ var setupSharding = function(shardingTest) { }; var start = function() { - // TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. return new ShardingTest({ auth: "", shards: numShards, @@ -187,7 +186,6 @@ var start = function() { chunkSize: 1, useHostname: false, // Must use localhost to take advantage of the localhost auth bypass - shardAsReplicaSet: false } }); }; @@ -208,10 +206,7 @@ var shutdown = function(st) { } for (var i = 0; i < st._connections.length; i++) { - var conn = st["shard" + i]; - MongoRunner.stopMongod(conn, - /*signal*/ false, - {auth: {user: username, pwd: password}}); + st["rs" + i].stopSet(/*signal*/ false, {auth: {user: username, pwd: password}}); } for (var i = 0; i < st._configServers.length; i++) { diff --git a/jstests/sharding/mongod_returns_no_cluster_time_without_keys.js b/jstests/sharding/mongod_returns_no_cluster_time_without_keys.js index 82bdaeed018..2665415aab5 100644 --- a/jstests/sharding/mongod_returns_no_cluster_time_without_keys.js +++ b/jstests/sharding/mongod_returns_no_cluster_time_without_keys.js @@ -15,8 +15,6 @@ TestData.disableImplicitSessions = true; load("jstests/multiVersion/libs/multi_rs.js"); -// TODO SERVER-32672: remove this flag. -TestData.skipGossipingClusterTime = true; const keyFile = 'jstests/libs/key1'; const adminUser = { db: "admin", diff --git a/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js b/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js index fa03a0310ba..226548fa88e 100644 --- a/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js +++ b/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js @@ -21,8 +21,6 @@ TestData.skipCheckingUUIDsConsistentAcrossCluster = true; // authenticates as __system and recieves clusterTime metadata then will fail trying to gossip that // time later in setup. // -// TODO SERVER-32672: remove this flag. -TestData.skipGossipingClusterTime = true; // TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. TestData.disableImplicitSessions = true; diff --git a/jstests/ssl/libs/ssl_helpers.js b/jstests/ssl/libs/ssl_helpers.js index d41fc6b7f10..b2aabd36b7d 100644 --- a/jstests/ssl/libs/ssl_helpers.js +++ b/jstests/ssl/libs/ssl_helpers.js @@ -115,7 +115,8 @@ function mixedShardTest(options1, options2, shouldSucceed) { // 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. + // TODO: SERVER-43899 Make sharding_with_x509.js and mixed_mode_sharded_transition.js start + // shards as replica sets. var st = new ShardingTest({ mongos: [options1], config: [options1], diff --git a/jstests/ssl/sharding_with_x509.js b/jstests/ssl/sharding_with_x509.js index d52d1e20d17..d00417c24f1 100644 --- a/jstests/ssl/sharding_with_x509.js +++ b/jstests/ssl/sharding_with_x509.js @@ -15,7 +15,8 @@ var x509_options = { // 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. +// TODO: SERVER-43899 Make sharding_with_x509.js and mixed_mode_sharded_transition.js start shards +// as replica sets. var st = new ShardingTest({ shards: 2, mongos: 1, diff --git a/jstests/ssl/ssl_fragment.js b/jstests/ssl/ssl_fragment.js index 4e15262e57f..e585b9ac706 100644 --- a/jstests/ssl/ssl_fragment.js +++ b/jstests/ssl/ssl_fragment.js @@ -45,17 +45,11 @@ const mongod = MongoRunner.runMongod(options); runTest(mongod); MongoRunner.stopMongod(mongod); -// TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. const st = new ShardingTest({ shards: 3, mongos: 1, config: 1, - other: { - configOptions: options, - mongosOptions: mongosOptions, - shardOptions: options, - shardAsReplicaSet: false, - } + other: {configOptions: options, mongosOptions: mongosOptions, shardOptions: options} }); runTest(st.s0); diff --git a/jstests/ssl/ssl_without_ca.js b/jstests/ssl/ssl_without_ca.js index 93658ef5ca8..cbc3aaa37f1 100644 --- a/jstests/ssl/ssl_without_ca.js +++ b/jstests/ssl/ssl_without_ca.js @@ -42,17 +42,11 @@ 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, - shardAsReplicaSet: false - } + other: {configOptions: sslParams, mongosOptions: sslParams, shardOptions: sslParams} }); }, [], "mongos started with x509 clusterAuthMode but no CA file"); diff --git a/jstests/ssl/ssl_x509_roles.js b/jstests/ssl/ssl_x509_roles.js index eb5bba46ab6..a0097bb5978 100644 --- a/jstests/ssl/ssl_x509_roles.js +++ b/jstests/ssl/ssl_x509_roles.js @@ -108,7 +108,6 @@ jsTestLog("2. Testing disabling x.509 auth with roles"); print("3. Testing x.509 auth to mongos"); { - // TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. let st = new ShardingTest({ shards: 1, mongos: 1, @@ -117,8 +116,7 @@ print("3. Testing x.509 auth to mongos"); configOptions: x509_options, mongosOptions: x509_options, shardOptions: x509_options, - useHostname: false, - shardAsReplicaSet: false + useHostname: false } }); @@ -131,7 +129,6 @@ print("4. Testing x.509 auth to mongos with x509 roles disabled"); { const localOptions = Object.merge(x509_options, {setParameter: "allowRolesFromX509Certificates=false"}); - // TODO: Remove 'shardAsReplicaSet: false' when SERVER-32672 is fixed. let st = new ShardingTest({ shards: 1, mongos: 1, @@ -140,8 +137,7 @@ print("4. Testing x.509 auth to mongos with x509 roles disabled"); configOptions: localOptions, mongosOptions: localOptions, shardOptions: localOptions, - useHostname: false, - shardAsReplicaSet: false + useHostname: false } }); diff --git a/jstests/ssl/x509_client.js b/jstests/ssl/x509_client.js index a9ec1c01dbc..595b063b1a8 100644 --- a/jstests/ssl/x509_client.js +++ b/jstests/ssl/x509_client.js @@ -100,7 +100,6 @@ 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, @@ -109,8 +108,7 @@ var st = new ShardingTest({ configOptions: x509_options, mongosOptions: x509_options, shardOptions: x509_options, - useHostname: false, - shardAsReplicaSet: false + useHostname: false } }); |