Net-SSH-Any

 view release on metacpan or  search on metacpan

lib/Net/SSH/Any/Test.pm  view on Meta::CPAN

The default set includes commands for common Linux, UNIX and MS
Windows systems.

=item working_dir => $path

Path to a directory where to write temporary files and logs.

=item timeout => $timeout

The given value is later honoured by methods doing network IO.

=item logger => sub { ... }

A logging function that will be used for reporting information to the
user. The function is called with the logging file handle and the
message as arguments.

For instance, using C<diag> from L<Test::More>:

  use Test::More;
  ...

  sub my_logger {
    my ($fh, $msg) = @_;
    # note that $fh is just not used!
    diag $msg;
  }

  my $tssh = Net::SSH::Any::Test->new(...,
                                      logger => \&my_logger);

The default logger prints the messages to the logger file handle.

=item logger_fh => $fh

Sets the logger file handle. Defaults to C<STDERR>.

=item target => $uri

=item targets => \@uris

Set of server targets to be used by the Remote backend.

The information in the targets is combined with that passed in other
options. For instance:

   my $tssh = Net::SSH::Any::Test->new(target => 'ssh://leo_caldas@10.0.3.1/',
                                       password => $password,
                                       port => 1022);

See also L<Net::SSH::Any::URI>.

=item port => $port

Sets the SSH port number used when looking for running servers.

=item password => $password

Sets the SSH password.

=item key_path => $private_key_path

=item key_paths => \@private_key_paths

Path to files containing private keys to use for authentication.

=item backend_opts => { $backend_name => \%opts, ... }

Per backend specific options.

=back

=item $uri = $tssh->uri

Returns a L<Net::SSH::Any::URI> object representing a working SSH
service.

=item $error = $tssh->error

Returns the last error.

=item $tssh->stop

Terminates any running process (i.e. any SSH server).

=back

=head1 BACKENDS

The following backends are currently available.

They lack proper documentation as this is a work in progress yet.

=over 4

=item Remote

Tries to connect to localhost or to any other given service.

See L<Net::SSH::Any::Test::Backend::Remote>.

=item OpenSSH_Daemon

Starts a new OpenSSH server.

See L<Net::SSH::Any::Test::Backend::OpenSSH_Daemon>.

=item Dropbear_Daemon

Starts a new Dropbear server.

Note: requires a patched version of dropbear installed
(L<https://github.com/salva/dropbear>).

See L<Net::SSH::Any::Test::Backend::Dropbear_Daemon>.

=item Cygwin

In MS Windows systems, downloads and install Cygwin, including the
OpenSSH packages, and uses then to run a SSH server.

See L<Net::SSH::Any::Test::Backend::Cygwin>.

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.729 second using v1.00-cache-2.02-grep-82fe00e-cpan-2cc899e4a130 )