table of contents
other versions
- jessie 1:17.3-dfsg-4+deb8u2
- jessie-backports 1:19.2.1+dfsg-2+deb9u1~bpo8+1
- stretch 1:19.2.1+dfsg-2+deb9u2
- testing 1:21.2.5+dfsg-1
- unstable 1:21.2.6+dfsg-1
- experimental 1:22.0~rc1+dfsg-1
| unix_telnet(3erl) | Erlang Module Definition | unix_telnet(3erl) |
NAME¶
unix_telnet - Callback module for ct_telnet, for connecting to a Telnetserver on a UNIX host.
DESCRIPTION¶
Callback module for ct_telnet, for connecting to a Telnet server on a UNIX host. It requires the following entry in the configuration file:
{unix,[{telnet,HostNameOrIpAddress},
{port,PortNum}, % optional
{username,UserName},
{password,Password},
{keep_alive,Bool}]}. % optional
To communicate through Telnet to the host specified by
HostNameOrIpAddress, use the interface functions in
ct_telnet, for example, open(Name) and
cmd(Name,Cmd).
Name is the name you allocated to the Unix host in your require
statement, for example:
suite() -> [{require,Name,{unix,[telnet]}}].
or
ct:require(Name,{unix,[telnet]}).
The "keep alive" activity (that is, that Common Test sends NOP
to the server every 10 seconds if the connection is idle) can be enabled or
disabled for one particular connection as described here. It can be disabled
for all connections using telnet_settings (see
ct_telnet).
The {port,PortNum} tuple is optional and if omitted, default Telnet port
23 is used. Also the keep_alive tuple is optional, and the value
defauls to true (enabled).
EXPORTS¶
connect(ConnName, Ip, Port, Timeout, KeepAlive, TCPNoDelay, Extra) -> {ok, Handle} | {error, Reason}
Types:
ConnName = target_name()
Ip = string() | {integer(), integer(), integer(), integer()}
Port = integer()
Timeout = integer()
KeepAlive = bool()
TCPNoDelay = bool()
Extra = target_name() | {Username, Password}
Username = string()
Password = string()
Handle = handle()
Reason = term()
Callback for ct_telnet.erl.
Setup Telnet connection to a Unix host.
For target_name(), see ct. For handle(), see
ct_telnet.
get_prompt_regexp() -> PromptRegexp
Types:
PromptRegexp = prompt_regexp()
Callback for ct_telnet.erl.
Returns a suitable regexp string matching common prompts for users on
Unix hosts.
For prompt_regexp(), see ct_telnet.
SEE ALSO¶
ct, ct_telnet| common_test 1.13 | Ericsson AB |