1unix_telnet(3) Erlang Module Definition unix_telnet(3)
2
3
4
6 unix_telnet - Callback module for ct_telnet, for connecting to a Telnet
7 server on a UNIX host.
8
10 Callback module for ct_telnet, for connecting to a Telnet server on a
11 UNIX host.
12
13 It requires the following entry in the configuration file:
14
15 {unix,[{telnet,HostNameOrIpAddress},
16 {port,PortNum}, % optional
17 {username,UserName},
18 {password,Password},
19 {keep_alive,Bool}]}. % optional
20
21 To communicate through Telnet to the host specified by HostNameOrIpAd‐
22 dress, use the interface functions in ct_telnet, for example,
23 open(Name) and cmd(Name,Cmd).
24
25 Name is the name you allocated to the Unix host in your require state‐
26 ment, for example:
27
28 suite() -> [{require,Name,{unix,[telnet]}}].
29
30 or
31
32 ct:require(Name,{unix,[telnet]}).
33
34 The "keep alive" activity (that is, that Common Test sends NOP to the
35 server every 10 seconds if the connection is idle) can be enabled or
36 disabled for one particular connection as described here. It can be
37 disabled for all connections using telnet_settings (see ct_telnet).
38
39 The {port,PortNum} tuple is optional and if omitted, default Telnet
40 port 23 is used. Also the keep_alive tuple is optional, and the value
41 default to true (enabled).
42
44 connect(ConnName, Ip, Port, Timeout, KeepAlive, TCPNoDelay, Extra) ->
45 {ok, Handle} | {error, Reason}
46
47 Types:
48
49 ConnName = target_name()
50 Ip = string() | {integer(), integer(), integer(), integer()}
51 Port = integer()
52 Timeout = integer()
53 KeepAlive = bool()
54 TCPNoDelay = bool()
55 Extra = target_name() | {Username, Password}
56 Username = string()
57 Password = string()
58 Handle = handle()
59 Reason = term()
60
61 Callback for ct_telnet.erl.
62
63 Setup Telnet connection to a Unix host.
64
65 For target_name(), see ct. For handle(), see ct_telnet.
66
67 get_prompt_regexp() -> PromptRegexp
68
69 Types:
70
71 PromptRegexp = prompt_regexp()
72
73 Callback for ct_telnet.erl.
74
75 Returns a suitable regexp string matching common prompts for
76 users on Unix hosts.
77
78 For prompt_regexp(), see ct_telnet.
79
81 ct, ct_telnet
82
83
84
85Ericsson AB common_test 1.25.1 unix_telnet(3)