diff options
author | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-05-18 17:34:06 -0400 |
---|---|---|
committer | Jack Mulrow <jack.mulrow@mongodb.com> | 2018-09-27 22:51:17 -0400 |
commit | 2e98a18d2122a30549e089bf30b96ac0c3bbf85d (patch) | |
tree | 716ac83efa19cdc60810d1f200cc4047f3627547 /jstests/sharding | |
parent | 241515814f8bd5dbc7ad3a0682dd531a965537cb (diff) | |
download | mongo-2e98a18d2122a30549e089bf30b96ac0c3bbf85d.tar.gz |
SERVER-32064 Requests from the shell should use an implicit session by default
(cherry picked from commit 8817328f87564a29e9be2ed1a746cf40e89587eb)
SERVER-32064 Disable implicit sessions when checking db version during connect()
(cherry picked from commit 8c5002b06fd737f75941a73785ce75e3ca7f5ce1)
Diffstat (limited to 'jstests/sharding')
-rw-r--r-- | jstests/sharding/advance_cluster_time_action_type.js | 4 | ||||
-rw-r--r-- | jstests/sharding/authCommands.js | 3 | ||||
-rw-r--r-- | jstests/sharding/auth_repl.js | 3 | ||||
-rw-r--r-- | jstests/sharding/cleanup_orphaned_auth.js | 3 | ||||
-rw-r--r-- | jstests/sharding/commands_that_write_accept_wc_configRS.js | 4 | ||||
-rw-r--r-- | jstests/sharding/kill_sessions.js | 4 | ||||
-rw-r--r-- | jstests/sharding/mongod_returns_no_cluster_time_without_keys.js | 7 | ||||
-rw-r--r-- | jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js | 3 | ||||
-rw-r--r-- | jstests/sharding/mrShardedOutputAuth.js | 3 | ||||
-rw-r--r-- | jstests/sharding/refresh_sessions.js | 3 | ||||
-rw-r--r-- | jstests/sharding/sessions_collection_auto_healing.js | 4 | ||||
-rw-r--r-- | jstests/sharding/sharding_options.js | 3 |
12 files changed, 44 insertions, 0 deletions
diff --git a/jstests/sharding/advance_cluster_time_action_type.js b/jstests/sharding/advance_cluster_time_action_type.js index d01357ec338..87679080b2d 100644 --- a/jstests/sharding/advance_cluster_time_action_type.js +++ b/jstests/sharding/advance_cluster_time_action_type.js @@ -5,8 +5,12 @@ (function() { "use strict"; + // TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. + TestData.disableImplicitSessions = true; + let st = new ShardingTest( {mongos: 1, config: 1, shards: 1, keyFile: 'jstests/libs/key1', mongosWaitsForKeys: true}); + let adminDB = st.s.getDB('admin'); assert.commandWorked(adminDB.runCommand({createUser: "admin", pwd: "admin", roles: ["root"]})); diff --git a/jstests/sharding/authCommands.js b/jstests/sharding/authCommands.js index 497a5748466..1ff86edb039 100644 --- a/jstests/sharding/authCommands.js +++ b/jstests/sharding/authCommands.js @@ -4,6 +4,9 @@ (function() { 'use strict'; + // TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. + TestData.disableImplicitSessions = true; + load("jstests/replsets/rslib.js"); var st = new ShardingTest({ diff --git a/jstests/sharding/auth_repl.js b/jstests/sharding/auth_repl.js index 9e1ddb06873..0c8e976bd48 100644 --- a/jstests/sharding/auth_repl.js +++ b/jstests/sharding/auth_repl.js @@ -1,3 +1,6 @@ +// TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. +TestData.disableImplicitSessions = true; + var replTest = new ReplSetTest({nodes: 3, useHostName: false, keyFile: 'jstests/libs/key1'}); replTest.startSet({oplogSize: 10}); replTest.initiate(); diff --git a/jstests/sharding/cleanup_orphaned_auth.js b/jstests/sharding/cleanup_orphaned_auth.js index 834ad613a38..941dafcd44d 100644 --- a/jstests/sharding/cleanup_orphaned_auth.js +++ b/jstests/sharding/cleanup_orphaned_auth.js @@ -5,6 +5,9 @@ (function() { 'use strict'; + // TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. + TestData.disableImplicitSessions = true; + function assertUnauthorized(res, msg) { if (assert._debug && msg) print("in assert for: " + msg); diff --git a/jstests/sharding/commands_that_write_accept_wc_configRS.js b/jstests/sharding/commands_that_write_accept_wc_configRS.js index 06326fa7403..ea864435604 100644 --- a/jstests/sharding/commands_that_write_accept_wc_configRS.js +++ b/jstests/sharding/commands_that_write_accept_wc_configRS.js @@ -17,6 +17,10 @@ load('jstests/multiVersion/libs/auth_helpers.js'); (function() { "use strict"; + + // TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. + TestData.disableImplicitSessions = true; + var st = new ShardingTest({ shards: { rs0: {nodes: 3, settings: {chainingAllowed: false}}, diff --git a/jstests/sharding/kill_sessions.js b/jstests/sharding/kill_sessions.js index 2757ef8935d..2af0a6a0658 100644 --- a/jstests/sharding/kill_sessions.js +++ b/jstests/sharding/kill_sessions.js @@ -3,6 +3,10 @@ load("jstests/libs/kill_sessions.js"); (function() { 'use strict'; + // TODO SERVER-35447: This test involves killing all sessions, which will not work as expected + // if the kill command is sent with an implicit session. + TestData.disableImplicitSessions = true; + function runTests(needAuth) { var other = { rs: true, 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 3c9cf3e6af7..eab329791dd 100644 --- a/jstests/sharding/mongod_returns_no_cluster_time_without_keys.js +++ b/jstests/sharding/mongod_returns_no_cluster_time_without_keys.js @@ -8,6 +8,10 @@ (function() { "use strict"; + // This test uses authentication and runs commands without authenticating, which is not + // compatible with implicit sessions. + TestData.disableImplicitSessions = true; + load("jstests/multiVersion/libs/multi_rs.js"); // TODO SERVER-32672: remove this flag. @@ -48,6 +52,7 @@ priRSConn.auth(rUser.username, rUser.password); const resWithKeys = priRSConn.runCommand({isMaster: 1}); assertContainsValidLogicalTime(resWithKeys); + priRSConn.logout(); // Enable the failpoint, remove all keys, and restart the config servers with the failpoint // still enabled to guarantee there are no keys. @@ -62,6 +67,7 @@ }); assert(adminDB.system.keys.count() == 0, "expected there to be no keys on the config server"); + adminDB.logout(); st.configRS.stopSet(null /* signal */, true /* forRestart */); st.configRS.startSet( @@ -74,6 +80,7 @@ priRSConn.auth(rUser.username, rUser.password); const resNoKeys = priRSConn.runCommand({isMaster: 1}); assert.commandWorked(resNoKeys); + priRSConn.logout(); assert.eq(resNoKeys.hasOwnProperty("$clusterTime"), false); assert.eq(resNoKeys.hasOwnProperty("operationTime"), false); diff --git a/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js b/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js index a5ae6c62aa6..b8e4e02a279 100644 --- a/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js +++ b/jstests/sharding/mongos_rs_auth_shard_failure_tolerance.js @@ -15,6 +15,9 @@ // shard does not have a primary. TestData.skipCheckingUUIDsConsistentAcrossCluster = true; +// TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. +TestData.disableImplicitSessions = true; + var options = {rs: true, rsOptions: {nodes: 2}, keyFile: "jstests/libs/key1"}; var st = new ShardingTest({shards: 3, mongos: 1, other: options}); diff --git a/jstests/sharding/mrShardedOutputAuth.js b/jstests/sharding/mrShardedOutputAuth.js index 93164e5e128..63b36a39f4d 100644 --- a/jstests/sharding/mrShardedOutputAuth.js +++ b/jstests/sharding/mrShardedOutputAuth.js @@ -6,6 +6,9 @@ (function() { + // TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. + TestData.disableImplicitSessions = true; + function doMapReduce(connection, outputDb) { // clean output db and run m/r outputDb.numbers_out.drop(); diff --git a/jstests/sharding/refresh_sessions.js b/jstests/sharding/refresh_sessions.js index 8199ffb4563..ee4ee125db3 100644 --- a/jstests/sharding/refresh_sessions.js +++ b/jstests/sharding/refresh_sessions.js @@ -1,6 +1,9 @@ (function() { "use strict"; + // This test makes assumptions about the number of logical sessions. + TestData.disableImplicitSessions = true; + var sessionsDb = "config"; var refresh = {refreshLogicalSessionCacheNow: 1}; var startSession = {startSession: 1}; diff --git a/jstests/sharding/sessions_collection_auto_healing.js b/jstests/sharding/sessions_collection_auto_healing.js index 5dcf6d66590..61271bd8dc5 100644 --- a/jstests/sharding/sessions_collection_auto_healing.js +++ b/jstests/sharding/sessions_collection_auto_healing.js @@ -3,6 +3,10 @@ load('jstests/libs/sessions_collection.js'); (function() { "use strict"; + // This test makes assertions about the number of sessions, which are not compatible with + // implicit sessions. + TestData.disableImplicitSessions = true; + var st = new ShardingTest({shards: 0}); var configSvr = st.configRS.getPrimary(); var configAdmin = configSvr.getDB("admin"); diff --git a/jstests/sharding/sharding_options.js b/jstests/sharding/sharding_options.js index 8af7bf01c53..190d78a1e94 100644 --- a/jstests/sharding/sharding_options.js +++ b/jstests/sharding/sharding_options.js @@ -1,3 +1,6 @@ +// TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session. +TestData.disableImplicitSessions = true; + var baseName = "jstests_sharding_sharding_options"; load('jstests/libs/command_line/test_parsed_options.js'); |