|
4 | 4 |
|
5 | 5 | -include_lib("common_test/include/ct.hrl").
|
6 | 6 | -include_lib("eunit/include/eunit.hrl").
|
| 7 | +-include_lib("rabbit_common/include/rabbit.hrl"). |
7 | 8 |
|
8 | 9 | all() ->
|
9 | 10 | [
|
@@ -57,8 +58,9 @@ init_per_testcase(TestCase, Config) ->
|
57 | 58 | ra_server_sup:remove_all(),
|
58 | 59 | ServerName2 = list_to_atom(atom_to_list(TestCase) ++ "2"),
|
59 | 60 | ServerName3 = list_to_atom(atom_to_list(TestCase) ++ "3"),
|
| 61 | + ClusterName = rabbit_misc:r("/", queue, atom_to_binary(TestCase, utf8)), |
60 | 62 | [
|
61 |
| - {cluster_name, TestCase}, |
| 63 | + {cluster_name, ClusterName}, |
62 | 64 | {uid, atom_to_binary(TestCase, utf8)},
|
63 | 65 | {node_id, {TestCase, node()}},
|
64 | 66 | {uid2, atom_to_binary(ServerName2, utf8)},
|
@@ -358,7 +360,7 @@ discard(Config) ->
|
358 | 360 | ServerId = ?config(node_id, Config),
|
359 | 361 | UId = ?config(uid, Config),
|
360 | 362 | ClusterName = ?config(cluster_name, Config),
|
361 |
| - Conf = #{cluster_name => ClusterName, |
| 363 | + Conf = #{cluster_name => ClusterName#resource.name, |
362 | 364 | id => ServerId,
|
363 | 365 | uid => UId,
|
364 | 366 | log_init_args => #{data_dir => PrivDir, uid => UId},
|
@@ -498,7 +500,7 @@ dead_letter_handler(Pid, Msgs) ->
|
498 | 500 | Pid ! {dead_letter, Msgs}.
|
499 | 501 |
|
500 | 502 | dequeue(Config) ->
|
501 |
| - ClusterName = ?config(priv_dir, Config), |
| 503 | + ClusterName = ?config(cluster_name, Config), |
502 | 504 | ServerId = ?config(node_id, Config),
|
503 | 505 | UId = ?config(uid, Config),
|
504 | 506 | Tag = UId,
|
@@ -624,15 +626,15 @@ validate_process_down(Name, Num) ->
|
624 | 626 | end.
|
625 | 627 |
|
626 | 628 | start_cluster(ClusterName, ServerIds, RaFifoConfig) ->
|
627 |
| - {ok, Started, _} = ra:start_cluster(ClusterName, |
| 629 | + {ok, Started, _} = ra:start_cluster(ClusterName#resource.name, |
628 | 630 | {module, rabbit_fifo, RaFifoConfig},
|
629 | 631 | ServerIds),
|
630 | 632 | ?assertEqual(length(Started), length(ServerIds)),
|
631 | 633 | ok.
|
632 | 634 |
|
633 | 635 | start_cluster(ClusterName, ServerIds) ->
|
634 | 636 | start_cluster(ClusterName, ServerIds, #{name => some_name,
|
635 |
| - queue_resource => resource}). |
| 637 | + queue_resource => ClusterName}). |
636 | 638 |
|
637 | 639 | flush() ->
|
638 | 640 | receive
|
|
0 commit comments