<<

NAME

Inca::Net::MockDepot - Emulates an Inca depot (for testing purposes only)

SYNOPSIS

  use Inca::Net::MockDepot;
  my $depot = new Inca::Net::MockDepot();
  my $numReports = $depot->readReportsFromSSL(
    4, 8434, "ca1", "t/certs/trusted"
  );
  $numReports = $depot->readReportsFromFile("./depot.tmp.$$", 0)

DESCRIPTION

Emulates the actions of a depot so we can test out the functionality of the reporter manager.

CLASS METHODS

new( $port, $ca, $trusted, trust_type => [file, dir] )

Class constructor which returns a new Inca::Net::MockDepot object.

getNumReports( )

Return the number of reports successfully received by the mock depot.

Returns:

An integer containing the number of reports successfully received by the mock depot.

getReports( )

Return an array of strings containing reports read by the mock depot.

Returns:

An array of strings containing the reports successfully received by the mock depot.

readReportsFromFile( $filename )

Read a report from file and clean the file from disk.

Returns:

True upon successful read and false otherwise.

readReportsFromSSL( $numReports, $port, $ca, $trusted, trust_type => [file, dir] )

Starts SSL server on $port using the CA certificate $ca and trusted cert dir and accepts $numReports from clients.

Arguments:

numReports

The number of connections the mock depot should accept

port

An integer representing the port number the mock depot should listen on.

ca

A string containing the name of the CA in t/certs to use

trusted

A string containing the path to the trusted CA dir or file

Options:

trust_type

Indicates whether trusted is a file or dir [default: dir]

AUTHOR

Shava Smallen <ssmallen@sdsc.edu>

CAVEATS/WARNINGS

No known problems.

<<