[erlang-questions] ct_telnet example

Peter Andersson peppe@REDACTED
Tue Aug 3 16:04:46 CEST 2010


Hi Luc,

I could prepare an example for you, but before I do, did you already
read these parts of the documentation?

http://www.erlang.org/doc/apps/common_test/config_file_chapter.html#id2270029
http://www.erlang.org/doc/man/unix_telnet.html
http://www.erlang.org/doc/man/ct_telnet.html

The ftp example in the config file chapter shows how you set up an ftp
connection, and you would do it in a very similar way with telnet. The
only "trick" is that with ct_telnet:open/3/4 you may specify the name of
a callback module that helps ct_telnet with login and detecting prompts.
The default callback module is unix_telnet, which is provided with
Common Test. If you need to connect to a telnet host on a different
system than unix/linux, you can modify the regexp-patterns in
unix_telnet and pass the name of your modified module to ct_telnet:open
for opening the connection. This is really the only thing that is
handled differently compared to e.g. ct_ftp and ct_ssh. Tip: To test
if/how it works, you can start Common Test in interactive mode (run_test
-shell) and call each function from the shell prompt.

  /Peter

Ericsson AB, Erlang/OTP

Luc Evers wrote:
>    Hi,
>
>   I'm looking for an example using the ct_telnet module.
>
>
>   Thanks!
>
>    Luc.
>
>   



More information about the erlang-questions mailing list