blob: d6422a6cebd0da874995bc08b7ab82d7203d0eae [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_ExecCtrl_CLITest_TestCases
//
// Purpose:
// This module contains the testcases of the EPTF ExecCtrl CLI test enviroment.
//
// Module depends on:
//
// Current Owner:
// Laszlo Skumat (elszsku)
//
// Last Review Date:
// 2010-03-29
//
// Detailed Comments:
// -
//
///////////////////////////////////////////////////////////////
module EPTF_ExecCtrl_CLITest_TestCases
{
import from EPTF_CLL_UIHandlerCLI_Functions all;
import from EPTF_CLL_LGenBase_ConfigDefinitions all;
import from EPTF_CLL_Variable_Definitions all;
import from EPTF_CLL_Common_Definitions all;
import from EPTF_CLL_LGenBase_Definitions all;
import from EPTF_CLL_ExecCtrl_Definitions all;
import from EPTF_CLL_ExecCtrlClient_Functions all;
import from EPTF_CLL_Base_Functions all;
import from EPTF_CLL_LGenBase_Functions all;
import from EPTF_CLL_LGenBase_ConfigFunctions all;
import from EPTF_ExecCtrl_CLITest_Definitions all;
import from EPTF_CLL_CLI_Functions all;
import from EPTF_CLL_ExecCtrl_CLIFunctions all;
import from EPTF_CLL_ExecCtrl_Functions all;
import from EPTF_CLL_ExecCtrlUIHandler_Functions all;
import from EPTF_CLL_UIHandler_WidgetFunctions all;
import from EPTF_CLL_UIHandler_XULFunctions all;
//temp, until HashMap repaired
import from EPTF_CLL_HashMapInt2Int_Functions all;
import from EPTF_CLL_HashMapOct2Int_Functions all;
import from EPTF_CLL_HashMapStr2Int_Functions all;
group startExec1{
modulepar float tsp_ExecCtrl_CLITest_guard := 10.0
function f_EPTF_ExecCtrl_CLITest_startExectr1LGenBehav(
in charstring pl_name,
in EPTF_ExecCtrl_CT pl_execCtrlCompRef)
runs on EPTF_ExecCtrl_CLITest_LGen_CT{
f_EPTF_LGenBase_init(pl_name)
f_EPTF_LGenBase_declareBehaviorType(c_EPTF_ExecCtrl_CLITest_behaviorName, -1, null, null, null)
f_EPTF_LGenBase_declareEntityType(c_EPTF_ExecCtrl_CLITest_eTypeName, {c_EPTF_ExecCtrl_CLITest_behaviorName})
f_EPTF_LGenBase_declareFSMTable(c_EPTF_ExecCtrl_CLITest_simpleResponseFSM)
f_EPTF_ExecCtrlClient_init_CT(pl_name, pl_execCtrlCompRef)
f_EPTF_Base_wait4Shutdown()
}
function f_EPTF_ExecCtrl_CLITest_terminalBehavior(
in charstring pl_command,
in template charstring pl_answer := ?,
in float pl_timeout := tsp_ExecCtrl_CLITest_guard
)
runs on EPTF_ExecCtrl_CLITest_Terminal_CT{
map(self:CLI_PCO, system:CLI_PCO)
f_EPTF_ExecCtrl_CLITest_cliCommand(pl_command, pl_answer, pl_timeout)
unmap(self:CLI_PCO, system:CLI_PCO)
}
function f_EPTF_ExecCtrl_CLITest_cliCommand(
in charstring pl_command,
in template charstring pl_answer := ?,
in float pl_timeout := tsp_ExecCtrl_CLITest_guard)
runs on EPTF_ExecCtrl_CLITest_Terminal_CT
//return charstring
{
timer t_guard
//log("Send command: ",pl_command)
CLI_PCO.send( pl_command )
t_guard.start( pl_timeout )
var charstring vl_received := ""
alt{
[] CLI_PCO.receive( charstring:"TTCN> " ) -> value vl_received{
//Prompt received after executing a command
t_guard.stop
}
[] CLI_PCO.receive( charstring:? ) -> value vl_received{
t_guard.stop
if(match(vl_received, pl_answer)){
setverdict(pass,pl_command)
}else{
var charstring vl_res :=log2str(match(vl_received, pl_answer))
log(vl_res)
setverdict(fail,vl_res)
}
t_guard.start( pl_timeout )
repeat
}
[] t_guard.timeout{
setverdict(fail, "Timeout waiting for answer to command "&pl_command)
}
};
//return vl_received
}
const charstring c_execCtrlMainWindow_str := "<window height=\"800.000000\" id=\"EPTF_Main_Window\" orient=\"vertical\" title=\"TTCN constructed window\" width=\"800.000000\">\n<hbox orient=\"vertical\">\n<tabbox>\n<tabs>\n<tab id=\"Execution_Control.tab\" label=\"Execution Control\">\n</tab>\n</tabs>\n<tabpanels>\n</tabpanels>\n</tabbox>\n</hbox>\n</window>\n";
function f_EPTF_ExecCtrl_CLITest_execCLICommand(
in charstring pl_command,
in template charstring pl_answer := ?,
in float pl_timeout := tsp_ExecCtrl_CLITest_guard
)
runs on EPTF_ExecCtrl_CLITest_Main_CT{
var EPTF_ExecCtrl_CLITest_Terminal_CT vl_terminal := EPTF_ExecCtrl_CLITest_Terminal_CT.create( pl_command );
vl_terminal.start(f_EPTF_ExecCtrl_CLITest_terminalBehavior(pl_command,pl_answer,pl_timeout));
vl_terminal.done;
action("execCLICommand->",pl_command);
}
function f_EPTF_ExecCtrl_CLITest_trafficCaseStateChangedCallback(
in charstring pl_eGrpName,
in charstring pl_scName,
in charstring pl_tcName,
in charstring pl_state)
runs on EPTF_ExecCtrl_CLITest_Main_CT{
select( pl_eGrpName ){
case ( c_EPTF_ExecCtrl_CLITest_eGrpName ){
select( pl_scName ){
case ( c_EPTF_ExecCtrl_CLITest_scNameNormal ){
select( pl_tcName ){
case ( c_EPTF_ExecCtrl_CLITest_tcNameTc1 ){
v_stateOfTcs[c_CLITest_tcNorm1] := pl_state
}
case ( c_EPTF_ExecCtrl_CLITest_tcNameTc2 ){
v_stateOfTcs[c_CLITest_tcNorm2] := pl_state
}
}
}
case ( c_EPTF_ExecCtrl_CLITest_scNameWeighted ){
select( pl_tcName ){
case ( c_EPTF_ExecCtrl_CLITest_tcNameTc1 ){
v_stateOfTcs[c_CLITest_tcWeighted1] := pl_state
}
case ( c_EPTF_ExecCtrl_CLITest_tcNameTc2 ){
v_stateOfTcs[c_CLITest_tcWeighted2] := pl_state
}
}
}
}
}
}
}
function f_EPTF_ExecCtrl_CLITest_wait4States(
in template EPTF_CharstringList pl_waitedStates,
in template EPTF_CharstringList pl_requiredStates,
in float pl_timeout := 10.0)
runs on EPTF_ExecCtrl_CLITest_Main_CT{
timer T_guard, T_alt
T_guard.start( 10.0 )
T_alt.start( 0.0 )
alt{
[] T_guard.timeout{
setverdict(fail,"Timeout waiting for states: ",pl_waitedStates," Current states: ",v_stateOfTcs)
f_EPTF_Base_stopAll()
}
[match(v_stateOfTcs,pl_waitedStates)] T_alt.timeout{
if(match(v_stateOfTcs,pl_requiredStates)){
setverdict(pass)
}else{
setverdict(fail,"Required state set, but ",match(v_stateOfTcs,pl_requiredStates))
}
}
};
}
function f_EPTF_ExecCtrl_CLITest_initCommands(in charstring pl_prefix := "")
runs on EPTF_ExecCtrl_CLITest_Main_CT{
v_EPTF_ExecCtrlCLICommand_startExecSC := pl_prefix&"startExec sc"
v_EPTF_ExecCtrlCLICommand_startExecTC := pl_prefix&"startExec tc"
v_EPTF_ExecCtrlCLICommand_startExecSCG := pl_prefix&"startExec scGroup"
v_EPTF_ExecCtrlCLICommand_startExecAll := pl_prefix&"startExec all"
v_EPTF_ExecCtrlCLICommand_stopExecSC := pl_prefix&"stopExec sc"
v_EPTF_ExecCtrlCLICommand_stopExecTC := pl_prefix&"stopExec tc"
v_EPTF_ExecCtrlCLICommand_stopExecSCG := pl_prefix&"stopExec scGroup"
v_EPTF_ExecCtrlCLICommand_stopExecAll := pl_prefix&"stopExec all"
v_EPTF_ExecCtrlCLICommand_setTargetCpsSC := pl_prefix&"setCPS sc"
v_EPTF_ExecCtrlCLICommand_setTargetCpsTC := pl_prefix&"setCPS tc"
v_EPTF_ExecCtrlCLICommand_getTargetCpsSC := pl_prefix&"getTargetCPS sc"
v_EPTF_ExecCtrlCLICommand_getTargetCpsTC := pl_prefix&"getTargetCPS tc"
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC := pl_prefix&"getCurrentCPS tc"
v_EPTF_ExecCtrlCLICommand_getCurrentCpsSC := pl_prefix&"getCurrentCPS sc"
v_EPTF_ExecCtrlCLICommand_getTargetWeight := pl_prefix&"getWeight tc"
v_EPTF_ExecCtrlCLICommand_setTargetWeight := pl_prefix&"setWeight tc"
}
function f_EPTF_ExecCtrl_CLITest_startExec1(in charstring pl_prefix)
runs on EPTF_ExecCtrl_CLITest_Main_CT{
f_EPTF_ExecCtrl_CLITest_initCommands(pl_prefix);
f_EPTF_CLI_init_CT("startExec1");
//map(self:CLI_PCO, system:CLI_PCO)
//action("XXXX Mapped")
f_EPTF_ExecCtrl_loadConfig(
pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_CLITest_ExectrTesterEGrp,
pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_CLITest_Scenarios2GrpList,
pl_EPTF_LGenBase_ScenarioDeclaratorList := {},
pl_EPTF_LGenBase_tcTypeDeclaratorList := {},
pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_CLITest_simpleResponseTCType},
pl_EPTF_LGenBase_TcMgmt_ScenarioDeclaratorList := {},
pl_EPTF_LGenBase_TcMgmt_WeightedScenarioDeclaratorList:= {},
pl_EPTF_ExecCtrl_TimeProfileDescrList:={},
pl_EPTF_ExecCtrl_TimeProfileList:={},
pl_EPTF_ExecCtrl_TimeProfile2TcList:={},
pl_EPTF_LGenBase_ScenarioTypeDeclaratorList:= {c_EPTF_ExecCtrl_CLITest_normalScenario,c_EPTF_ExecCtrl_CLITest_weightedScenario},
pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={},
pl_EPTF_ExecCtrl_LGenPool_Declarators:={},
pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:={},
pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={},
pl_EPTF_ExecCtrl_PhaseList_Declarators:={},
pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:={},
pl_EPTF_ExecCtrl_RegulatorNames:={},
pl_EPTF_ExecCtrl_RegulatedItems:={});
f_EPTF_ExecCtrl_setManualControl(true);
f_EPTF_ExecCtrl_CLI_init_CT(
pl_selfName := "startExec1",
pl_nrOfClients := 1,
pl_createLGenPools := true,
pl_CLI_compRef := self,
pl_commandPrefix := pl_prefix,
pl_loadModulepars := false,
pl_autoStart := true,
pl_dataSource_compRef := self);
var EPTF_ExecCtrl_CLITest_LGen_CT vl_lgen := EPTF_ExecCtrl_CLITest_LGen_CT.create;
vl_lgen.start( f_EPTF_ExecCtrl_CLITest_startExectr1LGenBehav("ExecCtrl_CLITest_LGen",self) );
f_EPTF_ExecCtrl_LGenPool_createLGens();
timer T_guard, T_alt;
T_guard.start( 30.0 );
T_alt.start( 0.0 );
alt{
[] T_guard.timeout{
setverdict(fail,"Timeout during config");
f_EPTF_Base_stopAll();
}
[f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{}
};
T_guard.start( tsp_LGenBaseStats_CPSCalc+tsp_EPTF_Var_SyncInterval+1.0 );
T_guard.timeout;
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&" bubu")
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsSC)
//Invalid argument (sc vs tc). Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsSC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm1Name)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsSC&" bubu")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsSC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&"bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getCurrentCpsSC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&" bubu")
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecSC)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecSC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&"bubu")
//Invalid argument. Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecSC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&" bubu")
//Invalid argument (sc vs tc). Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecSC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm1Name)
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecTC)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"bubu")
//Invalid argument. Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&" bubu")
//Invalid argument (sc vs tc). Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecTC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal)
//
////////////////////////////////////////////////////////////////////////////////////////
//Check that the tc must be pending
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm1Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcNorm1Name&"*[ ]+0.0+"
)
//Check that the tc must be pending
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"*[ ]+0.0+"
)
//Check that the tc must be pending
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted1Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcWeighted1Name&"*[ ]+0.0+"
)
//Check that the tc must be pending
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&"*[ ]+0.0+"
)
f_EPTF_ExecCtrl_registerTrafficCaseStateChangedCallback(refers(f_EPTF_ExecCtrl_CLITest_trafficCaseStateChangedCallback))
//Start TC
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_startExecTC&" "&
c_EPTF_ExecCtrl_CLITest_tcNorm2Name
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{?,c_EPTF_LGenBase_tcStateNameRunning,?,?},
{c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameRunning, c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameIdle}
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecTC)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"bubu")
//Invalid argument. Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&" bubu")
//Invalid argument (sc vs tc). Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecTC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal)
f_EPTF_ExecCtrl_CLITest_wait4States(
{?,c_EPTF_LGenBase_tcStateNameRunning,?,?},
{c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameRunning, c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameIdle}
)
//
////////////////////////////////////////////////////////////////////////////////////////
T_guard.start( tsp_LGenBaseStats_CPSCalc+tsp_EPTF_Var_SyncInterval+1.0 )
T_guard.timeout
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"*\s+[1-9][0-9]#(,).*"
)
//Set CPS
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetCpsTC&" "&
c_EPTF_ExecCtrl_CLITest_tcNorm2Name&" 8.5"
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail, nor change the CPS set
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetCpsTC)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"bubu 12.3")
//Invalid argument. Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&" bubu")
//Invalid argument (sc vs tc). Must not fail, nor change
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetCpsTC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&" 99.9")
//
////////////////////////////////////////////////////////////////////////////////////////
T_guard.start( 2.0*tsp_LGenBaseStats_CPSCalc+tsp_EPTF_Var_SyncInterval+1.0 )
T_guard.timeout
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"*\s+[7-9].*"
)
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getTargetCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"*\s+8.[3-7]*"
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail, nor change the CPS set
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsTC)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"bubu")
//Invalid argument. Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&" bubu")
//Invalid argument (sc vs tc). Must not fail, nor change
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsTC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal)
//
////////////////////////////////////////////////////////////////////////////////////////
//Set CPS with integer
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetCpsTC&" "&
c_EPTF_ExecCtrl_CLITest_tcNorm2Name&" 5"
)
T_guard.start( 2.0*tsp_LGenBaseStats_CPSCalc+tsp_EPTF_Var_SyncInterval+1.0 )
T_guard.timeout
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"*\s+[4,5].*"
)
//Stop TC
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_stopExecTC&" "&
c_EPTF_ExecCtrl_CLITest_tcNorm2Name
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{?,c_EPTF_LGenBase_tcStateNameStopped,?,?},
{c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameStopped, c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameIdle}
)
//Start normal sc
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_startExecSC&" "&
c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameNormal
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,?,?},
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning, c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameIdle}
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecSC)
//Invalid argument (sc vs tc). Must not fail, nor start
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecSC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm1Name)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecSC&" bubu")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecSC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&"bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecSC&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&" bubu")
//
////////////////////////////////////////////////////////////////////////////////////////
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,?,?},
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning, c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameIdle}
)
//Stop normal sc
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_stopExecSC&" "&
c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameNormal
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,?,?},
{c_EPTF_LGenBase_tcStateNameStopped, c_EPTF_LGenBase_tcStateNameStopped, c_EPTF_LGenBase_tcStateNameIdle, c_EPTF_LGenBase_tcStateNameIdle}
)
//Set weight
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&
c_EPTF_ExecCtrl_CLITest_tcWeighted1Name&" 1.0"
)
//Set weight
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&
c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&" 25"
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight)
//Empty argument. Must not fail, nor set
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&
c_EPTF_ExecCtrl_CLITest_tcWeighted2Name
)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight&" bubu 11.5")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&"bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_scNameNormal&" bubu")
//
////////////////////////////////////////////////////////////////////////////////////////
//Start weighted sc
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_startExecSC&" "&
c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{?,?,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning},
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning}
)
//Set CPS
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetCpsSC&" "&
c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted&" 8.5"
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetCpsSC)
//Empty argument. Must not fail, nor set
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetCpsSC&" "&
c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted
)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetCpsSC&" bubu 11.5")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetCpsSC&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted&"bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetCpsSC&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted&" bubu")
//
////////////////////////////////////////////////////////////////////////////////////////
T_guard.start( 2.0*tsp_LGenBaseStats_CPSCalc+tsp_EPTF_Var_SyncInterval+1.0 )
T_guard.timeout
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsSC&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted,
pattern "*"&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted&"*\s+[7-9].*"
)
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getTargetCpsSC&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted,
pattern "*"&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted&"*\s+8.[4,5]*"
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsSC)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsSC&" bubu")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsSC&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted&"bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsSC&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted&" bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetCpsSC&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameNormal)
//
////////////////////////////////////////////////////////////////////////////////////////
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&"*\s+[0-9].*" // actual value is irrelevant, only the first char is checked if it is a number
)
//Set weight
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&
c_EPTF_ExecCtrl_CLITest_tcWeighted1Name&" 25.0"
)
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&
c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&" 1"
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight&" bubu")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&"bubu")
//Invalid argument. Must not fail, nor set
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&" bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_setTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameNormal&" 11.3")
//
////////////////////////////////////////////////////////////////////////////////////////
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&"*\s+[0,1].*"
)
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetWeight)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetWeight&" bubu")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&"bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&" bubu")
//Invalid argument. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_getTargetWeight&" "&c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameNormal)
//
////////////////////////////////////////////////////////////////////////////////////////
T_guard.start( 3.0*tsp_LGenBaseStats_CPSCalc+tsp_EPTF_Var_SyncInterval+1.0 )
T_guard.timeout
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&"*\s+[0,1].*"
)
//Stop weighted sc
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_stopExecSC&" "&
c_EPTF_ExecCtrl_CLITest_eGrpName&"."&c_EPTF_ExecCtrl_CLITest_scNameWeighted
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{?,?,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped},
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped}
)
//Start all
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_startExecAll
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning},
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning}
)
//Stop all
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_stopExecAll
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped},
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped}
)
//unmap(self:CLI_PCO, system:CLI_PCO)
f_EPTF_Base_cleanup_CT()
}
testcase tc_EPTF_ExecCtrl_CLITest_startExec1()
runs on EPTF_ExecCtrl_CLITest_Main_CT{
f_EPTF_ExecCtrl_CLITest_startExec1("")
}
testcase tc_EPTF_ExecCtrl_CLITest_startExec1Prefix()
runs on EPTF_ExecCtrl_CLITest_Main_CT{
f_EPTF_ExecCtrl_CLITest_startExec1("exec_");
}
testcase tc_EPTF_ExecCtrl_CLITest_startExec2()
runs on EPTF_ExecCtrl_CLITest_Main_CT{
f_EPTF_ExecCtrl_CLITest_initCommands("");
f_EPTF_CLI_init_CT("startExec1")
//map(self:CLI_PCO, system:CLI_PCO)
//action("XXXX Mapped")
//c_EPTF_ExecCtrl_CLITest_scPhaseParams
var EPTF_LGenBase_ScenarioTypeDeclarator vl_EPTF_ExecCtrl_CLITest_normalScenario := c_EPTF_ExecCtrl_CLITest_normalScenario;
var EPTF_LGenBase_ScenarioTypeDeclarator vl_EPTF_ExecCtrl_CLITest_weightedScenario := c_EPTF_ExecCtrl_CLITest_weightedScenario;
vl_EPTF_ExecCtrl_CLITest_normalScenario.scParamsList :=
vl_EPTF_ExecCtrl_CLITest_normalScenario.scParamsList & c_EPTF_ExecCtrl_CLITest_scPhaseParams;
vl_EPTF_ExecCtrl_CLITest_weightedScenario.scParamsList :=
vl_EPTF_ExecCtrl_CLITest_weightedScenario.scParamsList & c_EPTF_ExecCtrl_CLITest_scPhaseParams;
f_EPTF_ExecCtrl_loadConfig(
pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_CLITest_ExectrTesterEGrp,
pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := {},
pl_EPTF_LGenBase_ScenarioDeclaratorList := {},
pl_EPTF_LGenBase_tcTypeDeclaratorList := {},
pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_CLITest_simpleResponseTCType},
pl_EPTF_LGenBase_TcMgmt_ScenarioDeclaratorList := {},
pl_EPTF_LGenBase_TcMgmt_WeightedScenarioDeclaratorList:= {},
pl_EPTF_ExecCtrl_TimeProfileDescrList:={},
pl_EPTF_ExecCtrl_TimeProfileList:={},
pl_EPTF_ExecCtrl_TimeProfile2TcList:={},
pl_EPTF_LGenBase_ScenarioTypeDeclaratorList:= {vl_EPTF_ExecCtrl_CLITest_normalScenario,vl_EPTF_ExecCtrl_CLITest_weightedScenario},
pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:=c_EPTF_ExecCtrl_CLITest_ScenarioInstanceTypeList,
pl_EPTF_ExecCtrl_LGenPool_Declarators:={},
pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:={},
pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={},
pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_CLITest_PhaseLists,
pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_CLITest_scGrps,
pl_EPTF_ExecCtrl_RegulatorNames:={},
pl_EPTF_ExecCtrl_RegulatedItems:={})
f_EPTF_ExecCtrl_setManualControl(true)
f_EPTF_ExecCtrl_CLI_init_CT(
pl_selfName := "startExec1",
pl_nrOfClients := 1,
pl_createLGenPools := false,
pl_CLI_compRef := self,
pl_loadModulepars := false,
pl_autoStart := true,
pl_dataSource_compRef := self);
var EPTF_ExecCtrl_CLITest_LGen_CT vl_lgen := EPTF_ExecCtrl_CLITest_LGen_CT.create;
vl_lgen.start( f_EPTF_ExecCtrl_CLITest_startExectr1LGenBehav("ExecCtrl_CLITest_LGen",self) )
f_EPTF_ExecCtrl_LGenPool_createLGens()
timer T_guard, T_alt
T_guard.start( 30.0 )
T_alt.start( 0.0 )
alt{
[] T_guard.timeout{
setverdict(fail,"Timeout during config")
f_EPTF_Base_stopAll()
}
[f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{}
};
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecSCG)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecSCG&" bubu")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_startExecSCG&" "&c_EPTF_ExecCtrl_CLITest_scGrps[0].name&"bubu")
T_guard.start( tsp_LGenBaseStats_CPSCalc+tsp_EPTF_Var_SyncInterval+1.0 )
T_guard.timeout
//Check that the tc is pending
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm1Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcNorm1Name&"*[ ]+0.0+"
)
//Check that the tc must be pending
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcNorm2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcNorm2Name&"*[ ]+0.0+"
)
//Check that the tc must be pending
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted1Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcWeighted1Name&"*[ ]+0.0+"
)
//Check that the tc must be pending
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_getCurrentCpsTC&" "&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name,
pattern "*"&c_EPTF_ExecCtrl_CLITest_tcWeighted2Name&"*[ ]+0.0+"
)
f_EPTF_ExecCtrl_registerTrafficCaseStateChangedCallback(refers(f_EPTF_ExecCtrl_CLITest_trafficCaseStateChangedCallback))
//Start SCGroup
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_startExecSCG&" "&
c_EPTF_ExecCtrl_CLITest_scGrps[0].name
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning},
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning}
)
//Stop SCGroup
////////////////////////////////////////////////////////////////////////////////////////
// Some negative tests
////////////////////////////////////////////////////////////////////////////////////////
//
//Empty name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecSCG)
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecSCG&" bubu")
//Invalid name. Must not fail
f_EPTF_ExecCtrl_CLITest_execCLICommand(v_EPTF_ExecCtrlCLICommand_stopExecSCG&" "&c_EPTF_ExecCtrl_CLITest_scGrps[0].name&"bubu")
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_stopExecSCG&" "&
c_EPTF_ExecCtrl_CLITest_scGrps[0].name
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped},
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped}
)
//startExec all
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_startExecAll
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning},
{c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning,c_EPTF_LGenBase_tcStateNameRunning}
)
//Stop all
f_EPTF_ExecCtrl_CLITest_execCLICommand(
v_EPTF_ExecCtrlCLICommand_stopExecAll
)
f_EPTF_ExecCtrl_CLITest_wait4States(
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped},
{c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped,c_EPTF_LGenBase_tcStateNameStopped}
)
f_EPTF_Base_cleanup_CT()
}
}
testcase tc_EPTF_ExecCtrl_CLITest_initAndWait()
runs on EPTF_ExecCtrl_CLITest_Main_CT{
f_EPTF_ExecCtrl_CLITest_initCommands("")
var charstring vl_wndLayout := c_execCtrlMainWindow_str;
f_EPTF_UIHandler_CLI_init_CT("startExec1", true, vl_wndLayout)
//map(self:CLI_PCO, system:CLI_PCO)
//action("XXXX Mapped")
f_EPTF_ExecCtrl_loadConfig(
pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_CLITest_ExectrTesterEGrp,
pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_CLITest_Scenarios2GrpList,
pl_EPTF_LGenBase_ScenarioDeclaratorList := {},
pl_EPTF_LGenBase_tcTypeDeclaratorList := {},
pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_CLITest_simpleResponseTCType},
pl_EPTF_LGenBase_TcMgmt_ScenarioDeclaratorList := {},
pl_EPTF_LGenBase_TcMgmt_WeightedScenarioDeclaratorList:= {},
pl_EPTF_ExecCtrl_TimeProfileDescrList:={},
pl_EPTF_ExecCtrl_TimeProfileList:={},
pl_EPTF_ExecCtrl_TimeProfile2TcList:={},
pl_EPTF_LGenBase_ScenarioTypeDeclaratorList:= {c_EPTF_ExecCtrl_CLITest_normalScenario,c_EPTF_ExecCtrl_CLITest_weightedScenario},
pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={},
pl_EPTF_ExecCtrl_LGenPool_Declarators:={},
pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:={},
pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={},
pl_EPTF_ExecCtrl_PhaseList_Declarators:={},
pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:={},
pl_EPTF_ExecCtrl_RegulatorNames:={},
pl_EPTF_ExecCtrl_RegulatedItems:={})
f_EPTF_ExecCtrl_setManualControl(true)
f_EPTF_ExecCtrl_UIHandler_init_CT(
pl_selfName := "startExec1",
pl_nrOfClients := 1,
pl_uiHandler_compRef := self,
pl_EPTF_GUI_Main_Tabbox_WidgetId := "Execution_Control.tab",
pl_createLGenPools := false)
var EPTF_ExecCtrl_CLITest_LGen_CT vl_lgen := EPTF_ExecCtrl_CLITest_LGen_CT.create;
vl_lgen.start( f_EPTF_ExecCtrl_CLITest_startExectr1LGenBehav("ExecCtrl_CLITest_LGen",self) )
f_EPTF_ExecCtrl_LGenPool_createLGens()
timer T_guard, T_alt
T_guard.start( 30.0 )
T_alt.start( 0.0 )
alt{
[] T_guard.timeout{
setverdict(fail,"Timeout during config")
f_EPTF_Base_stopAll()
}
[f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{}
};
T_guard.start( tsp_LGenBaseStats_CPSCalc+tsp_EPTF_Var_SyncInterval+1.0 )
T_guard.timeout
f_EPTF_Base_wait4Shutdown()
f_EPTF_Base_cleanup_CT()
}
control
{
execute(tc_EPTF_ExecCtrl_CLITest_startExec1())
execute(tc_EPTF_ExecCtrl_CLITest_startExec1Prefix())
execute(tc_EPTF_ExecCtrl_CLITest_startExec2())
}
} // end of module