blob: 64f21f12194f52bc484e94a28dd275f36a920c3e [file] [log] [blame]
///////////////////////////////////////////////////////////////////////////////
// //
// Copyright (c) 2000-2019 Ericsson Telecom AB //
// //
// All rights reserved. This program and the accompanying materials //
// are made available under the terms of the Eclipse Public License v2.0 //
// which accompanies this distribution, and is available at //
// https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html //
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
// Module: EPTF_CLL_CS_Definitions
//
// Purpose:
// This TTCN-3 module contains generic data type definitions for EPTF
// central scheduling
//
// Module Parameters:
// - tsp_EPTF_CS_LGenHostnameList - <EPTF_CharstringList>
//
// Module depends on:
// <EPTF_CLL_Common_Definitions>
// <EPTF_CLL_Base_Definitions>
// <EPTF_CLL_LGenBase_Definitions>
// <EPTF_CLL_FBQ_Definitions>
// <EPTF_CLL_Variable_Definitions>
// <EPTF_CLL_ExecCtrl_Definitions>
// <EPTF_CLL_HostAdmin_Definitions>
// <EPTF_CLL_Logging_Definitions>
//
// Current Owner:
// Gabor Tatarka (egbotat)
//
// Last Review Date:
// 2008-02-09
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////
module EPTF_CLL_CS_Definitions
{
//=========================================================================
// Imports
//=======================================================================
import from EPTF_CLL_Common_Definitions all;
import from EPTF_CLL_Base_Definitions all;
import from EPTF_CLL_LGenBase_Definitions all;
import from EPTF_CLL_FBQ_Definitions all;
import from EPTF_CLL_Variable_Definitions all;
import from EPTF_CLL_ExecCtrl_Definitions all;
import from EPTF_CLL_HostAdmin_Definitions all;
import from EPTF_CLL_Logging_Definitions all;
import from EPTF_CLL_DataSource_Definitions all;
modulepar EPTF_CharstringList tsp_EPTF_CS_LGenHostnameList := {};
modulepar charstring tsp_EPTF_CS_ApplAdminBase_loggingComponentMask := "EPTF_CS_ApplAdminBase";
///////////////////////////////////////////////////////////
// Group: EPTF_CS_LGenControl_Interface
//
// Purpose:
// Data types for LGen control interface
//
// Detailed comments:
// -
///////////////////////////////////////////////////////////
group EPTF_CS_LGenControl_Interface {
///////////////////////////////////////////////////////////
// Type: EPTF_CS_InternalTcId
//
// Purpose:
// Record type for storing traffic case related internal data.
//
// Elements:
// eIdx - *integer*
// fCtxIdx - *integer*
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type record EPTF_CS_InternalTcId
{
integer eIdx,
integer fCtxIdx
}
///////////////////////////////////////////////////////////
// Type: EPTF_CS_InternalTcIdList
//
// Purpose:
// Record type for storing a list of traffic case related internal data.
//
// Elements:
// record of <EPTF_CS_InternalTcId>
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type record of EPTF_CS_InternalTcId EPTF_CS_InternalTcIdList;
///////////////////////////////////////////////////////////
// Type: EPTF_CS_TcName2TcSelector
//
// Purpose:
// Record type for storing traffic case name and selector assignments.
//
// Elements:
// tcName - *charstring*
// tcSelector - *integer*
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type record EPTF_CS_TcName2TcSelector {
charstring tcName,
integer tcSelector
}
///////////////////////////////////////////////////////////
// Type: EPTF_CS_TcName2TcSelectorList
//
// Purpose:
// Record type for storing a list of traffic case name and selector assignments.
//
// Elements:
// record of <EPTF_CS_TcName2TcSelector>
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type record of EPTF_CS_TcName2TcSelector EPTF_CS_TcName2TcSelectorList;
///////////////////////////////////////////////////////////
// Type: EPTF_CS_LGenInfo
//
// Purpose:
// Record type for storing LGen related information.
//
// Elements:
// compRef - <EPTF_Base_CT> - LGen component reference
// hostIdx - *integer* - LGen host index
// runningTCs - <EPTF_CS_InternalTcIdList> - traffic cases running on the LGen
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type record EPTF_CS_LGenInfo
{
EPTF_Base_CT compRef,
integer hostIdx,
EPTF_CS_InternalTcIdList runningTCs
}
///////////////////////////////////////////////////////////
// Type: EPTF_CS_LGenInfoList
//
// Purpose:
// Record type for storing a list of LGen related information.
//
// Elements:
// record of <EPTF_CS_LGenInfo>
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type record of EPTF_CS_LGenInfo EPTF_CS_LGenInfoList;
///////////////////////////////////////////////////////////
// Type: EPTF_CS_LGenDatabase
//
// Purpose:
// Load Generator database type
//
// Elements:
// loadgens - <EPTF_CS_LGenInfoList> - list of LGen info
// queue - <EPTF_FreeBusyQueue> - associated queue
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type record EPTF_CS_LGenDatabase
{
EPTF_CS_LGenInfoList loadgens,
EPTF_FreeBusyQueue queue
}
} // group EPTF_CS_LGenControl_Interface
/////////////////////////////////////////////////////////////////////////
//
// Component: HostAdminList
//
// Purpose:
// List of component references to Host Admins for Load Balancing
//
// Elements:
// record of EPTF_HostAdmin_CT
//
// Detailed Comments:
// -
/////////////////////////////////////////////////////////////////////////
type record of EPTF_HostAdmin_CT HostAdminList;
///////////////////////////////////////////////////////////
// Group: EPTF_CS_User_Function_Prototypes
//
// Purpose:
// Function prototypes for central scheduling API
//
// Detailed comments:
// -
///////////////////////////////////////////////////////////
group EPTF_CS_User_Function_Prototypes {
///////////////////////////////////////////////////////////
// Type: EPTF_CS_AdminInit_FT
//
// Purpose:
// Function type to set user-defined init function type used in ApplAdmin.
//
// Elements:
// pl_adminName - *in* *charstring*
// pl_adminIdx - *in* *integer*
//
// Returns:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type function EPTF_CS_AdminInit_FT(in charstring pl_adminName, in integer pl_adminIdx) runs on self;
///////////////////////////////////////////////////////////
// Type: EPTF_CS_LGenCreate_FT
//
// Purpose:
// Function type to execute user-defined LGen create
// on ApplAdmin. It should also connect the created LGen to the
// ApplAdmin via the user defined port and start the behavior function.
//
// Elements:
// - pl_LgenIndex - *in* *integer* the index of the LGen to be created valid within the scenario
// - pl_LGenName - *in* *charstring* the name the LGen to be created
// - pl_LGenHostName - *in* *charstring* the name of the host where the LGen shall be created
//
// Returns:
// -
//
// Detailed Comments:
// If pl_LGenHostName is an empty string, the create operation should not
// contain a host parameter.
///////////////////////////////////////////////////////////
type function EPTF_CS_LGenCreate_FT(in integer pl_LGenIndex, in charstring pl_LGenName, in charstring pl_LGenHostName) runs on self return EPTF_Base_CT;
///////////////////////////////////////////////////////////
// Type: EPTF_CS_SendExecBurst_FT
//
// Purpose:
// Function type to add a new element to the buffered exec burst message
//
// Elements:
// -
//
// Returns:
// -
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type function EPTF_CS_AddExecBurstElement_FT(
in integer pl_trafficCaseSelector,
in EPTF_IntegerList pl_currentRangeItems) runs on self
///////////////////////////////////////////////////////////
// Type: EPTF_CS_SendExecBurst_FT
//
// Purpose:
// Function type to send the buffered execBurst message to the selected LGen
//
// Elements:
// -
//
// Returns:
// *boolean* - true if send succeeded
//
// Detailed Comments:
// -
///////////////////////////////////////////////////////////
type function EPTF_CS_SendExecBurst_FT() runs on self;
} // group
/////////////////////////////////////////////////////////////////////////
//
// Component: EPTF_CS_LGenBase_CT
//
// Purpose:
// Base component type for central scheduling LGen.
//
// Elements:
// - v_CS_LGenBase_initialized - *boolean* - initialization state
//
// Detailed Comments:
// Empty component, used for referencing extending components.
/////////////////////////////////////////////////////////////////////////
type component EPTF_CS_LGenBase_CT extends EPTF_Base_CT
{
var boolean v_CS_LGenBase_initialized := false;
}
/////////////////////////////////////////////////////////////////////////
//
// Component: EPTF_CS_ApplAdminBase_CT
//
// Purpose:
// Base component type for central scheduling ApplAdmin.
//
// Elements:
// v_EPTF_CS_initialized - *boolean* - true if component has been initialized
// v_EPTF_CS_myBIdx - *integer* - FSM related behavior index
// v_EPTF_CS_myBIdx_LGen - *integer* - behavior index for LGen entities
// v_EPTF_CS_EntityName_Suffix - *charstring* - Entity name suffix, has to be set from user init
// v_EPTF_CS_Admin_verdict - *verdicttype* - summarized verdict of traffic cases
// v_EPTF_CS_tcName2tcSelector - <EPTF_CS_TcName2TcSelectorList> - traffic case name to selector assignments
// v_EPTF_CS_tcTypeIdx2tcSelector - <EPTF_IntegerList> - traffic case type-index to selector lookup table
// v_EPTF_CS_AdminCleanup - <f_EPTF_Feature_cleanup_CT> - user-defined callback function for admin cleanup
// v_EPTF_CS_addExecBurstElem - <EPTF_CS_AddExecBurstElement_FT> - user-defined callback function for adding a new TC trigger to a buffer
// v_EPTF_CS_sendExecBurst - <EPTF_CS_SendExecBurst_FT> - user-defined callback function for sending buffered TC triggers
// v_EPTF_CS_LGenCreate - <EPTF_CS_LGenCreate_FT> - user-defined callback function for creating a LGen
// v_EPTF_CS_scenarioCreated_hookIdx - *integer*
// v_EPTF_CS_burstPostCalc_hook - <EPTF_LGenBase_burstPostCalc_FT>
// v_EPTF_CS_nofLGens - *integer* - number of configured LGens
// v_EPTF_CS_nofCreatedLGens - *integer* - number of created LGens
// v_EPTF_CS_selectedLGen - *integer* - LGen index selected for sending exec burst
// v_EPTF_CS_db_LGens - <EPTF_CS_LGenDatabase> - LGen database
// v_bufferedTCs - <EPTF_CS_InternalTcIdList> - internal TC information buffer
// v_EPTF_CS_scenarioPaused - *boolean* - set to true if scenario is paused
// v_hostAdmins - <HostAdminList> - list of HostAdmin component references for load balancing
// v_loadLevel_KeyList - <EPTF_IntegerList> - host CPU load key list for EPTF reference Varaibles towards HostAdmins
// v_EPTF_CS_scenarioNames - <EPTF_CharstringList>
// v_EPTF_CS_scenarioIntVerdict_keys - <EPTF_IntegerList>
//
// Detailed Comments:
// -
/////////////////////////////////////////////////////////////////////////
type component EPTF_CS_ApplAdminBase_CT extends EPTF_ExecCtrlClient_CT, EPTF_LGenBase_CT, EPTF_Var_CT, EPTF_Logging_CT, EPTF_DataSourceClient_CT, EPTF_FBQ_CT
{
private var boolean v_EPTF_CS_initialized := false;
private var integer v_EPTF_CS_myBIdx := -1;
private var integer v_EPTF_CS_myBIdx_LGen := -1;
private var charstring v_EPTF_CS_EntityName_Suffix := "";
private var verdicttype v_EPTF_CS_Admin_verdict := none;
private var integer v_EPTF_CS_Admin_intVerdict_k := -1;
private var EPTF_CS_TcName2TcSelectorList v_EPTF_CS_tcName2tcSelector := {};
private var EPTF_IntegerList v_EPTF_CS_tcTypeIdx2tcSelector := {};
public var f_EPTF_Feature_cleanup_CT v_EPTF_CS_AdminCleanup := null;
public var EPTF_CS_AddExecBurstElement_FT v_EPTF_CS_addExecBurstElem := null;
public var EPTF_CS_SendExecBurst_FT v_EPTF_CS_sendExecBurst := null;
public var EPTF_CS_LGenCreate_FT v_EPTF_CS_LGenCreate := null;
private var integer v_EPTF_CS_scenarioCreated_hookIdx := -1;
private var EPTF_LGenBase_burstPostCalc_FT v_EPTF_CS_burstPostCalc_hook := null;
private var integer v_EPTF_CS_nofLGens := -1;
private var integer v_EPTF_CS_nofCreatedLGens := 0;
private var integer v_EPTF_CS_selectedLGen := -1;
private var EPTF_CS_LGenDatabase v_EPTF_CS_db_LGens := {{}, c_EPTF_emptyFreeBusyQueue};
private var EPTF_CS_InternalTcIdList v_bufferedTCs := {};
private var boolean v_EPTF_CS_scenarioPaused := false;
private var integer v_EPTF_CS_MaxLGenUsageCounter := 0;
private var integer v_EPTF_CS_AvgLGenUsageCounter := 0;
private var integer v_EPTF_CS_SelectionAttempts := 0;
// Load Balancing
private var boolean v_EPTF_CS_loadBalancingInitialized := false;
private var HostAdminList v_hostAdmins := {};
private var EPTF_IntegerList v_loadLevel_KeyList := {}; // list of keys for <idx>.loadLevel, for all <idx> in slaveHostIdxList
// scenario verdicts
private var EPTF_CharstringList v_EPTF_CS_scenarioNames := {};
private var EPTF_IntegerList v_EPTF_CS_scenarioIntVerdict_keys := {};
// logging
private var integer v_CS_ApplAdminBase_loggingMaskId := c_EPTF_Logging_invalidMaskId;
}
///////////////////////////////////////////////////////////////////
// Constants
///////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_varName_intVerdict := "intVerdict";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_intVerdict_none
//
// Purpose:
// Integer representation of verdict value `none'.
//
// References:
// *integer* := 0
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_intVerdict_none := 0;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_intVerdict_pass
//
// Purpose:
// Integer representation of verdict value `pass'.
//
// References:
// *integer* := 1
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_intVerdict_pass := 1;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_intVerdict_inconc
//
// Purpose:
// Integer representation of verdict value `inconc'.
//
// References:
// *integer* := 2
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_intVerdict_inconc := 2;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_intVerdict_fail
//
// Purpose:
// Integer representation of verdict value `fail'.
//
// References:
// *integer* := 3
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_intVerdict_fail := 3;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_intVerdict_error
//
// Purpose:
// Integer representation of verdict value `error'.
//
// References:
// *integer* := 4
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_intVerdict_error := 4;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_BehaviorName
//
// Purpose:
// Central scheduling behavior name.
//
// References:
// *charstring* := "EPTF_CS_Behavior"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_BehaviorName := "EPTF_CS_Behavior";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_BehaviorName_LGen
//
// Purpose:
// Central scheduling behavior name for LGen entities.
//
// References:
// *charstring* := "EPTF_CS_Behavior_LGen"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_BehaviorName_LGen := "EPTF_CS_Behavior_LGen";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_stepIdx_startTc
//
// Purpose:
// FSM step - start traffic case on LGen (on LGenBase event startTC)
//
// References:
// *integer* := 0
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_stepIdx_startTc := 0;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_stepName_startTc
//
// Purpose:
// FSM step - start traffic case on LGen (on LGenBase event startTC)
//
// References:
// *charstring* := "Start TC on LGen"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_stepName_startTc := "Start TC on LGen";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_stepIdx_free
//
// Purpose:
// FSM step - free TC entity (on incoming exec burst result message)
//
// References:
// *integer* := 1
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_stepIdx_free := 1;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_stepName_free
//
// Purpose:
// FSM step - free TC entity (on incoming exec burst result message)
//
// References:
// *charstring* := "Free TC entity"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_stepName_free := "Free TC entity";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_stateIdx_idle
//
// Purpose:
// FSM state - TC entity is idle
//
// References:
// *integer* := 0
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_stateIdx_idle := 0;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_stateName_idle
//
// Purpose:
// FSM state - TC entity is idle
//
// References:
// *charstring* := "Idle"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_stateName_idle := "Idle";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_stateIdx_busy
//
// Purpose:
// FSM state - TC entity is busy
//
// References:
// *integer* := 1
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_stateIdx_busy := 1;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_stateName_busy
//
// Purpose:
// FSM state - TC entity is busy
//
// References:
// *charstring* := "Busy"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_stateName_busy := "Busy";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_eventIdx_receivedResultSuccess_Tc
//
// Purpose:
// FSM event - received successful result message
//
// References:
// *integer* := 0
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_eventIdx_receivedResultSuccess_Tc := 0;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_eventName_receivedResultSuccess_Tc
//
// Purpose:
// FSM event - received successful result message
//
// References:
// *charstring* := "Recevied execBurstResult success"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_eventName_receivedResultSuccess_Tc := "Recevied execBurstResult success";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_eventIdx_receivedResultFail_Tc
//
// Purpose:
// FSM event - received failed result message
//
// References:
// *integer* := 1
/////////////////////////////////////////////////////////////////////////
const integer c_EPTF_CS_eventIdx_receivedResultFail_Tc := 1;
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_eventName_receivedResultFail_Tc
//
// Purpose:
// FSM event - received failed result message
//
// References:
// *charstring* := "Recevied execBurstResult fail"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_eventName_receivedResultFail_Tc := "Recevied execBurstResult fail";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_EntityName_Tc
//
// Purpose:
// Entity name of TCs. Suffixed with v_EPTF_CS_EntityName_Suffix.
//
// References:
// *charstring* := "CS_Entity_Tc"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_EntityName_Tc := "CS_Entity_Tc";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_EntityName_LGen
//
// Purpose:
// Entity name of LGens. Suffixed with v_EPTF_CS_EntityName_Suffix.
// It is only used to define the number of LGens (via the entity group declarator).
//
// References:
// *charstring* := "CS_Entity_LGen"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_EntityName_LGen := "CS_Entity_LGen";
/////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_FsmName_Tc
//
// Purpose:
// FSM name for TCs.
//
// References:
// *charstring* := "EPTF_CS_FSM_Tc"
/////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_FsmName_Tc := "EPTF_CS_FSM_Tc";
///////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_loggingEventClasses
//
// Purpose:
// list of logging event class names used on the CentralScheduling
//
// Detailed Comments:
// <EPTF_Logging_EventClassPrefixList> { "Warning", "Debug" }
///////////////////////////////////////////////////////////
const EPTF_Logging_EventClassPrefixList c_EPTF_CS_loggingEventClasses := { "Warning", "Debug" };
///////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_loggingClassIdx_Warning
//
// Purpose:
// logging class index for Error
//
// Detailed Comments:
// *0*
///////////////////////////////////////////////////////////
const integer c_EPTF_CS_loggingClassIdx_Warning := 0;
///////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_loggingClassIdx_Debug
//
// Purpose:
// logging class index for Error
//
// Detailed Comments:
// *1*
///////////////////////////////////////////////////////////
const integer c_EPTF_CS_loggingClassIdx_Debug := 1;
///////////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_DataSource_sourceId
//
// Purpose:
// This constant defines the identifier which should be written into the datasource
// requests in order to tell the DataSource server that the requests belong to CentralScheduling,
// so send it to the CentralScheduling in order to process.
//
///////////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_DataSource_sourceId := "CentralScheduling";
///////////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_AvgLGenUsage
//
// Purpose:
// This constant defines what to write into the gui xml in order to get the
// following data element back : AvgLGenUsage, type float
//
// Parameters:
// -
//
///////////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_AvgLGenUsage := "AvgLGenUsage";
///////////////////////////////////////////////////////////////////////////////
// Constant: c_EPTF_CS_MaxLGenUsage
//
// Purpose:
// This constant defines what to write into the gui xml in order to get the
// following data element back : MaxLGenUsage, type float
//
// Parameters:
// -
//
///////////////////////////////////////////////////////////////////////////////
const charstring c_EPTF_CS_MaxLGenUsage := "MaxLGenUsage";
} // module