NAME

PITA::Guest - The PITA Guest abstract, a container for running tests

DESCRIPTION

All testing is run inside a Guest, a container object usually involving a system image and a configuration.

This class implements the Guest abstraction.

METHODS

new

$guest = PITA::Guest->new( 'guest-51231.pita' );
$guest = PITA::Guest->new( \$file_content     );
$guest = PITA::Guest->new( $guest_xml_object  );

The new constructor creates a new PITA::Guest object from an XML description. It takes a single param of either a PITA::XML::Guest object, a string which is the name of a PITA file containing the XML description, or a SCALAR reference (which may be a constant SCALAR ref) containing the XML.

Returns a new PITA::Guest object, or dies on error.

file

The file accessor returns the name of the file the Guest object was created from.

guestxml

The PITA::XML file loads to a PITA::XML::Guest object which is held internally.

The guestxml accessor returns the PITA::XML::Guest object.

discovered

The discovered method returns true if the Guest has gone through the discovery process that identifies testing platforms in the Guest, or false if not.

driver

The driver method returns the PITA::Driver object within the PITA::Guest that the tests are run through.

ping

All guests are required to identify themselves.

The ping method is dispatched to the driver and does whatever is necesary to determine if the guest is live (and actually a PITA::Guest)

Returns true (may take up to 5 minutes) or false if not.

discover

Most often the detailed of a Guest are provided without identifying what is set up inside them.

The discover method is dispatched to the driver, loading the Guest and interrogating it to determine the testing platforms available from it.

Returns true (may take up to 5 minutes) if the testing platforms are correctly discovered, or dies if not.

test

$response = $guest->test( 'request.pita' );

The test method executes a single testing request.

It takes as argument the name of a PITA::XML file with a <request> at the root. Loads the request and dispatches it to the driver, which will load the Guest, inject the test request and package, and then hand back the response once it is completed.

Depending on the package, this could take from minutes to hours to run.

Returns a PITA::XML::Report object, or dies on error.

save

The PITA::Guest object remembers the name of the file it was loaded from.

If you run discover, then afterwards your can run save to save the now-discovered Guest back to a file.

Returns true or dies on error.

SUPPORT

Bugs should be reported via the CPAN bug tracker at

http://rt.cpan.org/NoAuth/ReportBug.html?Queue=PITA

For other issues, contact the author.

AUTHOR

Adam Kennedy <adamk@cpan.org>

SEE ALSO

The Practical Image Testing Architecture (http://ali.as/pita/)

PITA::XML, PITA::Scheme

COPYRIGHT

Copyright 2005 - 2011 Adam Kennedy.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.