From 61faea7ded93df8d444adf7079a7be2cc9e0f176 Mon Sep 17 00:00:00 2001
From: Peter Andersson It requires the following entry in the config file: To talk telnet to the host specified by
+%%% To communicate via telnet to the host specified by
%%%
@@ -28,15 +28,15 @@
%%% {password,Password},
%%% {keep_alive,Bool}]}. % optional
%%%
-%%% 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