diff options
Diffstat (limited to 'lib/common_test/test/ct_gen_conn_SUITE_data')
-rw-r--r-- | lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl b/lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl index c0707160cf..6877e0c2d2 100644 --- a/lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl +++ b/lib/common_test/test/ct_gen_conn_SUITE_data/conn_SUITE.erl @@ -18,8 +18,9 @@ %% %%%------------------------------------------------------------------- -%%% File : -%%% Description : +%%% File : conn_SUITE +%%% Description : Check that the generic connection handling in CT +%%% works as expected. %%%------------------------------------------------------------------- -module(conn_SUITE). @@ -32,7 +33,6 @@ %% COMMON TEST CALLBACK FUNCTIONS %%-------------------------------------------------------------------- - suite() -> [{timetrap,{seconds,5}}]. @@ -59,7 +59,7 @@ all() -> handles_to_multi_conn_pids() -> [{require,multi_conn_pid}]. -handles_to_multi_conn_pids(Config) -> +handles_to_multi_conn_pids(_Config) -> application:set_env(ct_test, reconnect, true), Handle1 = proto:open(multi_conn_pid), @@ -97,7 +97,7 @@ handles_to_multi_conn_pids(Config) -> handles_to_single_conn_pids() -> [{require,single_conn_pid}]. -handles_to_single_conn_pids(Config) -> +handles_to_single_conn_pids(_Config) -> application:set_env(ct_test, reconnect, true), Handle1 = proto:open(single_conn_pid), @@ -110,9 +110,9 @@ handles_to_single_conn_pids(Config) -> ConnPid = ct_gen_conn:get_conn_pid(Handle3), {true,true} = {is_process_alive(Handle3),is_process_alive(ConnPid)}, - Conns = [{undefined,Handle3,_,_}, + Conns = [{undefined,Handle1,_,_}, {undefined,Handle2,_,_}, - {undefined,Handle1,_,_}] = ct_util:get_connections(ConnPid), + {undefined,Handle3,_,_}] = lists:sort(ct_util:get_connections(ConnPid)), ct:pal("CONNS = ~n~p", [Conns]), ok = proto:close(Handle1), @@ -138,43 +138,43 @@ handles_to_single_conn_pids(Config) -> ok. names_to_multi_conn_pids() -> - [{require,conn1,multi_conn_pid}, - {require,conn2,multi_conn_pid}, - {require,conn3,multi_conn_pid}]. + [{require,mconn1,multi_conn_pid}, + {require,mconn2,multi_conn_pid}, + {require,mconn3,multi_conn_pid}]. -names_to_multi_conn_pids(Config) -> +names_to_multi_conn_pids(_Config) -> application:set_env(ct_test, reconnect, true), - Handle1 = proto:open(conn1), + Handle1 = proto:open(mconn1), ConnPid1 = ct_gen_conn:get_conn_pid(Handle1), {true,true} = {is_process_alive(Handle1),is_process_alive(ConnPid1)}, - Handle2 = proto:open(conn2), + Handle2 = proto:open(mconn2), ConnPid2 = ct_gen_conn:get_conn_pid(Handle2), {true,true} = {is_process_alive(Handle2),is_process_alive(ConnPid2)}, - Handle3 = proto:open(conn3), + Handle3 = proto:open(mconn3), ConnPid3 = ct_gen_conn:get_conn_pid(Handle3), {true,true} = {is_process_alive(Handle3),is_process_alive(ConnPid3)}, - Handle1 = proto:open(conn1), + Handle1 = proto:open(mconn1), - ok = proto:close(conn1), + ok = proto:close(mconn1), timer:sleep(100), {false,false} = {is_process_alive(Handle1),is_process_alive(ConnPid1)}, ok = proto:kill_conn_proc(Handle2), timer:sleep(100), - Handle2 = proto:open(conn2), % should've been reconnected already + Handle2 = proto:open(mconn2), % should've been reconnected already {true,false} = {is_process_alive(Handle2),is_process_alive(ConnPid2)}, ConnPid2x = ct_gen_conn:get_conn_pid(Handle2), true = is_process_alive(ConnPid2x), - ok = proto:close(conn2), + ok = proto:close(mconn2), timer:sleep(100), {false,false} = {is_process_alive(Handle2),is_process_alive(ConnPid2x)}, - Handle2y = proto:open(conn2), + Handle2y = proto:open(mconn2), ConnPid2y = ct_gen_conn:get_conn_pid(Handle2y), {true,true} = {is_process_alive(Handle2y),is_process_alive(ConnPid2y)}, - ok = proto:close(conn2), + ok = proto:close(mconn2), timer:sleep(100), {false,false} = {is_process_alive(Handle2y),is_process_alive(ConnPid2y)}, @@ -186,47 +186,47 @@ names_to_multi_conn_pids(Config) -> ok. names_to_single_conn_pids() -> - [{require,conn1,single_conn_pid}, - {require,conn2,single_conn_pid}, - {require,conn3,single_conn_pid}]. + [{require,sconn1,single_conn_pid}, + {require,sconn2,single_conn_pid}, + {require,sconn3,single_conn_pid}]. -names_to_single_conn_pids(Config) -> +names_to_single_conn_pids(_Config) -> application:set_env(ct_test, reconnect, true), - Handle1 = proto:open(conn1), + Handle1 = proto:open(sconn1), ConnPid = ct_gen_conn:get_conn_pid(Handle1), {true,true} = {is_process_alive(Handle1),is_process_alive(ConnPid)}, - Handle2 = proto:open(conn2), + Handle2 = proto:open(sconn2), ConnPid = ct_gen_conn:get_conn_pid(Handle2), {true,true} = {is_process_alive(Handle2),is_process_alive(ConnPid)}, - Handle3 = proto:open(conn3), + Handle3 = proto:open(sconn3), ConnPid = ct_gen_conn:get_conn_pid(Handle3), {true,true} = {is_process_alive(Handle3),is_process_alive(ConnPid)}, - Handle1 = proto:open(conn1), + Handle1 = proto:open(sconn1), - Conns = [{conn1,Handle1,_,_}, - {conn2,Handle2,_,_}, - {conn3,Handle3,_,_}] = lists:sort(ct_util:get_connections(ConnPid)), + Conns = [{sconn1,Handle1,_,_}, + {sconn2,Handle2,_,_}, + {sconn3,Handle3,_,_}] = lists:sort(ct_util:get_connections(ConnPid)), ct:pal("CONNS on ~p = ~n~p", [ConnPid,Conns]), - ok = proto:close(conn1), + ok = proto:close(sconn1), timer:sleep(100), {false,true} = {is_process_alive(Handle1),is_process_alive(ConnPid)}, ok = proto:kill_conn_proc(Handle2), timer:sleep(100), {true,false} = {is_process_alive(Handle2),is_process_alive(ConnPid)}, - Handle2 = proto:open(conn2), % should've been reconnected already + Handle2 = proto:open(sconn2), % should've been reconnected already NewConnPid = ct_gen_conn:get_conn_pid(Handle2), true = is_process_alive(NewConnPid), - Conns1 = [{conn2,Handle2,_,_}, - {conn3,Handle3,_,_}] = + Conns1 = [{sconn2,Handle2,_,_}, + {sconn3,Handle3,_,_}] = lists:sort(ct_util:get_connections(NewConnPid)), ct:pal("CONNS on ~p = ~n~p", [NewConnPid,Conns1]), - ok = proto:close(conn2), + ok = proto:close(sconn2), timer:sleep(100), {false,true} = {is_process_alive(Handle2),is_process_alive(NewConnPid)}, |