mongo 2.19.3 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Rakefile +27 -154
- data/lib/mongo/cluster/topology/base.rb +16 -0
- data/lib/mongo/cluster.rb +27 -1
- data/lib/mongo/collection/view/iterable.rb +1 -0
- data/lib/mongo/collection.rb +4 -2
- data/lib/mongo/error/transactions_not_supported.rb +34 -0
- data/lib/mongo/error.rb +1 -0
- data/lib/mongo/grid/fs_bucket.rb +6 -0
- data/lib/mongo/monitoring/event/secure.rb +1 -1
- data/lib/mongo/operation/shared/executable.rb +43 -27
- data/lib/mongo/operation/shared/response_handling.rb +23 -25
- data/lib/mongo/retryable/read_worker.rb +7 -6
- data/lib/mongo/retryable/write_worker.rb +7 -4
- data/lib/mongo/retryable.rb +2 -2
- data/lib/mongo/server/app_metadata/environment.rb +64 -9
- data/lib/mongo/server/app_metadata.rb +5 -4
- data/lib/mongo/server/description/features.rb +1 -0
- data/lib/mongo/server_selector/base.rb +32 -6
- data/lib/mongo/session/server_session/dirtyable.rb +52 -0
- data/lib/mongo/session/server_session.rb +3 -0
- data/lib/mongo/session/session_pool.rb +12 -18
- data/lib/mongo/session.rb +32 -0
- data/lib/mongo/uri.rb +0 -4
- data/lib/mongo/version.rb +1 -1
- data/mongo.gemspec +1 -7
- data/spec/atlas/atlas_connectivity_spec.rb +4 -4
- data/spec/faas/ruby-sam-app/Gemfile +9 -0
- data/spec/faas/ruby-sam-app/mongodb/Gemfile +4 -0
- data/spec/faas/ruby-sam-app/mongodb/app.rb +149 -0
- data/spec/faas/ruby-sam-app/template.yaml +48 -0
- data/spec/integration/client_side_encryption/corpus_spec.rb +10 -2
- data/spec/integration/retryable_reads_errors_spec.rb +161 -8
- data/spec/integration/retryable_writes_errors_spec.rb +156 -0
- data/spec/mongo/cluster_spec.rb +36 -0
- data/spec/mongo/collection/view/aggregation_spec.rb +6 -1
- data/spec/mongo/collection/view/explainable_spec.rb +2 -0
- data/spec/mongo/collection_crud_spec.rb +1 -1
- data/spec/mongo/operation/insert_spec.rb +1 -1
- data/spec/mongo/retryable/write_worker_spec.rb +39 -0
- data/spec/mongo/server/app_metadata/environment_spec.rb +135 -0
- data/spec/mongo/server/app_metadata_spec.rb +12 -2
- data/spec/mongo/server/connection_spec.rb +4 -0
- data/spec/mongo/session/session_pool_spec.rb +1 -16
- data/spec/mongo/session_transaction_spec.rb +15 -0
- data/spec/mongo/uri_spec.rb +0 -9
- data/spec/runners/crud/test.rb +0 -8
- data/spec/runners/crud.rb +1 -1
- data/spec/runners/transactions/test.rb +12 -3
- data/spec/runners/unified/assertions.rb +16 -3
- data/spec/runners/unified/crud_operations.rb +12 -0
- data/spec/runners/unified/support_operations.rb +3 -5
- data/spec/runners/unified/test.rb +8 -1
- data/spec/shared/lib/mrss/docker_runner.rb +3 -0
- data/spec/shared/share/Dockerfile.erb +20 -69
- data/spec/shared/shlib/server.sh +1 -0
- data/spec/shared/shlib/set_env.sh +5 -28
- data/spec/spec_tests/data/client_side_encryption/explain.yml +2 -2
- data/spec/spec_tests/data/connection_string/invalid-uris.yml +0 -10
- data/spec/spec_tests/data/connection_string/valid-options.yml +13 -0
- data/spec/spec_tests/data/crud_unified/find-test-all-options.yml +348 -0
- data/spec/spec_tests/data/index_management/createSearchIndex.yml +5 -3
- data/spec/spec_tests/data/index_management/createSearchIndexes.yml +7 -4
- data/spec/spec_tests/data/index_management/dropSearchIndex.yml +2 -1
- data/spec/spec_tests/data/index_management/listSearchIndexes.yml +13 -7
- data/spec/spec_tests/data/index_management/updateSearchIndex.yml +2 -1
- data/spec/spec_tests/data/retryable_writes/unified/bulkWrite-serverErrors.yml +3 -6
- data/spec/spec_tests/data/retryable_writes/unified/insertOne-serverErrors.yml +3 -6
- data/spec/spec_tests/data/run_command_unified/runCommand.yml +319 -0
- data/spec/spec_tests/data/sessions_unified/driver-sessions-dirty-session-errors.yml +351 -0
- data/spec/spec_tests/data/unified/valid-pass/poc-crud.yml +1 -1
- data/spec/spec_tests/data/unified/valid-pass/poc-retryable-writes.yml +7 -7
- data/spec/spec_tests/data/unified/valid-pass/poc-sessions.yml +3 -4
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-convenient-api.yml +1 -1
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions-mongos-pin-auto.yml +1 -1
- data/spec/spec_tests/data/unified/valid-pass/poc-transactions.yml +3 -3
- data/spec/spec_tests/run_command_unified_spec.rb +13 -0
- data/spec/spec_tests/sdam_unified_spec.rb +2 -0
- data/spec/support/constraints.rb +6 -0
- data/spec/support/ocsp +1 -1
- data/spec/support/recording_logger.rb +27 -0
- data.tar.gz.sig +0 -0
- metadata +1272 -1253
- metadata.gz.sig +0 -0
- data/spec/spec_tests/data/cmap/pool-clear-interrupt-immediately.yml +0 -49
@@ -17,21 +17,6 @@ describe Mongo::Session::SessionPool do
|
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
describe '.create' do
|
21
|
-
|
22
|
-
let!(:pool) do
|
23
|
-
described_class.create(cluster)
|
24
|
-
end
|
25
|
-
|
26
|
-
it 'creates a session pool' do
|
27
|
-
expect(pool).to be_a(Mongo::Session::SessionPool)
|
28
|
-
end
|
29
|
-
|
30
|
-
it 'adds the pool as an instance variable on the cluster' do
|
31
|
-
expect(cluster.session_pool).to eq(pool)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
20
|
describe '#initialize' do
|
36
21
|
|
37
22
|
let(:pool) do
|
@@ -181,7 +166,7 @@ describe Mongo::Session::SessionPool do
|
|
181
166
|
describe '#end_sessions' do
|
182
167
|
|
183
168
|
let(:pool) do
|
184
|
-
|
169
|
+
client.cluster.session_pool
|
185
170
|
end
|
186
171
|
|
187
172
|
let!(:session_a) do
|
@@ -26,6 +26,17 @@ describe Mongo::Session do
|
|
26
26
|
collection.delete_many
|
27
27
|
end
|
28
28
|
|
29
|
+
describe 'start_transaction' do
|
30
|
+
context 'when topology is sharded and server is < 4.2' do
|
31
|
+
max_server_fcv '4.1'
|
32
|
+
require_topology :sharded
|
33
|
+
|
34
|
+
it 'raises an error' do
|
35
|
+
expect { session.start_transaction }.to raise_error(Mongo::Error::TransactionsNotSupported, /sharded transactions require server version/)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
29
40
|
describe '#abort_transaction' do
|
30
41
|
require_topology :replica_set
|
31
42
|
|
@@ -75,6 +86,8 @@ describe Mongo::Session do
|
|
75
86
|
end
|
76
87
|
|
77
88
|
describe '#with_transaction' do
|
89
|
+
require_topology :replica_set
|
90
|
+
|
78
91
|
context 'callback successful' do
|
79
92
|
it 'commits' do
|
80
93
|
session.with_transaction do
|
@@ -123,6 +136,7 @@ describe Mongo::Session do
|
|
123
136
|
expect(Mongo::Utils).to receive(:monotonic_time).ordered.and_return(start + 1)
|
124
137
|
expect(Mongo::Utils).to receive(:monotonic_time).ordered.and_return(start + 2)
|
125
138
|
expect(Mongo::Utils).to receive(:monotonic_time).ordered.and_return(start + 200)
|
139
|
+
allow(session).to receive('check_transactions_supported!').and_return true
|
126
140
|
|
127
141
|
expect do
|
128
142
|
session.with_transaction do
|
@@ -156,6 +170,7 @@ describe Mongo::Session do
|
|
156
170
|
expect(Mongo::Utils).to receive(:monotonic_time).ordered.and_return(start + i)
|
157
171
|
end
|
158
172
|
expect(Mongo::Utils).to receive(:monotonic_time).ordered.and_return(start + 200)
|
173
|
+
allow(session).to receive('check_transactions_supported!').and_return true
|
159
174
|
|
160
175
|
exc = Mongo::Error::OperationFailure.new('timeout test')
|
161
176
|
exc.add_label(label)
|
data/spec/mongo/uri_spec.rb
CHANGED
@@ -266,15 +266,6 @@ describe Mongo::URI do
|
|
266
266
|
end
|
267
267
|
end
|
268
268
|
|
269
|
-
context 'no slash after hosts, and options' do
|
270
|
-
|
271
|
-
let(:string) { 'mongodb://example.com?tls=true' }
|
272
|
-
|
273
|
-
it 'raises an error' do
|
274
|
-
expect { uri }.to raise_error(Mongo::Error::InvalidURI, %r,MongoDB URI must have a slash \(/\) after the hosts if options are given,)
|
275
|
-
end
|
276
|
-
end
|
277
|
-
|
278
269
|
context 'mongodb://example.com/?w' do
|
279
270
|
|
280
271
|
let(:string) { 'mongodb://example.com/?w' }
|
data/spec/runners/crud/test.rb
CHANGED
@@ -110,14 +110,6 @@ module Mongo
|
|
110
110
|
end
|
111
111
|
setup_fail_point(client)
|
112
112
|
end
|
113
|
-
|
114
|
-
def actual_collection_contents(client)
|
115
|
-
unless @spec.collection_name
|
116
|
-
raise ArgumentError, 'Spec does not specify a global collection'
|
117
|
-
end
|
118
|
-
|
119
|
-
client[@spec.collection_name, read_concern: {level: :majority}].find.to_a
|
120
|
-
end
|
121
113
|
end
|
122
114
|
end
|
123
115
|
end
|
data/spec/runners/crud.rb
CHANGED
@@ -26,7 +26,7 @@ require 'runners/crud/operation'
|
|
26
26
|
require 'runners/crud/verifier'
|
27
27
|
|
28
28
|
def collection_data(collection)
|
29
|
-
collection.find.to_a
|
29
|
+
collection.find.sort(_id: 1).to_a
|
30
30
|
end
|
31
31
|
|
32
32
|
def crud_execute_operations(spec, test, num_ops, event_subscriber, expect_error,
|
@@ -132,7 +132,6 @@ module Mongo
|
|
132
132
|
@test_client ||= begin
|
133
133
|
sdam_proc = lambda do |test_client|
|
134
134
|
test_client.subscribe(Mongo::Monitoring::COMMAND, command_subscriber)
|
135
|
-
|
136
135
|
test_client.subscribe(Mongo::Monitoring::TOPOLOGY_OPENING, sdam_subscriber)
|
137
136
|
test_client.subscribe(Mongo::Monitoring::SERVER_OPENING, sdam_subscriber)
|
138
137
|
test_client.subscribe(Mongo::Monitoring::SERVER_DESCRIPTION_CHANGED, sdam_subscriber)
|
@@ -321,6 +320,9 @@ module Mongo
|
|
321
320
|
# without auto_encryption_options for querying results.
|
322
321
|
result_collection_name = outcome&.collection_name || @spec.collection_name
|
323
322
|
@result_collection = support_client.use(@spec.database_name)[result_collection_name]
|
323
|
+
|
324
|
+
# DRIVERS-2816, adjusted for legacy spec runner
|
325
|
+
@cluster_time = support_client.command(ping: 1).cluster_time
|
324
326
|
end
|
325
327
|
|
326
328
|
def teardown_test
|
@@ -358,12 +360,19 @@ module Mongo
|
|
358
360
|
end
|
359
361
|
end
|
360
362
|
|
363
|
+
def new_session(options)
|
364
|
+
test_client.start_session(options || {}).tap do |s|
|
365
|
+
# DRIVERS-2816, adjusted for legacy spec runner
|
366
|
+
s.advance_cluster_time(@cluster_time)
|
367
|
+
end
|
368
|
+
end
|
369
|
+
|
361
370
|
def session0
|
362
|
-
@session0 ||=
|
371
|
+
@session0 ||= new_session(@session_options[:session0])
|
363
372
|
end
|
364
373
|
|
365
374
|
def session1
|
366
|
-
@session1 ||=
|
375
|
+
@session1 ||= new_session(@session_options[:session1])
|
367
376
|
end
|
368
377
|
end
|
369
378
|
end
|
@@ -251,11 +251,11 @@ module Unified
|
|
251
251
|
end
|
252
252
|
when Hash
|
253
253
|
if expected.keys == %w($$unsetOrMatches) && expected.values.first.keys == %w(insertedId)
|
254
|
-
actual_v = actual
|
254
|
+
actual_v = get_actual_value(actual, 'inserted_id')
|
255
255
|
expected_v = expected.values.first.values.first
|
256
256
|
assert_value_matches(actual_v, expected_v, 'inserted_id')
|
257
257
|
elsif expected.keys == %w(insertedId)
|
258
|
-
actual_v = actual
|
258
|
+
actual_v = get_actual_value(actual, 'inserted_id')
|
259
259
|
expected_v = expected.values.first
|
260
260
|
assert_value_matches(actual_v, expected_v, 'inserted_id')
|
261
261
|
else
|
@@ -270,7 +270,7 @@ module Unified
|
|
270
270
|
if k.start_with?('$$')
|
271
271
|
assert_value_matches(actual, expected, k)
|
272
272
|
else
|
273
|
-
actual_v = actual
|
273
|
+
actual_v = get_actual_value(actual, k)
|
274
274
|
if Hash === expected_v && expected_v.length == 1 && expected_v.keys.first.start_with?('$$')
|
275
275
|
assert_value_matches(actual_v, expected_v, k)
|
276
276
|
else
|
@@ -290,6 +290,19 @@ module Unified
|
|
290
290
|
end
|
291
291
|
end
|
292
292
|
|
293
|
+
# The actual value may be of different types depending on the operation.
|
294
|
+
# In order to avoid having to write a lot of code to handle the different
|
295
|
+
# types, we use this method to get the actual value.
|
296
|
+
def get_actual_value(actual, key)
|
297
|
+
if Hash === actual
|
298
|
+
actual[key]
|
299
|
+
elsif Mongo::Operation::Result === actual && !actual.respond_to?(key.to_sym)
|
300
|
+
actual.documents.first[key]
|
301
|
+
else
|
302
|
+
actual.send(key)
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
293
306
|
def assert_type(object, type)
|
294
307
|
ok = [*type].reduce(false) { |acc, x| acc || type_matches?(object, x) }
|
295
308
|
|
@@ -32,6 +32,18 @@ module Unified
|
|
32
32
|
if session = args.use('session')
|
33
33
|
opts[:session] = entities.get(:session, session)
|
34
34
|
end
|
35
|
+
if collation = args.use('collation')
|
36
|
+
opts[:collation] = collation
|
37
|
+
end
|
38
|
+
if args.key?('noCursorTimeout')
|
39
|
+
opts[:no_cursor_timeout] = args.use('noCursorTimeout')
|
40
|
+
end
|
41
|
+
if args.key?('oplogReplay')
|
42
|
+
opts[:oplog_replay] = args.use('oplogReplay')
|
43
|
+
end
|
44
|
+
if args.key?('allowPartialResults')
|
45
|
+
opts[:allow_partial_results] = args.use('allowPartialResults')
|
46
|
+
end
|
35
47
|
req = collection.find(args.use!('filter'), **opts)
|
36
48
|
if batch_size = args.use('batchSize')
|
37
49
|
req = req.batch_size(batch_size)
|
@@ -70,8 +70,7 @@ module Unified
|
|
70
70
|
consume_test_runner(op)
|
71
71
|
use_arguments(op) do |args|
|
72
72
|
session = entities.get(:session, args.use!('session'))
|
73
|
-
|
74
|
-
true
|
73
|
+
session.dirty? || raise(Error::ResultMismatch, 'expected session to be dirty')
|
75
74
|
end
|
76
75
|
end
|
77
76
|
|
@@ -79,8 +78,7 @@ module Unified
|
|
79
78
|
consume_test_runner(op)
|
80
79
|
use_arguments(op) do |args|
|
81
80
|
session = entities.get(:session, args.use!('session'))
|
82
|
-
|
83
|
-
true
|
81
|
+
session.dirty? && raise(Error::ResultMismatch, 'expected session to be not dirty')
|
84
82
|
end
|
85
83
|
end
|
86
84
|
|
@@ -92,7 +90,7 @@ module Unified
|
|
92
90
|
unless subscriber.started_events.length >= 2
|
93
91
|
raise Error::ResultMismatch, "Must have at least 2 events, have #{subscriber.started_events.length}"
|
94
92
|
end
|
95
|
-
lsids = subscriber.started_events[-2
|
93
|
+
lsids = subscriber.started_events[-2..-1].map do |cmd|
|
96
94
|
cmd.command.fetch('lsid')
|
97
95
|
end
|
98
96
|
if expected
|
@@ -227,7 +227,9 @@ module Unified
|
|
227
227
|
opts = {}
|
228
228
|
end
|
229
229
|
|
230
|
-
client.start_session(**opts)
|
230
|
+
client.start_session(**opts).tap do |session|
|
231
|
+
session.advance_cluster_time(@cluster_time)
|
232
|
+
end
|
231
233
|
when 'clientEncryption'
|
232
234
|
client_encryption_opts = spec.use!('clientEncryptionOpts')
|
233
235
|
key_vault_client = entities.get(:client, client_encryption_opts['keyVaultClient'])
|
@@ -342,6 +344,11 @@ module Unified
|
|
342
344
|
raise NotImplementedError, "Unhandled spec keys: #{spec}"
|
343
345
|
end
|
344
346
|
end
|
347
|
+
|
348
|
+
# the cluster time is used to advance the cluster time of any
|
349
|
+
# sessions created during this test.
|
350
|
+
# -> see DRIVERS-2816
|
351
|
+
@cluster_time = root_authorized_client.command(ping: 1).cluster_time
|
345
352
|
end
|
346
353
|
|
347
354
|
def run
|
@@ -195,12 +195,15 @@ module Mrss
|
|
195
195
|
'debian81' => 'debian:jessie',
|
196
196
|
'debian92' => 'debian:stretch',
|
197
197
|
'debian10' => 'debian:buster',
|
198
|
+
'debian11' => 'debian:bullseye',
|
198
199
|
'ubuntu1404' => 'ubuntu:trusty',
|
199
200
|
'ubuntu1604' => 'ubuntu:xenial',
|
200
201
|
'ubuntu1804' => 'ubuntu:bionic',
|
201
202
|
'ubuntu2004' => 'ubuntu:focal',
|
203
|
+
'ubuntu2204' => 'ubuntu:jammy',
|
202
204
|
'rhel62' => 'centos:6',
|
203
205
|
'rhel70' => 'centos:7',
|
206
|
+
'rhel80' => 'rockylinux:8',
|
204
207
|
}.freeze
|
205
208
|
|
206
209
|
def base_image
|
@@ -13,7 +13,7 @@ server_archive_basename = File.basename(server_url)
|
|
13
13
|
server_extracted_dir = server_archive_basename.sub(/\.(tar\.gz|tgz)$/, '')
|
14
14
|
|
15
15
|
# When changing, also update the hash in shlib/set_env.sh.
|
16
|
-
TOOLCHAIN_VERSION='
|
16
|
+
TOOLCHAIN_VERSION='ded7ea845b08cf96f11a747d9540ba3199580dea'
|
17
17
|
|
18
18
|
def ruby_toolchain_url(ruby)
|
19
19
|
"http://boxes.10gen.com/build/toolchain-drivers/mongo-ruby-driver/#{TOOLCHAIN_VERSION}/#{distro}/#{ruby}.tar.xz"
|
@@ -56,7 +56,7 @@ ENV DOCKER=1
|
|
56
56
|
# Ruby runtime dependencies: libyaml-0-2
|
57
57
|
# Compiling ruby libraries: gcc make
|
58
58
|
# Compiling python packages: python3-dev
|
59
|
-
# JRuby: openjdk-
|
59
|
+
# JRuby: openjdk-17-jdk-headless
|
60
60
|
# Server dependencies: libsnmp30 libcurl3/libcurl4
|
61
61
|
# Determining OS we are running on: lsb-release
|
62
62
|
# Load balancer testing: haproxy
|
@@ -78,45 +78,32 @@ ENV DOCKER=1
|
|
78
78
|
|
79
79
|
<% packages = %w(
|
80
80
|
procps lsb-release bzip2 curl wget gpg zsh
|
81
|
-
git make gcc libyaml-
|
81
|
+
git make gcc g++ libyaml-dev libgmp-dev zlib1g-dev libsnappy-dev
|
82
82
|
krb5-user krb5-kdc krb5-admin-server libsasl2-dev libsasl2-modules-gssapi-mit
|
83
|
-
haproxy
|
83
|
+
haproxy libcurl4
|
84
84
|
python3-pip
|
85
|
-
tzdata shared-mime-info software-properties-common
|
85
|
+
tzdata shared-mime-info software-properties-common xz-utils nodejs npm
|
86
|
+
openjdk-17-jdk-headless
|
86
87
|
) %>
|
87
88
|
|
88
89
|
<% if distro =~ /ubuntu2004/ %>
|
89
90
|
<% packages << 'libsnmp35' %>
|
91
|
+
<% elsif distro =~ /ubuntu2204|debian11/ %>
|
92
|
+
<% packages << 'libsnmp40' %>
|
90
93
|
<% else %>
|
91
94
|
<% packages << 'libsnmp30' %>
|
92
95
|
<% end %>
|
93
96
|
|
94
|
-
<% if distro !~ /ubuntu2004/ %>
|
97
|
+
<% if distro !~ /ubuntu2004|ubuntu2204|debian11/ %>
|
95
98
|
<% packages << 'python-pip' %>
|
96
99
|
<% end %>
|
97
100
|
|
98
|
-
<% if distro =~ /
|
99
|
-
<% packages << '
|
100
|
-
<% elsif distro =~ /ubuntu1404/ %>
|
101
|
-
# Ubuntu 14.04 only has openjdk 7, this is too old to be useful
|
102
|
-
<% else %>
|
103
|
-
<% packages << 'openjdk-8-jdk-headless' %>
|
104
|
-
<% end %>
|
105
|
-
|
106
|
-
# ubuntu1404, ubuntu1604: libcurl3
|
107
|
-
# ubuntu1804, ubuntu2004, debian10: libcurl4
|
108
|
-
<% if distro =~ /ubuntu1804|ubuntu2004|debian10/ %>
|
109
|
-
<% packages << 'libcurl4' %>
|
110
|
-
<% else %>
|
111
|
-
<% packages << 'libcurl3' %>
|
112
|
-
<% end %>
|
113
|
-
|
114
|
-
<% if distro =~ /ubuntu1804|ubuntu2004/ %>
|
115
|
-
<% packages << 'nodejs' %>
|
101
|
+
<% if distro =~ /ubuntu2204|debian11/ %>
|
102
|
+
<% packages << 'python3-venv' %>
|
116
103
|
<% end %>
|
117
104
|
|
118
|
-
<% if distro =~ /ubuntu2004/ %>
|
119
|
-
<% packages += %w(ruby
|
105
|
+
<% if distro =~ /ubuntu2004|ubuntu2204/ %>
|
106
|
+
<% packages += %w(ruby bundler) %>
|
120
107
|
<% end %>
|
121
108
|
|
122
109
|
RUN apt-get update && apt-get install -y <%= packages.join(' ') %>
|
@@ -129,29 +116,6 @@ ENV DOCKER=1
|
|
129
116
|
|
130
117
|
<% else %>
|
131
118
|
|
132
|
-
<% if distro =~ /rhel6/ %>
|
133
|
-
|
134
|
-
# CentOS 6 is dead - to use it retrieve the packages from vault:
|
135
|
-
# https://stackoverflow.com/questions/53562691/error-cannot-retrieve-repository-metadata-repomd-xml-for-repository-base-pl
|
136
|
-
|
137
|
-
<%
|
138
|
-
|
139
|
-
cfg = <<-CFG
|
140
|
-
[base]
|
141
|
-
name=CentOS-$releasever - Base
|
142
|
-
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
|
143
|
-
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
|
144
|
-
baseurl=http://vault.centos.org/6.10/os/x86_64/
|
145
|
-
gpgcheck=1
|
146
|
-
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
147
|
-
CFG
|
148
|
-
|
149
|
-
%>
|
150
|
-
|
151
|
-
RUN printf "<%= cfg.gsub("\n", "\\n") %>" >/etc/yum.repos.d/CentOS-Base.repo
|
152
|
-
|
153
|
-
<% end %>
|
154
|
-
|
155
119
|
# Enterprise server: net-snmp
|
156
120
|
# lsb_release: redhat-lsb-core
|
157
121
|
# our runner scripts: which
|
@@ -160,30 +124,15 @@ CFG
|
|
160
124
|
# Kerberos tests: krb5-workstation + cyrus-sasl-devel to build the
|
161
125
|
# mongo_kerberos gem + cyrus-sasl-gssapi for authentication to work
|
162
126
|
# Local Kerberos server: krb5-server
|
163
|
-
# JRuby: java-
|
127
|
+
# JRuby: java-17-openjdk
|
164
128
|
#
|
165
129
|
# Note: lacking cyrus-sasl-gssapi produces a cryptic message
|
166
130
|
# "SASL(-4): no mechanism available: No worthy mechs found"
|
167
131
|
# https://github.com/farorm/python-ad/issues/10
|
168
132
|
|
169
|
-
RUN yum install -y redhat-lsb-core which git gcc libyaml krb5-server \
|
170
|
-
krb5-workstation cyrus-sasl-devel cyrus-sasl-gssapi java-
|
171
|
-
net-snmp
|
172
|
-
|
173
|
-
<% if distro =~ /rhel6/ %>
|
174
|
-
|
175
|
-
# RHEL 6 ships with Python 2.6.
|
176
|
-
|
177
|
-
RUN yum install -y centos-release-scl && \
|
178
|
-
yum install -y python27-python python27-python-devel
|
179
|
-
ENV PATH=/opt/rh/python27/root/usr/bin:$PATH \
|
180
|
-
LD_LIBRARY_PATH=/opt/rh/python27/root/usr/lib64
|
181
|
-
|
182
|
-
<% else %>
|
183
|
-
|
184
|
-
RUN yum install -y python-devel
|
185
|
-
|
186
|
-
<% end %>
|
133
|
+
RUN yum --enablerepo=powertools install -y redhat-lsb-core which git gcc gcc-c++ libyaml-devel krb5-server \
|
134
|
+
krb5-workstation cyrus-sasl-devel cyrus-sasl-gssapi java-17-openjdk \
|
135
|
+
net-snmp python38 python38-devel cmake nodejs npm xz
|
187
136
|
|
188
137
|
<% end %>
|
189
138
|
|
@@ -240,7 +189,7 @@ CFG
|
|
240
189
|
<% if @env.fetch('MONGODB_VERSION') >= '4.4' %>
|
241
190
|
# ubuntu1604 installs MarkupSafe 0.0.0 here instead of 2.0.0+
|
242
191
|
# as specified by dependencies, causing OCSP mock to not work.
|
243
|
-
RUN python3 -mpip install asn1crypto oscrypto flask --upgrade
|
192
|
+
RUN python3 -mpip install asn1crypto oscrypto flask --upgrade --ignore-installed
|
244
193
|
<% end %>
|
245
194
|
|
246
195
|
# FLE is tested against 4.0+ servers.
|
@@ -300,6 +249,8 @@ WORKDIR /app
|
|
300
249
|
ENV DOCKER_PRELOAD=1
|
301
250
|
<% end %>
|
302
251
|
|
252
|
+
RUN npm install --global yarn
|
253
|
+
|
303
254
|
ENV MONGO_ORCHESTRATION_HOME=/tmpfs \
|
304
255
|
PROJECT_DIRECTORY=/app \
|
305
256
|
<%= @env.map { |k, v| %Q`#{k}="#{v.gsub('$', "\\$").gsub('"', "\\\"")}"` }.join(" \\\n ") %>
|
data/spec/shared/shlib/server.sh
CHANGED
@@ -104,6 +104,7 @@ install_mlaunch_venv() {
|
|
104
104
|
#pip install 'mtools==1.7' 'pymongo==4.1' python-dateutil psutil
|
105
105
|
|
106
106
|
# dateutil dependency is missing in mtools: https://github.com/rueckstiess/mtools/issues/864
|
107
|
+
pip install --upgrade setuptools
|
107
108
|
pip install 'mtools-legacy[mlaunch]' 'pymongo<4' python-dateutil
|
108
109
|
fi
|
109
110
|
}
|
@@ -1,39 +1,16 @@
|
|
1
1
|
# When changing, also update the hash in share/Dockerfile.
|
2
|
-
TOOLCHAIN_VERSION=
|
2
|
+
TOOLCHAIN_VERSION=ded7ea845b08cf96f11a747d9540ba3199580dea
|
3
|
+
JDK_VERSION=jdk17
|
3
4
|
|
4
5
|
set_env_java() {
|
5
6
|
ls -l /opt || true
|
6
7
|
ls -l /usr/lib/jvm || true
|
7
8
|
|
8
9
|
# Use toolchain java if it exists
|
9
|
-
if [ -f /opt/java/
|
10
|
-
export JAVACMD=/opt/java/
|
11
|
-
#export PATH=$PATH:/opt/java/jdk8/bin
|
12
|
-
fi
|
13
|
-
|
14
|
-
# ppc64le has it in a different place
|
15
|
-
if test -z "$JAVACMD" && [ -f /usr/lib/jvm/java-1.8.0/bin/java ]; then
|
16
|
-
export JAVACMD=/usr/lib/jvm/java-1.8.0/bin/java
|
17
|
-
#export PATH=$PATH:/usr/lib/jvm/java-1.8.0/bin
|
18
|
-
fi
|
19
|
-
|
20
|
-
if true; then
|
21
|
-
# newer
|
22
|
-
# rhel71-ppc, https://jira.mongodb.org/browse/BUILD-9231
|
23
|
-
if test -z "$JAVACMD" &&
|
24
|
-
(ls /opt/java || true) |grep -q java-1.8.0-openjdk-1.8.0 &&
|
25
|
-
test -f /opt/java/java-1.8.0-openjdk-1.8.0*/bin/java;
|
26
|
-
then
|
27
|
-
path=$(cd /opt/java && ls -d java-1.8.0-openjdk-1.8.0* |head -n 1)
|
28
|
-
export JAVACMD=/opt/java/"$path"/bin/java
|
29
|
-
fi
|
10
|
+
if [ -f /opt/java/$JDK_VERSION/bin/java ]; then
|
11
|
+
export JAVACMD=/opt/java/$JDK_VERSION/bin/java
|
30
12
|
else
|
31
|
-
|
32
|
-
# rhel71-ppc seems to have an /opt/java/jdk8/bin/java but it doesn't work
|
33
|
-
if test -n "$JAVACMD" && ! exec $JAVACMD -version; then
|
34
|
-
JAVACMD=
|
35
|
-
# we will try the /usr/lib/jvm then
|
36
|
-
fi
|
13
|
+
echo Could not find $JDK_VERSION in /opt/java
|
37
14
|
fi
|
38
15
|
|
39
16
|
if test -n "$JAVACMD"; then
|
@@ -1,5 +1,5 @@
|
|
1
1
|
runOn:
|
2
|
-
- minServerVersion: "
|
2
|
+
- minServerVersion: "7.0.0"
|
3
3
|
database_name: &database_name "default"
|
4
4
|
collection_name: &collection_name "default"
|
5
5
|
|
@@ -54,4 +54,4 @@ tests:
|
|
54
54
|
# Outcome is checked using a separate MongoClient without auto encryption.
|
55
55
|
data:
|
56
56
|
- *doc0_encrypted
|
57
|
-
- *doc1_encrypted
|
57
|
+
- *doc1_encrypted
|
@@ -143,14 +143,6 @@ tests:
|
|
143
143
|
hosts: ~
|
144
144
|
auth: ~
|
145
145
|
options: ~
|
146
|
-
-
|
147
|
-
description: "Missing delimiting slash between hosts and options"
|
148
|
-
uri: "mongodb://example.com?w=1"
|
149
|
-
valid: false
|
150
|
-
warning: ~
|
151
|
-
hosts: ~
|
152
|
-
auth: ~
|
153
|
-
options: ~
|
154
146
|
-
|
155
147
|
description: "Incomplete key value pair for option"
|
156
148
|
uri: "mongodb://example.com/?w"
|
@@ -257,5 +249,3 @@ tests:
|
|
257
249
|
hosts: ~
|
258
250
|
auth: ~
|
259
251
|
options: ~
|
260
|
-
|
261
|
-
|
@@ -15,3 +15,16 @@ tests:
|
|
15
15
|
db: "admin"
|
16
16
|
options:
|
17
17
|
authmechanism: "MONGODB-CR"
|
18
|
+
-
|
19
|
+
description: "Missing delimiting slash between hosts and options"
|
20
|
+
uri: "mongodb://example.com?tls=true"
|
21
|
+
valid: true
|
22
|
+
warning: false
|
23
|
+
hosts:
|
24
|
+
-
|
25
|
+
type: "hostname"
|
26
|
+
host: "example.com"
|
27
|
+
port: ~
|
28
|
+
auth: ~
|
29
|
+
options:
|
30
|
+
tls: true
|