summaryrefslogtreecommitdiff
path: root/buildscripts/resmokeconfig/suites/causally_consistent_jscore_passthrough_auth.yml
blob: e09d9791c5f661c84dc30cb79b2154e3e7f95a64 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
config_variables:
- &keyFile jstests/libs/authTestsKey
- &keyFileData Thiskeyisonlyforrunningthesuitewithauthenticationdontuseitinanytestsdirectly
- &authOptions
  authenticationDatabase: admin
  authenticationMechanism: SCRAM-SHA-1
  password: *keyFileData
  username: __system

test_kind: js_test

selector:
  roots:
  - jstests/core/**/*.js
  exclude_files:
  # In MongoDB 4.0, transactions are not supported in sharded clusters.
  - jstests/core/txns/**/*.js
  # Skip any tests that run with auth explicitly.
  - jstests/core/*[aA]uth*.js
  # Skip any tests that require privileges for non test databases.
  - jstests/core/copydb.js
  - jstests/core/system_profile.js
  # The following tests fail because a certain command or functionality is not supported on
  # mongos. This command or functionality is placed in a comment next to the failing test.
  - jstests/core/apitest_db.js  # profiling.
  - jstests/core/apply_ops*.js  # applyOps, SERVER-1439.
  - jstests/core/capped_convertToCapped1.js  # cloneCollectionAsCapped.
  - jstests/core/capped_empty.js  # emptycapped.
  - jstests/core/capped_update.js # uses godinsert and can't run under replication.
  - jstests/core/check_shard_index.js  # checkShardingIndex.
  - jstests/core/collection_truncate.js  # emptycapped.
  - jstests/core/collmod_without_uuid.js # applyOps, SERVER-1439
  - jstests/core/compact_keeps_indexes.js  # compact.
  - jstests/core/currentop.js  # uses fsync.
  - jstests/core/dbadmin.js  # "local" database.
  - jstests/core/dbhash.js  # dbhash.
  - jstests/core/dbhash2.js  # dbhash.
  - jstests/core/diagdata.js # Command not supported in mongos
  - jstests/core/do_txn*.js  # doTxn
  - jstests/core/dropdb_race.js  # syncdelay.
  - jstests/core/evalb.js  # db.eval() and profiling.
  - jstests/core/fsync.js  # uses fsync.
  - jstests/core/geo_haystack*.js  # geoSearch.
  - jstests/core/geo_update_btree2.js  # notablescan.
  - jstests/core/index_bigkeys_nofail.js  # failIndexKeyTooLong.
  - jstests/core/index_bigkeys_validation.js  # failIndexKeyTooLong.
  - jstests/core/index_id_options.js  # "local" database.
  - jstests/core/index9.js  # "local" database.
  - jstests/core/profile*.js  # profiling.
  - jstests/core/queryoptimizera.js  # "local" database. 
  - jstests/core/repair_database.js # repairDatabase
  - jstests/core/repair_database_input_validation.js # repairDatabase
  - jstests/core/repair_server12955.js # repairDatabase
  - jstests/core/stages*.js  # stageDebug.
  # The following tests fail because mongos behaves differently from mongod when testing certain
  # functionality. The differences are in a comment next to the failing test.
  - jstests/core/explain_missing_database.js  # Behavior with no db different on mongos.
  - jstests/core/geo_2d_explain.js  # executionSuccess in different spot in explain().
  - jstests/core/geo_s2explain.js  # inputStage in different spot in explain().
  - jstests/core/geo_s2sparse.js  # keysPerIndex in different spot in validate().
  # TODO: SERVER-27269: mongos can't establish cursor if view has $collStats and views another view.
  - jstests/core/views/views_coll_stats.js
  - jstests/core/killop_drop_collection.js # Uses fsyncLock.
  # Tests that won't work with an injected 'majority' readConcern
  # and/or an injected 'majority' writeConcern. Where a function is
  # listed the reason is we don't have a reliable solution to override
  # the write concern for that function.
  - jstests/core/batch_write_command*.js # these tests use various write concerns
  - jstests/core/bench_test*.js # benchRun() used for writes
  - jstests/core/crud_api.js # has specific w:0 tests
  - jstests/core/error2.js # db.eval() used
  - jstests/core/eval0.js # db.eval() used
  - jstests/core/eval1.js # db.eval() used
  - jstests/core/eval3.js # db.eval() used
  - jstests/core/eval4.js # db.eval() used
  - jstests/core/eval5.js # db.eval() used
  - jstests/core/eval6.js # db.eval() used
  - jstests/core/eval7.js # db.eval() used
  - jstests/core/eval9.js # db.eval() used
  - jstests/core/evala.js # db.eval() used
  - jstests/core/evald.js # db.eval() used
  - jstests/core/evale.js # db.eval() used
  - jstests/core/evalg.js # db.eval() used
  - jstests/core/eval_mr.js # db.eval() used
  - jstests/core/eval_nolock.js # db.eval() used
  - jstests/core/js3.js # db.dbEval() used
  - jstests/core/js7.js # db.eval() used
  - jstests/core/js9.js # db.eval() used
  - jstests/core/mr_merge.js # mr temp tables aren't replicated
  - jstests/core/mr_merge2.js # mr temp tables aren't replicated
  - jstests/core/mr_outreduce.js # mr temp tables aren't replicated
  - jstests/core/mr_outreduce2.js # mr temp tables aren't replicated
  - jstests/core/opcounters_active.js  # off by n problem with opcounters
  - jstests/core/opcounters_write_cmd.js # off by n problem with opcounters
  - jstests/core/read_after_optime.js # verifies read after optime fails on standalone
  - jstests/core/remove8.js # db.eval() used
  - jstests/core/rename4.js # db.eval() used
  - jstests/core/shell1.js # tests setSlaveOk() variations on standalone mongod
  - jstests/core/shellkillop.js # db.eval() used
  - jstests/core/shell_writeconcern.js # checks write concern shell helpers
  - jstests/core/storefunc.js # db.eval() used
  - jstests/core/write_result.js # Tests invalid writeConcern, we shouldn't override.
  # Tests that need triaging & remediation | blacklist decision
  # Comments list possible problem point under review.
  - jstests/core/stages_delete.js # Uses stageDebug command for deletes.
  # Tests that fail for Causal Consistency as they have statements that do not support
  # non-local read concern.
  - jstests/core/geo_mapreduce.js
  - jstests/core/geo_mapreduce2.js
  - jstests/core/geo_big_polygon3.js
  - jstests/core/mr*.js
  - jstests/core/profile_mapreduce.js
  - jstests/core/collation.js
  - jstests/core/loadserverscripts.js
  - jstests/core/bypass_doc_validation.js
  - jstests/core/capped_max1.js
  - jstests/core/commands_namespace_parsing.js
  - jstests/core/tailable_cursor_invalidation.js
  - jstests/core/tailable_getmore_batch_size.js
  - jstests/core/tailable_skip_limit.js
  - jstests/core/constructors.js
  - jstests/core/views/views_all_commands.js
  - jstests/core/or4.js
  - jstests/core/recursion.js
  - jstests/core/temp_cleanup.js
  # An index drop does not necessarily cause cursors to be killed on the secondary.
  - jstests/core/ord.js
  # Parallel shell is not causally consistent
  - jstests/core/cursora.js
  - jstests/core/find_and_modify_concurrent_update.js
  - jstests/core/shellstartparallel.js
  # TODO SERVER-30466
  - jstests/core/explain_multi_plan.js
  - jstests/core/explain_shell_helpers.js
  - jstests/core/index_partial_read_ops.js
  - jstests/core/update_arrayFilters.js
  # TODO: SERVER-30488
  - jstests/core/apitest_dbcollection.js 
  - jstests/core/getmore_invalidated_cursors.js
  - jstests/core/orf.js #explain.executionStats is not CC
  - jstests/core/rename7.js
  # getMore is not causally consistent if collection is dropped
  - jstests/core/drop3.js
  # Logical sessions require that only one user be authenticated,
  # but this suite puts us in a multi-auth state.
  - jstests/core/list_all_local_cursors.js # Too many users authenticated
  - jstests/core/list_all_sessions.js # Too many users authenticated
  - jstests/core/list_sessions.js # Too many users authenticated
  # The following tests fail because of divergent dropCollection behavior between standalones and 
  # sharded clusters. These tests expect a second drop command to error, whereas in sharded clusters
  # we expect a second drop to return status OK. 
  - jstests/core/drop.js
  - jstests/core/explain_upsert.js
  # The `dbstats` command builds in-memory structures that are not causally consistent.
  - jstests/core/dbstats.js
  # TODO SERVER-33248: Remove this test from the blacklist. The secondary can get stuck without a
  # sync source if the RestartCatalog command kills its oplog fetching cursor, which blocks
  # secondary majority reads.
  - jstests/core/restart_catalog.js

  # These include operations the root user auth'd on the test database is not authorized to perform,
  # e.g. dropping or creating system collections.
  - jstests/core/cannot_create_system_dot_indexes.js
  - jstests/core/list_collections_no_views.js
  - jstests/core/rename8.js
  - jstests/core/views/duplicate_ns.js
  - jstests/core/views/invalid_system_views.js
  - jstests/core/views/views_creation.js
  - jstests/core/views/views_drop.js
  - jstests/core/views/views_rename.js
  exclude_with_any_tags:
  - assumes_against_mongod_not_mongos
  ##
  # The next tag corresponds to the special error thrown by the set_read_preference_secondary.js
  # override when it refuses to replace the readPreference of a particular command. Above each tag
  # are the message(s) that cause the tag to be warranted.
  ##
  # "Cowardly refusing to override read preference of command: ..."
  # "Cowardly refusing to run test with overridden read preference when it reads from a
  #  non-replicated collection: ..."
  - assumes_read_preference_unchanged
  # TODO SERVER-35447: Multiple users cannot be authenticated on one connection within a session.
  - creates_and_authenticates_user
  - requires_collstats
  # This suite runs as the root user, but eval requires universal privileges with authentication on.
  - requires_eval_command

executor:
  archive:
    hooks:
      - CheckReplDBHash
      - ValidateCollections
  config:
    shell_options:
      global_vars:
        TestData: &TestData
          auth: true
          authMechanism: SCRAM-SHA-1
          keyFile: *keyFile
          keyFileData: *keyFileData
      eval: |
        jsTest.authenticate(db.getMongo());
        (function() {
          const username = "misha";
          const password = "pwd";

          const res = db.runCommand({
              createUser: username,
              pwd: password,
              roles: [{role: "root", db: jsTest.options().authenticationDatabase}]
          });

          if (res.ok === 1) {
              assert.commandWorked(res);
          } else {
              // If 'username' already exists, then attempts to create a user with the same name
              // will fail with a duplicate key error.
              assert.commandFailedWithCode(res, ErrorCodes.DuplicateKey);
          }

          // Log out as the __system user and auth as the newly created user.
          db.getSiblingDB(jsTest.options().authenticationDatabase).logout();
          db.auth(username, password);
        })();
        load("jstests/libs/override_methods/enable_causal_consistency.js");
      <<: *authOptions
      readMode: commands
  hooks:
  - class: CheckReplDBHash
    shell_options:
      global_vars:
        TestData: *TestData
        eval: jsTest.authenticate(db.getMongo())
      <<: *authOptions
  - class: ValidateCollections
    shell_options:
      global_vars:
        TestData: *TestData
        eval: jsTest.authenticate(db.getMongo())
      <<: *authOptions
  - class: CleanEveryN
    n: 20
  fixture:
    class: ShardedClusterFixture
    mongos_options:
      keyFile: *keyFile
      set_parameters:
        enableTestCommands: 1
        logComponentVerbosity:
          verbosity: 0
          command: 1
          network:
            verbosity: 1
            asio: 2
          tracking: 0
    mongod_options:
      nopreallocj: ''
      enableMajorityReadConcern: ''
      auth: ''
      keyFile: *keyFile
      set_parameters:
        enableTestCommands: 1
        enableLocalhostAuthBypass: false
        logComponentVerbosity:
          verbosity: 0
          command: 1
          network:
            verbosity: 1
            asio: 2
          replication:
            heartbeats: 2
          tracking: 0
        numInitialSyncAttempts: 1
    num_rs_nodes_per_shard: 2
    # TODO SERVER-32572 remove voting_secondaries: true
    shard_options:
      voting_secondaries: true
    enable_sharding:
    - test
    auth_options: *authOptions