Tapper::MCP::State
use Tapper::MCP::State; my $state_handler = Tapper::MCP::State->new($testrun_id); my $state = $state_handler->get_current_state(); $self->compare_given_state($state);
Tapper::MCP::State - Keep state information for one specific test run
Check whether received message is valid in current state.
@param hash ref - message
@return valid - 1 @return invalid - 0
Compare the current state to a given state name. Return -1 if the given state is earlier then the current, 1 if the current state is earlier then the given one and 0 if both are equal.
@param string - state name
@return current state is earlier - 1 @return given state is earlier - -1 @return states are equal - 0
Returns the time in seconds until the next timeout hits. When multiple timeouts are currently running (during test with multiple PRCs) the lowest of these timeouts is choosen. This value can be used for sleeping in reads.
@return int - timeout span in seconds
Initialize the state or reload it from database.
@param hash ref - initial state data (ignored in revive mode) @param bool - are we in revive mode?
@return success - 0 @return error - error string
Update the timeout during installation.
@return success - (0, timeout span for next state change) @return error - (1, undef)
Check and update timeouts for one PRC.
@param int - PRC number
@return success - new timeout @return error - undef
Update timeouts during test phase.
@return success - (1, new timeout) @return error - (0, undef)
Check whether keep-alive timeout has ended and if so, act accordingly.
Update the timeouts in $self->state_details structure.
The reboot call was successfully executed, now update the state for waiting for the first message.
@return success - (0, timeout span for next state change)
Handle message start-install
Handle message end-install
Handle message error-install
Handle message error-guest
Handle message start-guest
Handle message start-testing
Handle message end-testing
Handle message end-testprogram
Handle message error-testprogram
Handle message reboot
Handle message quit
@return (1, undef)
Handle message keep-alive. This function does not return anything because the caller ignores the return value anyway.
Update state machine based on message.
@param Result class - message
@return success - 1 @return error - undef
Update the state based on a message received from caller. The function returns a timeout span value that is the lowest of all currently active timeouts. The given message can be empty. In this case only timeouts are checked and updated if needed.
Tells caller whether the testrun is already finished or not.
@return TR finished - 1 @return TR not finished - 0
AMD OSRC Tapper Team <tapper@amd64.org>
This software is Copyright (c) 2012 by Advanced Micro Devices, Inc..
This is free software, licensed under:
The (two-clause) FreeBSD License
To install Tapper::MCP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Tapper::MCP
CPAN shell
perl -MCPAN -e shell install Tapper::MCP
For more information on module installation, please visit the detailed CPAN module installation guide.