aboutsummaryrefslogtreecommitdiffstats
path: root/lib/common_test/test/telnet_server.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common_test/test/telnet_server.erl')
-rw-r--r--lib/common_test/test/telnet_server.erl15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/common_test/test/telnet_server.erl b/lib/common_test/test/telnet_server.erl
index 5843155eee..31884aa182 100644
--- a/lib/common_test/test/telnet_server.erl
+++ b/lib/common_test/test/telnet_server.erl
@@ -93,6 +93,7 @@ do_accept(LSock,Server) ->
end.
init_client(#state{client=Sock}=State) ->
+ dbg("Server sending: ~p~n",["login: "]),
R = case gen_tcp:send(Sock,"login: ") of
ok ->
loop(State);
@@ -164,8 +165,18 @@ do_handle_data(Data,#state{authorized={user,_}}=State) ->
do_handle_data("echo "++ Data,State) ->
send(Data++"\r\n> ",State),
{ok,State};
-do_handle_data("repeat "++ Data,State) ->
- send(Data++"\r\n"++Data++"\r\n> ",State),
+do_handle_data("echo_no_prompt "++ Data,State) ->
+ send(Data,State),
+ {ok,State};
+do_handle_data("echo_ml "++ Data,State) ->
+ Lines = string:tokens(Data," "),
+ ReturnData = string:join(Lines,"\n"),
+ send(ReturnData++"\r\n> ",State),
+ {ok,State};
+do_handle_data("echo_ml_no_prompt "++ Data,State) ->
+ Lines = string:tokens(Data," "),
+ ReturnData = string:join(Lines,"\n"),
+ send(ReturnData,State),
{ok,State};
do_handle_data([],State) ->
send("> ",State),