diff options
author | Bernie Hackett <bernie@10gen.com> | 2014-12-01 16:45:51 -0800 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2014-12-02 10:35:23 -0500 |
commit | 11b2d7b6051766674c2d66c86d9f23d0befdee09 (patch) | |
tree | 2dce702af832239463fb1f76f4986a43a44b103d /jstests/auth/user_special_chars.js | |
parent | 9872c67dafc6d1d5be312b97a74ee0d0d6640c3e (diff) | |
download | mongo-11b2d7b6051766674c2d66c86d9f23d0befdee09.tar.gz |
SERVER-16002 SERVER-16369 Cluster / standalone auth tests.
Closes #870
Signed-off-by: Benety Goh <benety@mongodb.com>
Diffstat (limited to 'jstests/auth/user_special_chars.js')
-rw-r--r-- | jstests/auth/user_special_chars.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/auth/user_special_chars.js b/jstests/auth/user_special_chars.js new file mode 100644 index 00000000000..f4dc218aeb7 --- /dev/null +++ b/jstests/auth/user_special_chars.js @@ -0,0 +1,14 @@ +// Test creating and authenticating a user with special characters. +var conn = MongoRunner.runMongod({auth: ''}); + +var testUserSpecialCharacters = function(){ + // Create a user with special characters, make sure it can auth. + var adminDB = conn.getDB('admin'); + adminDB.createUser({user: '~`!@#$%^&*()-_+={}[]||;:",.//><', pwd: 'pass', + roles: jsTest.adminUserRoles}); + assert(adminDB.auth({user: '~`!@#$%^&*()-_+={}[]||;:",.//><', + pwd: 'pass'})); +} + +testUserSpecialCharacters(); +MongoRunner.stopMongod(conn); |