summaryrefslogtreecommitdiff
path: root/jstests/auth/logout_reconnect.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/auth/logout_reconnect.js')
-rw-r--r--jstests/auth/logout_reconnect.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/jstests/auth/logout_reconnect.js b/jstests/auth/logout_reconnect.js
index 5646a30a292..775c3010920 100644
--- a/jstests/auth/logout_reconnect.js
+++ b/jstests/auth/logout_reconnect.js
@@ -15,8 +15,10 @@ conn = MongoRunner.runMongod({
// create user with rw permissions and login
var testDB = conn.getDB('test');
var adminDB = conn.getDB('admin');
-testDB.addUser({user:'rwuser', pwd:'rwuser', roles:['readWrite']})
adminDB.addUser({user:'admin', pwd:'admin', roles:['userAdminAnyDatabase']});
+adminDB.auth('admin','admin');
+testDB.addUser({user:'rwuser', pwd:'rwuser', roles:['readWrite']})
+adminDB.logout();
testDB.auth('rwuser', 'rwuser');
// verify that the rwuser can read and write