You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ko...@apache.org on 2020/01/29 16:28:32 UTC

[couchdb] branch 2493-remove-auth-cache updated (56535e8 -> bdd3e9e)

This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a change to branch 2493-remove-auth-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git.


    omit 56535e8  Temporarily skip JS tests hitting couch_auth_cache
    omit 6cd767b  Start chttpd
    omit 03ea009  Try moving multi-part att tests to clustered port
    omit 7de1be8  More expunging of backdoor
    omit d2037b6  Temporarily disable couch_auth_cache tests
    omit 6455856  Remove tests for backdoor port
     new 06be09d  Remove tests for backdoor port
     new 49b4fcb  Move multi-part attachment test to clustered port
     new 2b9d367  Temporarily disable couch_auth_cache tests
     new bdd3e9e  Temporarily skip JS tests hitting couch_auth_cache

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (56535e8)
            \
             N -- N -- N   refs/heads/2493-remove-auth-cache (bdd3e9e)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:


[couchdb] 03/04: Temporarily disable couch_auth_cache tests

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch 2493-remove-auth-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 2b9d367d2119f448807fa945475893d51c472be5
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 28 15:26:07 2020 -0500

    Temporarily disable couch_auth_cache tests
    
    Consider porting to chttpd_auth_cache
---
 src/couch/test/eunit/couch_auth_cache_tests.erl | 50 ++++++++++++-------------
 1 file changed, 25 insertions(+), 25 deletions(-)

diff --git a/src/couch/test/eunit/couch_auth_cache_tests.erl b/src/couch/test/eunit/couch_auth_cache_tests.erl
index 5439dd7..e1d413f 100644
--- a/src/couch/test/eunit/couch_auth_cache_tests.erl
+++ b/src/couch/test/eunit/couch_auth_cache_tests.erl
@@ -33,31 +33,31 @@ teardown(DbName) ->
     ok.
 
 
-couch_auth_cache_test_() ->
-    {
-        "CouchDB auth cache tests",
-        {
-            setup,
-            fun start/0, fun test_util:stop_couch/1,
-            {
-                foreach,
-                fun setup/0, fun teardown/1,
-                [
-                    fun should_get_nil_on_missed_cache/1,
-                    fun should_get_right_password_hash/1,
-                    fun should_ensure_doc_hash_equals_cached_one/1,
-                    fun should_update_password/1,
-                    fun should_cleanup_cache_after_userdoc_deletion/1,
-                    fun should_restore_cache_after_userdoc_recreation/1,
-                    fun should_drop_cache_on_auth_db_change/1,
-                    fun should_restore_cache_on_auth_db_change/1,
-                    fun should_recover_cache_after_shutdown/1,
-                    fun should_close_old_db_on_auth_db_change/1,
-                    fun should_get_admin_from_config/1
-                ]
-            }
-        }
-    }.
+% couch_auth_cache_test_() ->
+%     {
+%         "CouchDB auth cache tests",
+%         {
+%             setup,
+%             fun start/0, fun test_util:stop_couch/1,
+%             {
+%                 foreach,
+%                 fun setup/0, fun teardown/1,
+%                 [
+%                     fun should_get_nil_on_missed_cache/1,
+%                     fun should_get_right_password_hash/1,
+%                     fun should_ensure_doc_hash_equals_cached_one/1,
+%                     fun should_update_password/1,
+%                     fun should_cleanup_cache_after_userdoc_deletion/1,
+%                     fun should_restore_cache_after_userdoc_recreation/1,
+%                     fun should_drop_cache_on_auth_db_change/1,
+%                     fun should_restore_cache_on_auth_db_change/1,
+%                     fun should_recover_cache_after_shutdown/1,
+%                     fun should_close_old_db_on_auth_db_change/1,
+%                     fun should_get_admin_from_config/1
+%                 ]
+%             }
+%         }
+%     }.
 
 auth_vdu_test_() ->
     Cases = [


[couchdb] 02/04: Move multi-part attachment test to clustered port

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch 2493-remove-auth-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 49b4fcb020bddd9cb68f286782b59bd66ea2a0a8
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 28 15:47:14 2020 -0500

    Move multi-part attachment test to clustered port
---
 src/couch/test/eunit/couch_db_mpr_tests.erl | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/couch/test/eunit/couch_db_mpr_tests.erl b/src/couch/test/eunit/couch_db_mpr_tests.erl
index bb97c66..3005127 100644
--- a/src/couch/test/eunit/couch_db_mpr_tests.erl
+++ b/src/couch/test/eunit/couch_db_mpr_tests.erl
@@ -27,12 +27,18 @@
         {"Content-Type", "multipart/related;boundary=\"bound\""}).
 
 
+start() ->
+    test_util:start_couch([chttpd]).
+
+stop(Ctx) ->
+    test_util:stop_couch(Ctx).
+
 setup() ->
     Hashed = couch_passwords:hash_admin_password(?PASS),
     ok = config:set("admins", ?USER, ?b2l(Hashed), _Persist=false),
     TmpDb = ?tempdb(),
     Addr = config:get("httpd", "bind_address", "127.0.0.1"),
-    Port = mochiweb_socket_server:get(couch_httpd, port),
+    Port = mochiweb_socket_server:get(chttpd, port),
     Url = lists:concat(["http://", Addr, ":", Port, "/", ?b2l(TmpDb)]),
     Url.
 
@@ -64,8 +70,8 @@ couch_db_mpr_test_() ->
         "multi-part attachment tests",
         {
             setup,
-            fun test_util:start_couch/0,
-            fun test_util:stop_couch/1,
+            fun start/0,
+            fun stop/1,
             {
                 foreach,
                 fun setup/0,


[couchdb] 01/04: Remove tests for backdoor port

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch 2493-remove-auth-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit 06be09dc1f4c314924285fbb1b7c91709640ca8f
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 28 15:21:48 2020 -0500

    Remove tests for backdoor port
    
    We only support the clustered interface now.
---
 src/couch/test/eunit/couchdb_auth_tests.erl        | 11 +----------
 src/couch/test/eunit/couchdb_mrview_cors_tests.erl | 14 ++------------
 src/couch/test/eunit/couchdb_mrview_tests.erl      | 22 +++-------------------
 3 files changed, 6 insertions(+), 41 deletions(-)

diff --git a/src/couch/test/eunit/couchdb_auth_tests.erl b/src/couch/test/eunit/couchdb_auth_tests.erl
index 19d32d0..92f8a0a 100644
--- a/src/couch/test/eunit/couchdb_auth_tests.erl
+++ b/src/couch/test/eunit/couchdb_auth_tests.erl
@@ -49,7 +49,6 @@ auth_test_() ->
             fun() -> test_util:start_couch([chttpd]) end, fun test_util:stop_couch/1,
             [
                 make_test_cases(clustered, Tests),
-                make_test_cases(backdoor, Tests),
                 make_require_valid_user_test_cases(clustered, RequireValidUserTests)
             ]
         }
@@ -86,12 +85,6 @@ should_not_return_authenticated_field(_PortType, Url) ->
                 <<"info">>, <<"authenticated">>])
         end).
 
-should_return_list_of_handlers(backdoor, Url) ->
-    ?_assertEqual([<<"cookie">>,<<"default">>],
-        begin
-            couch_util:get_nested_json_value(session(Url), [
-                <<"info">>, <<"authentication_handlers">>])
-        end);
 should_return_list_of_handlers(clustered, Url) ->
     ?_assertEqual([<<"cookie">>,<<"default">>],
         begin
@@ -110,6 +103,4 @@ session(Url) ->
     jiffy:decode(Body).
 
 port(clustered) ->
-    integer_to_list(mochiweb_socket_server:get(chttpd, port));
-port(backdoor) ->
-    integer_to_list(mochiweb_socket_server:get(couch_httpd, port)).
+    integer_to_list(mochiweb_socket_server:get(chttpd, port)).
diff --git a/src/couch/test/eunit/couchdb_mrview_cors_tests.erl b/src/couch/test/eunit/couchdb_mrview_cors_tests.erl
index 0f69048..3083586 100644
--- a/src/couch/test/eunit/couchdb_mrview_cors_tests.erl
+++ b/src/couch/test/eunit/couchdb_mrview_cors_tests.erl
@@ -70,8 +70,7 @@ show_tests() ->
     {
         "Check CORS for show",
         [
-            make_test_case(clustered, [fun should_make_shows_request/2]),
-            make_test_case(backdoor, [fun should_make_shows_request/2])
+            make_test_case(clustered, [fun should_make_shows_request/2])
         ]
     }.
 
@@ -92,16 +91,11 @@ should_make_shows_request(_, {Host, DbName}) ->
          ?assertEqual(<<"<h1>wosh</h1>">>, Body)
     end).
 
-create_db(backdoor, DbName) ->
-    {ok, Db} = couch_db:create(DbName, [?ADMIN_CTX]),
-    couch_db:close(Db);
 create_db(clustered, DbName) ->
     {ok, Status, _, _} = test_request:put(db_url(DbName), [?AUTH], ""),
     assert_success(create_db, Status),
     ok.
 
-delete_db(backdoor, DbName) ->
-    couch_server:delete(DbName, [?ADMIN_CTX]);
 delete_db(clustered, DbName) ->
     {ok, Status, _, _} = test_request:delete(db_url(DbName), [?AUTH]),
     assert_success(delete_db, Status),
@@ -119,7 +113,6 @@ host_url(PortType) ->
 bind_address(PortType) ->
     config:get(section(PortType), "bind_address", "127.0.0.1").
 
-section(backdoor) -> "http";
 section(clustered) -> "chttpd".
 
 db_url(DbName) when is_binary(DbName) ->
@@ -128,10 +121,7 @@ db_url(DbName) when is_list(DbName) ->
     host_url(clustered) ++ "/" ++ DbName.
 
 port(clustered) ->
-    integer_to_list(mochiweb_socket_server:get(chttpd, port));
-port(backdoor) ->
-    integer_to_list(mochiweb_socket_server:get(couch_httpd, port)).
-
+    integer_to_list(mochiweb_socket_server:get(chttpd, port)).
 
 upload_ddoc(Host, DbName) ->
     Url = Host ++ "/" ++ DbName ++ "/_design/foo",
diff --git a/src/couch/test/eunit/couchdb_mrview_tests.erl b/src/couch/test/eunit/couchdb_mrview_tests.erl
index ec77b19..67a56f3 100644
--- a/src/couch/test/eunit/couchdb_mrview_tests.erl
+++ b/src/couch/test/eunit/couchdb_mrview_tests.erl
@@ -75,8 +75,7 @@ mrview_show_test_() ->
             fun setup_all/0,
             fun teardown_all/1,
             [
-                make_test_case(clustered, [fun should_return_invalid_request_body/2]),
-                make_test_case(backdoor, [fun should_return_invalid_request_body/2])
+                make_test_case(clustered, [fun should_return_invalid_request_body/2])
             ]
         }
     }.
@@ -89,8 +88,7 @@ mrview_query_test_() ->
             fun setup_all/0,
             fun teardown_all/1,
             [
-                make_test_case(clustered, [fun should_return_400_for_wrong_order_of_keys/2]),
-                make_test_case(backdoor, [fun should_return_400_for_wrong_order_of_keys/2])
+                make_test_case(clustered, [fun should_return_400_for_wrong_order_of_keys/2])
             ]
         }
     }.
@@ -191,28 +189,17 @@ should_cleanup_index_files(_PortType, {Host, DbName}) ->
     end).
 
 
-create_doc(backdoor, DbName, Id, Body) ->
-    JsonDoc = couch_util:json_apply_field({<<"_id">>, Id}, Body),
-    Doc = couch_doc:from_json_obj(JsonDoc),
-    {ok, Db} = couch_db:open(DbName, [?ADMIN_CTX]),
-    {ok, _} = couch_db:update_docs(Db, [Doc]),
-    couch_db:close(Db);
 create_doc(clustered, DbName, Id, Body) ->
     JsonDoc = couch_util:json_apply_field({<<"_id">>, Id}, Body),
     Doc = couch_doc:from_json_obj(JsonDoc),
     {ok, _} = fabric:update_docs(DbName, [Doc], [?ADMIN_CTX]),
     ok.
 
-create_db(backdoor, DbName) ->
-    {ok, Db} = couch_db:create(DbName, [?ADMIN_CTX]),
-    couch_db:close(Db);
 create_db(clustered, DbName) ->
     {ok, Status, _, _} = test_request:put(db_url(DbName), [?AUTH], ""),
     assert_success(create_db, Status),
     ok.
 
-delete_db(backdoor, DbName) ->
-    couch_server:delete(DbName, [?ADMIN_CTX]);
 delete_db(clustered, DbName) ->
     {ok, Status, _, _} = test_request:delete(db_url(DbName), [?AUTH]),
     assert_success(delete_db, Status),
@@ -230,7 +217,6 @@ host_url(PortType) ->
 bind_address(PortType) ->
     config:get(section(PortType), "bind_address", "127.0.0.1").
 
-section(backdoor) -> "http";
 section(clustered) -> "chttpd".
 
 db_url(DbName) when is_binary(DbName) ->
@@ -239,9 +225,7 @@ db_url(DbName) when is_list(DbName) ->
     host_url(clustered) ++ "/" ++ DbName.
 
 port(clustered) ->
-    integer_to_list(mochiweb_socket_server:get(chttpd, port));
-port(backdoor) ->
-    integer_to_list(mochiweb_socket_server:get(couch_httpd, port)).
+    integer_to_list(mochiweb_socket_server:get(chttpd, port)).
 
 
 upload_ddoc(Host, DbName) ->


[couchdb] 04/04: Temporarily skip JS tests hitting couch_auth_cache

Posted by ko...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kocolosk pushed a commit to branch 2493-remove-auth-cache
in repository https://gitbox.apache.org/repos/asf/couchdb.git

commit bdd3e9ef17ce97ce52de5f269526a632257c36af
Author: Adam Kocoloski <ko...@apache.org>
AuthorDate: Tue Jan 28 17:02:58 2020 -0500

    Temporarily skip JS tests hitting couch_auth_cache
---
 test/javascript/tests/reader_acl.js          | 2 ++
 test/javascript/tests/security_validation.js | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/test/javascript/tests/reader_acl.js b/test/javascript/tests/reader_acl.js
index 3966b64..261aaa5 100644
--- a/test/javascript/tests/reader_acl.js
+++ b/test/javascript/tests/reader_acl.js
@@ -10,6 +10,8 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
+couchTests.skip = true;
+
 couchTests.reader_acl = function(debug) {
   // this tests read access control
 
diff --git a/test/javascript/tests/security_validation.js b/test/javascript/tests/security_validation.js
index 128b90b..6098628 100644
--- a/test/javascript/tests/security_validation.js
+++ b/test/javascript/tests/security_validation.js
@@ -10,6 +10,8 @@
 // License for the specific language governing permissions and limitations under
 // the License.
 
+couchTests.skip = true;
+
 couchTests.security_validation = function(debug) {
 
   var db_name = get_random_db_name();