couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [6/7] couchdb commit: updated refs/heads/master to c34d871
Date Tue, 12 Jul 2016 20:17:30 GMT
cleanup wip


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f72b2530
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f72b2530
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f72b2530

Branch: refs/heads/master
Commit: f72b2530103dff9c2784916ead2dad5331f075f3
Parents: b124719
Author: Jan Lehnardt <jan@apache.org>
Authored: Tue Jul 12 20:28:13 2016 +0200
Committer: Jan Lehnardt <jan@apache.org>
Committed: Tue Jul 12 20:55:59 2016 +0200

----------------------------------------------------------------------
 test/javascript/tests/users_db.js          |  2 ++
 test/javascript/tests/users_db_security.js | 27 +++++++++++++++----------
 2 files changed, 18 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f72b2530/test/javascript/tests/users_db.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/users_db.js b/test/javascript/tests/users_db.js
index c075f89..9c67ec5 100644
--- a/test/javascript/tests/users_db.js
+++ b/test/javascript/tests/users_db.js
@@ -104,6 +104,7 @@ couchTests.users_db = function(debug) {
       });
       T(false && "this will throw");
     } catch(e) {
+      log(e.error)
       T(e.error == "unauthorized");
       T(/conflict/.test(e.reason));
     }
@@ -205,6 +206,7 @@ couchTests.users_db = function(debug) {
       } finally {
         CouchDB.login("jan", "apple");
         usersDb.deleteDb(); // cleanup
+        usersDb.createDb();
         usersDbAlt.deleteDb(); // cleanup
         CouchDB.logout();
       }

http://git-wip-us.apache.org/repos/asf/couchdb/blob/f72b2530/test/javascript/tests/users_db_security.js
----------------------------------------------------------------------
diff --git a/test/javascript/tests/users_db_security.js b/test/javascript/tests/users_db_security.js
index da51b23..a23c1d8 100644
--- a/test/javascript/tests/users_db_security.js
+++ b/test/javascript/tests/users_db_security.js
@@ -94,7 +94,7 @@ couchTests.users_db_security = function(debug) {
 
     // jan's gonna be admin as he's the first user
     TEquals(true, usersDb.save(userDoc).ok, "should save document");
-    wait(5000)
+    // wait(5000)
     userDoc = open_as(usersDb, "org.couchdb.user:jchris", "jchris");
     TEquals(undefined, userDoc.password, "password field should be null 1");
     TEquals(40, userDoc.derived_key.length, "derived_key should exist");
@@ -126,8 +126,8 @@ couchTests.users_db_security = function(debug) {
     jchrisDoc.password = "couch";
 
     TEquals(true, save_as(usersDb, jchrisDoc, "jchris").ok);
-    // wait(5000);
-    var jchrisDoc = open_as(usersDb, "org.couchdb.user:jchris", "jchris1");
+    // wait(10000);
+    var jchrisDoc = open_as(usersDb, "org.couchdb.user:jchris", "jan");
 
     TEquals(undefined, jchrisDoc.password, "password field should be null 2");
     TEquals(40, jchrisDoc.derived_key.length, "derived_key should exist");
@@ -147,9 +147,7 @@ couchTests.users_db_security = function(debug) {
     };
 
     usersDb.save(fdmananaDoc);
-
-    var fdmananaDocAsReadByjchris =
-      open_as(usersDb, "org.couchdb.user:fdmanana", "jchris1");
+    var fdmananaDocAsReadByjchris = open_as(usersDb, "org.couchdb.user:fdmanana", "jchris");
     TEquals(null, fdmananaDocAsReadByjchris,
       "should not_found opening another user's user doc");
 
@@ -204,7 +202,7 @@ couchTests.users_db_security = function(debug) {
 
     // non-admins can't read design docs
     try {
-      open_as(usersDb, "_design/user_db_auth", "jchris1");
+      open_as(usersDb, "_design/user_db_auth", "jchris");
       T(false, "non-admin read design doc, should not happen");
     } catch(e) {
       TEquals("forbidden", e.error, "non-admins can't read design docs");
@@ -308,7 +306,7 @@ couchTests.users_db_security = function(debug) {
         value: "false"
       }
     ], function() {
-      TEquals(true, CouchDB.login("jchris", "couch").ok);
+      TEquals(true, CouchDB.login("jchris", "mp3").ok);
 
       try {
         var all = usersDb.allDocs({ include_docs: true });
@@ -334,8 +332,15 @@ couchTests.users_db_security = function(debug) {
       key: "iterations", value: "1"},
    {section: "admins",
     key: "jan", value: "apple"}],
-    testFun
+    function() {
+      try {
+        testFun();
+      } finally {
+        CouchDB.login("jan", "apple");
+        usersDb.deleteDb(); // cleanup
+        usersDb.createDb();
+        CouchDB.logout();
+      }
+    }
   );
-  usersDb.deleteDb(); // cleanup
-  // wait(2000)
 };


Mime
View raw message