|
20 | 20 | %% %CopyrightEnd% |
21 | 21 | %% |
22 | 22 | -module(sys_SUITE). |
23 | | --export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, |
| 23 | +-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1, |
24 | 24 | init_per_group/2,end_per_group/2,log/1,log_to_file/1, |
25 | | - stats/1,trace/1,suspend/1,install/1,special_process/1]). |
| 25 | + stats/1,trace/1,suspend/1,multi_suspend/1, |
| 26 | + install/1,special_process/1]). |
26 | 27 | -export([handle_call/3,terminate/2,init/1]). |
27 | 28 | -include_lib("common_test/include/ct.hrl"). |
28 | 29 |
|
|
35 | 36 | suite() -> [{ct_hooks,[ts_install_cth]}]. |
36 | 37 |
|
37 | 38 | all() -> |
38 | | - [log, log_to_file, stats, trace, suspend, install, special_process]. |
| 39 | + [log, log_to_file, stats, trace, suspend, multi_suspend, |
| 40 | + install, special_process]. |
39 | 41 |
|
40 | 42 | groups() -> |
41 | 43 | []. |
@@ -124,6 +126,29 @@ suspend(Config) when is_list(Config) -> |
124 | 126 | stop(), |
125 | 127 | ok. |
126 | 128 |
|
| 129 | +multi_suspend(Config) when is_list(Config) -> |
| 130 | + S1 = sys_SUITE_server1, |
| 131 | + S2 = sys_SUITE_server2, |
| 132 | + {ok,_} = gen_server:start_link({local,S1},?MODULE,[],[]), |
| 133 | + {ok,_} = gen_server:start_link({local,S2},?MODULE,[],[]), |
| 134 | + [{S1,ok},{S2,ok}] = sys:multi_suspend([S1,S2],1000), |
| 135 | + {'EXIT',_} = (catch gen_server:call(S1,{req,48},1000)), |
| 136 | + {'EXIT',_} = (catch gen_server:call(S2,{req,48},1000)), |
| 137 | + {status,_,_,[_,suspended,_,_,_]} = sys:get_status(S1), |
| 138 | + {status,_,_,[_,suspended,_,_,_]} = sys:get_status(S2), |
| 139 | + sys:resume(S1), |
| 140 | + sys:resume(S2), |
| 141 | + {status,_,_,[_,running,_,_,_]} = sys:get_status(S1), |
| 142 | + {status,_,_,[_,running,_,_,_]} = sys:get_status(S2), |
| 143 | + [] = sys:multi_suspend([],1000), |
| 144 | + [{S1,ok},{no_such_process,{error,noproc}}] = |
| 145 | + sys:multi_suspend([S1,no_such_process],1000), |
| 146 | + {status,_,_,[_,suspended,_,_,_]} = sys:get_status(S1), |
| 147 | + sys:resume(S1), |
| 148 | + gen_server:call(S1,stop,1000), |
| 149 | + gen_server:call(S2,stop,1000), |
| 150 | + ok. |
| 151 | + |
127 | 152 | install(Config) when is_list(Config) -> |
128 | 153 | {ok,_Server} = start(), |
129 | 154 | Master = self(), |
|
0 commit comments