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/28 20:26:45 UTC

[couchdb] branch 2493-remove-auth-cache updated (f4356a3 -> d2037b6)

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.


    from f4356a3  Remove couch_auth_cache service
     new 6455856  Remove tests for backdoor port
     new d2037b6  Temporarily disable couch_auth_cache tests

The 2 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:
 src/couch/test/eunit/couch_auth_cache_tests.erl | 50 ++++++++++++-------------
 src/couch/test/eunit/couchdb_auth_tests.erl     | 11 +-----
 src/couch/test/eunit/couchdb_mrview_tests.erl   | 22 ++---------
 3 files changed, 29 insertions(+), 54 deletions(-)


[couchdb] 01/02: 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 645585661658f3403a732485007958196931cb6b
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_tests.erl | 22 +++-------------------
 2 files changed, 4 insertions(+), 29 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_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] 02/02: 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 d2037b619e4ea716ff485aa6b6c6205aa91bb2ba
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 = [