summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2017-02-20 12:44:34 +0100
committerJean-Sébastien Pédron <jean-sebastien@rabbitmq.com>2017-02-20 17:58:13 +0100
commit0151abf37710dfc421523f9235514a438270e032 (patch)
tree788e3dc729bcbeaf0d75f85d904dea220aa3ea0f /test
parentc4d74f4294169d875bb734164c52d020f10f37c9 (diff)
downloadrabbitmq-server-git-0151abf37710dfc421523f9235514a438270e032.tar.gz
Restore "Do not expand plugins anymore"
Support for reading static files from Erlang .ez archives was added to Cowboy and various RabbitMQ plugins were updated to take advantage of the new API. So this commit restores the following commits: 7069f3b40daeb5095077bdac19f3837978bc2665 76a8c66c8092cc1c37bb4aa90a0a3d18b27f7d9d 2044cb1eed02e67c4ea749a807694c55ed574756 bc64ac16774aeb403cba87f7e48ad70329dd8b3b d616cc922dbd73eca7700c50f09e33e6b578b0d9 They were reverted in 72f7c8e70028209ee1c58074c087b4d0cb901e6c because Cowboy didn't have this support at the time. Signed-off-by: Gerhard Lazu <gerhard@rabbitmq.com> [#118562759, #136622317]
Diffstat (limited to 'test')
-rw-r--r--test/plugins_SUITE.erl80
-rw-r--r--test/plugins_SUITE_data/plugins1/mock_rabbitmq_plugins_01-0.1.0.ezbin0 -> 3280 bytes
2 files changed, 80 insertions, 0 deletions
diff --git a/test/plugins_SUITE.erl b/test/plugins_SUITE.erl
new file mode 100644
index 0000000000..8896298df1
--- /dev/null
+++ b/test/plugins_SUITE.erl
@@ -0,0 +1,80 @@
+%% The contents of this file are subject to the Mozilla Public License
+%% Version 1.1 (the "License"); you may not use this file except in
+%% compliance with the License. You may obtain a copy of the License at
+%% http://www.mozilla.org/MPL/
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+%% License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% The Original Code is RabbitMQ.
+%%
+%% The Initial Developer of the Original Code is GoPivotal, Inc.
+%% Copyright (c) 2016 Pivotal Software, Inc. All rights reserved.
+%%
+
+-module(plugins_SUITE).
+
+-include_lib("common_test/include/ct.hrl").
+
+-compile(export_all).
+
+all() ->
+ [
+ active_with_single_plugin_dir,
+ active_with_multiple_plugin_dirs
+ ].
+
+%% -------------------------------------------------------------------
+%% Testsuite setup/teardown.
+%% -------------------------------------------------------------------
+
+init_per_suite(Config) ->
+ rabbit_ct_helpers:log_environment(),
+ application:load(rabbit),
+ rabbit_ct_helpers:run_setup_steps(Config).
+
+end_per_suite(Config) ->
+ rabbit_ct_helpers:run_teardown_steps(Config).
+
+init_per_group(_, Config) ->
+ Config.
+
+end_per_group(_, Config) ->
+ Config.
+
+init_per_testcase(Testcase, Config) ->
+ rabbit_ct_helpers:testcase_started(Config, Testcase).
+
+end_per_testcase(Testcase, Config) ->
+ rabbit_ct_helpers:testcase_finished(Config, Testcase).
+
+%% -------------------------------------------------------------------
+%% Testcases.
+%% -------------------------------------------------------------------
+
+active_with_single_plugin_dir(Config) ->
+ DataDir = rabbit_ct_helpers:get_config(Config, data_dir),
+ PluginsDir1 = filename:join(DataDir, "plugins1"),
+
+ true = code:add_path(filename:join([PluginsDir1,
+ "mock_rabbitmq_plugins_01-0.1.0.ez",
+ "mock_rabbitmq_plugins_01-0.1.0", "ebin"])),
+ {ok, _} = application:ensure_all_started(mock_rabbitmq_plugins_01),
+ application:set_env(rabbit, plugins_dir, PluginsDir1),
+
+ [mock_rabbitmq_plugins_01] = rabbit_plugins:active().
+
+active_with_multiple_plugin_dirs(Config) ->
+ DataDir = rabbit_ct_helpers:get_config(Config, data_dir),
+ PluginsDir1 = filename:join(DataDir, "plugins1"),
+ PluginsDir2 = filename:join(DataDir, "plugins2"),
+
+ true = code:add_path(filename:join([PluginsDir1,
+ "mock_rabbitmq_plugins_01-0.1.0.ez",
+ "mock_rabbitmq_plugins_01-0.1.0", "ebin"])),
+ {ok, _} = application:ensure_all_started(mock_rabbitmq_plugins_01),
+ application:set_env(rabbit, plugins_dir, PluginsDir1 ++ ":" ++ PluginsDir2),
+
+ [mock_rabbitmq_plugins_01] = rabbit_plugins:active().
diff --git a/test/plugins_SUITE_data/plugins1/mock_rabbitmq_plugins_01-0.1.0.ez b/test/plugins_SUITE_data/plugins1/mock_rabbitmq_plugins_01-0.1.0.ez
new file mode 100644
index 0000000000..40cba9f16b
--- /dev/null
+++ b/test/plugins_SUITE_data/plugins1/mock_rabbitmq_plugins_01-0.1.0.ez
Binary files differ