From 61faea7ded93df8d444adf7079a7be2cc9e0f176 Mon Sep 17 00:00:00 2001 From: Peter Andersson Date: Tue, 1 Apr 2014 16:50:20 +0200 Subject: Document new ct_telnet logging features OTP-11440 --- lib/common_test/src/unix_telnet.erl | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'lib/common_test/src/unix_telnet.erl') diff --git a/lib/common_test/src/unix_telnet.erl b/lib/common_test/src/unix_telnet.erl index b05386a5ab..10666b979d 100644 --- a/lib/common_test/src/unix_telnet.erl +++ b/lib/common_test/src/unix_telnet.erl @@ -17,8 +17,8 @@ %% %CopyrightEnd% %% -%%% @doc Callback module for ct_telnet for talking telnet -%%% to a unix host. +%%% @doc Callback module for ct_telnet, for connecting to a telnet +%%% server on a unix host. %%% %%%

It requires the following entry in the config file:

%%%
@@ -28,15 +28,15 @@
 %%%        {password,Password},
 %%%        {keep_alive,Bool}]}.            % optional
%%% -%%%

To talk telnet to the host specified by +%%%

To communicate via telnet to the host specified by %%% HostNameOrIpAddress, use the interface functions in -%%% ct, e.g. open(Name), cmd(Name,Cmd), ....

+%%% ct_telnet, e.g. open(Name), cmd(Name,Cmd), ....

%%% %%%

Name is the name you allocated to the unix host in %%% your require statement. E.g.

-%%%
   suite() -> [{require,Name,{unix,[telnet,username,password]}}].
+%%%
   suite() -> [{require,Name,{unix,[telnet]}}].
%%%

or

-%%%
   ct:require(Name,{unix,[telnet,username,password]}).
+%%%
   ct:require(Name,{unix,[telnet]}).
%%% %%%

The "keep alive" activity (i.e. that Common Test sends NOP to the server %%% every 10 seconds if the connection is idle) may be enabled or disabled for one @@ -62,20 +62,18 @@ -define(prx,"login: |Password: |\\\$ |> "). %%%----------------------------------------------------------------- -%%% @hidden %%% @spec get_prompt_regexp() -> PromptRegexp %%% PromptRegexp = ct_telnet:prompt_regexp() %%% %%% @doc Callback for ct_telnet.erl. %%% -%%%

Return the prompt regexp for telnet connections to the -%%% interwatch instrument.

+%%%

Return a suitable regexp string that will match common +%%% prompts for users on unix hosts.

get_prompt_regexp() -> ?prx. %%%----------------------------------------------------------------- -%%% @hidden %%% @spec connect(ConnName,Ip,Port,Timeout,KeepAlive,Extra) -> %%% {ok,Handle} | {error,Reason} %%% ConnName = ct:target_name() @@ -83,14 +81,15 @@ get_prompt_regexp() -> %%% Port = integer() %%% Timeout = integer() %%% KeepAlive = bool() -%%% Extra = {Username,Password} +%%% Extra = ct:target_name() | {Username,Password} %%% Username = string() %%% Password = string() %%% Handle = ct_telnet:handle() +%%% Reason = term() %%% %%% @doc Callback for ct_telnet.erl. %%% -%%%

Setup telnet connection to a UNIX host.

+%%%

Setup telnet connection to a unix host.

connect(ConnName,Ip,Port,Timeout,KeepAlive,Extra) -> case Extra of {Username,Password} -> -- cgit v1.2.3