summaryrefslogtreecommitdiff
path: root/jstests/auth/speculative-sasl-start.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/auth/speculative-sasl-start.js')
-rw-r--r--jstests/auth/speculative-sasl-start.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/jstests/auth/speculative-sasl-start.js b/jstests/auth/speculative-sasl-start.js
index c69d6f11aed..8db5d03dcb7 100644
--- a/jstests/auth/speculative-sasl-start.js
+++ b/jstests/auth/speculative-sasl-start.js
@@ -92,5 +92,10 @@ test(baseOKURI + '?authMechanism=SCRAM-SHA-256', false);
assertStats((s) => expectN(s, 'SCRAM-SHA-1', 3, 2));
assertStats((s) => expectN(s, 'SCRAM-SHA-256', 6, 2));
+// Test that a user not in the admin DB can speculate
+mongod.getDB('test').createUser({user: 'alice', pwd: 'secret', roles: []});
+test('mongodb://alice:secret@localhost:' + mongod.port + '/test', true);
+assertStats((s) => expectN(s, 'SCRAM-SHA-256', 7, 3));
+
MongoRunner.stopMongod(mongod);
})();