From 68d7535fe0cccd50622884f704edeb9d8bb47430 Mon Sep 17 00:00:00 2001 From: tmanevik Date: Fri, 18 Dec 2015 12:21:32 +0100 Subject: Common Test: Editorial changes 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reference Manual files from Pär Wennstad added --- lib/common_test/doc/src/unix_telnet.xml | 134 ++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 lib/common_test/doc/src/unix_telnet.xml (limited to 'lib/common_test/doc/src/unix_telnet.xml') diff --git a/lib/common_test/doc/src/unix_telnet.xml b/lib/common_test/doc/src/unix_telnet.xml new file mode 100644 index 0000000000..189379c39a --- /dev/null +++ b/lib/common_test/doc/src/unix_telnet.xml @@ -0,0 +1,134 @@ + + + + +
+ + 20102012 + Ericsson AB. All Rights Reserved. + + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + + + + unix_telnet + + + + + + + A + unix_telnet.xml +
+ unix_telnet + Callback module for ct_telnet, for connecting to a Telnet + server on a UNIX host. + + + +

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).

+
+ + + + connect(ConnName, Ip, Port, Timeout, KeepAlive, Extra) -> {ok, Handle} | {error, Reason} + Callback for ct_telnet.erl. + + ConnName = target_name() + Ip = string() | {integer(), integer(), integer(), integer()} + Port = integer() + Timeout = integer() + KeepAlive = 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 + Callback for ct_telnet.erl. + + 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

+
+ +
+ + -- cgit v1.2.3