aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/src/ct_telnet.erl
diff options
context:
space:
mode:
authorPeter Andersson <[email protected]>2014-03-10 16:22:25 +0100
committerPeter Andersson <[email protected]>2014-03-12 16:00:14 +0100
commit5667601be38a2e35fbbe59491f448f947bfcc73c (patch)
tree005d9d79402b2a99b7411c329bb5bf58051fc827 /lib/common_test/src/ct_telnet.erl
parent609349f6acac4b03b8cac53eb9ad456a2b2d5536 (diff)
downloadotp-5667601be38a2e35fbbe59491f448f947bfcc73c.tar.gz
otp-5667601be38a2e35fbbe59491f448f947bfcc73c.tar.bz2
otp-5667601be38a2e35fbbe59491f448f947bfcc73c.zip
Add test cases and fix some problems with logging and with the telnet client
Diffstat (limited to 'lib/common_test/src/ct_telnet.erl')
-rw-r--r--lib/common_test/src/ct_telnet.erl16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/common_test/src/ct_telnet.erl b/lib/common_test/src/ct_telnet.erl
index 096e893720..8c3ce03732 100644
--- a/lib/common_test/src/ct_telnet.erl
+++ b/lib/common_test/src/ct_telnet.erl
@@ -281,8 +281,16 @@ open(KeyOrName,ConnType,TargetMod,Extra) ->
end,
log(undefined,open,"Connecting to ~p(~p)",
[KeyOrName,Addr1]),
- ct_gen_conn:start(KeyOrName,full_addr(Addr1,ConnType),
- {TargetMod,KeepAlive,Extra},?MODULE)
+ Reconnect =
+ case ct:get_config({telnet_settings,reconnection_attempts}) of
+ 0 -> false;
+ _ -> true
+ end,
+ ct_gen_conn:start(full_addr(Addr1,ConnType),
+ {TargetMod,KeepAlive,Extra},
+ ?MODULE, [{name,KeyOrName},
+ {reconnect,Reconnect},
+ {old,true}])
end.
%%%-----------------------------------------------------------------
@@ -601,11 +609,9 @@ handle_msg({cmd,Cmd,Timeout},State) ->
end_gen_log(),
{Return,State#state{buffer=NewBuffer,prompt=Prompt}};
handle_msg({send,Cmd},State) ->
- log(State,send,"Cmd: ~p",[Cmd]),
-
+ log(State,send,"Sending: ~p",[Cmd]),
debug_cont_gen_log("Throwing Buffer:",[]),
debug_log_lines(State#state.buffer),
-
case {State#state.type,State#state.prompt} of
{ts,_} ->
silent_teln_expect(State#state.name,