Skip to content

Commit 61066ca

Browse files
committed
update spec files
1 parent 2fefd93 commit 61066ca

File tree

9 files changed

+48
-123
lines changed

9 files changed

+48
-123
lines changed

lib/mongo/uri.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,9 +454,9 @@ def self.uri_option(uri_key, name, extra = {})
454454
uri_option 'tls', :ssl
455455
uri_option 'tlsallowinvalidcertificates', :ssl_verify, :type => :ssl_verify
456456
uri_option 'tlscafile', :ssl_ca_cert
457-
uri_option 'tlsclientcertfile', :ssl_cert
457+
uri_option 'tlscertificatekeyfile', :ssl_cert
458458
uri_option 'tlsclientkeyfile', :ssl_key
459-
uri_option 'tlsclientkeypassword', :ssl_key_pass_phrase
459+
uri_option 'tlscertificatekeypassword', :ssl_key_pass_phrase
460460
uri_option 'tlsinsecure', :ssl_verify, :type => :ssl_verify
461461

462462
# Topology options

spec/spec_tests/data/uri_options/auth-options.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ tests:
55
valid: true
66
warning: false
77
hosts: ~
8-
auth:
9-
username: ~
10-
password: ~
11-
db: ~
8+
auth: ~
129
options:
1310
authmechanism: "GSSAPI"
1411
authMechanismProperties:
1512
SERVICE_NAME: "other"
1613
CANONICALIZE_HOST_NAME: "true"
17-
authSource: "$external"
14+
authSource: "$external"

spec/spec_tests/data/uri_options/compression-options.yml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ tests:
55
valid: true
66
warning: false
77
hosts: ~
8-
auth:
9-
username: ~
10-
password: ~
11-
db: ~
8+
auth: ~
129
options:
1310
compressors: "zlib"
1411
zlibCompressionLevel: "9"
@@ -18,19 +15,13 @@ tests:
1815
valid: true
1916
warning: true
2017
hosts: ~
21-
auth:
22-
username: ~
23-
password: ~
24-
db: ~
18+
auth: ~
2519
options: {}
2620
-
2721
description: "Invalid zlibCompressionLevel causes a warning"
2822
uri: "mongodb://example.com/?compressors=zlib&zlibCompressionLevel=invalid"
2923
valid: true
3024
warning: true
3125
hosts: ~
32-
auth:
33-
username: ~
34-
password: ~
35-
db: ~
26+
auth: ~
3627
options: {}

spec/spec_tests/data/uri_options/concern-options.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ tests:
55
valid: true
66
warning: false
77
hosts: ~
8-
auth:
9-
username: ~
10-
password: ~
11-
db: ~
8+
auth: ~
129
options:
1310
readConcernLevel: "majority"
1411
w: "5"
@@ -20,10 +17,7 @@ tests:
2017
valid: true
2118
warning: false
2219
hosts: ~
23-
auth:
24-
username: ~
25-
password: ~
26-
db: ~
20+
auth: ~
2721
options:
2822
readConcernLevel: "arbitraryButStillValid"
2923
-
@@ -32,10 +26,7 @@ tests:
3226
valid: true
3327
warning: false
3428
hosts: ~
35-
auth:
36-
username: ~
37-
password: ~
38-
db: ~
29+
auth: ~
3930
options:
4031
w: "arbitraryButStillValid"
4132
-
@@ -44,19 +35,13 @@ tests:
4435
valid: true
4536
warning: true
4637
hosts: ~
47-
auth:
48-
username: ~
49-
password: ~
50-
db: ~
38+
auth: ~
5139
options: {}
5240
-
5341
description: "Invalid journal causes a warning"
5442
uri: "mongodb://example.com/?journal=invalid"
5543
valid: true
5644
warning: true
5745
hosts: ~
58-
auth:
59-
username: ~
60-
password: ~
61-
db: ~
46+
auth: ~
6247
options: {}

spec/spec_tests/data/uri_options/connection-options.yml

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ tests:
55
valid: true
66
warning: false
77
hosts: ~
8-
auth:
9-
username: ~
10-
password: ~
11-
db: ~
8+
auth: ~
129
options:
1310
appname: "URI-OPTIONS-SPEC-TEST"
1411
connectTimeoutMS: "20000"
@@ -25,52 +22,37 @@ tests:
2522
valid: true
2623
warning: true
2724
hosts: ~
28-
auth:
29-
username: ~
30-
password: ~
31-
db: ~
25+
auth: ~
3226
options: {}
3327
-
3428
description: "Invalid heartbeatFrequencyMS causes a warning"
3529
uri: "mongodb://example.com/?heartbeatFrequencyMS=invalid"
3630
valid: true
3731
warning: true
3832
hosts: ~
39-
auth:
40-
username: ~
41-
password: ~
42-
db: ~
33+
auth: ~
4334
options: {}
4435
-
4536
description: "Invalid localThresholdMS causes a warning"
4637
uri: "mongodb://example.com/?localThresholdMS=invalid"
4738
valid: true
4839
warning: true
4940
hosts: ~
50-
auth:
51-
username: ~
52-
password: ~
53-
db: ~
41+
auth: ~
5442
options: {}
5543
-
5644
description: "Invalid serverSelectionTimeoutMS causes a warning"
5745
uri: "mongodb://example.com/?serverSelectionTimeoutMS=invalid"
5846
valid: true
5947
warning: true
6048
hosts: ~
61-
auth:
62-
username: ~
63-
password: ~
64-
db: ~
49+
auth: ~
6550
options: {}
6651
-
6752
description: "Invalid socketTimeoutMS causes a warning"
6853
uri: "mongodb://example.com/?socketTimeoutMS=invalid"
6954
valid: true
7055
warning: true
7156
hosts: ~
72-
auth:
73-
username: ~
74-
password: ~
75-
db: ~
57+
auth: ~
7658
options: {}

spec/spec_tests/data/uri_options/connection-pool-options.yml

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,14 @@ tests:
55
valid: true
66
warning: false
77
hosts: ~
8-
auth:
9-
username: ~
10-
password: ~
11-
db: ~
8+
auth: ~
129
options:
13-
appname: "URI-OPTIONS-SPEC-TEST"
14-
connectTimeoutMS: "20000"
15-
heartbeatFrequencyMS: "5000"
16-
localThresholdMS: "3000"
1710
maxIdleTimeMS: "50000"
18-
replicaSet: "uri-options-spec"
19-
retryWrites: "true"
20-
serverSelectionTimeoutMS: "15000"
21-
socketTimeoutMS: "7500"
2211
-
2312
description: "Invalid maxIdleTimeMS causes a warning"
2413
uri: "mongodb://example.com/?maxIdleTimeMS=invalid"
2514
valid: true
2615
warning: true
2716
hosts: ~
28-
auth:
29-
username: ~
30-
password: ~
31-
db: ~
32-
options: {}
17+
auth: ~
18+
options: {}
Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
tests:
22
-
3-
description: "Valid connection and timeout options are parsed correctly"
3+
description: "Valid read preference options are parsed correctly"
44
uri: "mongodb://example.com/?readPreference=primaryPreferred&readPreferenceTags=dc:ny,rack:1&maxStalenessSeconds=120&readPreferenceTags=dc:ny"
55
valid: true
66
warning: false
77
hosts: ~
8-
auth:
9-
username: ~
10-
password: ~
11-
db: ~
8+
auth: ~
129
options:
1310
readPreference: "primaryPreferred"
1411
readPreferenceTags:
@@ -21,20 +18,14 @@ tests:
2118
valid: true
2219
warning: true
2320
hosts: ~
24-
auth:
25-
username: ~
26-
password: ~
27-
db: ~
21+
auth: ~
2822
options: {}
2923
-
3024
description: "Invalid maxStalenessSeconds causes a warning"
3125
uri: "mongodb://example.com/?maxStalenessSeconds=invalid"
3226
valid: true
3327
warning: true
3428
hosts: ~
35-
auth:
36-
username: ~
37-
password: ~
38-
db: ~
29+
auth: ~
3930
options: {}
4031

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
tests:
22
-
33
description: "Valid required tls options are parsed correctly"
4-
uri: "mongodb://example.com/?tls=true&tlsCAFilePath=ca.pem&tlsClientCertFilePath=cert.pem&tlsClientKeyPassword=hunter2"
4+
uri: "mongodb://example.com/?tls=true&tlsCAFile=ca.pem&tlsCertificateKeyFile=cert.pem&tlsCertificateKeyPassword=hunter2"
55
valid: true
66
warning: false
77
hosts: ~
8-
auth:
9-
username: ~
10-
password: ~
11-
db: ~
8+
auth: ~
129
options:
1310
tls: "true"
14-
tlsCAFilePath: "ca.pem"
15-
tlsClientCertFilePath: "cert.pem"
16-
tlsClientKeyPassword: "hunter2"
11+
tlsCAFile: "ca.pem"
12+
tlsCertificateKeyFile: "cert.pem"
13+
tlsCertificateKeyPassword: "hunter2"
1714
-
1815
description: "tlsAllowInvalidCertificates is parsed correctly"
1916
uri: "mongodb://example.com/?tlsAllowInvalidCertificates=true"
2017
valid: true
2118
warning: false
2219
hosts: ~
23-
auth:
24-
username: ~
25-
password: ~
26-
db: ~
20+
auth: ~
2721
options:
2822
tlsAllowInvalidCertificates: "true"
2923
-
@@ -32,10 +26,7 @@ tests:
3226
valid: true
3327
warning: false
3428
hosts: ~
35-
auth:
36-
username: ~
37-
password: ~
38-
db: ~
29+
auth: ~
3930
options:
4031
tlsAllowInvalidHostnames: "true"
4132
-
@@ -44,21 +35,23 @@ tests:
4435
valid: true
4536
warning: false
4637
hosts: ~
47-
auth:
48-
username: ~
49-
password: ~
50-
db: ~
38+
auth: ~
5139
options:
5240
tlsInsecure: "true"
5341
-
54-
description: "tlsClientKeyFilePath is parsed correctly"
55-
uri: "mongodb://example.com/?tlsClientKeyFilePath=client.pem"
42+
description: "tlsInsecure=true and tlsAllowInvalidCertificates=false warns"
43+
uri: "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidCertificates=false"
5644
valid: true
57-
warning: false
45+
warning: true
5846
hosts: ~
59-
auth:
60-
username: ~
61-
password: ~
62-
db: ~
63-
options:
64-
tlsClientKeyFilePath: "client.pem"
47+
auth: ~
48+
options: ~
49+
-
50+
description: "tlsInsecure=true and tlsAllowInvalidHostnames=false warns"
51+
uri: "mongodb://example.com/?tlsInsecure=true&tlsAllowInvalidHostnames=false"
52+
valid: true
53+
warning: true
54+
hosts: ~
55+
auth: ~
56+
options: ~
57+

spec/spec_tests/uri_options_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Address
4141
spec.tests.each do |test|
4242

4343
# Skip optional tests for options the driver doesn't support.
44-
next if test.description.start_with?('tlsAllowInvalidHostnames', 'tlsInsecure')
44+
next if test.description.start_with?('tlsAllowInvalidHostnames')
4545

4646
context "#{test.description}" do
4747

0 commit comments

Comments
 (0)