EPTF_MBT_LGen_Functions

Purpose

Functions of the MBT Applib

Module depends on

  • EPTF_MBT_LGen_Definitions
  • <EPTF_CLL_Logging_Definitions>
  • <EPTF_CLL_Logging_Functions>
  • <EPTF_CLL_Common_Definitions>
  • <EPTF_CLL_Variable_Definitions>
  • <EPTF_CLL_Variable_Functions>
  • <EPTF_CLL_Scheduler_Definitions>
  • <EPTF_CLL_Base_Definitions>
  • <EPTF_CLL_Base_Functions>
  • <EPTF_CLL_LGenBase_ConfigDefinitions>
  • <EPTF_CLL_LGenBase_ConfigFunctions>
  • <EPTF_CLL_LGenBase_Functions>
  • <EPTF_CLL_LGenBase_Definitions>
  • <EPTF_CLL_LGenBase_EventHandlingFunctions>
  • <EPTF_CLL_LGenBase_StepFunctions>
  • <EPTF_CLL_RBTScheduler_Functions>
  • <EPTF_CLL_Semaphore_Functions>
Summary
EPTF_MBT_LGen_FunctionsFunctions of the MBT Applib
f_EPTF_MBT_initFunction to initialize MBT behaviour
f_EPTF_MBT_cleanup_CTCleanup function of the MBT Applib
f_EPTF_MBT_declareEventsRegister the EVents used by the MBT AppLib
f_EPTF_MBT_declareTestStepsRegister the TestSteps used by the MBT AppLib
f_EPTF_MBT_bindEntityBind function of the MBT AppLib
f_EPTF_MBT_unbindEntityUnbind function of the MBT AppLib
f_EPTF_MBT_resetEntityReset function of the MBT AppLib
f_EPTF_MBT_TestStep_invokeTestStepGeneral Purpose wrapper TestStep to select the Proper TestStep based on its actual parameters and invokes it.
f_EPTF_MBT_TestStep_sendUserResponseTestStep function to generate the User response,.
f_EPTF_MBT_TestStep_invokeUserFunctionTestStep function to invoke user specific function
f_EPTF_MBT_Listener_catchEntityEventsThis is a listener to catch all entity level events.
f_EPTF_MBT_Listener_catchGenericEventsThis is a listener to catch all generic level events.
as_EPTF_MBT_PCO_HandlerEventHandler of the MBT AppLib
f_EPTF_MBT_initLGenFsmThis function inits the MBT FSM
f_EPTF_MBT_Tester_initThis function inits the EPTF_MBT_Tester_CT
f_MBT_executeThis function executes a test step on specifid FSM (which must run the FSM_MBT) FSM.
f_MBT_waitForThis function waits for specified EPTF event to arrive.
f_MBT_dispatchThis function sends an EPTF event to an FSM.
f_MBT_activateFsmThis function activates an FSM on an entity.
f_convert_FsmAddr2TestStepArgsUtility function to convert an FsmAddr address to a TestStepArgs value.

f_EPTF_MBT_init

function f_EPTF_MBT_init (
   in charstring pl_selfName,  
   in integer pl_selfId,  
   in charstring pl_entityNamePrefix,  
   in integer pl_numEntities : =  0,
   in EPTF_LGenBase_BehaviorContextBinder_FT pl_bind : =  refers(f_EPTF_MBT_bindEntity),
   in EPTF_LGenBase_BehaviorContextHandler_FT pl_reset : =  refers(f_EPTF_MBT_resetEntity),
   in EPTF_LGenBase_BehaviorContextHandler_FT pl_unbind : =  refers(f_EPTF_MBT_unbindEntity)
) runs on EPTF_MBT_LGen_CT

Purpose

Function to initialize MBT behaviour

Parameters

pl_selfNamein charstring - the components self name
pl_selfIdin integer - component self id
pl_entityNamePrefixin charstring - entity name prefix
pl_numEntitiesin integer - number of entities
pl_bindin <EPTF_LGenBase_BehaviorContextBinder_FT> - behaviour context bind callback function
pl_resetin <EPTF_LGenBase_BehaviorContextHandler_FT> - behaviour context reset callback function
pl_unbindin <EPTF_LGenBase_BehaviorContextHandler_FT> - behaviour context unbind callback function

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_cleanup_CT

function f_EPTF_MBT_cleanup_CT() runs on EPTF_MBT_LGen_CT

Purpose

Cleanup function of the MBT Applib

Parameters

-

Return Value

-

Errors

-

Detailed Comments

Unmaps the TestPorts from teh System

f_EPTF_MBT_declareEvents

function f_EPTF_MBT_declareEvents() runs on EPTF_MBT_LGen_CT

Purpose

Register the EVents used by the MBT AppLib

Parameters

-

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_declareTestSteps

function f_EPTF_MBT_declareTestSteps() runs on EPTF_MBT_LGen_CT

Purpose

Register the TestSteps used by the MBT AppLib

Parameters

-

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_bindEntity

function f_EPTF_MBT_bindEntity(
   in integer pl_eIdx
) runs on EPTF_MBT_LGen_CT return EPTF_IntegerList

Purpose

Bind function of the MBT AppLib

Parameters

-

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_unbindEntity

function f_EPTF_MBT_unbindEntity(in integer pl_eIdx) runs on EPTF_MBT_LGen_CT

Purpose

Unbind function of the MBT AppLib

Parameters

-

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_resetEntity

function f_EPTF_MBT_resetEntity(in integer pl_eIdx) runs on EPTF_MBT_LGen_CT

Purpose

Reset function of the MBT AppLib

Parameters

-

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_TestStep_invokeTestStep

function f_EPTF_MBT_TestStep_invokeTestStep(
   in EPTF_LGenBase_TestStepArgs pl_ptr
) runs on EPTF_MBT_LGen_CT

Purpose

General Purpose wrapper TestStep to select the Proper TestStep based on its actual parameters and invokes it.  Otherwise generates a log&console statement

Parameters

in EPTF_LGenBase_TestStepArgs pl_ptr

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_TestStep_sendUserResponse

function f_EPTF_MBT_TestStep_sendUserResponse(
   in EPTF_LGenBase_TestStepArgs pl_ptr
) runs on EPTF_MBT_LGen_CT

Purpose

TestStep function to generate the User response,.  It shall be invoked in case of the unhandled events (FSM description) based on the generated event it sends back a response towards the Tester component

Parameters

in EPTF_LGenBase_TestStepArgs pl_ptr

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_TestStep_invokeUserFunction

function f_EPTF_MBT_TestStep_invokeUserFunction(
   in EPTF_LGenBase_TestStepArgs pl_ptr
) runs on EPTF_MBT_LGen_CT

Purpose

TestStep function to invoke user specific function

Parameters

in EPTF_LGenBase_TestStepArgs pl_ptr

Return Value

-

Errors

-

Detailed Comments

It seraches for the user declared function basedon its name (stored in a component variable) and invokes it.)

f_EPTF_MBT_Listener_catchEntityEvents

function f_EPTF_MBT_Listener_catchEntityEvents(
   EPTF_LGenBase_ReportedEventDescriptor pl_event,
   EPTF_IntegerList pl_listenerArgs
) runs on EPTF_MBT_LGen_CT

Purpose

This is a listener to catch all entity level events.  Because unhandled events in the FSM descriptor can catch only FSM level events.

Parameters

in EPTF_LGenBase_ReportedEventDescriptor pl_event in EPTF_IntegerList pl_listenerArgs

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_Listener_catchGenericEvents

function f_EPTF_MBT_Listener_catchGenericEvents(
   EPTF_LGenBase_ReportedEventDescriptor pl_event,
   EPTF_IntegerList pl_listenerArgs
) runs on EPTF_MBT_LGen_CT

Purpose

This is a listener to catch all generic level events.  Because unhandled events in the FSM descriptor can catch only FSM level events.

Parameters

in EPTF_LGenBase_ReportedEventDescriptor pl_event in EPTF_IntegerList pl_listenerArgs

Return Value

-

Errors

-

Detailed Comments

-

as_EPTF_MBT_PCO_Handler

altstep as_EPTF_MBT_PCO_Handler() runs on EPTF_MBT_LGen_CT

Purpose

EventHandler of the MBT AppLib

Parameters

-

Return Value

-

Errors

-

Detailed Comments

Handles the following cases In case of an incomming TestStep Request dispatches the c_EPTF_MBT_inputIdx_incomingTestStepRequest event incomming Config Request configure the LoadGens creates the entity goups activate the fsms...etc incomming Command Request executes the requested command - incomming User Request dispatches the c_EPTF_MBT_inputIdx_incomingUserRequest event

f_EPTF_MBT_initLGenFsm

function f_EPTF_MBT_initLGenFsm (
   in fcb_EPTF_MBT_customUserFunction p_userFunc,
   in fcb_EPTF_MBT_entityGroupCreated p_entityGroupCreateFunc
) runs on EPTF_MBT_LGen_CT

Purpose

This function inits the MBT FSM

Parameters

in fcb_EPTF_MBT_customUserFunction p_userFuncsets the callback that shall create the UserResponses
in fcb_EPTF_MBT_entityGroupCreated p_entityGroupCreateFuncsets the callback to handle entity group created

Return Value

-

Errors

-

Detailed Comments

-

f_EPTF_MBT_Tester_init

function f_EPTF_MBT_Tester_init (
   in charstring pl_selfName
) runs on EPTF_MBT_Tester_CT

Purpose

This function inits the EPTF_MBT_Tester_CT

Parameters

  • in charstring pl_selfName - local internal name for the MBT Tester component

Return Value

-

Errors

-

Detailed Comments

-

f_MBT_execute

function f_MBT_execute(
   in charstring p_name,  
   in EPTF_MBT_LGen_Definitions.FsmAddr p_addr,  
   in EPTF_IntegerList p_params : =  {},
   in boolean p_lock : =  true
) runs on EPTF_MBT_Tester_CT

Purpose

This function executes a test step on specifid FSM (which must run the FSM_MBT) FSM.  It is possible to make the function blocking until the test stepis executed by setting the p_lock parameter to true, but it will only work in case the component extends the EPTF_MBT_Tester_CT and EPTF_MBT_LGen_CT as well!

Parameters

  • in charstring p_name - name of the test step
  • in FsmAddr p_addr - address of the FSM
  • in <EPTF_IntegerList> - p_params - parameters for the test step
  • in boolean - p_lock - Enables/disables waiting for the test step to finish executing.

Return Value

-

Errors

-

Detailed Comments

-

f_MBT_waitFor

function f_MBT_waitFor(
   in charstring p_behavior,  
   in template charstring p_name,  
   in template EPTF_MBT_LGen_Definitions.FsmAddr p_addr,  
   in float p_timeout : =  30.0
) runs on EPTF_MBT_Tester_CT return boolean

Purpose

This function waits for specified EPTF event to arrive.  Please note, that until the waiting time runs out all the other incoming events are dropped.

Parameters

  • in charstring p_behavior - behavior name of the expected event
  • in charstring p_name - name of the expected event
  • in FsmAddr - p_addr - the event must arrive from this FSM.
  • in float - p_timeout - Maximum waiting time for the expected event

Return Value

  • boolean - True if the expected emssage was caught.

Errors

-

Detailed Comments

-

f_MBT_dispatch

function f_MBT_dispatch(
   in charstring p_bName,
   in integer p_iIndex,
   in EPTF_MBT_LGen_Definitions.FsmAddr p_addr
) runs on EPTF_MBT_Tester_CT

Purpose

This function sends an EPTF event to an FSM.

Parameters

  • in charstring p_bName - behavior name of the event
  • in integer p_iIndex - index of the event
  • in FsmAddr - p_addr - the event will be sent to this FSM.

Return Value

-

Errors

-

Detailed Comments

-

f_MBT_activateFsm

function f_MBT_activateFsm(
   in charstring p_entityGroupName,
   in integer p_eIdx,
   in charstring p_fsmName,
   out FsmAddr p_fsmAddr
) runs on EPTF_MBT_Tester_CT return integer

Purpose

This function activates an FSM on an entity.

Parameters

  • in charstring p_entityGroupName - entity group name of the entity
  • in integer p_eIdx - index of the entity
  • in charstring - p_fsmName - the event will be sent to this FSM.
  • out FsmAddr - p_fsmAddr - The address of the activated FSM if succesful

Return Value

  • integer - the result of the FSM activation (-1 if unsuccesful)

Errors

-

Detailed Comments

-

f_convert_FsmAddr2TestStepArgs

function f_convert_FsmAddr2TestStepArgs(
   in EPTF_MBT_LGen_Definitions.FsmAddr p_addr
) return EPTF_LGenBase_TestStepArgs

Purpose

Utility function to convert an FsmAddr address to a TestStepArgs value.

Parameters

  • in FsmAddr - p_fsmAddr - An FSM address

Return Value

  • <EPTF_LGenBase_TestStepArgs> - the corresponding TestStapArgs value

Errors

-

Detailed Comments

-

function f_EPTF_MBT_init (
   in charstring pl_selfName,  
   in integer pl_selfId,  
   in charstring pl_entityNamePrefix,  
   in integer pl_numEntities : =  0,
   in EPTF_LGenBase_BehaviorContextBinder_FT pl_bind : =  refers(f_EPTF_MBT_bindEntity),
   in EPTF_LGenBase_BehaviorContextHandler_FT pl_reset : =  refers(f_EPTF_MBT_resetEntity),
   in EPTF_LGenBase_BehaviorContextHandler_FT pl_unbind : =  refers(f_EPTF_MBT_unbindEntity)
) runs on EPTF_MBT_LGen_CT
Function to initialize MBT behaviour
function f_EPTF_MBT_cleanup_CT() runs on EPTF_MBT_LGen_CT
Cleanup function of the MBT Applib
function f_EPTF_MBT_declareEvents() runs on EPTF_MBT_LGen_CT
Register the EVents used by the MBT AppLib
function f_EPTF_MBT_declareTestSteps() runs on EPTF_MBT_LGen_CT
Register the TestSteps used by the MBT AppLib
function f_EPTF_MBT_bindEntity(
   in integer pl_eIdx
) runs on EPTF_MBT_LGen_CT return EPTF_IntegerList
Bind function of the MBT AppLib
function f_EPTF_MBT_unbindEntity(in integer pl_eIdx) runs on EPTF_MBT_LGen_CT
Unbind function of the MBT AppLib
function f_EPTF_MBT_resetEntity(in integer pl_eIdx) runs on EPTF_MBT_LGen_CT
Reset function of the MBT AppLib
function f_EPTF_MBT_TestStep_invokeTestStep(
   in EPTF_LGenBase_TestStepArgs pl_ptr
) runs on EPTF_MBT_LGen_CT
General Purpose wrapper TestStep to select the Proper TestStep based on its actual parameters and invokes it.
function f_EPTF_MBT_TestStep_sendUserResponse(
   in EPTF_LGenBase_TestStepArgs pl_ptr
) runs on EPTF_MBT_LGen_CT
TestStep function to generate the User response,.
function f_EPTF_MBT_TestStep_invokeUserFunction(
   in EPTF_LGenBase_TestStepArgs pl_ptr
) runs on EPTF_MBT_LGen_CT
TestStep function to invoke user specific function
function f_EPTF_MBT_Listener_catchEntityEvents(
   EPTF_LGenBase_ReportedEventDescriptor pl_event,
   EPTF_IntegerList pl_listenerArgs
) runs on EPTF_MBT_LGen_CT
This is a listener to catch all entity level events.
function f_EPTF_MBT_Listener_catchGenericEvents(
   EPTF_LGenBase_ReportedEventDescriptor pl_event,
   EPTF_IntegerList pl_listenerArgs
) runs on EPTF_MBT_LGen_CT
This is a listener to catch all generic level events.
altstep as_EPTF_MBT_PCO_Handler() runs on EPTF_MBT_LGen_CT
EventHandler of the MBT AppLib
function f_EPTF_MBT_initLGenFsm (
   in fcb_EPTF_MBT_customUserFunction p_userFunc,
   in fcb_EPTF_MBT_entityGroupCreated p_entityGroupCreateFunc
) runs on EPTF_MBT_LGen_CT
This function inits the MBT FSM
function f_EPTF_MBT_Tester_init (
   in charstring pl_selfName
) runs on EPTF_MBT_Tester_CT
This function inits the EPTF_MBT_Tester_CT
function f_MBT_execute(
   in charstring p_name,  
   in EPTF_MBT_LGen_Definitions.FsmAddr p_addr,  
   in EPTF_IntegerList p_params : =  {},
   in boolean p_lock : =  true
) runs on EPTF_MBT_Tester_CT
This function executes a test step on specifid FSM (which must run the FSM_MBT) FSM.
function f_MBT_waitFor(
   in charstring p_behavior,  
   in template charstring p_name,  
   in template EPTF_MBT_LGen_Definitions.FsmAddr p_addr,  
   in float p_timeout : =  30.0
) runs on EPTF_MBT_Tester_CT return boolean
This function waits for specified EPTF event to arrive.
function f_MBT_dispatch(
   in charstring p_bName,
   in integer p_iIndex,
   in EPTF_MBT_LGen_Definitions.FsmAddr p_addr
) runs on EPTF_MBT_Tester_CT
This function sends an EPTF event to an FSM.
function f_MBT_activateFsm(
   in charstring p_entityGroupName,
   in integer p_eIdx,
   in charstring p_fsmName,
   out FsmAddr p_fsmAddr
) runs on EPTF_MBT_Tester_CT return integer
This function activates an FSM on an entity.
function f_convert_FsmAddr2TestStepArgs(
   in EPTF_MBT_LGen_Definitions.FsmAddr p_addr
) return EPTF_LGenBase_TestStepArgs
Utility function to convert an FsmAddr address to a TestStepArgs value.
Type definitions for the MBT Applib
type record FsmAddr
Describes the FSM address