<<

NAME

Inca::Net::MockAgent - Emulates an Inca agent (for testing purposes only)

SYNOPSIS

  use Inca::Net::MockAgent;
  my $agent = new Inca::Net::MockAgent( 3432, "ca1", "t/certs/trusted" );
  my ($conn, $numStmts, @responses) = $agent->accept(
    "REGISTER" => [ 'OK', 'END'],
  );
  $conn->close();
  $agent->stop();

DESCRIPTION

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

CLASS METHODS

new( $port, $ca, $trusted )

Starts SSL server on $port using the CA certificate $ca and trusted cert dir. Returns a new Inca::Net::MockAgent object.

Arguments:

port

An integer representing the port number the mock agent 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

accept( %commands )

Accepts a connection to the mock agent. %commands is a hash array where the keys are patterns to expect from the manager and the value is an array of commands to send in response

Arguments:

commands

A hash array where the keys are patterns of commands to accept from the manager and the values are an array of responses to send back.

stop( )

Stop mock agent.

AUTHOR

Shava Smallen <ssmallen@sdsc.edu>

CAVEATS/WARNINGS

Describe any known problems.

<<