You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@couchdb.apache.org by ch...@apache.org on 2014/08/15 22:25:09 UTC
[42/50] [abbrv] couch commit: updated refs/heads/1963-eunit-bigcouch
to 95bfc03
Switch to using config instead of couch_config
Project: http://git-wip-us.apache.org/repos/asf/couchdb-couch/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb-couch/commit/0456db3c
Tree: http://git-wip-us.apache.org/repos/asf/couchdb-couch/tree/0456db3c
Diff: http://git-wip-us.apache.org/repos/asf/couchdb-couch/diff/0456db3c
Branch: refs/heads/1963-eunit-bigcouch
Commit: 0456db3c0d9f0094cae69dd9877bdf0ced2a2d23
Parents: c237090
Author: Russell Branca <ch...@apache.org>
Authored: Mon Aug 11 15:52:57 2014 -0700
Committer: Russell Branca <ch...@apache.org>
Committed: Fri Aug 15 13:24:05 2014 -0700
----------------------------------------------------------------------
test/couch_auth_cache_tests.erl | 8 +-
test/couch_config_tests.erl | 112 +++++++++++++-------------
test/couch_db_tests.erl | 2 +-
test/couch_doc_json_tests.erl | 6 +-
test/couch_stats_tests.erl | 4 +-
test/couch_util_tests.erl | 4 +-
test/couch_uuids_tests.erl | 6 +-
test/couchdb_attachments_tests.erl | 8 +-
test/couchdb_compaction_daemon.erl | 18 ++---
test/couchdb_cors_tests.erl | 28 +++----
test/couchdb_csp_tests.erl | 10 +--
test/couchdb_file_compression_tests.erl | 18 ++---
test/couchdb_http_proxy_tests.erl | 6 +-
test/couchdb_os_daemons_tests.erl | 18 ++---
test/couchdb_os_proc_pool.erl | 2 +-
test/couchdb_update_conflicts_tests.erl | 2 +-
test/couchdb_vhosts_tests.erl | 44 +++++-----
test/couchdb_views_tests.erl | 18 ++---
test/fixtures/os_daemon_configer.escript | 2 +-
19 files changed, 158 insertions(+), 158 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couch_auth_cache_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_auth_cache_tests.erl b/test/couch_auth_cache_tests.erl
index 371cb63..83531ff 100644
--- a/test/couch_auth_cache_tests.erl
+++ b/test/couch_auth_cache_tests.erl
@@ -22,7 +22,7 @@
setup() ->
DbName = ?tempdb(),
- couch_config:set("couch_httpd_auth", "authentication_db",
+ config:set("couch_httpd_auth", "authentication_db",
?b2l(DbName), false),
DbName.
@@ -113,7 +113,7 @@ should_drop_cache_on_auth_db_change(DbName) ->
?_test(begin
{ok, _} = update_user_doc(DbName, "joe", "pass1"),
full_commit(DbName),
- couch_config:set("couch_httpd_auth", "authentication_db",
+ config:set("couch_httpd_auth", "authentication_db",
?b2l(?tempdb()), false),
?assertEqual(nil, couch_auth_cache:get_user_creds("joe"))
end).
@@ -126,13 +126,13 @@ should_restore_cache_on_auth_db_change(DbName) ->
full_commit(DbName),
DbName1 = ?tempdb(),
- couch_config:set("couch_httpd_auth", "authentication_db",
+ config:set("couch_httpd_auth", "authentication_db",
?b2l(DbName1), false),
{ok, _} = update_user_doc(DbName1, "joe", "pass5"),
full_commit(DbName1),
- couch_config:set("couch_httpd_auth", "authentication_db",
+ config:set("couch_httpd_auth", "authentication_db",
?b2l(DbName), false),
Creds = couch_auth_cache:get_user_creds("joe"),
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couch_config_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_config_tests.erl b/test/couch_config_tests.erl
index 91ec5e6..3b7a63f 100644
--- a/test/couch_config_tests.erl
+++ b/test/couch_config_tests.erl
@@ -41,7 +41,7 @@ setup({temporary, Chain}) ->
setup({persistent, Chain}) ->
setup(lists:append(Chain, [?CONFIG_FIXTURE_TEMP]));
setup(Chain) ->
- {ok, Pid} = couch_config:start_link(Chain),
+ {ok, Pid} = config:start_link(Chain),
Pid.
setup_empty() ->
@@ -74,7 +74,7 @@ teardown({ConfigPid, SentinelPid}) ->
end
end;
teardown(Pid) ->
- couch_config:stop(),
+ config:stop(),
erlang:monitor(process, Pid),
receive
{'DOWN', _, _, Pid, _} ->
@@ -201,7 +201,7 @@ config_register_tests() ->
config_no_files_tests() ->
{
- "Test couch_config with no files",
+ "Test config with no files",
{
foreach,
fun setup_empty/0, fun teardown/1,
@@ -215,132 +215,132 @@ config_no_files_tests() ->
should_load_all_configs() ->
- ?_assert(length(couch_config:all()) > 0).
+ ?_assert(length(config:all()) > 0).
should_locate_daemons_section() ->
- ?_assert(length(couch_config:get("daemons")) > 0).
+ ?_assert(length(config:get("daemons")) > 0).
should_locate_mrview_handler() ->
?_assertEqual("{couch_mrview_http, handle_view_req}",
- couch_config:get("httpd_design_handlers", "_view")).
+ config:get("httpd_design_handlers", "_view")).
should_return_undefined_atom_on_missed_section() ->
?_assertEqual(undefined,
- couch_config:get("foo", "bar")).
+ config:get("foo", "bar")).
should_return_undefined_atom_on_missed_option() ->
?_assertEqual(undefined,
- couch_config:get("httpd", "foo")).
+ config:get("httpd", "foo")).
should_return_custom_default_value_on_missed_option() ->
?_assertEqual("bar",
- couch_config:get("httpd", "foo", "bar")).
+ config:get("httpd", "foo", "bar")).
should_only_return_default_on_missed_option() ->
?_assertEqual("0",
- couch_config:get("httpd", "port", "bar")).
+ config:get("httpd", "port", "bar")).
should_get_binary_option() ->
?_assertEqual(<<"baz">>,
- couch_config:get(<<"foo">>, <<"bar">>, <<"baz">>)).
+ config:get(<<"foo">>, <<"bar">>, <<"baz">>)).
should_update_option() ->
?_assertEqual("severe",
begin
- ok = couch_config:set("log", "level", "severe", false),
- couch_config:get("log", "level")
+ ok = config:set("log", "level", "severe", false),
+ config:get("log", "level")
end).
should_create_new_section() ->
?_assertEqual("bang",
begin
- undefined = couch_config:get("new_section", "bizzle"),
- ok = couch_config:set("new_section", "bizzle", "bang", false),
- couch_config:get("new_section", "bizzle")
+ undefined = config:get("new_section", "bizzle"),
+ ok = config:set("new_section", "bizzle", "bang", false),
+ config:get("new_section", "bizzle")
end).
should_set_binary_option() ->
?_assertEqual(<<"baz">>,
begin
- ok = couch_config:set(<<"foo">>, <<"bar">>, <<"baz">>, false),
- couch_config:get(<<"foo">>, <<"bar">>)
+ ok = config:set(<<"foo">>, <<"bar">>, <<"baz">>, false),
+ config:get(<<"foo">>, <<"bar">>)
end).
should_return_undefined_atom_after_option_deletion() ->
?_assertEqual(undefined,
begin
- ok = couch_config:delete("log", "level", false),
- couch_config:get("log", "level")
+ ok = config:delete("log", "level", false),
+ config:get("log", "level")
end).
should_be_ok_on_deleting_unknown_options() ->
- ?_assertEqual(ok, couch_config:delete("zoo", "boo", false)).
+ ?_assertEqual(ok, config:delete("zoo", "boo", false)).
should_delete_binary_option() ->
?_assertEqual(undefined,
begin
- ok = couch_config:set(<<"foo">>, <<"bar">>, <<"baz">>, false),
- ok = couch_config:delete(<<"foo">>, <<"bar">>, false),
- couch_config:get(<<"foo">>, <<"bar">>)
+ ok = config:set(<<"foo">>, <<"bar">>, <<"baz">>, false),
+ ok = config:delete(<<"foo">>, <<"bar">>, false),
+ config:get(<<"foo">>, <<"bar">>)
end).
should_ensure_in_defaults(_, _) ->
?_test(begin
?assertEqual("100",
- couch_config:get("couchdb", "max_dbs_open")),
+ config:get("couchdb", "max_dbs_open")),
?assertEqual("5984",
- couch_config:get("httpd", "port")),
+ config:get("httpd", "port")),
?assertEqual(undefined,
- couch_config:get("fizbang", "unicode"))
+ config:get("fizbang", "unicode"))
end).
should_override_options(_, _) ->
?_test(begin
?assertEqual("10",
- couch_config:get("couchdb", "max_dbs_open")),
+ config:get("couchdb", "max_dbs_open")),
?assertEqual("4895",
- couch_config:get("httpd", "port"))
+ config:get("httpd", "port"))
end).
should_create_new_sections_on_override(_, _) ->
?_test(begin
?assertEqual("80",
- couch_config:get("httpd", "port")),
+ config:get("httpd", "port")),
?assertEqual("normalized",
- couch_config:get("fizbang", "unicode"))
+ config:get("fizbang", "unicode"))
end).
should_win_last_in_chain(_, _) ->
- ?_assertEqual("80", couch_config:get("httpd", "port")).
+ ?_assertEqual("80", config:get("httpd", "port")).
should_write_changes(_, _) ->
?_test(begin
?assertEqual("5984",
- couch_config:get("httpd", "port")),
+ config:get("httpd", "port")),
?assertEqual(ok,
- couch_config:set("httpd", "port", "8080")),
+ config:set("httpd", "port", "8080")),
?assertEqual("8080",
- couch_config:get("httpd", "port")),
+ config:get("httpd", "port")),
?assertEqual(ok,
- couch_config:delete("httpd", "bind_address", "8080")),
+ config:delete("httpd", "bind_address", "8080")),
?assertEqual(undefined,
- couch_config:get("httpd", "bind_address"))
+ config:get("httpd", "bind_address"))
end).
should_ensure_that_default_wasnt_modified(_, _) ->
?_test(begin
?assertEqual("5984",
- couch_config:get("httpd", "port")),
+ config:get("httpd", "port")),
?assertEqual("127.0.0.1",
- couch_config:get("httpd", "bind_address"))
+ config:get("httpd", "bind_address"))
end).
should_ensure_that_written_to_last_config_in_chain(_, _) ->
?_test(begin
?assertEqual("8080",
- couch_config:get("httpd", "port")),
+ config:get("httpd", "port")),
?assertEqual(undefined,
- couch_config:get("httpd", "bind_address"))
+ config:get("httpd", "bind_address"))
end).
should_handle_port_changes({_, SentinelPid}) ->
@@ -348,16 +348,16 @@ should_handle_port_changes({_, SentinelPid}) ->
MainProc = self(),
Port = "8080",
- couch_config:register(
+ config:register(
fun("httpd", "port", Value) ->
- % couch_config catches every error raised from handler
+ % config catches every error raised from handler
% so it's not possible to just assert on wrong value.
% We have to return the result as message
MainProc ! (Value =:= Port)
end,
SentinelPid
),
- ok = couch_config:set("httpd", "port", Port, false),
+ ok = config:set("httpd", "port", Port, false),
receive
R ->
@@ -374,16 +374,16 @@ should_pass_persistent_flag({_, SentinelPid}) ->
?_assert(begin
MainProc = self(),
- couch_config:register(
+ config:register(
fun("httpd", "port", _, Persist) ->
- % couch_config catches every error raised from handler
+ % config catches every error raised from handler
% so it's not possible to just assert on wrong value.
% We have to return the result as message
MainProc ! Persist
end,
SentinelPid
),
- ok = couch_config:set("httpd", "port", "8080", false),
+ ok = config:set("httpd", "port", "8080", false),
receive
false ->
@@ -397,13 +397,13 @@ should_not_trigger_handler_on_other_options_changes({_, SentinelPid}) ->
?_assert(begin
MainProc = self(),
- couch_config:register(
+ config:register(
fun("httpd", "port", _) ->
MainProc ! ok
end,
SentinelPid
),
- ok = couch_config:set("httpd", "bind_address", "0.0.0.0", false),
+ ok = config:set("httpd", "bind_address", "0.0.0.0", false),
receive
ok ->
@@ -417,7 +417,7 @@ should_not_trigger_handler_after_related_process_death({_, SentinelPid}) ->
?_assert(begin
MainProc = self(),
- couch_config:register(
+ config:register(
fun("httpd", "port", _) ->
MainProc ! ok
end,
@@ -435,7 +435,7 @@ should_not_trigger_handler_after_related_process_death({_, SentinelPid}) ->
{reason, "Timeout"}]})
end,
- ok = couch_config:set("httpd", "port", "12345", false),
+ ok = config:set("httpd", "port", "12345", false),
receive
ok ->
@@ -446,18 +446,18 @@ should_not_trigger_handler_after_related_process_death({_, SentinelPid}) ->
end).
should_ensure_that_no_ini_files_loaded() ->
- ?_assertEqual(0, length(couch_config:all())).
+ ?_assertEqual(0, length(config:all())).
should_create_non_persistent_option() ->
?_assertEqual("80",
begin
- ok = couch_config:set("httpd", "port", "80", false),
- couch_config:get("httpd", "port")
+ ok = config:set("httpd", "port", "80", false),
+ config:get("httpd", "port")
end).
should_create_persistent_option() ->
?_assertEqual("127.0.0.1",
begin
- ok = couch_config:set("httpd", "bind_address", "127.0.0.1"),
- couch_config:get("httpd", "bind_address")
+ ok = config:set("httpd", "bind_address", "127.0.0.1"),
+ config:get("httpd", "bind_address")
end).
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couch_db_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_db_tests.erl b/test/couch_db_tests.erl
index 90f0537..83d6a81 100644
--- a/test/couch_db_tests.erl
+++ b/test/couch_db_tests.erl
@@ -19,7 +19,7 @@
setup() ->
ok = test_util:start_couch(),
- couch_config:set("log", "include_sasl", "false", false),
+ config:set("log", "include_sasl", "false", false),
ok.
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couch_doc_json_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_doc_json_tests.erl b/test/couch_doc_json_tests.erl
index 23fc961..ef5d0f2 100644
--- a/test/couch_doc_json_tests.erl
+++ b/test/couch_doc_json_tests.erl
@@ -17,12 +17,12 @@
setup() ->
- couch_config:start_link(?CONFIG_CHAIN),
- couch_config:set("attachments", "compression_level", "0", false),
+ config:start_link(?CONFIG_CHAIN),
+ config:set("attachments", "compression_level", "0", false),
ok.
teardown(_) ->
- couch_config:stop().
+ config:stop().
json_doc_test_() ->
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couch_stats_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_stats_tests.erl b/test/couch_stats_tests.erl
index 6dbbb6a..d62afaf 100644
--- a/test/couch_stats_tests.erl
+++ b/test/couch_stats_tests.erl
@@ -28,7 +28,7 @@ setup_collector() ->
ok.
setup_aggregator(_) ->
- {ok, Pid} = couch_config:start_link([?STATS_INI_FIXTURE]),
+ {ok, Pid} = config:start_link([?STATS_INI_FIXTURE]),
{ok, _} = couch_stats_collector:start(),
{ok, _} = couch_stats_aggregator:start(?STATS_CFG_FIXTURE),
Pid.
@@ -41,7 +41,7 @@ teardown_aggregator(_, Pid) ->
couch_stats_aggregator:stop(),
couch_stats_collector:stop(),
erlang:monitor(process, Pid),
- couch_config:stop(),
+ config:stop(),
receive
{'DOWN', _, _, Pid, _} ->
ok
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couch_util_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_util_tests.erl b/test/couch_util_tests.erl
index c5689af..4c313a2 100644
--- a/test/couch_util_tests.erl
+++ b/test/couch_util_tests.erl
@@ -24,13 +24,13 @@ setup() ->
%% {error, not_loaded_by_this_process} while it is. Any ideas is welcome.
%%
ok = test_util:start_couch(),
- %% couch_config:start_link(?CONFIG_CHAIN),
+ %% config:start_link(?CONFIG_CHAIN),
%% {ok, _} = couch_drv:start_link(),
ok.
teardown(_) ->
ok = test_util:stop_couch(),
- %% couch_config:stop(),
+ %% config:stop(),
%% erl_ddll:unload_driver(couch_icu_driver),
ok.
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couch_uuids_tests.erl
----------------------------------------------------------------------
diff --git a/test/couch_uuids_tests.erl b/test/couch_uuids_tests.erl
index 754a49b..27c5cb8 100644
--- a/test/couch_uuids_tests.erl
+++ b/test/couch_uuids_tests.erl
@@ -18,7 +18,7 @@
setup() ->
- {ok, Pid} = couch_config:start_link(?CONFIG_CHAIN),
+ {ok, Pid} = config:start_link(?CONFIG_CHAIN),
erlang:monitor(process, Pid),
couch_uuids:start(),
Pid.
@@ -27,13 +27,13 @@ setup(Opts) ->
Pid = setup(),
lists:foreach(
fun({Option, Value}) ->
- couch_config:set("uuids", Option, Value, false)
+ config:set("uuids", Option, Value, false)
end, Opts),
Pid.
teardown(Pid) ->
couch_uuids:stop(),
- couch_config:stop(),
+ config:stop(),
receive
{'DOWN', _, _, Pid, _} -> ok
after
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_attachments_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_attachments_tests.erl b/test/couchdb_attachments_tests.erl
index 0391822..b203a82 100644
--- a/test/couchdb_attachments_tests.erl
+++ b/test/couchdb_attachments_tests.erl
@@ -29,16 +29,16 @@
start() ->
ok = test_util:start_couch(),
% ensure in default compression settings for attachments_compression_tests
- couch_config:set("attachments", "compression_level",
+ config:set("attachments", "compression_level",
?i2l(?COMPRESSION_LEVEL), false),
- couch_config:set("attachments", "compressible_types", "text/*", false),
+ config:set("attachments", "compressible_types", "text/*", false),
ok.
setup() ->
DbName = ?tempdb(),
{ok, Db} = couch_db:create(DbName, []),
ok = couch_db:close(Db),
- Addr = couch_config:get("httpd", "bind_address", any),
+ Addr = config:get("httpd", "bind_address", any),
Port = mochiweb_socket_server:get(couch_httpd, port),
Host = Addr ++ ":" ++ ?i2l(Port),
{Host, ?b2l(DbName)}.
@@ -540,7 +540,7 @@ chunked_body([Chunk | Rest], Acc) ->
get_socket() ->
Options = [binary, {packet, 0}, {active, false}],
- Addr = couch_config:get("httpd", "bind_address", any),
+ Addr = config:get("httpd", "bind_address", any),
Port = mochiweb_socket_server:get(couch_httpd, port),
{ok, Sock} = gen_tcp:connect(Addr, Port, Options),
Sock.
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_compaction_daemon.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_compaction_daemon.erl b/test/couchdb_compaction_daemon.erl
index de166a4..24c5d7b 100644
--- a/test/couchdb_compaction_daemon.erl
+++ b/test/couchdb_compaction_daemon.erl
@@ -23,8 +23,8 @@
start() ->
ok = test_util:start_couch(),
- couch_config:set("compaction_daemon", "check_interval", "3", false),
- couch_config:set("compaction_daemon", "min_file_size", "100000", false),
+ config:set("compaction_daemon", "check_interval", "3", false),
+ config:set("compaction_daemon", "min_file_size", "100000", false),
ok.
setup() ->
@@ -35,10 +35,10 @@ setup() ->
DbName.
teardown(DbName) ->
- Configs = couch_config:get("compactions"),
+ Configs = config:get("compactions"),
lists:foreach(
fun({Key, _}) ->
- ok = couch_config:delete("compactions", Key, false)
+ ok = config:delete("compactions", Key, false)
end,
Configs),
couch_server:delete(DbName, [?ADMIN_USER]),
@@ -71,13 +71,13 @@ should_compact_by_default_rule(DbName) ->
{_, DbFileSize} = get_db_frag(DbName),
{_, ViewFileSize} = get_view_frag(DbName),
- ok = couch_config:set("compactions", "_default",
+ ok = config:set("compactions", "_default",
"[{db_fragmentation, \"70%\"}, {view_fragmentation, \"70%\"}]",
false),
ok = timer:sleep(4000), % something >= check_interval
wait_compaction_finished(DbName),
- ok = couch_config:delete("compactions", "_default", false),
+ ok = config:delete("compactions", "_default", false),
{DbFrag2, DbFileSize2} = get_db_frag(DbName),
{ViewFrag2, ViewFileSize2} = get_view_frag(DbName),
@@ -100,13 +100,13 @@ should_compact_by_dbname_rule(DbName) ->
{_, DbFileSize} = get_db_frag(DbName),
{_, ViewFileSize} = get_view_frag(DbName),
- ok = couch_config:set("compactions", ?b2l(DbName),
+ ok = config:set("compactions", ?b2l(DbName),
"[{db_fragmentation, \"70%\"}, {view_fragmentation, \"70%\"}]",
false),
ok = timer:sleep(4000), % something >= check_interval
wait_compaction_finished(DbName),
- ok = couch_config:delete("compactions", ?b2l(DbName), false),
+ ok = config:delete("compactions", ?b2l(DbName), false),
{DbFrag2, DbFileSize2} = get_db_frag(DbName),
{ViewFrag2, ViewFileSize2} = get_view_frag(DbName),
@@ -168,7 +168,7 @@ update(DbName) ->
couch_db:close(Db).
db_url(DbName) ->
- Addr = couch_config:get("httpd", "bind_address", "127.0.0.1"),
+ Addr = config:get("httpd", "bind_address", "127.0.0.1"),
Port = integer_to_list(mochiweb_socket_server:get(couch_httpd, port)),
"http://" ++ Addr ++ ":" ++ Port ++ "/" ++ ?b2l(DbName).
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_cors_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_cors_tests.erl b/test/couchdb_cors_tests.erl
index 336d5ee..02f9da9 100644
--- a/test/couchdb_cors_tests.erl
+++ b/test/couchdb_cors_tests.erl
@@ -24,8 +24,8 @@
start() ->
ok = test_util:start_couch(),
- ok = couch_config:set("httpd", "enable_cors", "true", false),
- ok = couch_config:set("vhosts", "example.com", "/", false),
+ ok = config:set("httpd", "enable_cors", "true", false),
+ ok = config:set("vhosts", "example.com", "/", false),
ok.
setup() ->
@@ -33,10 +33,10 @@ setup() ->
{ok, Db} = couch_db:create(DbName, [?ADMIN_USER]),
couch_db:close(Db),
- couch_config:set("cors", "credentials", "false", false),
- couch_config:set("cors", "origins", "http://example.com", false),
+ config:set("cors", "credentials", "false", false),
+ config:set("cors", "origins", "http://example.com", false),
- Addr = couch_config:get("httpd", "bind_address", "127.0.0.1"),
+ Addr = config:get("httpd", "bind_address", "127.0.0.1"),
Port = integer_to_list(mochiweb_socket_server:get(couch_httpd, port)),
Host = "http://" ++ Addr ++ ":" ++ Port,
{Host, ?b2l(DbName)}.
@@ -136,7 +136,7 @@ make_test_case(Mod, UseVhost, Funs) ->
should_not_allow_origin(_, {_, _, Url, Headers0}) ->
?_assertEqual(undefined,
begin
- couch_config:delete("cors", "origins", false),
+ config:delete("cors", "origins", false),
Headers1 = proplists:delete("Origin", Headers0),
Headers = [{"Origin", "http://127.0.0.1"}]
++ Headers1,
@@ -200,7 +200,7 @@ should_make_preflight_request(_, {_, _, Url, DefaultHeaders}) ->
should_make_prefligh_request_with_port({_, VHost}, {_, _, Url, _}) ->
?_assertEqual("http://example.com:5984",
begin
- couch_config:set("cors", "origins", "http://example.com:5984",
+ config:set("cors", "origins", "http://example.com:5984",
false),
Headers = [{"Origin", "http://example.com:5984"},
{"Access-Control-Request-Method", "GET"}]
@@ -212,7 +212,7 @@ should_make_prefligh_request_with_port({_, VHost}, {_, _, Url, _}) ->
should_make_prefligh_request_with_scheme({_, VHost}, {_, _, Url, _}) ->
?_assertEqual("https://example.com:5984",
begin
- couch_config:set("cors", "origins", "https://example.com:5984",
+ config:set("cors", "origins", "https://example.com:5984",
false),
Headers = [{"Origin", "https://example.com:5984"},
{"Access-Control-Request-Method", "GET"}]
@@ -224,7 +224,7 @@ should_make_prefligh_request_with_scheme({_, VHost}, {_, _, Url, _}) ->
should_make_prefligh_request_with_wildcard_origin({_, VHost}, {_, _, Url, _}) ->
?_assertEqual("https://example.com:5984",
begin
- couch_config:set("cors", "origins", "*", false),
+ config:set("cors", "origins", "*", false),
Headers = [{"Origin", "https://example.com:5984"},
{"Access-Control-Request-Method", "GET"}]
++ maybe_append_vhost(VHost),
@@ -235,7 +235,7 @@ should_make_prefligh_request_with_wildcard_origin({_, VHost}, {_, _, Url, _}) ->
should_make_request_with_credentials(_, {_, _, Url, DefaultHeaders}) ->
?_assertEqual("true",
begin
- ok = couch_config:set("cors", "credentials", "true", false),
+ ok = config:set("cors", "credentials", "true", false),
{ok, _, Resp, _} = test_request:options(Url, DefaultHeaders),
proplists:get_value("Access-Control-Allow-Credentials", Resp)
end).
@@ -244,10 +244,10 @@ should_make_origin_request_with_auth(_, {_, _, Url, DefaultHeaders}) ->
?_assertEqual("http://example.com",
begin
Hashed = couch_passwords:hash_admin_password(<<"test">>),
- couch_config:set("admins", "test", Hashed, false),
+ config:set("admins", "test", Hashed, false),
{ok, _, Resp, _} = test_request:get(
Url, DefaultHeaders, [{basic_auth, {"test", "test"}}]),
- couch_config:delete("admins", "test", false),
+ config:delete("admins", "test", false),
proplists:get_value("Access-Control-Allow-Origin", Resp)
end).
@@ -255,12 +255,12 @@ should_make_preflight_request_with_auth(_, {_, _, Url, DefaultHeaders}) ->
?_assertEqual(?SUPPORTED_METHODS,
begin
Hashed = couch_passwords:hash_admin_password(<<"test">>),
- couch_config:set("admins", "test", Hashed, false),
+ config:set("admins", "test", Hashed, false),
Headers = DefaultHeaders
++ [{"Access-Control-Request-Method", "GET"}],
{ok, _, Resp, _} = test_request:options(
Url, Headers, [{basic_auth, {"test", "test"}}]),
- couch_config:delete("admins", "test", false),
+ config:delete("admins", "test", false),
proplists:get_value("Access-Control-Allow-Methods", Resp)
end).
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_csp_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_csp_tests.erl b/test/couchdb_csp_tests.erl
index 0626a08..3dbe6e3 100644
--- a/test/couchdb_csp_tests.erl
+++ b/test/couchdb_csp_tests.erl
@@ -18,8 +18,8 @@
setup() ->
- ok = couch_config:set("csp", "enable", "true", false),
- Addr = couch_config:get("httpd", "bind_address", "127.0.0.1"),
+ ok = config:set("csp", "enable", "true", false),
+ Addr = config:get("httpd", "bind_address", "127.0.0.1"),
Port = integer_to_list(mochiweb_socket_server:get(couch_httpd, port)),
lists:concat(["http://", Addr, ":", Port, "/_utils/"]).
@@ -50,7 +50,7 @@ csp_test_() ->
should_not_return_any_csp_headers_when_disabled(Url) ->
?_assertEqual(undefined,
begin
- ok = couch_config:set("csp", "enable", "false", false),
+ ok = config:set("csp", "enable", "false", false),
{ok, _, Headers, _} = test_request:get(Url),
proplists:get_value("Content-Security-Policy", Headers)
end).
@@ -67,7 +67,7 @@ should_apply_default_policy(Url) ->
should_return_custom_policy(Url) ->
?_assertEqual("default-src 'http://example.com';",
begin
- ok = couch_config:set("csp", "header_value",
+ ok = config:set("csp", "header_value",
"default-src 'http://example.com';", false),
{ok, _, Headers, _} = test_request:get(Url),
proplists:get_value("Content-Security-Policy", Headers)
@@ -76,7 +76,7 @@ should_return_custom_policy(Url) ->
should_only_enable_csp_when_true(Url) ->
?_assertEqual(undefined,
begin
- ok = couch_config:set("csp", "enable", "tru", false),
+ ok = config:set("csp", "enable", "tru", false),
{ok, _, Headers, _} = test_request:get(Url),
proplists:get_value("Content-Security-Policy", Headers)
end).
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_file_compression_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_file_compression_tests.erl b/test/couchdb_file_compression_tests.erl
index 5573dd8..5b12882 100644
--- a/test/couchdb_file_compression_tests.erl
+++ b/test/couchdb_file_compression_tests.erl
@@ -22,7 +22,7 @@
setup() ->
- couch_config:set("couchdb", "file_compression", "none", false),
+ config:set("couchdb", "file_compression", "none", false),
DbName = ?tempdb(),
{ok, Db} = couch_db:create(DbName, [?ADMIN_USER]),
ok = populate_db(Db, ?DOCS_COUNT),
@@ -68,7 +68,7 @@ couch_auth_cache_test_() ->
should_use_none(DbName) ->
- couch_config:set("couchdb", "file_compression", "none", false),
+ config:set("couchdb", "file_compression", "none", false),
{
"Use no compression",
[
@@ -78,7 +78,7 @@ should_use_none(DbName) ->
}.
should_use_deflate_1(DbName) ->
- couch_config:set("couchdb", "file_compression", "deflate_1", false),
+ config:set("couchdb", "file_compression", "deflate_1", false),
{
"Use deflate compression at level 1",
[
@@ -88,7 +88,7 @@ should_use_deflate_1(DbName) ->
}.
should_use_deflate_9(DbName) ->
- couch_config:set("couchdb", "file_compression", "deflate_9", false),
+ config:set("couchdb", "file_compression", "deflate_9", false),
{
"Use deflate compression at level 9",
[
@@ -98,7 +98,7 @@ should_use_deflate_9(DbName) ->
}.
should_use_snappy(DbName) ->
- couch_config:set("couchdb", "file_compression", "snappy", false),
+ config:set("couchdb", "file_compression", "snappy", false),
{
"Use snappy compression",
[
@@ -112,13 +112,13 @@ should_compare_compression_methods(DbName) ->
{timeout, ?TIMEOUT div 1000, ?_test(compare_compression_methods(DbName))}}.
compare_compression_methods(DbName) ->
- couch_config:set("couchdb", "file_compression", "none", false),
+ config:set("couchdb", "file_compression", "none", false),
compact_db(DbName),
compact_view(DbName),
DbSizeNone = db_disk_size(DbName),
ViewSizeNone = view_disk_size(DbName),
- couch_config:set("couchdb", "file_compression", "snappy", false),
+ config:set("couchdb", "file_compression", "snappy", false),
compact_db(DbName),
compact_view(DbName),
DbSizeSnappy = db_disk_size(DbName),
@@ -127,7 +127,7 @@ compare_compression_methods(DbName) ->
?assert(DbSizeNone > DbSizeSnappy),
?assert(ViewSizeNone > ViewSizeSnappy),
- couch_config:set("couchdb", "file_compression", "deflate_1", false),
+ config:set("couchdb", "file_compression", "deflate_1", false),
compact_db(DbName),
compact_view(DbName),
DbSizeDeflate1 = db_disk_size(DbName),
@@ -136,7 +136,7 @@ compare_compression_methods(DbName) ->
?assert(DbSizeSnappy > DbSizeDeflate1),
?assert(ViewSizeSnappy > ViewSizeDeflate1),
- couch_config:set("couchdb", "file_compression", "deflate_9", false),
+ config:set("couchdb", "file_compression", "deflate_9", false),
compact_db(DbName),
compact_view(DbName),
DbSizeDeflate9 = db_disk_size(DbName),
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_http_proxy_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_http_proxy_tests.erl b/test/couchdb_http_proxy_tests.erl
index 0c554ff..cee6a02 100644
--- a/test/couchdb_http_proxy_tests.erl
+++ b/test/couchdb_http_proxy_tests.erl
@@ -33,7 +33,7 @@ start() ->
% (each httpd_global_handlers changes causes couch_httpd restart)
ok = test_util:start_couch(test_util:config_files() ++ [?CONFIG_FIXTURE_TEMP]),
% 49151 is IANA Reserved, let's assume no one is listening there
- couch_config:set("httpd_global_handlers", "_error",
+ config:set("httpd_global_handlers", "_error",
"{couch_httpd_proxy, handle_proxy_req, <<\"http://127.0.0.1:49151/\">>}"
),
ok.
@@ -43,7 +43,7 @@ setup() ->
Value = lists:flatten(io_lib:format(
"{couch_httpd_proxy, handle_proxy_req, ~p}",
[list_to_binary(proxy_url())])),
- couch_config:set("httpd_global_handlers", "_test", Value),
+ config:set("httpd_global_handlers", "_test", Value),
% let couch_httpd restart
timer:sleep(100),
Pid.
@@ -381,7 +381,7 @@ server_url() ->
server_url("/_test").
server_url(Resource) ->
- Addr = couch_config:get("httpd", "bind_address"),
+ Addr = config:get("httpd", "bind_address"),
Port = integer_to_list(mochiweb_socket_server:get(couch_httpd, port)),
lists:concat(["http://", Addr, ":", Port, Resource]).
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_os_daemons_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_os_daemons_tests.erl b/test/couchdb_os_daemons_tests.erl
index ef21f58..3eeb7d7 100644
--- a/test/couchdb_os_daemons_tests.erl
+++ b/test/couchdb_os_daemons_tests.erl
@@ -37,16 +37,16 @@
setup(DName) ->
- {ok, CfgPid} = couch_config:start_link(?CONFIG_CHAIN),
+ {ok, CfgPid} = config:start_link(?CONFIG_CHAIN),
{ok, OsDPid} = couch_os_daemons:start_link(),
- couch_config:set("os_daemons", DName,
+ config:set("os_daemons", DName,
filename:join([?FIXTURESDIR, DName]), false),
timer:sleep(?DELAY), % sleep a bit to let daemon set kill flag
{CfgPid, OsDPid}.
teardown(_, {CfgPid, OsDPid}) ->
erlang:monitor(process, CfgPid),
- couch_config:stop(),
+ config:stop(),
receive
{'DOWN', _, _, CfgPid, _} ->
ok
@@ -121,16 +121,16 @@ should_check_daemon_table_form(DName, _) ->
should_clean_tables_on_daemon_remove(DName, _) ->
?_test(begin
- couch_config:delete("os_daemons", DName, false),
+ config:delete("os_daemons", DName, false),
{ok, Tab2} = couch_os_daemons:info(),
?_assertEqual([], ets:tab2list(Tab2))
end).
should_spawn_multiple_daemons(DName, _) ->
?_test(begin
- couch_config:set("os_daemons", "bar",
+ config:set("os_daemons", "bar",
filename:join([?FIXTURESDIR, DName]), false),
- couch_config:set("os_daemons", "baz",
+ config:set("os_daemons", "baz",
filename:join([?FIXTURESDIR, DName]), false),
timer:sleep(?DELAY),
{ok, Daemons} = couch_os_daemons:info([table]),
@@ -145,7 +145,7 @@ should_spawn_multiple_daemons(DName, _) ->
should_keep_alive_one_daemon_on_killing_other(DName, _) ->
?_test(begin
- couch_config:set("os_daemons", "bar",
+ config:set("os_daemons", "bar",
filename:join([?FIXTURESDIR, DName]), false),
timer:sleep(?DELAY),
{ok, Daemons} = couch_os_daemons:info([table]),
@@ -153,7 +153,7 @@ should_keep_alive_one_daemon_on_killing_other(DName, _) ->
check_daemon(D)
end, Daemons),
- couch_config:delete("os_daemons", "bar", false),
+ config:delete("os_daemons", "bar", false),
timer:sleep(?DELAY),
{ok, [D2]} = couch_os_daemons:info([table]),
check_daemon(D2, DName),
@@ -203,7 +203,7 @@ should_halts(DName, Time) ->
timer:sleep(Time),
{ok, [D]} = couch_os_daemons:info([table]),
check_dead(D, DName),
- couch_config:delete("os_daemons", DName, false).
+ config:delete("os_daemons", DName, false).
check_daemon(D) ->
check_daemon(D, D#daemon.name).
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_os_proc_pool.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_os_proc_pool.erl b/test/couchdb_os_proc_pool.erl
index ae07d58..a8ab752 100644
--- a/test/couchdb_os_proc_pool.erl
+++ b/test/couchdb_os_proc_pool.erl
@@ -20,7 +20,7 @@
start() ->
ok = test_util:start_couch(),
- couch_config:set("query_server_config", "os_process_limit", "3", false),
+ config:set("query_server_config", "os_process_limit", "3", false),
ok.
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_update_conflicts_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_update_conflicts_tests.erl b/test/couchdb_update_conflicts_tests.erl
index 2450313..7ac1187 100644
--- a/test/couchdb_update_conflicts_tests.erl
+++ b/test/couchdb_update_conflicts_tests.erl
@@ -24,7 +24,7 @@
start() ->
ok = test_util:start_couch(),
- couch_config:set("couchdb", "delayed_commits", "true", false),
+ config:set("couchdb", "delayed_commits", "true", false),
ok.
setup() ->
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_vhosts_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_vhosts_tests.erl b/test/couchdb_vhosts_tests.erl
index 7432022..321012f 100644
--- a/test/couchdb_vhosts_tests.erl
+++ b/test/couchdb_vhosts_tests.erl
@@ -47,7 +47,7 @@ setup() ->
couch_db:ensure_full_commit(Db),
couch_db:close(Db),
- Addr = couch_config:get("httpd", "bind_address", "127.0.0.1"),
+ Addr = config:get("httpd", "bind_address", "127.0.0.1"),
Port = integer_to_list(mochiweb_socket_server:get(couch_httpd, port)),
Url = "http://" ++ Addr ++ ":" ++ Port,
{Url, ?b2l(DbName)}.
@@ -56,14 +56,14 @@ setup_oauth() ->
DbName = ?tempdb(),
{ok, Db} = couch_db:create(DbName, [?ADMIN_USER]),
- couch_config:set("couch_httpd_auth", "authentication_db",
+ config:set("couch_httpd_auth", "authentication_db",
?b2l(?tempdb()), false),
- couch_config:set("oauth_token_users", "otoksec1", "joe", false),
- couch_config:set("oauth_consumer_secrets", "consec1", "foo", false),
- couch_config:set("oauth_token_secrets", "otoksec1", "foobar", false),
- couch_config:set("couch_httpd_auth", "require_valid_user", "true", false),
+ config:set("oauth_token_users", "otoksec1", "joe", false),
+ config:set("oauth_consumer_secrets", "consec1", "foo", false),
+ config:set("oauth_token_secrets", "otoksec1", "foobar", false),
+ config:set("couch_httpd_auth", "require_valid_user", "true", false),
- ok = couch_config:set(
+ ok = config:set(
"vhosts", "oauth-example.com",
"/" ++ ?b2l(DbName) ++ "/_design/test/_rewrite/foobar", false),
@@ -82,7 +82,7 @@ setup_oauth() ->
couch_db:ensure_full_commit(Db),
couch_db:close(Db),
- Addr = couch_config:get("httpd", "bind_address", "127.0.0.1"),
+ Addr = config:get("httpd", "bind_address", "127.0.0.1"),
Port = integer_to_list(mochiweb_socket_server:get(couch_httpd, port)),
Url = "http://" ++ Addr ++ ":" ++ Port,
{Url, ?b2l(DbName)}.
@@ -140,7 +140,7 @@ oauth_test_() ->
should_return_database_info({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", "example.com", "/" ++ DbName, false),
+ ok = config:set("vhosts", "example.com", "/" ++ DbName, false),
case test_request:get(Url, [], [{host_header, "example.com"}]) of
{ok, _, _, Body} ->
{JsonBody} = ejson:decode(Body),
@@ -155,7 +155,7 @@ should_return_database_info({Url, DbName}) ->
should_return_revs_info({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", "example.com", "/" ++ DbName, false),
+ ok = config:set("vhosts", "example.com", "/" ++ DbName, false),
case test_request:get(Url ++ "/doc1?revs_info=true", [],
[{host_header, "example.com"}]) of
{ok, _, _, Body} ->
@@ -171,7 +171,7 @@ should_return_revs_info({Url, DbName}) ->
should_serve_utils_for_vhost({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", "example.com", "/" ++ DbName, false),
+ ok = config:set("vhosts", "example.com", "/" ++ DbName, false),
case test_request:get(Url ++ "/_utils/index.html", [],
[{host_header, "example.com"}]) of
{ok, _, _, Body} ->
@@ -186,7 +186,7 @@ should_serve_utils_for_vhost({Url, DbName}) ->
should_return_virtual_request_path_field_in_request({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", "example1.com",
+ ok = config:set("vhosts", "example1.com",
"/" ++ DbName ++ "/_design/doc1/_rewrite/",
false),
case test_request:get(Url, [], [{host_header, "example1.com"}]) of
@@ -204,7 +204,7 @@ should_return_virtual_request_path_field_in_request({Url, DbName}) ->
should_return_real_request_path_field_in_request({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", "example1.com",
+ ok = config:set("vhosts", "example1.com",
"/" ++ DbName ++ "/_design/doc1/_rewrite/",
false),
case test_request:get(Url, [], [{host_header, "example1.com"}]) of
@@ -222,7 +222,7 @@ should_return_real_request_path_field_in_request({Url, DbName}) ->
should_match_wildcard_vhost({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", "*.example.com",
+ ok = config:set("vhosts", "*.example.com",
"/" ++ DbName ++ "/_design/doc1/_rewrite", false),
case test_request:get(Url, [], [{host_header, "test.example.com"}]) of
{ok, _, _, Body} ->
@@ -239,7 +239,7 @@ should_match_wildcard_vhost({Url, DbName}) ->
should_return_db_info_for_wildcard_vhost_for_custom_db({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", ":dbname.example1.com",
+ ok = config:set("vhosts", ":dbname.example1.com",
"/:dbname", false),
Host = DbName ++ ".example1.com",
case test_request:get(Url, [], [{host_header, Host}]) of
@@ -256,7 +256,7 @@ should_return_db_info_for_wildcard_vhost_for_custom_db({Url, DbName}) ->
should_replace_rewrite_variables_for_db_and_doc({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts",":appname.:dbname.example1.com",
+ ok = config:set("vhosts",":appname.:dbname.example1.com",
"/:dbname/_design/:appname/_rewrite/", false),
Host = "doc1." ++ DbName ++ ".example1.com",
case test_request:get(Url, [], [{host_header, Host}]) of
@@ -274,7 +274,7 @@ should_replace_rewrite_variables_for_db_and_doc({Url, DbName}) ->
should_return_db_info_for_vhost_with_resource({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts",
+ ok = config:set("vhosts",
"example.com/test", "/" ++ DbName, false),
ReqUrl = Url ++ "/test",
case test_request:get(ReqUrl, [], [{host_header, "example.com"}]) of
@@ -292,7 +292,7 @@ should_return_db_info_for_vhost_with_resource({Url, DbName}) ->
should_return_revs_info_for_vhost_with_resource({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts",
+ ok = config:set("vhosts",
"example.com/test", "/" ++ DbName, false),
ReqUrl = Url ++ "/test/doc1?revs_info=true",
case test_request:get(ReqUrl, [], [{host_header, "example.com"}]) of
@@ -309,7 +309,7 @@ should_return_revs_info_for_vhost_with_resource({Url, DbName}) ->
should_return_db_info_for_vhost_with_wildcard_resource({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", "*.example2.com/test", "/*", false),
+ ok = config:set("vhosts", "*.example2.com/test", "/*", false),
ReqUrl = Url ++ "/test",
Host = DbName ++ ".example2.com",
case test_request:get(ReqUrl, [], [{host_header, Host}]) of
@@ -326,7 +326,7 @@ should_return_db_info_for_vhost_with_wildcard_resource({Url, DbName}) ->
should_return_path_for_vhost_with_wildcard_host({Url, DbName}) ->
?_test(begin
- ok = couch_config:set("vhosts", "*/test1",
+ ok = config:set("vhosts", "*/test1",
"/" ++ DbName ++ "/_design/doc1/_show/test",
false),
case test_request:get(Url ++ "/test1") of
@@ -360,7 +360,7 @@ should_require_auth({Url, _}) ->
should_succeed_oauth({Url, _}) ->
?_test(begin
- AuthDbName = couch_config:get("couch_httpd_auth", "authentication_db"),
+ AuthDbName = config:get("couch_httpd_auth", "authentication_db"),
JoeDoc = couch_doc:from_json_obj({[
{<<"_id">>, <<"org.couchdb.user:joe">>},
{<<"type">>, <<"user">>},
@@ -394,7 +394,7 @@ should_succeed_oauth({Url, _}) ->
should_fail_oauth_with_wrong_credentials({Url, _}) ->
?_test(begin
- AuthDbName = couch_config:get("couch_httpd_auth", "authentication_db"),
+ AuthDbName = config:get("couch_httpd_auth", "authentication_db"),
JoeDoc = couch_doc:from_json_obj({[
{<<"_id">>, <<"org.couchdb.user:joe">>},
{<<"type">>, <<"user">>},
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/couchdb_views_tests.erl
----------------------------------------------------------------------
diff --git a/test/couchdb_views_tests.erl b/test/couchdb_views_tests.erl
index 6efa7a1..03fb9cc 100644
--- a/test/couchdb_views_tests.erl
+++ b/test/couchdb_views_tests.erl
@@ -121,7 +121,7 @@ should_not_remember_docs_in_index_after_backup_restore_test() ->
should_upgrade_legacy_view_files_test() ->
start(),
- ok = couch_config:set("query_server_config", "commit_freq", "0", false),
+ ok = config:set("query_server_config", "commit_freq", "0", false),
DbName = <<"test">>,
DbFileName = "test.couch",
@@ -130,8 +130,8 @@ should_upgrade_legacy_view_files_test() ->
FixtureViewFilePath = filename:join([?FIXTURESDIR, OldViewName]),
NewViewName = "a1c5929f912aca32f13446122cc6ce50.view",
- DbDir = couch_config:get("couchdb", "database_dir"),
- ViewDir = couch_config:get("couchdb", "view_index_dir"),
+ DbDir = config:get("couchdb", "database_dir"),
+ ViewDir = config:get("couchdb", "view_index_dir"),
OldViewFilePath = filename:join([ViewDir, ".test_design", OldViewName]),
NewViewFilePath = filename:join([ViewDir, ".test_design", "mrview",
NewViewName]),
@@ -290,8 +290,8 @@ couchdb_1309(DbName) ->
couchdb_1283() ->
?_test(begin
- ok = couch_config:set("couchdb", "max_dbs_open", "3", false),
- ok = couch_config:set("couchdb", "delayed_commits", "false", false),
+ ok = config:set("couchdb", "max_dbs_open", "3", false),
+ ok = config:set("couchdb", "delayed_commits", "false", false),
{ok, MDb1} = couch_db:create(?tempdb(), [?ADMIN_USER]),
DDoc = couch_doc:from_json_obj({[
@@ -463,7 +463,7 @@ delete_design_doc(DbName, DDName, Rev) ->
couch_db:close(Db).
db_url(DbName) ->
- Addr = couch_config:get("httpd", "bind_address", "127.0.0.1"),
+ Addr = config:get("httpd", "bind_address", "127.0.0.1"),
Port = integer_to_list(mochiweb_socket_server:get(couch_httpd, port)),
"http://" ++ Addr ++ ":" ++ Port ++ "/" ++ ?b2l(DbName).
@@ -507,7 +507,7 @@ count_db_refs(DbName) ->
count_index_files(DbName) ->
% call server to fetch the index files
- RootDir = couch_config:get("couchdb", "view_index_dir"),
+ RootDir = config:get("couchdb", "view_index_dir"),
length(filelib:wildcard(RootDir ++ "/." ++
binary_to_list(DbName) ++ "_design"++"/mrview/*")).
@@ -516,13 +516,13 @@ has_doc(DocId1, Rows) ->
lists:any(fun({R}) -> lists:member({<<"id">>, DocId}, R) end, Rows).
backup_db_file(DbName) ->
- DbDir = couch_config:get("couchdb", "database_dir"),
+ DbDir = config:get("couchdb", "database_dir"),
DbFile = filename:join([DbDir, ?b2l(DbName) ++ ".couch"]),
{ok, _} = file:copy(DbFile, DbFile ++ ".backup"),
ok.
restore_backup_db_file(DbName) ->
- DbDir = couch_config:get("couchdb", "database_dir"),
+ DbDir = config:get("couchdb", "database_dir"),
stop(whereis(couch_server_sup)),
DbFile = filename:join([DbDir, ?b2l(DbName) ++ ".couch"]),
ok = file:delete(DbFile),
http://git-wip-us.apache.org/repos/asf/couchdb-couch/blob/0456db3c/test/fixtures/os_daemon_configer.escript
----------------------------------------------------------------------
diff --git a/test/fixtures/os_daemon_configer.escript b/test/fixtures/os_daemon_configer.escript
index d437423..0074fc0 100755
--- a/test/fixtures/os_daemon_configer.escript
+++ b/test/fixtures/os_daemon_configer.escript
@@ -83,7 +83,7 @@ loop({error, _Reason}) ->
main([]) ->
init_code_path(),
- couch_config:start_link(?CONFIG_CHAIN),
+ config:start_link(?CONFIG_CHAIN),
couch_drv:start_link(),
do_tests().