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:46 UTC
[couchdb] 01/02: Remove tests for backdoor port
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) ->