summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2020-01-30 17:25:53 +0300
committerMichael Klishin <michael@clojurewerkz.org>2020-01-30 17:25:53 +0300
commit91b3a783bfc227f67969c251fd8c74216c11d435 (patch)
treec748c72b2839ce516d1fc587b09b0ac9b249b704 /test
parentd621ec907a4b7f33e85e4bc61f10d1c6e1ef0601 (diff)
downloadrabbitmq-server-git-91b3a783bfc227f67969c251fd8c74216c11d435.tar.gz
Introduce a persistent internal cluster ID
That the operator cannot and are not supposed to control. The ID is cluster-wide and stored as a global runtime parameter to make sure it is replicated across all nodes. It is intentionally excluded from imported definitions because it is not meant to be reused. This ID would be useful in several features/plugins under development.
Diffstat (limited to 'test')
-rw-r--r--test/clustering_management_SUITE.erl19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/clustering_management_SUITE.erl b/test/clustering_management_SUITE.erl
index 8566b23130..43029153b0 100644
--- a/test/clustering_management_SUITE.erl
+++ b/test/clustering_management_SUITE.erl
@@ -56,7 +56,8 @@ groups() ->
status_with_alarm,
pid_file_and_await_node_startup,
await_running_count,
- start_with_invalid_schema_in_path
+ start_with_invalid_schema_in_path,
+ persistent_cluster_id
]},
{cluster_size_4, [], [
forget_promotes_offline_slave
@@ -120,10 +121,9 @@ end_per_testcase(Testcase, Config) ->
rabbit_ct_helpers:testcase_finished(Config1, Testcase).
%% -------------------------------------------------------------------
-%% Testcases.
+%% Test cases
%% -------------------------------------------------------------------
-
start_with_invalid_schema_in_path(Config) ->
[Rabbit, Hare] = cluster_members(Config),
stop_app(Rabbit),
@@ -137,6 +137,19 @@ start_with_invalid_schema_in_path(Config) ->
ErrRabbit -> error({unable_to_start_with_bad_schema_in_work_dir, ErrRabbit})
end.
+persistent_cluster_id(Config) ->
+ [Rabbit, Hare] = cluster_members(Config),
+ ClusterIDA1 = rpc:call(Rabbit, rabbit_nodes, persistent_cluster_id, []),
+ ClusterIDB1 = rpc:call(Hare, rabbit_nodes, persistent_cluster_id, []),
+ ?assertEqual(ClusterIDA1, ClusterIDB1),
+
+ rabbit_ct_broker_helpers:restart_node(Config, Rabbit),
+ ClusterIDA2 = rpc:call(Rabbit, rabbit_nodes, persistent_cluster_id, []),
+ rabbit_ct_broker_helpers:restart_node(Config, Hare),
+ ClusterIDB2 = rpc:call(Hare, rabbit_nodes, persistent_cluster_id, []),
+ ?assertEqual(ClusterIDA1, ClusterIDA2),
+ ?assertEqual(ClusterIDA2, ClusterIDB2).
+
create_bad_schema(Rabbit, Hare, Config) ->
{ok, RabbitMnesiaDir} = rpc:call(Rabbit, application, get_env, [mnesia, dir]),