aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_gen_conn.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2017-03-27 11:54:07 +0200
committerSiri Hansen <[email protected]>2017-05-08 10:30:42 +0200
commit63d63920f3f68f1d3cc62184e9f1a5c51da17088 (patch)
treef6bee65a455eabee07bb832dd17f49b876d548f1 /lib/common_test/src/ct_gen_conn.erl
parent9ac8bdb19f55c593b8b4b10a5d72032e33bef406 (diff)
downloadotp-63d63920f3f68f1d3cc62184e9f1a5c51da17088.tar.gz
otp-63d63920f3f68f1d3cc62184e9f1a5c51da17088.tar.bz2
otp-63d63920f3f68f1d3cc62184e9f1a5c51da17088.zip
[ct_netconfc] Start multiple sessions per SSH connection
The following new functions are added to ct_netconfc: * connect/1,2 - open an SSH connection to a netconf server * disconnect/1 - close the given SSH connectoin * session/1,2,3 - open an SSH channel on the give connection and send 'hello' to start a netconf session. This allows running multiple channels on on SSH connection, realizing one netconf session per channel. The existing ct_netconfc:open will always run one channel(session) per SSH connection.
Diffstat (limited to 'lib/common_test/src/ct_gen_conn.erl')
-rw-r--r--lib/common_test/src/ct_gen_conn.erl15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/common_test/src/ct_gen_conn.erl b/lib/common_test/src/ct_gen_conn.erl
index 8b59d3ab23..5046ffade0 100644
--- a/lib/common_test/src/ct_gen_conn.erl
+++ b/lib/common_test/src/ct_gen_conn.erl
@@ -373,8 +373,9 @@ loop(Opts) ->
end;
{stop, From} ->
ct_util:unregister_connection(self()),
- (Opts#gen_opts.callback):terminate(Opts#gen_opts.conn_pid,
- Opts#gen_opts.cb_state),
+ ConnPid = Opts#gen_opts.conn_pid,
+ unlink(ConnPid),
+ (Opts#gen_opts.callback):terminate(ConnPid,Opts#gen_opts.cb_state),
return(From,ok),
ok;
{{retry,{Error,_Name,CPid,_Msg}}, From} when
@@ -411,8 +412,9 @@ loop(Opts) ->
loop(Opts#gen_opts{cb_state=NewState});
{stop,Reply,NewState} ->
ct_util:unregister_connection(self()),
- (Opts#gen_opts.callback):terminate(Opts#gen_opts.conn_pid,
- NewState),
+ ConnPid = Opts#gen_opts.conn_pid,
+ unlink(ConnPid),
+ (Opts#gen_opts.callback):terminate(ConnPid,NewState),
return(From,Reply)
end;
Msg when Opts#gen_opts.forward==true ->
@@ -422,8 +424,9 @@ loop(Opts) ->
loop(Opts#gen_opts{cb_state=NewState});
{stop,NewState} ->
ct_util:unregister_connection(self()),
- (Opts#gen_opts.callback):terminate(Opts#gen_opts.conn_pid,
- NewState)
+ ConnPid = Opts#gen_opts.conn_pid,
+ unlink(ConnPid),
+ (Opts#gen_opts.callback):terminate(ConnPid,NewState)
end
end.