25
25
26
26
all () ->
27
27
[
28
- {group , non_parallel_tests }
28
+ {group , import_on_a_running_node },
29
+ {group , import_on_a_booting_node }
29
30
].
30
31
31
32
groups () ->
32
33
[
33
- {non_parallel_tests , [], [
34
+ {import_on_a_running_node , [], [
34
35
% % Note: to make it easier to see which case failed,
35
36
% % these are intentionally not folded into a single case.
36
37
% % If generation becomes an alternative worth considering for these tests,
@@ -47,7 +48,10 @@ groups() ->
47
48
import_case10 ,
48
49
import_case11 ,
49
50
import_case12
50
- ]}
51
+ ]},
52
+ {import_on_a_booting_node , [], [
53
+ import_on_boot_case1
54
+ ]}
51
55
].
52
56
53
57
% % -------------------------------------------------------------------
@@ -74,6 +78,20 @@ init_per_group(_, Config) ->
74
78
end_per_group (_ , Config ) ->
75
79
Config .
76
80
81
+ init_per_testcase (import_on_boot_case1 = Testcase , Config ) ->
82
+ CasePath = filename :join (? config (data_dir , Config ), " case5.json" ),
83
+ Config1 = rabbit_ct_helpers :set_config (Config , [
84
+ {rmq_nodename_suffix , Testcase },
85
+ {rmq_nodes_count , 1 }
86
+ ]),
87
+ Config2 = rabbit_ct_helpers :merge_app_env (Config1 ,
88
+ {rabbit , [
89
+ {load_definitions , CasePath }
90
+ ]}),
91
+ rabbit_ct_helpers :run_steps (Config2 ,
92
+ rabbit_ct_broker_helpers :setup_steps () ++
93
+ rabbit_ct_client_helpers :setup_steps ()),
94
+ rabbit_ct_helpers :testcase_started (Config , Testcase );
77
95
init_per_testcase (Testcase , Config ) ->
78
96
rabbit_ct_helpers :testcase_started (Config , Testcase ).
79
97
@@ -108,6 +126,19 @@ import_case5(Config) ->
108
126
import_case11 (Config ) -> import_file_case (Config , " case11" ).
109
127
import_case12 (Config ) -> import_invalid_file_case (Config , " failing_case12" ).
110
128
129
+ import_on_boot_case1 (Config ) ->
130
+ % % see case5.json
131
+ VHost = <<" vhost2" >>,
132
+ % % verify that vhost2 eventually starts
133
+ case rabbit_ct_broker_helpers :rpc (Config , 0 , rabbit_vhost , await_running_on_all_nodes , [VHost , 3000 ]) of
134
+ ok -> ok ;
135
+ {error , timeout } -> ct :fail (" virtual host ~p was not imported on boot" , [VHost ])
136
+ end .
137
+
138
+ % %
139
+ % % Implementation
140
+ % %
141
+
111
142
import_file_case (Config , CaseName ) ->
112
143
CasePath = filename :join (? config (data_dir , Config ), CaseName ++ " .json" ),
113
144
rabbit_ct_broker_helpers :rpc (Config , 0 , ? MODULE , run_import_case , [CasePath ]),
0 commit comments