From d76229a3d12e6bc3c5e2450aad1cdf446160254a Mon Sep 17 00:00:00 2001 From: Daniil Fedotov Date: Thu, 26 Jan 2017 16:28:01 +0000 Subject: [PATCH] Test plugin version validation when enabling all plugins --- .../test/plugins/enable_plugins_command_test.exs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/deps/rabbitmq_cli/test/plugins/enable_plugins_command_test.exs b/deps/rabbitmq_cli/test/plugins/enable_plugins_command_test.exs index 30fa888e7a..3d6bdd8ed0 100644 --- a/deps/rabbitmq_cli/test/plugins/enable_plugins_command_test.exs +++ b/deps/rabbitmq_cli/test/plugins/enable_plugins_command_test.exs @@ -235,6 +235,19 @@ defmodule EnablePluginsCommandTest do @command.validate(["mock_rabbitmq_plugin_for_3_8"], opts) end + test "validation: does not enable plugins with unmet version requirements even when enabling all plugins", context do + set_enabled_plugins([], :online, context[:opts][:node], context[:opts]) + + plugins_directory = fixture_plugins_path("plugins_with_version_requirements") + opts = get_opts_with_plugins_directories(context, [plugins_directory]) + opts = Map.merge(opts, %{all: true}) + switch_plugins_directories(context[:opts][:plugins_dir], opts[:plugins_dir]) + + {:validation_failure, _version_error} = @command.validate([], opts) + end + + + defp check_plugins_enabled(plugins, context) do {:ok, [xs]} = :file.consult(context[:opts][:enabled_plugins_file]) assert_equal_sets(plugins, xs)