AOLserver-CtrlPort

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        );

        my $out = $conn->send_cmds(<<EOT);
            info tclversion
        EOT

        print $out, "\n";

DESCRIPTION
    "AOLserver::CtrlPort" uses "Net::Telnet" to connect to a running
    AOLserver's control port, issues commands there and returns the output.

    It is useful for creating test suites for AOLserver applications which
    can be controlled via the control port.

    To configure AOLserver's control port, use settings similar to the
    following ones:

        ns_section "ns/server/${servername}/module/nscp"
            ns_param address myhostname
            ns_param port 3334

README  view on Meta::CPAN

    port 3334. Authentication is on, the username is "username" and the
    password is "password" (hashed to "3G5/H31peci.o" with a program like
    "htpasswd").

  METHODS
    AOLserver::CtrlPort->new(...)
        Creates a new control port client object. The following options are
        available to the constructor:

        Port
            The port AOLserver is listening to for control port commands.

        Host
            The control port "address" as defined in the configuration.

        Timeout
            Number of seconds after which the client will time out if the
            server doesn't send a response.

        User
            User name for control port login defaults to the empty string
            for non-protected control ports.

        Password
            Password for control port login defaults to the empty string for
            non-protected control ports.

    $conn->send_cmds("$cmd1\ncmd2\n...")
        Send one or more commands, separated by newlines, AOLserver's
        control port. The method will return the server's response as a
        string. Typically, this will look like

            $out = $conn->send_cmds(<<EOT);
                info tclversion
                info commands
            EOT

        and return the newline-separated response as a single string.

Debugging
    AOLserver::CtrlPort is Log4perl enabled. If your scripts don't do what
    you want and you need to find out which messages are being sent back and
    forth, you can easily bump up AOLserver::CtrlPort's internal debugging
    level by saying something like

        use Log::Log4perl qw(:easy);
        Log::Log4perl->easy_init($DEBUG);

    in your test script before any AOLserver::CtrlPort commands are called.

    Please check out the Log::Log4perl documentation for details.

AUTHOR
    Mike Schilli, 2004, m@perlmeister.com

eg/info  view on Meta::CPAN

#!/usr/bin/perl
############################################################
# info -- send info commands to AOLserver
# Mike Schilli <m@perlmeister.com>, 2004
############################################################

use strict;
use warnings;

use AOLserver::CtrlPort;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init($DEBUG);

lib/AOLserver/CtrlPort.pm  view on Meta::CPAN


    my $out = $conn->send_cmds(<<EOT);
        info tclversion
    EOT

    print $out, "\n";

=head1 DESCRIPTION

C<AOLserver::CtrlPort> uses C<Net::Telnet> to connect to a running
AOLserver's control port, issues commands there and returns the 
output.

It is useful for creating test suites for AOLserver applications which
can be controlled via the control port. 

To configure AOLserver's control port, use settings similar to the following
ones:

    ns_section "ns/server/${servername}/module/nscp"
        ns_param address myhostname

lib/AOLserver/CtrlPort.pm  view on Meta::CPAN


=item AOLserver::CtrlPort-E<gt>new(...)

Creates a new control port client object. The following options
are available to the constructor:

=over 4

=item Port

The port AOLserver is listening to for control port commands.

=item Host

The control port C<address> as defined in the configuration.

=item Timeout

Number of seconds after which the client will time out if the
server doesn't send a response.

lib/AOLserver/CtrlPort.pm  view on Meta::CPAN

    $t->login("", "");

    DEBUG("Waiting for prompt");
    $t->waitfor();

    bless $self, $class;
}

=item $conn->send_cmds("$cmd1\ncmd2\n...")

Send one or more commands, separated by newlines, AOLserver's
control port. The method will return the server's response as a string.
Typically, this will look like

    $out = $conn->send_cmds(<<EOT);
        info tclversion
        info commands
    EOT

and return the newline-separated response as a single string.

=cut

############################################################
sub send_cmds {
############################################################
    my ($self, $lines) = @_;

lib/AOLserver/CtrlPort.pm  view on Meta::CPAN

=head1 Debugging

AOLserver::CtrlPort is Log4perl enabled. If your scripts don't do 
what you want and you need to find out which messages are being sent
back and forth, you can easily bump up AOLserver::CtrlPort's
internal debugging level by saying something like

    use Log::Log4perl qw(:easy);
    Log::Log4perl->easy_init($DEBUG);

in your test script before any AOLserver::CtrlPort commands are called.

Please check out the Log::Log4perl documentation for details.

=head1 AUTHOR

Mike Schilli, 2004, m@perlmeister.com

=cut



( run in 0.930 second using v1.01-cache-2.11-cpan-f56aa216473 )