bson 4.13.0-java → 4.15.0-java
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/lib/bson/big_decimal.rb +67 -0
- data/lib/bson/dbref.rb +31 -4
- data/lib/bson/decimal128/builder.rb +9 -5
- data/lib/bson/decimal128.rb +29 -5
- data/lib/bson/float.rb +1 -1
- data/lib/bson/version.rb +1 -1
- data/lib/bson-ruby.jar +0 -0
- data/lib/bson.rb +2 -1
- data/spec/bson/big_decimal_spec.rb +316 -0
- data/spec/bson/dbref_legacy_spec.rb +169 -0
- data/spec/bson/dbref_spec.rb +26 -0
- data/spec/bson/decimal128_spec.rb +231 -0
- data/spec/bson/hash_spec.rb +32 -0
- data/spec/shared/bin/s3-copy +45 -0
- data/spec/shared/bin/s3-upload +69 -0
- data/spec/shared/lib/mrss/cluster_config.rb +14 -4
- data/spec/shared/lib/mrss/constraints.rb +51 -11
- data/spec/shared/lib/mrss/docker_runner.rb +8 -2
- data/spec/shared/lib/mrss/event_subscriber.rb +200 -0
- data/spec/shared/lib/mrss/server_version_registry.rb +17 -12
- data/spec/shared/lib/mrss/spec_organizer.rb +29 -2
- data/spec/shared/share/Dockerfile.erb +147 -40
- data/spec/shared/share/haproxy-1.conf +16 -0
- data/spec/shared/share/haproxy-2.conf +17 -0
- data/spec/shared/shlib/distro.sh +2 -1
- data/spec/shared/shlib/server.sh +100 -23
- data/spec/shared/shlib/set_env.sh +9 -6
- data/spec/spec_helper.rb +7 -0
- data/spec/spec_tests/common_driver_spec.rb +2 -1
- data.tar.gz.sig +0 -0
- metadata +36 -20
- metadata.gz.sig +0 -0
@@ -12,9 +12,12 @@ server_url = "http://downloads.10gen.com/linux/mongodb-linux-x86_64-enterprise-#
|
|
12
12
|
server_archive_basename = File.basename(server_url)
|
13
13
|
server_extracted_dir = server_archive_basename.sub(/\.(tar\.gz|tgz)$/, '')
|
14
14
|
|
15
|
-
|
15
|
+
TOOLCHAIN_VERSION='35fb9fb797a941094bf4ee8678284da88849435c'
|
16
|
+
|
17
|
+
def ruby_toolchain_url(ruby)
|
18
|
+
"http://boxes.10gen.com/build/toolchain-drivers/mongo-ruby-driver/#{TOOLCHAIN_VERSION}/#{distro}/#{ruby}.tar.xz"
|
19
|
+
end
|
16
20
|
|
17
|
-
ruby_toolchain_url = "http://boxes.10gen.com/build/toolchain-drivers/mongo-ruby-driver/ruby-toolchain-#{distro}-#{toolchain_upper}.tar.xz"
|
18
21
|
#ruby_toolchain_url = "https://s3.amazonaws.com//mciuploads/mongo-ruby-toolchain/#{distro}/#{toolchain_upper}/mongo_ruby_driver_toolchain_#{distro.gsub('-', '_')}_patch_#{toolchain_upper}_#{toolchain_lower}.tar.gz"
|
19
22
|
|
20
23
|
%>
|
@@ -55,9 +58,10 @@ FROM <%= base_image %>
|
|
55
58
|
# Ruby runtime dependencies: libyaml-0-2
|
56
59
|
# Compiling ruby libraries: gcc make
|
57
60
|
# Compiling pyhton packages: python2.7-dev
|
58
|
-
# JRuby: openjdk-8-
|
61
|
+
# JRuby: openjdk-8-jdk-headless
|
59
62
|
# Server dependencies: libsnmp30 libcurl3/libcurl4
|
60
63
|
# Determining OS we are running on: lsb-release
|
64
|
+
# Load balancer testing: haproxy
|
61
65
|
# Kerberos testing: krb5-user
|
62
66
|
# Local Kerberos server: krb5-kdc krb5-admin-server
|
63
67
|
# Installing mlaunch from git: git
|
@@ -65,8 +69,9 @@ FROM <%= base_image %>
|
|
65
69
|
# nio4r on JRuby: libgmp-dev
|
66
70
|
# Snappy compression: libsnappy-dev
|
67
71
|
# nokogiri: zlib1g-dev
|
68
|
-
# Mongoid testing: tzdata
|
72
|
+
# Mongoid testing: tzdata shared-mime-info
|
69
73
|
# Mongoid application testing: nodejs (8.x or newer)
|
74
|
+
# Test suite: procps for ps (to kill JRubies)
|
70
75
|
#
|
71
76
|
# We currently use Python 2-compatible version of mtools, which
|
72
77
|
# is installable via pip (which uses Python 2). All of the MongoDB
|
@@ -74,22 +79,44 @@ FROM <%= base_image %>
|
|
74
79
|
# therefore install python-pip in all configurations here.
|
75
80
|
|
76
81
|
<% packages = %w(
|
77
|
-
lsb-release bzip2 curl zsh
|
82
|
+
procps lsb-release bzip2 curl zsh
|
78
83
|
git make gcc libyaml-0-2 libgmp-dev zlib1g-dev libsnappy-dev
|
79
|
-
libsnmp30
|
80
84
|
krb5-user krb5-kdc krb5-admin-server libsasl2-dev libsasl2-modules-gssapi-mit
|
81
|
-
|
82
|
-
|
85
|
+
haproxy
|
86
|
+
python3-pip
|
87
|
+
tzdata shared-mime-info
|
83
88
|
) %>
|
84
89
|
|
85
|
-
|
86
|
-
|
87
|
-
<% packages
|
90
|
+
<% if distro =~ /ubuntu1404/ %>
|
91
|
+
# For building python & setuptools
|
92
|
+
<% packages += %w(libssl-dev unzip) %>
|
93
|
+
<% end %>
|
94
|
+
|
95
|
+
<% if distro !~ /ubuntu2004/ %>
|
96
|
+
<% packages += %w(python2.7-dev) %>
|
97
|
+
<% end %>
|
98
|
+
|
99
|
+
<% if distro =~ /ubuntu2004/ %>
|
100
|
+
<% packages << 'libsnmp35' %>
|
101
|
+
<% else %>
|
102
|
+
<% packages << 'libsnmp30' %>
|
103
|
+
<% end %>
|
104
|
+
|
105
|
+
<% if distro !~ /ubuntu2004/ %>
|
106
|
+
<% packages << 'python-pip' %>
|
107
|
+
<% end %>
|
108
|
+
|
109
|
+
<% if distro =~ /debian10/ %>
|
110
|
+
<% packages << 'openjdk-11-jdk-headless' %>
|
111
|
+
<% elsif distro =~ /ubuntu1404/ %>
|
112
|
+
# Ubuntu 14.04 only has openjdk 7, this is too old to be useful
|
113
|
+
<% else %>
|
114
|
+
<% packages << 'openjdk-8-jdk-headless' %>
|
88
115
|
<% end %>
|
89
116
|
|
90
117
|
# ubuntu1404, ubuntu1604: libcurl3
|
91
|
-
# ubuntu1804: libcurl4
|
92
|
-
<% if distro =~ /ubuntu1804/ %>
|
118
|
+
# ubuntu1804, ubuntu2004, debian10: libcurl4
|
119
|
+
<% if distro =~ /ubuntu1804|ubuntu2004|debian10/ %>
|
93
120
|
<% packages << 'libcurl4' %>
|
94
121
|
<% else %>
|
95
122
|
<% packages << 'libcurl3' %>
|
@@ -99,9 +126,36 @@ FROM <%= base_image %>
|
|
99
126
|
<% packages << 'nodejs' %>
|
100
127
|
<% end %>
|
101
128
|
|
129
|
+
<% if distro =~ /ubuntu2004/ %>
|
130
|
+
<% packages += %w(ruby ruby2.7 bundler python2 python2-dev) %>
|
131
|
+
<% end %>
|
132
|
+
|
102
133
|
RUN apt-get update && apt-get install -y <%= packages.join(' ') %>
|
103
134
|
<% else %>
|
104
135
|
|
136
|
+
<% if distro =~ /rhel6/ %>
|
137
|
+
|
138
|
+
# CentOS 6 is dead - to use it retrieve the packages from vault:
|
139
|
+
# https://stackoverflow.com/questions/53562691/error-cannot-retrieve-repository-metadata-repomd-xml-for-repository-base-pl
|
140
|
+
|
141
|
+
<%
|
142
|
+
|
143
|
+
cfg = <<-CFG
|
144
|
+
[base]
|
145
|
+
name=CentOS-$releasever - Base
|
146
|
+
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
|
147
|
+
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
|
148
|
+
baseurl=http://vault.centos.org/6.10/os/x86_64/
|
149
|
+
gpgcheck=1
|
150
|
+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
|
151
|
+
CFG
|
152
|
+
|
153
|
+
%>
|
154
|
+
|
155
|
+
RUN printf "<%= cfg.gsub("\n", "\\n") %>" >/etc/yum.repos.d/CentOS-Base.repo
|
156
|
+
|
157
|
+
<% end %>
|
158
|
+
|
105
159
|
# Enterprise server: net-snmp
|
106
160
|
# lsb_release: redhat-lsb-core
|
107
161
|
# our runner scripts: which
|
@@ -118,7 +172,7 @@ FROM <%= base_image %>
|
|
118
172
|
|
119
173
|
RUN yum install -y redhat-lsb-core which git gcc libyaml krb5-server \
|
120
174
|
krb5-workstation cyrus-sasl-devel cyrus-sasl-gssapi java-1.8.0-openjdk \
|
121
|
-
net-snmp
|
175
|
+
net-snmp python3
|
122
176
|
|
123
177
|
<% if distro =~ /rhel6/ %>
|
124
178
|
|
@@ -134,32 +188,34 @@ FROM <%= base_image %>
|
|
134
188
|
RUN yum install -y python-devel
|
135
189
|
|
136
190
|
<% end %>
|
137
|
-
|
191
|
+
|
138
192
|
<% end %>
|
139
193
|
|
140
194
|
<% if preload? %>
|
141
195
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
<%
|
196
|
+
<% if distro =~ /ubuntu1404/ %>
|
197
|
+
|
198
|
+
# I couldn't find a prebuilt package of anything more recent than 2.7.6
|
199
|
+
# for 14.04.
|
200
|
+
RUN curl --retry 3 -fL https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tar.xz | \
|
201
|
+
tar xfJ - && \
|
202
|
+
cd Python-2.7.16 && \
|
203
|
+
./configure && \
|
204
|
+
nice make -j4 && \
|
205
|
+
make install && \
|
206
|
+
cd .. && rm -rf Python-2.7.16
|
207
|
+
|
208
|
+
ENV PATH=/usr/local/bin:$PATH
|
209
|
+
|
210
|
+
RUN curl --retry 3 -fL -o setuptools-44.1.1.zip https://files.pythonhosted.org/packages/b2/40/4e00501c204b457f10fe410da0c97537214b2265247bc9a5bc6edd55b9e4/setuptools-44.1.1.zip && \
|
211
|
+
unzip setuptools-44.1.1.zip && \
|
212
|
+
cd setuptools-44.1.1 && \
|
213
|
+
python setup.py install && \
|
214
|
+
cd .. && rm -rf setuptools-44.1.1
|
215
|
+
|
216
|
+
<% end%>
|
217
|
+
|
218
|
+
<% if true || distro =~ /rhel|ubuntu1604/ %>
|
163
219
|
|
164
220
|
# Ubuntu 12.04 ships pip 1.0 which is ancient and does not work.
|
165
221
|
#
|
@@ -173,7 +229,42 @@ FROM <%= base_image %>
|
|
173
229
|
# therefore install it the manual way.
|
174
230
|
#
|
175
231
|
# https://pip.pypa.io/en/stable/installing/
|
176
|
-
RUN curl --retry 3 -fL https://bootstrap.pypa.io/pip/2.7/get-pip.py |
|
232
|
+
RUN curl --retry 3 -fL https://bootstrap.pypa.io/pip/2.7/get-pip.py | python2
|
233
|
+
|
234
|
+
<% end %>
|
235
|
+
|
236
|
+
# Current virtualenv fails with
|
237
|
+
# https://github.com/pypa/virtualenv/issues/1630
|
238
|
+
<% if distro =~ /ubuntu2004/ %>
|
239
|
+
RUN python3 -m pip install 'virtualenv<20' 'mtools-legacy[mlaunch]'
|
240
|
+
<% else %>
|
241
|
+
RUN python2 -m pip install 'virtualenv<20' 'mtools-legacy[mlaunch]'
|
242
|
+
<% end %>
|
243
|
+
|
244
|
+
RUN pip --version && \
|
245
|
+
pip install mtools-legacy[mlaunch]
|
246
|
+
|
247
|
+
<% if @env.fetch('MONGODB_VERSION') >= '4.4' %>
|
248
|
+
# ubuntu1604 installs MarkupSafe 0.0.0 here instead of 2.0.0+
|
249
|
+
# as specified by dependencies, causing OCSP mock to not work.
|
250
|
+
RUN python3 -mpip install asn1crypto oscrypto flask --upgrade
|
251
|
+
<% end %>
|
252
|
+
|
253
|
+
# FLE is tested against 4.0+ servers.
|
254
|
+
<% if @env.fetch('MONGODB_VERSION') >= '4.0' %>
|
255
|
+
# Requirements in drivers-evergreen-tools:
|
256
|
+
# boto3~=1.19 cryptography~=3.4.8 pykmip~=0.10.0
|
257
|
+
# cryptography does not install due to lacking setuptools_rust
|
258
|
+
# (either that version or anything that isn't part of system packages)
|
259
|
+
RUN python3 -mpip install boto3~=1.19 cryptography pykmip~=0.10.0
|
260
|
+
<% end %>
|
261
|
+
|
262
|
+
<% unless ruby_head? || system_ruby? %>
|
263
|
+
|
264
|
+
RUN curl --retry 3 -fL <%= ruby_toolchain_url(ruby) %> |tar -xC /opt -Jf -
|
265
|
+
ENV PATH=/opt/rubies/<%= ruby %>/bin:$PATH \
|
266
|
+
USE_OPT_TOOLCHAIN=1
|
267
|
+
#ENV PATH=/opt/rubies/python/3/bin:$PATH
|
177
268
|
|
178
269
|
<% end %>
|
179
270
|
|
@@ -183,6 +274,14 @@ FROM <%= base_image %>
|
|
183
274
|
|
184
275
|
<% end %>
|
185
276
|
|
277
|
+
<% if distro =~ /debian|ubuntu/ %>
|
278
|
+
# mkdir was moved from /usr/bin to /bin and MongoDB's distros
|
279
|
+
# apparently keep using the old location.
|
280
|
+
# This definitely affects debian10.
|
281
|
+
# https://stackoverflow.com/questions/64653051/make-usr-bin-mkdir-command-not-found-during-gem-install-nokogiri-in-ubuntu
|
282
|
+
RUN test -f /usr/bin/mkdir || ln -s /bin/mkdir /usr/bin/mkdir
|
283
|
+
<% end %>
|
284
|
+
|
186
285
|
WORKDIR /app
|
187
286
|
|
188
287
|
<% if preload? && !ruby_head? %>
|
@@ -193,17 +292,25 @@ WORKDIR /app
|
|
193
292
|
COPY lib/<%= project_lib_subdir %>/version.rb lib/<%= project_lib_subdir %>/version.rb
|
194
293
|
RUN bundle install
|
195
294
|
COPY .evergreen/patch-debuggers .evergreen/patch-debuggers
|
196
|
-
|
295
|
+
<% if system_ruby? %>
|
296
|
+
# Running under docker with root access
|
297
|
+
RUN .evergreen/patch-debuggers /var/lib/gems
|
298
|
+
<% else %>
|
299
|
+
RUN .evergreen/patch-debuggers /opt/rubies
|
300
|
+
<% end %>
|
197
301
|
|
198
302
|
<% end %>
|
199
303
|
|
200
304
|
<% if fle? %>
|
201
|
-
RUN curl --retry 3 -
|
202
|
-
RUN tar xf libmongocrypt-all.tar.gz
|
305
|
+
RUN curl --retry 3 -fL "https://s3.amazonaws.com/mciuploads/libmongocrypt/all/master/latest/libmongocrypt-all.tar.gz" |tar zxf -
|
203
306
|
|
204
307
|
<%= "ENV LIBMONGOCRYPT_PATH #{libmongocrypt_path}" %>
|
205
308
|
<% end %>
|
206
309
|
|
310
|
+
<% if preload? %>
|
311
|
+
ENV DOCKER_PRELOAD=1
|
312
|
+
<% end %>
|
313
|
+
|
207
314
|
ENV MONGO_ORCHESTRATION_HOME=/tmpfs \
|
208
315
|
PROJECT_DIRECTORY=/app \
|
209
316
|
<%= @env.map { |k, v| %Q`#{k}="#{v.gsub('$', "\\$").gsub('"', "\\\"")}"` }.join(" \\\n ") %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Modeled after
|
2
|
+
# https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/run-load-balancer.sh
|
3
|
+
|
4
|
+
defaults
|
5
|
+
mode tcp
|
6
|
+
timeout connect 7s
|
7
|
+
timeout client 55s
|
8
|
+
timeout server 55s
|
9
|
+
|
10
|
+
frontend mongos_frontend
|
11
|
+
bind *:27017
|
12
|
+
use_backend mongos_backend
|
13
|
+
|
14
|
+
backend mongos_backend
|
15
|
+
mode tcp
|
16
|
+
server mongos_one 127.0.0.1:27117 check
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# Modeled after
|
2
|
+
# https://github.com/mongodb-labs/drivers-evergreen-tools/blob/master/.evergreen/run-load-balancer.sh
|
3
|
+
|
4
|
+
defaults
|
5
|
+
mode tcp
|
6
|
+
timeout connect 7s
|
7
|
+
timeout client 55s
|
8
|
+
timeout server 55s
|
9
|
+
|
10
|
+
frontend mongos_frontend
|
11
|
+
bind *:27017
|
12
|
+
use_backend mongos_backend
|
13
|
+
|
14
|
+
backend mongos_backend
|
15
|
+
mode tcp
|
16
|
+
server mongos_one 127.0.0.1:27117 check
|
17
|
+
server mongos_two 127.0.0.1:27118 check
|
data/spec/shared/shlib/distro.sh
CHANGED
@@ -13,7 +13,8 @@ _detect_distro() {
|
|
13
13
|
if test -f /etc/debian_version; then
|
14
14
|
# Debian or Ubuntu
|
15
15
|
if test "`uname -m`" = aarch64; then
|
16
|
-
|
16
|
+
release=`lsb_release -rs |tr -d .`
|
17
|
+
distro="ubuntu$release"-arm
|
17
18
|
elif lsb_release -is |grep -q Debian; then
|
18
19
|
release=`lsb_release -rs |tr -d .`
|
19
20
|
# In docker, release is something like 9.11.
|
data/spec/shared/shlib/server.sh
CHANGED
@@ -10,21 +10,21 @@ set_fcv() {
|
|
10
10
|
|
11
11
|
add_uri_option() {
|
12
12
|
opt=$1
|
13
|
-
|
13
|
+
|
14
14
|
if ! echo $MONGODB_URI |sed -e s,//,, |grep -q /; then
|
15
15
|
MONGODB_URI="$MONGODB_URI/"
|
16
16
|
fi
|
17
|
-
|
17
|
+
|
18
18
|
if ! echo $MONGODB_URI |grep -q '?'; then
|
19
19
|
MONGODB_URI="$MONGODB_URI?"
|
20
20
|
fi
|
21
|
-
|
21
|
+
|
22
22
|
MONGODB_URI="$MONGODB_URI&$opt"
|
23
23
|
}
|
24
24
|
|
25
25
|
prepare_server() {
|
26
26
|
arch=$1
|
27
|
-
|
27
|
+
|
28
28
|
if test -n "$USE_OPT_MONGODB"; then
|
29
29
|
export BINDIR=/opt/mongodb/bin
|
30
30
|
export PATH=$BINDIR:$PATH
|
@@ -39,7 +39,7 @@ prepare_server() {
|
|
39
39
|
else
|
40
40
|
download_version="$MONGODB_VERSION"
|
41
41
|
fi
|
42
|
-
|
42
|
+
|
43
43
|
url=`$(dirname $0)/get-mongodb-download-url $download_version $arch`
|
44
44
|
|
45
45
|
prepare_server_from_url $url
|
@@ -80,7 +80,7 @@ install_mlaunch_pip() {
|
|
80
80
|
# mlaunch is preinstalled in the docker image, do not install it here
|
81
81
|
return
|
82
82
|
fi
|
83
|
-
|
83
|
+
|
84
84
|
python -V || true
|
85
85
|
python3 -V || true
|
86
86
|
pythonpath="$MONGO_ORCHESTRATION_HOME"/python
|
@@ -96,20 +96,20 @@ install_mlaunch_git() {
|
|
96
96
|
python3 -V || true
|
97
97
|
which pip || true
|
98
98
|
which pip3 || true
|
99
|
-
|
99
|
+
|
100
100
|
if false; then
|
101
101
|
if ! virtualenv --version; then
|
102
102
|
python3 `which pip3` install --user virtualenv
|
103
103
|
export PATH=$HOME/.local/bin:$PATH
|
104
104
|
virtualenv --version
|
105
105
|
fi
|
106
|
-
|
106
|
+
|
107
107
|
venvpath="$MONGO_ORCHESTRATION_HOME"/venv
|
108
108
|
virtualenv -p python3 $venvpath
|
109
109
|
. $venvpath/bin/activate
|
110
|
-
|
110
|
+
|
111
111
|
pip3 install psutil pymongo
|
112
|
-
|
112
|
+
|
113
113
|
git clone $repo mlaunch
|
114
114
|
cd mlaunch
|
115
115
|
git checkout origin/$branch
|
@@ -118,13 +118,13 @@ install_mlaunch_git() {
|
|
118
118
|
else
|
119
119
|
pip install --user 'virtualenv==13'
|
120
120
|
export PATH=$HOME/.local/bin:$PATH
|
121
|
-
|
121
|
+
|
122
122
|
venvpath="$MONGO_ORCHESTRATION_HOME"/venv
|
123
123
|
virtualenv $venvpath
|
124
124
|
. $venvpath/bin/activate
|
125
|
-
|
125
|
+
|
126
126
|
pip install psutil pymongo
|
127
|
-
|
127
|
+
|
128
128
|
git clone $repo mlaunch
|
129
129
|
(cd mlaunch &&
|
130
130
|
git checkout origin/$branch &&
|
@@ -133,24 +133,32 @@ install_mlaunch_git() {
|
|
133
133
|
fi
|
134
134
|
}
|
135
135
|
|
136
|
+
# This function sets followong global variables:
|
137
|
+
# server_cert_path
|
138
|
+
# server_ca_path
|
139
|
+
# server_client_cert_path
|
140
|
+
#
|
141
|
+
# These variables are used later to connect to processes via mongo client.
|
136
142
|
calculate_server_args() {
|
137
143
|
local mongo_version=`echo $MONGODB_VERSION |tr -d .`
|
138
|
-
|
144
|
+
|
139
145
|
if test -z "$mongo_version"; then
|
140
146
|
echo "$MONGODB_VERSION must be set and not contain only dots" 1>&2
|
141
147
|
exit 3
|
142
148
|
fi
|
143
|
-
|
149
|
+
|
144
150
|
if test $mongo_version = latest; then
|
145
151
|
mongo_version=49
|
146
152
|
fi
|
147
153
|
|
148
154
|
local args="--setParameter enableTestCommands=1"
|
149
|
-
|
150
|
-
if test $mongo_version -ge
|
155
|
+
|
156
|
+
if test $mongo_version -ge 50; then
|
157
|
+
args="$args --setParameter acceptApiVersion2=1"
|
158
|
+
elif test $mongo_version -ge 47; then
|
151
159
|
args="$args --setParameter acceptAPIVersion2=1"
|
152
160
|
fi
|
153
|
-
|
161
|
+
|
154
162
|
# diagnosticDataCollectionEnabled is a mongod-only parameter on server 3.2,
|
155
163
|
# and mlaunch does not support specifying mongod-only parameters:
|
156
164
|
# https://github.com/rueckstiess/mtools/issues/696
|
@@ -160,15 +168,31 @@ calculate_server_args() {
|
|
160
168
|
fi
|
161
169
|
local uri_options=
|
162
170
|
if test "$TOPOLOGY" = replica-set; then
|
163
|
-
args="$args --replicaset --name
|
171
|
+
args="$args --replicaset --name test-rs --nodes 2 --arbiter"
|
164
172
|
export HAVE_ARBITER=1
|
165
173
|
elif test "$TOPOLOGY" = sharded-cluster; then
|
166
|
-
args="$args --replicaset --nodes 2 --sharded 1 --name
|
174
|
+
args="$args --replicaset --nodes 2 --sharded 1 --name test-rs"
|
167
175
|
if test -z "$SINGLE_MONGOS"; then
|
168
176
|
args="$args --mongos 2"
|
169
177
|
fi
|
170
|
-
|
178
|
+
elif test "$TOPOLOGY" = standalone; then
|
171
179
|
args="$args --single"
|
180
|
+
elif test "$TOPOLOGY" = load-balanced; then
|
181
|
+
args="$args --replicaset --nodes 2 --sharded 1 --name test-rs --port 27117"
|
182
|
+
if test -z "$MRSS_ROOT"; then
|
183
|
+
echo "Please set MRSS_ROOT" 1>&2
|
184
|
+
exit 2
|
185
|
+
fi
|
186
|
+
if test -n "$SINGLE_MONGOS"; then
|
187
|
+
haproxy_config=$MRSS_ROOT/share/haproxy-1.conf
|
188
|
+
else
|
189
|
+
args="$args --mongos 2"
|
190
|
+
haproxy_config=$MRSS_ROOT/share/haproxy-2.conf
|
191
|
+
fi
|
192
|
+
uri_options="$uri_options&loadBalanced=true"
|
193
|
+
else
|
194
|
+
echo "Unknown topology: $TOPOLOGY" 1>&2
|
195
|
+
exit 1
|
172
196
|
fi
|
173
197
|
if test -n "$MMAPV1"; then
|
174
198
|
args="$args --storageEngine mmapv1 --smallfiles --noprealloc"
|
@@ -191,7 +215,6 @@ calculate_server_args() {
|
|
191
215
|
fi
|
192
216
|
fi
|
193
217
|
|
194
|
-
local server_cert_path server_ca_path server_client_cert_path
|
195
218
|
if test "$SSL" = ssl || test -n "$OCSP_ALGORITHM"; then
|
196
219
|
if test -n "$OCSP_ALGORITHM"; then
|
197
220
|
if test "$OCSP_MUST_STAPLE" = 1; then
|
@@ -270,7 +293,7 @@ calculate_server_args() {
|
|
270
293
|
ocsp_args="$ocsp_args --fault $OCSP_STATUS"
|
271
294
|
fi
|
272
295
|
fi
|
273
|
-
|
296
|
+
|
274
297
|
OCSP_ARGS="$ocsp_args"
|
275
298
|
SERVER_ARGS="$args"
|
276
299
|
URI_OPTIONS="$uri_options"
|
@@ -287,4 +310,58 @@ launch_ocsp_mock() {
|
|
287
310
|
launch_server() {
|
288
311
|
local dbdir="$1"
|
289
312
|
python -m mtools.mlaunch.mlaunch --dir "$dbdir" --binarypath "$BINDIR" $SERVER_ARGS
|
313
|
+
|
314
|
+
if test "$TOPOLOGY" = sharded-cluster && test $MONGODB_VERSION = 3.6; then
|
315
|
+
# On 3.6 server the sessions collection is not immediately available,
|
316
|
+
# so we run the refreshLogicalSessionCacheNow command on the config server
|
317
|
+
# and again on each mongos in order for the mongoses
|
318
|
+
# to correctly report logicalSessionTimeoutMinutes.
|
319
|
+
mongos_regex="\s*mongos\s+([0-9]+)\s+running\s+[0-9]+"
|
320
|
+
config_server_regex="\s*config\sserver\s+([0-9]+)\s+running\s+[0-9]+"
|
321
|
+
config_server=""
|
322
|
+
mongoses=()
|
323
|
+
if test "$AUTH" = auth
|
324
|
+
then
|
325
|
+
base_url="mongodb://bob:pwd123@localhost"
|
326
|
+
else
|
327
|
+
base_url="mongodb://localhost"
|
328
|
+
fi
|
329
|
+
if test "$SSL" = "ssl"
|
330
|
+
then
|
331
|
+
mongo_command="${BINDIR}/mongo --ssl --sslPEMKeyFile $server_cert_path --sslCAFile $server_ca_path"
|
332
|
+
else
|
333
|
+
mongo_command="${BINDIR}/mongo"
|
334
|
+
fi
|
335
|
+
|
336
|
+
while read -r line
|
337
|
+
do
|
338
|
+
if [[ $line =~ $config_server_regex ]]
|
339
|
+
then
|
340
|
+
port="${BASH_REMATCH[1]}"
|
341
|
+
config_server="${base_url}:${port}"
|
342
|
+
fi
|
343
|
+
if [[ $line =~ $mongos_regex ]]
|
344
|
+
then
|
345
|
+
port="${BASH_REMATCH[1]}"
|
346
|
+
mongoses+=("${base_url}:${port}")
|
347
|
+
fi
|
348
|
+
done < <(python -m mtools.mlaunch.mlaunch list --dir "$dbdir" --binarypath "$BINDIR")
|
349
|
+
|
350
|
+
if [ -n "$config_server" ]; then
|
351
|
+
${mongo_command} "$config_server" --eval 'db.adminCommand("refreshLogicalSessionCacheNow")'
|
352
|
+
for mongos in ${mongoses[*]}
|
353
|
+
do
|
354
|
+
${mongo_command} "$mongos" --eval 'db.adminCommand("refreshLogicalSessionCacheNow")'
|
355
|
+
done
|
356
|
+
fi
|
357
|
+
fi
|
358
|
+
|
359
|
+
if test "$TOPOLOGY" = load-balanced; then
|
360
|
+
if test -z "$haproxy_config"; then
|
361
|
+
echo haproxy_config should have been set 1>&2
|
362
|
+
exit 3
|
363
|
+
fi
|
364
|
+
|
365
|
+
haproxy -D -f $haproxy_config -p $mongodb_dir/haproxy.pid
|
366
|
+
fi
|
290
367
|
}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
TOOLCHAIN_VERSION=
|
1
|
+
TOOLCHAIN_VERSION=43b0b8a644363c4052b9bf8221320a1828fe01a5
|
2
2
|
|
3
3
|
set_env_java() {
|
4
4
|
ls -l /opt || true
|
@@ -9,13 +9,13 @@ set_env_java() {
|
|
9
9
|
export JAVACMD=/opt/java/jdk8/bin/java
|
10
10
|
#export PATH=$PATH:/opt/java/jdk8/bin
|
11
11
|
fi
|
12
|
-
|
12
|
+
|
13
13
|
# ppc64le has it in a different place
|
14
14
|
if test -z "$JAVACMD" && [ -f /usr/lib/jvm/java-1.8.0/bin/java ]; then
|
15
15
|
export JAVACMD=/usr/lib/jvm/java-1.8.0/bin/java
|
16
16
|
#export PATH=$PATH:/usr/lib/jvm/java-1.8.0/bin
|
17
17
|
fi
|
18
|
-
|
18
|
+
|
19
19
|
if true; then
|
20
20
|
# newer
|
21
21
|
# rhel71-ppc, https://jira.mongodb.org/browse/BUILD-9231
|
@@ -34,7 +34,7 @@ set_env_java() {
|
|
34
34
|
# we will try the /usr/lib/jvm then
|
35
35
|
fi
|
36
36
|
fi
|
37
|
-
|
37
|
+
|
38
38
|
if test -n "$JAVACMD"; then
|
39
39
|
eval $JAVACMD -version
|
40
40
|
elif which java 2>/dev/null; then
|
@@ -68,15 +68,18 @@ set_env_ruby() {
|
|
68
68
|
export PATH=`pwd`/ruby-head/bin:`pwd`/ruby-head/lib/ruby/gems/2.6.0/bin:$PATH
|
69
69
|
ruby --version
|
70
70
|
ruby --version |grep dev
|
71
|
+
elif test "$SYSTEM_RUBY" = 1; then
|
72
|
+
# Nothing
|
73
|
+
:
|
71
74
|
else
|
72
75
|
if test "$USE_OPT_TOOLCHAIN" = 1; then
|
73
|
-
#
|
76
|
+
# Nothing, also PATH is already set
|
74
77
|
:
|
75
78
|
elif true; then
|
76
79
|
|
77
80
|
# For testing toolchains:
|
78
81
|
#toolchain_url=https://s3.amazonaws.com//mciuploads/mongo-ruby-toolchain/`host_distro`/f11598d091441ffc8d746aacfdc6c26741a3e629/mongo_ruby_driver_toolchain_`host_distro |tr - _`_patch_f11598d091441ffc8d746aacfdc6c26741a3e629_5e46f2793e8e866f36eda2c5_20_02_14_19_18_18.tar.gz
|
79
|
-
toolchain_url=http://boxes.10gen.com/build/toolchain-drivers/mongo-ruby-driver
|
82
|
+
toolchain_url=http://boxes.10gen.com/build/toolchain-drivers/mongo-ruby-driver/$TOOLCHAIN_VERSION/`host_distro`/$RVM_RUBY.tar.xz
|
80
83
|
curl --retry 3 -fL $toolchain_url |tar Jxf -
|
81
84
|
export PATH=`pwd`/rubies/$RVM_RUBY/bin:$PATH
|
82
85
|
#export PATH=`pwd`/rubies/python/3/bin:$PATH
|
data/spec/spec_helper.rb
CHANGED
@@ -30,6 +30,13 @@ require "yaml"
|
|
30
30
|
require 'support/spec_config'
|
31
31
|
|
32
32
|
if SpecConfig.instance.active_support?
|
33
|
+
require "active_support/version"
|
34
|
+
if ActiveSupport.version >= Gem::Version.new(7)
|
35
|
+
# ActiveSupport wants us to require ALL of it all of the time.
|
36
|
+
# See: https://github.com/rails/rails/issues/43851,
|
37
|
+
# https://github.com/rails/rails/issues/43889, etc.
|
38
|
+
require 'active_support'
|
39
|
+
end
|
33
40
|
require "active_support/time"
|
34
41
|
require 'bson/active_support'
|
35
42
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|