unix_telnet(3erl)
okay bestie, buckle up π«Ά this is the unix_telnet page β an Erlang module definition, and itβs literally the callback-module bestie for ct_telnet when you need to talk to a Telnet server on a UNIX host. No cap. π
β¨ NAME β¨
unix_telnet β Callback module for ct_telnet, for connecting to a Telnet server on a UNIX host. Periodt. π
πΈ DESCRIPTION πΈ
okay so, same main-character energy as NAME: this is the 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 default to true (enabled). π
π₯ EXPORTS π₯
π connect π
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 π¦
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 β thatβs the whole squad. π
xoxo π cute little sign-off: this page comes from Ericsson AB, itβs common_test version 1.24.0.1, and youβre reading the unix_telnet(3erl) manual page. Slay. π
π¦ where this page comes from
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4 Β· Apache-2.0
- ubuntu noble: erlang-manpages 1:25.3.2.8+dfsg-1ubuntu4.8 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms