| /////////////////////////////////////////////////////////////////////////////// |
| // // |
| // Copyright (c) 2000-2018 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_Testcases |
| // |
| // Purpose: |
| // This module contains the testcases of the EPTF ExecCtrl test enviroment. |
| // |
| // Module depends on: |
| // <EPTF_ExecCtrl_Test_Definitions> |
| // <EPTF_ExecCtrl_Test_Function> |
| // <EPTF_CLL_Base_Functions> |
| // <EPTF_CLL_Common_Definitions> |
| // <EPTF_CLL_CLI_Definitions> |
| // <EPTF_CLL_ExecCtrlTimeProfile_Definitions> |
| // <EPTF_CLL_ExecCtrl_Functions> |
| // <EPTF_CLL_ExecCtrl_CLIFunctions> |
| // <EPTF_CLL_ExecCtrl_Definitions> |
| // <EPTF_CLL_UIHandler_WidgetFunctions> |
| // <EPTF_CLL_ExecCtrlUIHandler_Definitions> |
| // <EPTF_CLL_HashMapInt2Int_Functions> |
| // <EPTF_CLL_HashMapOct2Int_Functions> |
| // <EPTF_CLL_HashMapStr2Int_Functions> |
| // |
| // Current Owner: |
| // Balazs Barcsik (EBALBAR) |
| // Gabor Tatarka (EGBOTAT) |
| // |
| // Last Review Date: |
| // 2007-xx-xx |
| // |
| // Detailed Comments: |
| // - |
| // |
| /////////////////////////////////////////////////////////////// |
| |
| module EPTF_ExecCtrl_Test_Testcases |
| |
| { |
| import from EPTF_CLL_UIHandlerClient_Functions all; |
| import from ttcn_ericsson_se_protocolModules_xtdp_xtdl all; |
| |
| //========================================================================= |
| // Import Part |
| //========================================================================= |
| |
| import from EPTF_ExecCtrl_Test_Definitions all; |
| import from EPTF_ExecCtrl_Test_Functions all; |
| |
| import from EPTF_CLL_ExecCtrlTimeProfile_Definitions all; |
| import from EPTF_CLL_ExecCtrl_Definitions all; |
| import from EPTF_CLL_ExecCtrl_Functions all; |
| import from EPTF_CLL_ExecCtrl_CLIFunctions all; |
| import from EPTF_CLL_ExecCtrl_ScenarioFunctions all; |
| import from EPTF_CLL_Common_Definitions all; |
| import from EPTF_CLL_CLI_Definitions all; |
| import from EPTF_CLL_Base_Functions all; |
| import from EPTF_CLL_Variable_Definitions all; |
| import from EPTF_CLL_Variable_Functions all; |
| import from EPTF_CLL_UIHandler_WidgetFunctions all; |
| import from EPTF_CLL_UIHandler_XULFunctions all; |
| //import from XTDP_PDU_Defs language "ASN.1:2002" all; |
| import from EPTF_CLL_ExecCtrlUIHandler_Definitions all; |
| import from EPTF_CLL_UIHandlerCLI_Definitions all; |
| import from EPTF_CLL_UIHandlerCLI_Functions all; |
| import from EPTF_CLL_ExecCtrlUIHandler_Functions all; |
| |
| import from EPTF_CLL_LGenBase_Definitions all; |
| import from EPTF_CLL_ExecCtrl_ScenarioDefinitions all; |
| import from EPTF_CLL_LGenBase_PhaseDefinitions all; |
| import from EPTF_CLL_LGenBase_ConfigDefinitions all; |
| import from EPTF_CLL_ExecCtrl_PhaseDefinitions all; |
| |
| import from EPTF_CLL_LoadRegulator_Definitions all; |
| import from EPTF_CLL_StatHandler_Definitions all; |
| import from EPTF_CLL_StatHandler_Functions all; |
| |
| import from EPTF_CLL_CLI_Functions all; |
| import from EPTF_CLL_Logging_Functions all; |
| |
| import from EPTF_CLL_DataSource_Definitions all; |
| import from EPTF_CLL_DataSource_Functions all; |
| import from TCCDateTime_Functions all; |
| |
| |
| // Testcases |
| //========================================================================= |
| testcase tc_EPTF_ExecCtrl_Test_cleanUp_CT() runs on EPTF_ExecCtrl_Test_CT |
| { |
| f_EPTF_ExecCtrl_init_CT("ExecCtrl_Test",1); |
| f_EPTF_Base_cleanup_CT(); |
| f_EPTF_ExecCtrl_Test_checkCleanup(); |
| f_EPTF_ExecCtrl_init_CT("ExecCtrl_Test2",1); |
| f_EPTF_Base_cleanup_CT(); |
| setverdict(pass); // the test passes if we get here without error (i.e. the ExecCtrl can be re-initialized) |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_init_CT() runs on EPTF_ExecCtrl_Test_CT |
| { |
| f_EPTF_ExecCtrl_Test_init_CT(2); |
| f_EPTF_Base_cleanup_CT(); |
| setverdict(pass); |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_initScTimeProfileListDB() runs on EPTF_ExecCtrl_Test_CT |
| { |
| f_EPTF_ExecCtrl_init_CT("ExecCtrl_Test",1); |
| f_EPTF_ExecCtrl_Test_initScTimeProfileListDB(tsp_EPTF_ExecCtrl_TimeProfileDescrList, |
| tsp_EPTF_ExecCtrl_TimeProfileList, tsp_EPTF_ExecCtrl_TimeProfile2TcList); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_Regulator_init() runs on EPTF_ExecCtrl_Test_CT |
| { |
| f_EPTF_ExecCtrl_init_CT("ExecCtrl_Test",1); |
| f_EPTF_ExecCtrl_Test_checkRegulatorInit(tsp_EPTF_ExecCtrl_RegulatorNames, tsp_EPTF_ExecCtrl_RegulatedItems); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_manualControlTrue() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1,{}}, |
| {"grp1", "scenario_0", "TC0", -1,{}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_manualControlTrue("ExecCtrl", 1, v_scens, tsp_EPTF_Var_SyncInterval+2.0)); |
| v_clients[0].start(f_ExecCtrlClient_Test_behaviour("Client_0", v_execCtrl)); |
| |
| t.start(tsp_EPTF_Var_SyncInterval+3.0); |
| alt { |
| [] t.timeout { |
| f_EPTF_Base_cleanup_CT(); |
| } |
| } |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_manualControlFalse() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1,{}}, |
| {"grp1", "scenario_0", "TC0", -1,{}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_manualControlFalse("ExecCtrl", 1, v_scens, tsp_EPTF_Var_SyncInterval+2.0)); |
| v_clients[0].start(f_ExecCtrlClient_Test_behaviour("Client_0", v_execCtrl)); |
| |
| t.start(tsp_EPTF_Var_SyncInterval+3.0); |
| alt { |
| [] t.timeout { |
| f_EPTF_Base_cleanup_CT(); |
| } |
| } |
| } |
| |
| |
| testcase tc_EPTF_ExecCtrl_Test_CPS() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1,{{ 3.0, 12.0}}}, |
| {"grp1", "scenario_0", "TC0", -1,{{ 3.0, 12.0}}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_startScenarioOnLGens("ExecCtrl_Test", 1, v_scens, 4.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("Client_0", v_execCtrl, v_scens)); |
| |
| t.start(8.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_CPSFromTimeDescrProfile() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1,tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].timeProfileData} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_manualControlFalse("ExecCtrl_Test", 1, v_scens, 4.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("Client_0", v_execCtrl, v_scens)); |
| |
| t.start(13.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_CPSFromTimeProfileDescr2Client() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1,tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].timeProfileData} |
| } |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_manualControlFalse("ExecCtrl_Test", 2, v_scens, 4.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient)); |
| |
| t.start(13.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_CPSFromTimeProfile() runs on myMTC |
| { |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1,tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].timeProfileData} |
| } |
| //add 2nd time sequence |
| for (var integer i:= 0; i < sizeof(tsp_EPTF_ExecCtrl_TimeProfileDescrList[1].timeProfileData); i := i + 1) { |
| v_scens[0].timeProfile[sizeof(v_scens[0].timeProfile)] := tsp_EPTF_ExecCtrl_TimeProfileDescrList[1].timeProfileData[i] |
| } |
| |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_manualControlFalse("ExecCtrl_Test", 1, v_scens, 4.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("Client_0", v_execCtrl, v_scens)); |
| |
| t.start(25.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /*testcase tc_EPTF_ExecCtrl_Test_getTypeFromGroup() runs on myMTC |
| { |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_getTypeFromGroup("ExecCtrl_Test",0, 1.0)); |
| t.start(2.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| }*/ |
| |
| /*testcase tc_EPTF_ExecCtrl_Test_getETypeFromScenario() runs on myMTC |
| { |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_getETypeFromScenario("ExecCtrl_Test",0, 1.0)); |
| t.start(2.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| }*/ |
| |
| /*testcase tc_EPTF_ExecCtrl_Test_getTcName() runs on myMTC |
| { |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_getTcName("ExecCtrl_Test",0, 1.0)); |
| t.start(2.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| }*/ |
| |
| /*testcase tc_EPTF_ExecCtrl_Test_getTcIdx() runs on myMTC |
| { |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_getTcIdx("ExecCtrl_Test",0, 1.0)); |
| t.start(2.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| }*/ |
| //not public |
| /* |
| This test makes no sense |
| testcase tc_EPTF_ExecCtrl_Test_getScenGrpIdx() runs on myMTC |
| { |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_getScenGrpIdx("ExecCtrl_Test",0, 1.0)); |
| t.start(2.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| } |
| */ |
| testcase tc_EPTF_ExecCtrl_Test_startScenarioOnLGensByName2Client() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1,{{ 3.0, 12.0}}}, |
| {"grp1", "scenario_0", "TC0", -1,{{ 3.0, 12.0}}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_startScenarioOnLGens("ExecCtrl_Test", 2, v_scens, 3.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient)); |
| |
| t.start(8.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_stopScenarioOnLGens2Client() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1,{{ 4.0, 0.0}}}, |
| {"grp1", "scenario_0", "TC0", -1,{{ 4.0, 0.0}}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_stopScenarioOnLGens("ExecCtrl_Test", 2, v_scens, 3.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scens, false)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scens, false)); |
| |
| t.start(8.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_startTCOnLGensByName2Client() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC1_declarator2", -1, {{ 3.0, 6.0}}}, |
| {"grp1", "scenario_0", "TC1", -1, {{ 3.0, 6.0}}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_startTCOnLGens("ExecCtrl_Test", 2,v_scens, 2.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient)); |
| |
| t.start(15.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_stopTCOnLGens2Client() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC1_declarator2", -1, {{ 4.0, 0.0}}}, |
| {"grp1", "scenario_0", "TC1", -1, {{ 4.0, 0.0}}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_stopTCOnLGensByName("ExecCtrl_Test", 2, v_scens, 3.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scens, false)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scens, false)); |
| |
| t.start(8.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_checkScenarioStatus2Client() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1,{{ 3.0, 12.0}}}, |
| {"grp1", "scenario_0", "TC0", -1,{{ 3.0, 12.0}}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_checkScenarioStatus("ExecCtrl_Test", 2, v_scens, tsp_EPTF_Var_SyncInterval+2.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient)); |
| |
| t.start(tsp_EPTF_Var_SyncInterval+8.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_scenarioEnabled() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_scenarioEnabled("ExecCtrl_Test", 1, 2.0)); |
| v_clients[0].start(f_ExecCtrlClient_Test_behaviour("ExecCtrlC_0", v_execCtrl)); |
| |
| |
| t.start(3.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_startAllScenarios() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {{4.0,12.0}}}, |
| {"grp1", "scenario_0", "TC0", -1, {{4.0,12.0}}} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_startAllScenarios("ExecCtrl_Test",2, v_scens, 2.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient)); |
| |
| t.start(20.0); |
| t.timeout; |
| setverdict(fail,"Scenario did not start up in time") |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| testcase tc_EPTF_ExecCtrl_Test_stopAllScenarios() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {{4.0,0.0}}}, |
| {"grp1", "scenario_0", "TC0", -1, {{4.0,0.0}}} |
| } |
| |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_stopAllScenarios("ExecCtrl_Test",2, v_scens, 3.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient, false)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient, false)); |
| |
| t.start(8.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_checkAllScenarios() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {{4.0,12.0}}}, |
| {"grp1", "scenario_0", "TC0", -1, {{4.0,12.0}}} |
| } |
| |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_checkAllScenarios("ExecCtrl_Test",2, v_scens, 6.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient, false)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient, false)); |
| |
| t.start(20.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| |
| testcase tc_EPTF_ExecCtrl_Test_setCps_TC() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {{3.0,5.0},{7.0,0.0}}}, |
| {"grp1", "scenario_0", "TC0", -1, {{3.0,5.0},{7.0,0.0}}} |
| } |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_setCps_TC("ExecCtrl_Test",2, v_scens, 0.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient, false, 3.0)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient, false, 3.0)); |
| |
| t.start(10.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_setCps_SC() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp1", "scenario_0_declarator3", "TC0_declarator2", -1, {{4.0,18.0},{7.0,0.0}}}//, |
| // {"grp1", "scenario_0", "TC0", -1, {{10.0,5.0},{16.0,0.0}}} |
| } |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_setCps_SC("ExecCtrl_Test",2, v_scens, 0.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scensClient)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_1", v_execCtrl, v_scensClient)); |
| |
| t.start(10.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_setCps_TCCPSChangedCallback() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {{3.0,5.0},{7.0,0.0}}}, |
| {"grp1", "scenario_0", "TC0", -1, {{3.0,5.0},{7.0,0.0}}} |
| } |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_setCps_TCCPSChangedCallback("ExecCtrl_Test",2, v_scens, 0.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPSChangedCallback_TC("ExecCtrlC_0", v_execCtrl, v_scensClient, false, 3.0)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPSChangedCallback_TC("ExecCtrlC_1", v_execCtrl, v_scensClient, false, 3.0)); |
| |
| t.start(10.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_Test_setCps_SCCPSChangedCallback() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp1", "scenario_0_declarator3", "", -1, {{3.0,5.0},{7.0,0.0}}} |
| } |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_setCps_SCCPSChangedCallback("ExecCtrl_Test",2, v_scens, 0.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPSChangedCallback_SC("ExecCtrlC_0", v_execCtrl, v_scensClient, false, 3.0)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPSChangedCallback_SC("ExecCtrlC_1", v_execCtrl, v_scensClient, false, 3.0)); |
| |
| t.start(10.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_EPTF_ExecCtrl_UIHandler_Test_setCPS() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| v_scens := { |
| {"grp1", "scenario_0_declarator3", "TC0_declarator2", -1, {{13.0,20.0},{19.0,0.0}}}, |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {{13.0,20.0},{19.0,0.0}}} |
| } |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| v_clientsUI[1] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_1"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_setCPS("ExecCtrl_Test",2, self, v_scens, 25.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_CPS(int2str(0), v_execCtrlUI, v_scensClient,false, 3.0)); |
| v_clientsUI[1].start(f_EPTF_ExecCtrlClient_UIHandler_Test_CPS(int2str(1), v_execCtrlUI, v_scensClient,false, 3.0)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t.start(26.0); |
| alt { |
| [] all component.done {} |
| [] t.timeout {} |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ETPF_ExecCtrl_UIHandler_Test_startButton() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("UIHandler", true, vl_wndLayout,self); |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_startButton("ExecCtrl_Test",1, self, 5.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| action(%definitionId&"->checkReadyToRun"); |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config[checkReadyToRun]"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| action(%definitionId&"->ReadyToRun"); |
| |
| t.start(40.0); // 30 |
| alt { |
| [] all component.done {} |
| [] t.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| |
| testcase tc_EPTF_UIHandler_Test_addnewElementsToGui() |
| runs on myMTC_UI |
| { |
| var charstring vl_clientName :="MyUIHandlerClient"; |
| f_EPTF_UIHandlerXUL_init_CT("UIHandler",true); |
| if(not f_EPTF_UIHandler_GUIConnected()){ |
| setverdict(inconc,"The GUI is not connected...") |
| } |
| f_EPTF_UIHandler_clearGUI(); //if You don't apply it, the addWindow doesn't work |
| |
| |
| var boolean vl_dummy:=false; |
| var Widgets vl_newWindowWithButtons := { |
| window := { |
| /*about :=*/ "", |
| /*height :=*/ tsp_EPTF_GUI_Main_Window_Height, |
| /*help :=*/ "", |
| /*id :=*/ tsp_EPTF_GUI_Main_Window_WidgetId, |
| /*orientation :=*/ vertical, |
| /*title :=*/ tsp_EPTF_GUI_Main_Window_Title, |
| /*width :=*/ tsp_EPTF_GUI_Main_Window_Width, |
| /*image_list :=*/ {}, |
| /*embeddedwidgets :=*/ { |
| /*embeddedwidget_list :=*/ { |
| { |
| pushbutton := { |
| /*customclass :=*/ omit, |
| /*disabled :=*/ omit, |
| /*disabledongui :=*/ omit, |
| /*flex :=*/ omit, |
| /*id :=*/ "FirstTbarPushButtonId", |
| /*imageid :=*/ omit, |
| /*label_ :=*/ "push", |
| /*tooltiptext :=*/ "FirstTbarPushButton ToolTip", |
| omit |
| } |
| }, |
| { |
| togglebutton := { |
| /*customclass :=*/ omit, |
| /*disabled :=*/ omit, |
| /*disabledongui :=*/ omit, |
| /*flex :=*/ omit, |
| /*id :=*/ "FirstTbarToggleButtonId", |
| /*imageid :=*/ omit, |
| /*label_ :=*/ "toggle", |
| /*state :=*/ true, |
| /*tooltiptext :=*/ "FirstTbarToggleButton ToolTip", |
| omit |
| } |
| }, |
| { |
| toolbar := { |
| /*customclass :=*/ omit, |
| /*disabled :=*/ omit, |
| /*disabledongui :=*/ omit, |
| /*id :=*/ tsp_EPTF_GUI_Main_Toolbar_WidgetId, |
| /*placement :=*/ north, |
| /*choice_list :=*/ { |
| { |
| pushbutton := { |
| /*customclass :=*/ omit, |
| /*disabled :=*/ omit, |
| /*disabledongui :=*/ omit, |
| /*flex :=*/ omit, |
| /*id :=*/ "SecondTbarPushButtonId", |
| /*imageid :=*/ omit, |
| /*label_ :=*/ "push", |
| /*tooltiptext :=*/ "SecondTbarPushButton ToolTip", |
| omit |
| } |
| }, |
| { separator := {omit} }, |
| { |
| togglebutton := { |
| /*customclass :=*/ omit, |
| /*disabled :=*/ omit, |
| /*disabledongui :=*/ omit, |
| /*flex :=*/ omit, |
| /*id :=*/ "SecondTbarToggleButtonId", |
| /*imageid :=*/ omit, |
| /*label_ :=*/ "toggle", |
| /*state :=*/ true, |
| /*tooltiptext :=*/ "SecondTbarToggleButton ToolTip", |
| omit |
| } |
| } |
| } |
| } |
| } |
| } |
| } |
| }//window |
| }; |
| |
| f_EPTF_UIHandler_XSD_addElementToGui(vl_newWindowWithButtons, "", vl_dummy); |
| |
| setverdict(pass); |
| var charstring vl_fetchedLayout := f_EPTF_UIHandler_snapshot(); |
| var Widgets vl_snapshotXUL := f_EPTF_UIHandler_XSD_decodeXUL(vl_fetchedLayout) |
| if( not match(vl_newWindowWithButtons,vl_snapshotXUL)) { |
| var charstring vl_errMsg := log2str( match(vl_newWindowWithButtons,vl_snapshotXUL)); //fails |
| log(vl_errMsg) |
| setverdict(fail,vl_errMsg); |
| } |
| |
| all component.done; |
| f_EPTF_Base_cleanup_CT(); |
| |
| |
| } |
| |
| //HQ70577 |
| testcase tc_ExecCtrl_UIHandler_Test_stopButton_manualControl_false() runs on myMTC_UI |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("EXECCTRL_DSClient", true, vl_wndLayout,self); |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_stopButton_manualControl_false("ExecCtrl_Test",1, self, false)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| // f_EPTF_Base_stopAll(); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""/*c_ExecCtrl_DS_customGUIHBox*/); |
| |
| t.start(30.0); |
| alt { |
| [] all component.done {} |
| [] t.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_stopButton() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_stopButton("ExecCtrl_Test",1, self, 6.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| action(%definitionId&"->checkReadyToRun"); |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config[checkReadyToRun]"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| action(%definitionId&"->ReadyToRun"); |
| |
| t.start(40.0); |
| alt { |
| [] all component.done {} |
| [] t.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_terminateButton() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_terminateButton("ExecCtrl_Test",1, self, 6.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| action(%definitionId&"->checkReadyToRun"); |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config[checkReadyToRun]"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| action(%definitionId&"->ReadyToRun"); |
| |
| t.start(30.0); |
| alt { |
| [] all component.done {} |
| [] t.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_ExitButton() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_ExitButton("ExecCtrl_Test",1, self, 5.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| action(%definitionId&"->checkReadyToRun"); |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config[checkReadyToRun]"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| action(%definitionId&"->ReadyToRun"); |
| |
| t.start(40.0); |
| alt { |
| [] all component.done { |
| setverdict(pass);} |
| [] t.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_resetAllButton() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", -1, {}} |
| } |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_resetAllButton("ExecCtrl_Test",1, self, 6.0, v_scens)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config[v_ready]"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| |
| // On MTC |
| var charstring vl_varResetButtonName := ""; |
| var integer vl_retCode := 0; |
| vl_retCode := f_EPTF_DataSource_getData(vl_varResetButtonName,"StatHandler","","ResetAll",{}); |
| action(%definitionId&"->vl_varResetButtonName->",vl_varResetButtonName,"[",vl_retCode,"]"); |
| |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| // action(%definitionId&"->checkReadyToRun"); |
| // T_guard.start( 100.0 ); |
| // T_alt.start( 0.0 ); |
| // alt{ |
| // [] T_guard.timeout{ |
| // setverdict(fail,"Timeout during config[checkReadyToRun]"); |
| // f_EPTF_Base_stopAll(); |
| // } |
| // [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| // }; |
| // action(%definitionId&"->ReadyToRun"); |
| |
| t.start(200.0); |
| alt { |
| [] all component.done {} |
| [] t.timeout { |
| setverdict(fail, "Test did not finish in time"); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_StartStopScenarioDisable() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| v_scens := { |
| {"grp1", "scenario_0_declarator3", "TC0_declarator2", -1, {}}, |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {}} |
| } |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_StartStopScenarioDisable("ExecCtrl_Test",1, self, v_scens, 15.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t.start(45.0); |
| alt { |
| [] all component.done { |
| setverdict(pass); |
| } |
| [] t.timeout { |
| setverdict(fail); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_StartStopScenarioDisable2() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test");//superfluous |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| v_scens := { |
| {"grp1", "scenario_0_declarator3", "TC0_declarator2", -1, {}}, |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {}} |
| } |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_StartStopScenarioDisable2("ExecCtrl_Test",1, self, v_scens, 30.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t.start(60.0); |
| alt { |
| [] all component.done { |
| setverdict(pass);} |
| [] t.timeout { |
| setverdict(fail);} |
| } |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_StartStopTcDisable() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {}}, |
| {"grp1", "scenario_0_declarator3", "TC0_declarator2", -1, {}} |
| } |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_StartStopTcDisable("ExecCtrl_Test",1, self, v_scens, 5.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t.start(30.0); |
| alt { |
| [] all component.done { |
| setverdict(pass);} |
| [] t.timeout { |
| setverdict(fail);} |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_Tab_EntityGroup() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_Tab_EntityGroup("ExecCtrl_Test", 1, self, 7.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t.start(30.0); |
| alt { |
| [] all component.done { |
| setverdict(pass);} |
| [] t.timeout { |
| setverdict(fail);} |
| } |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_Tab_Resources() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_Tab_Resources("ExecCtrlUI",1, self, 7.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("0", v_execCtrlUI)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t.start(30.0); |
| alt { |
| [] all component.done { |
| setverdict(pass);} |
| [] t.timeout { |
| setverdict(fail);} |
| } |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| testcase tc_ExecCtrl_UIHandler_Test_Regulator() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| //4. parameters is the Regulator`s index |
| v_scens := { |
| {tsp_EPTF_ExecCtrl_RegulatedItems[0].idName.cps_TC.eGrpName, |
| tsp_EPTF_ExecCtrl_RegulatedItems[0].idName.cps_TC.scName, |
| tsp_EPTF_ExecCtrl_RegulatedItems[0].idName.cps_TC.tcName, 0, {{5.0, 12.0}}}, |
| {"grp1", "scenario_0_declarator3", "TC0_declarator2", 0, {{5.0, 6.0}}} |
| } |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_Regulator("ExecCtrl_Test",1, self, v_scens, 5.0)); |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_behavior("ExecCtrlCUI_0", v_execCtrlUI)); |
| |
| t.start(1.0); t.timeout; // wait until execCtrl starts |
| // start the regulators: |
| var EPTF_LoadRegulator_CT vl_regulator1 := EPTF_LoadRegulator_CT.create; |
| vl_regulator1.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator 1",v_execCtrlUI,1.0)); |
| vl_regulator1 := EPTF_LoadRegulator_CT.create; |
| vl_regulator1.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator 2",v_execCtrlUI,1.0)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t.start(30.0); |
| alt { |
| [] all component.done { |
| setverdict(pass);} |
| [] t.timeout { |
| setverdict(fail);} |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| |
| testcase tc_ExecCtrl_Regulator_Test_getTotalCps() runs on myMTC_UI |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_1_declarator2", "TC0_declarator2", -1, {{4.0, 12.0}}} |
| } |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_1"); |
| |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| //last parameter is Total CPS |
| v_execCtrl.start(f_EPTF_ExecCtrl_Regulator_Test_getTotalCps("ExecCtrl_Test", 2, "Regulator 1", 12.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlCUI_0", v_execCtrl, v_scensClient)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlCUI_1", v_execCtrl, v_scensClient)); |
| |
| t.start(15.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_Regulator_Test_getRegulatorName() runs on myMTC_UI |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_execCtrl.start(f_EPTF_ExecCtrl_Regulator_Test_getRegulatorName("ExecCtrl_Test", 1, "Regulator 1", 0)); |
| |
| t.start(1.5); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_Regulator_Test_findRegulatorsForScenario() runs on myMTC_UI |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| //{"grp0", "scenario_1_declarator2", "TC0_declarator2", 0, {{4.0, 4.0}}}//, |
| {"grp1", "scenario_0_declarator3", "TC0_declarator2", 1, {{4.0, 8.0}}} |
| } |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_execCtrl.start(f_EPTF_ExecCtrl_Regulator_Test_findRegulatorsForScenario("ExecCtrl_Test", 1, v_scens)); |
| |
| t.start(1.5); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| // the CPS of a regulated item (regulated by a limit-max regulator in auto off state) |
| // is changed by a time profile. it is checked if the total cps of the regulator will be correct |
| testcase tc_ExecCtrl_Regulator_Test_totalCPSWithTimeProfile() runs on myMTC_UI |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp0", "scenario_0_declarator2", "TC0_declarator2", 1, tsp_EPTF_ExecCtrl_TimeProfileDescrList[0].timeProfileData} |
| } |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Regulator_Test_totalCPSWithTimeProfile("ExecCtrl_Test", 1, self, v_scens, v_scens[0].timeProfile[3].targetValue)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scens,-,c_EPTF_ExecCtrl_Regulator_Test_regulatorStartTime)); |
| |
| |
| var EPTF_LoadRegulator_CT vl_regulator1 := EPTF_LoadRegulator_CT.create; |
| vl_regulator1.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator 1",v_execCtrl,1.0)); |
| vl_regulator1 := EPTF_LoadRegulator_CT.create; |
| vl_regulator1.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator 2",v_execCtrl,1.0)); |
| |
| t.start(30.0+v_scens[0].timeProfile[3].time+c_EPTF_ExecCtrl_Regulator_Test_regulatorStartTime); |
| alt { |
| [] all component.done { |
| setverdict(pass);} |
| [] t.timeout { |
| setverdict(fail, "Timeout before test finished");} |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| group SetTargetCPSInAutoOff { |
| |
| // Tests if Target CPS can be changed for a traffic case or scenario if it is |
| // regulated by a regulator with limitMax algorithm and the regulator is in |
| // "Auto-off" state (HL58788) |
| type component ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT extends EPTF_UIHandler_CLI_CT, EPTF_ExecCtrl_UIHandler_CT, myMTC_UI { |
| |
| } |
| //====================================================== |
| //f_EPTF_ExecCtrl_Test_SetTargetCPSInAutoOff_initItselfAndGui |
| //====================================================== |
| function f_EPTF_ExecCtrl_Test_SetTargetCPSInAutoOff_initItselfAndGui(in charstring pl_selfName, in charstring pl_wndLayout) runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| //f_EPTF_UIHandlerXUL_init_CT(pl_selfName, true, pl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| } |
| |
| const EPTF_ExecCtrl_RegulatedItems c_EPTF_ExecCtrl_RegulatedItems_setTargetCPSInAutoOff := { |
| { |
| idName := { |
| cps_TC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameNormal, |
| tcName := c_EPTF_ExecCtrl_DefaultScenarios_tcNameTc2 |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "LimitMaxRegulator" |
| }, |
| { |
| idName := { |
| cps_SC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameWeighted |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "LimitMaxRegulator" |
| } |
| } |
| |
| testcase tc_ExecCtrl_Regulator_Test_setTargetCPSInAutoOff() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| f_EPTF_CLI_init_CT("SetTargetCPSInAutoOff"); |
| |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario}, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:={}, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:={}, |
| pl_EPTF_ExecCtrl_RegulatorNames:={"LimitMaxRegulator"}, |
| pl_EPTF_ExecCtrl_RegulatedItems:=c_EPTF_ExecCtrl_RegulatedItems_setTargetCPSInAutoOff |
| ); |
| |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| f_EPTF_ExecCtrl_CLI_init_CT( |
| pl_selfName := f_EPTF_Base_selfName(), |
| pl_nrOfClients := 0, |
| pl_createLGenPools := true, |
| pl_CLI_compRef := self, |
| pl_loadModulepars := false, |
| pl_autoStart := true, |
| pl_dataSource_compRef := self); |
| |
| // start the regulator: |
| var EPTF_LoadRegulator_CT vl_regulator := EPTF_LoadRegulator_CT.create; |
| vl_regulator.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("LimitMaxRegulator",self,10.0)); |
| |
| timer T_guard, T_alt; |
| timer T_ping := 1.0; |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| T_ping.start; |
| alt{ |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config: checkReadyToRun"); |
| f_EPTF_Base_stopAll(); |
| } |
| }; |
| // wait for regulator start!!! |
| var integer vl_regulatorStatusVarIdx := f_EPTF_Var_getId("EPTF_ExecCtrl.Regulator.status.LimitMaxRegulator"); |
| T_alt.start( 0.0 ); |
| T_guard.start( 10.0 ); |
| alt { |
| [] T_guard.timeout{ |
| action(%definitionId&"-timeout[LimitMaxRegulator]:{",vl_regulatorStatusVarIdx,"}",f_EPTF_Var_getStatusLEDValue(vl_regulatorStatusVarIdx)); |
| setverdict(fail,"Timeout: Regulator did not go to Connected state"); |
| f_EPTF_Base_stopAll(); |
| }[f_EPTF_Var_getStatusLEDValue(vl_regulatorStatusVarIdx) == {led_green, "Connected"}] T_alt.timeout { |
| } |
| [] T_ping.timeout{ T_ping.start; |
| action(%definitionId&" - f_EPTF_Var_getStatusLEDValue(vl_regulatorStatusVarIdx)=",f_EPTF_Var_getStatusLEDValue(vl_regulatorStatusVarIdx)); |
| repeat;} |
| } |
| |
| f_EPTF_ExecCtrl_startAllScenarios(); |
| // wait until regulator is auto-off: |
| T_alt.start( 0.0 ); |
| T_guard.start( 120.0 ); |
| alt { |
| [] T_guard.timeout{ |
| action(%definitionId&"-timeout[LimitMaxRegulator]:{",vl_regulatorStatusVarIdx,"}",f_EPTF_Var_getStatusLEDValue(vl_regulatorStatusVarIdx)); |
| setverdict(fail,"Timeout: Regulator did not go to Auto-off state"); |
| f_EPTF_Base_stopAll(); |
| }[f_EPTF_Var_getStatusLEDValue(vl_regulatorStatusVarIdx) == {led_blue, "Auto-off"}] T_alt.timeout { |
| } |
| } |
| f_EPTF_CLI_executeCommand("setcps tc DefaultEGrp.DefaultSc.DefaultTC1 6"); |
| if ("Target CPS of traffic case DefaultEGrp.DefaultSc.DefaultTC1: 6.000000" |
| != f_EPTF_CLI_executeCommand("gettargetcps tc DefaultEGrp.DefaultSc.DefaultTC1")) { |
| setverdict(fail,%definitionId&": CPS of traffic case cannot be changed on Auto-off state"); |
| } |
| f_EPTF_CLI_executeCommand("setcps sc DefaultEGrp.DefaultWSc 8"); |
| if ("Target CPS of scenario DefaultEGrp.DefaultWSc: 8.000000" |
| != f_EPTF_CLI_executeCommand("gettargetcps sc DefaultEGrp.DefaultWSc")) { |
| setverdict(fail,%definitionId&": CPS of scenario cannot be changed on Auto-off state"); |
| } |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| } //~group SetTargetCPSInAutoOff |
| |
| // this is a manual test |
| // scenarios are autoStarted after gui is ready |
| testcase tc_ExecCtrl_Test_Manual() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("SetTargetCPSInAutoOff", false, vl_wndLayout); |
| |
| timer t_wait := 0.0, t_maxWait := 2.0; |
| var charstring vl_dataVarName; |
| t_maxWait.start; |
| t_wait.start; |
| alt { |
| [0==f_EPTF_DataSource_checkData( |
| pl_dataVarName := vl_dataVarName, |
| pl_source := "UIHandler", |
| pl_ptcName := "", |
| pl_element := "progressBar", |
| pl_params := {} |
| )] t_wait.timeout; // wait for UIHander DS registration |
| [] t_maxWait.timeout { |
| setverdict(fail,"Cannot display progress information, UIHandler DS registration timed out"); |
| //f_EPTF_Base_stop(none); |
| } |
| } |
| |
| |
| // add progressbar to gui: |
| f_EPTF_UIHandler_createGUI(" |
| <Widgets xmlns='http://ttcn.ericsson.se/protocolModules/xtdp/xtdl'> |
| <hbox flex='0.0' id='' orientation='horizontal'> |
| <label flex='0.0' value='Progress:' /> |
| <spacer flex='0.0' /> |
| <textbox id='ProgressBar' flex='1.0' readonly='true' value=''> |
| <externaldata element='progressBar' source='UIHandler'> |
| <params> |
| </params> |
| </externaldata> |
| </textbox> |
| </hbox> |
| </Widgets>", |
| "EPTF_Main_Window" |
| ); |
| |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={}, |
| pl_EPTF_ExecCtrl_RegulatedItems:={} |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| f_EPTF_ExecCtrl_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| // start the regulators: |
| var PhaseRegulator_CT vl_regulator1 := PhaseRegulator_CT.create; |
| vl_regulator1.start(f_EPTF_ExecCtrl_Test_PhaseRegulator_behavior("Regulator 1",self,1.0)); |
| var EPTF_LoadRegulator_CT vl_regulator2 := EPTF_LoadRegulator_CT.create; |
| vl_regulator2.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator 3",self,1.0)); |
| timer T_guard, T_alt; |
| T_guard.start( 100.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{} |
| }; |
| f_EPTF_ExecCtrl_startAllScenarios(); |
| f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_EPTF_ExecCtrl_UIHandler_Test_setCPSOrig() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| v_scens := { |
| {"grp2", "SC_0", "TC0_declarator2", -1, {{23.0,10.0}, {29.0,15.0}, {35.0,20.0}, {41.0,25.0}, {47.0,30.0}}} |
| } |
| v_scensClient := v_scens; |
| f_setCPStoClients(v_scensClient, 2); |
| |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrlUI"); |
| v_clientsUI[0] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_0"); |
| v_clientsUI[1] := EPTF_ExecCtrlClient_UIHandler_Test_CT.create("ExecCtrlCUI_1"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_UIHandler_Test_setCPS("ExecCtrl_Test",2, self, v_scens, 54.0)); // 4. params: exit |
| v_clientsUI[0].start(f_EPTF_ExecCtrlClient_UIHandler_Test_CPS(int2str(0), v_execCtrlUI, v_scensClient)); |
| v_clientsUI[1].start(f_EPTF_ExecCtrlClient_UIHandler_Test_CPS(int2str(1), v_execCtrlUI, v_scensClient)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 10.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t.start(60.0); |
| alt { |
| [] all component.done { |
| setverdict(pass); |
| |
| } |
| [] t.timeout { |
| setverdict(fail); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_Test_Pool() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {"grp1", "scenario_0_declarator3", "TC0_declarator2", -1, {{4.0, 6.0}}} |
| } |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| // v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_pool("ExecCtrl_Test", 0, v_scens, 10.0)); |
| //v_clients[0].start(f_EPTF_ExecCtrlClient_Test_CPS("ExecCtrlC_0", v_execCtrl, v_scens)); |
| |
| // v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create; |
| // v_clients[0].start(f_ExecCtrlClient_Test_behaviour2("TestPool0", v_execCtrl)); |
| |
| t.start(7.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_ExecCtrl_Test_LGenPool_checkBehaviorFnNameOfPool |
| // |
| // Purpose: |
| // This testcase checks if the function <f_EPTF_ExecCtrl_getLGenCompRefsOfPool> works correctly. |
| // It creates an LGen pool for two entity groups and calls the function with different parameters. |
| // The verdict of the test should be pass. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_ExecCtrl_Test_LGenPool_getLGenCompRefsOfPool() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| |
| // Need to create a dummy component to be able to determine the correct component indexes in case of multiple TC-s are executed: |
| var ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT vl_dummyComp := ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT.create; |
| var integer vl_compRefOffset := f_EPTF_Base_upcast(vl_dummyComp); |
| |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("LGenPool_getLGenCompRefsOfPool", true, vl_wndLayout); |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList& |
| {{ |
| name := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName&".2", |
| eType := c_EPTF_ExecCtrl_Test_defaultETypeName, |
| eCount := c_EPTF_ExecCtrl_DefaultScenarios_eGrpSize |
| }}, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario}, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators&{ |
| { |
| name := c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2", |
| lgenPoolItems := { |
| { |
| hostname := "localhost", |
| num := 1, |
| createFunctionName := "EPTF_ExecCtrl_Test_Functions.f_ExecCtrl_Test_createDefaultLGen" |
| } |
| } |
| } |
| }, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List&{ |
| { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName&".2", |
| lgenPoolName := c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2" |
| } |
| }, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| 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_init_CT( |
| pl_selfName := f_EPTF_Base_selfName(), |
| pl_nrOfClients := 0, |
| pl_createLGenPools := true, |
| pl_loadModulepars := false, |
| pl_autoStart := true, |
| pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.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{} |
| }; |
| |
| // check the LGens in the 1st Pool: |
| var EPTF_IntegerList vl_lgenIdxs; |
| f_EPTF_ExecCtrl_getLGenCompRefsOfPool(c_EPTF_ExecCtrl_Test_defaultLGenPoolName,vl_lgenIdxs); |
| if (sizeof(vl_lgenIdxs) != 2) { |
| setverdict(fail,%definitionId&": Wrong number of lgens in pool: ",sizeof(vl_lgenIdxs), " Expected: 2"); |
| f_EPTF_Base_stop(none); |
| } |
| if (vl_lgenIdxs != {1+vl_compRefOffset,2+vl_compRefOffset} and vl_lgenIdxs != {2+vl_compRefOffset,1+vl_compRefOffset}) { |
| setverdict(fail,%definitionId&": Wrong lgens in pool: ",vl_lgenIdxs, " Expected: {",1+vl_compRefOffset,",",2+vl_compRefOffset,"}"); |
| f_EPTF_Base_stop(none); |
| } |
| |
| // check the 2nd pool |
| f_EPTF_ExecCtrl_getLGenCompRefsOfPool(c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2",vl_lgenIdxs); |
| if (vl_lgenIdxs != {3+vl_compRefOffset}) { |
| setverdict(fail,%definitionId&": Wrong lgens in pool: ",vl_lgenIdxs, " Expected: {",3+vl_compRefOffset,"}"); |
| f_EPTF_Base_stop(none); |
| } |
| |
| // check a non-existent pool |
| f_EPTF_ExecCtrl_getLGenCompRefsOfPool("NonExistentPool",vl_lgenIdxs); |
| if (vl_lgenIdxs != {}) { |
| setverdict(fail,%definitionId&": Wrong lgens in non-existent pool: ",vl_lgenIdxs, " Expected: {}"); |
| f_EPTF_Base_stop(none); |
| } |
| |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| /////////////////////////////////////////////////////////// |
| // Testcase: tc_ExecCtrl_Test_LGenPool_checkCreatorFnNameOfPool |
| // |
| // Purpose: |
| // This testcase checks if the function <f_EPTF_ExecCtrl_checkCreatorFnNameOfPool> works correctly. |
| // It creates an LGen pool for two entity groups and calls the function with different parameters. |
| // The verdict of the test should be pass. |
| // |
| /////////////////////////////////////////////////////////// |
| testcase tc_ExecCtrl_Test_LGenPool_checkCreatorFnNameOfPool() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("LGenPool_getLGenCompRefsOfPool", true, vl_wndLayout); |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList& |
| {{ |
| name := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName&".2", |
| eType := c_EPTF_ExecCtrl_Test_defaultETypeName, |
| eCount := c_EPTF_ExecCtrl_DefaultScenarios_eGrpSize |
| }}, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario}, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators&{ |
| { |
| name := c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2", |
| lgenPoolItems := { |
| { |
| hostname := "localhost", |
| num := 1, |
| createFunctionName := "EPTF_ExecCtrl_Test_Functions.f_ExecCtrl_Test_createDefaultLGen" |
| } |
| } |
| } |
| }, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List&{ |
| { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName&".2", |
| lgenPoolName := c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2" |
| } |
| }, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| 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_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.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{} |
| }; |
| |
| // check the function in the 1st Pool: |
| var integer vl_poolIdx; |
| var boolean vl_retVal; |
| |
| // pool and fn exist: |
| vl_retVal := f_EPTF_ExecCtrl_checkCreatorFnNameOfPool(c_EPTF_ExecCtrl_Test_defaultLGenPoolName,"EPTF_ExecCtrl_Test_Functions.f_ExecCtrl_Test_createDefaultLGen",vl_poolIdx); |
| if (vl_retVal == false) { |
| setverdict(fail,%definitionId&": Existent pool not found: ",c_EPTF_ExecCtrl_Test_defaultLGenPoolName); |
| f_EPTF_Base_stop(none); |
| } |
| if (vl_poolIdx != 0) { |
| setverdict(fail,%definitionId&": Wrong pool index: ",vl_poolIdx, " Expected: 0"); |
| f_EPTF_Base_stop(none); |
| } |
| // pool exist, but fn not: |
| vl_retVal := f_EPTF_ExecCtrl_checkCreatorFnNameOfPool(c_EPTF_ExecCtrl_Test_defaultLGenPoolName,"nonexistentFn",vl_poolIdx); |
| if (vl_retVal == true) { |
| setverdict(fail,%definitionId&": Non-existent fn found in pool ",c_EPTF_ExecCtrl_Test_defaultLGenPoolName, ": nonexistentFn"); |
| f_EPTF_Base_stop(none); |
| } |
| if (vl_poolIdx != 0) { |
| setverdict(fail,%definitionId&": Wrong pool index for non-existent fn: ",vl_poolIdx, " Expected: 0"); |
| f_EPTF_Base_stop(none); |
| } |
| |
| // check the 2nd pool |
| // pool and fn exist: |
| vl_retVal := f_EPTF_ExecCtrl_checkCreatorFnNameOfPool(c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2","EPTF_ExecCtrl_Test_Functions.f_ExecCtrl_Test_createDefaultLGen",vl_poolIdx); |
| if (vl_retVal == false) { |
| setverdict(fail,%definitionId&": Existent pool not found: ",c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2"); |
| f_EPTF_Base_stop(none); |
| } |
| if (vl_poolIdx != 1) { |
| setverdict(fail,%definitionId&": Wrong pool index: ",vl_poolIdx, " Expected: 1"); |
| f_EPTF_Base_stop(none); |
| } |
| // pool exist, but fn not: |
| vl_retVal := f_EPTF_ExecCtrl_checkCreatorFnNameOfPool(c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2","nonexistentFn",vl_poolIdx); |
| if (vl_retVal == true) { |
| setverdict(fail,%definitionId&": Non-existent fn found in pool ",c_EPTF_ExecCtrl_Test_defaultLGenPoolName&".2", ": nonexistentFn"); |
| f_EPTF_Base_stop(none); |
| } |
| if (vl_poolIdx != 1) { |
| setverdict(fail,%definitionId&": Wrong pool index for non-existent fn: ",vl_poolIdx, " Expected: 1"); |
| f_EPTF_Base_stop(none); |
| } |
| |
| // check a non-existent pool |
| vl_retVal := f_EPTF_ExecCtrl_checkCreatorFnNameOfPool("NonExistentPool","EPTF_ExecCtrl_Test_Functions.f_ExecCtrl_Test_createDefaultLGen",vl_poolIdx); |
| if (vl_retVal == true) { |
| setverdict(fail,%definitionId&": Non-existent pool found: NonExistentPool"); |
| f_EPTF_Base_stop(none); |
| } |
| if (vl_poolIdx != -1) { |
| setverdict(fail,%definitionId&": Wrong pool index for non-existent pool: ",vl_poolIdx, " Expected: -1"); |
| f_EPTF_Base_stop(none); |
| } |
| |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_Test_TrafficDistribution() runs on myMTC |
| { |
| f_EPTF_Base_init_CT("ExecCtrl_Test"); |
| |
| v_scens := { |
| {eGrpName:="grp1", scenName:="scenario_0_declarator3", tcName:="TC0_declarator2", state:=-1, timeProfile:={{20.0, 6.0}}}, |
| {"grp2", "SC_PH_0", "TC1_declarator2", -1, {{20.0, 6.0}}} |
| } |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_0"); |
| v_clients[1] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_1"); |
| v_clients[2] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlC_2"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_TrafficDistribution("ExecCtrl_Test", 3, v_scens, 4.0)); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_TrafficDistribution("ExecCtrlC_0", v_execCtrl, v_scens,1)); |
| v_clients[1].start(f_EPTF_ExecCtrlClient_Test_TrafficDistribution("ExecCtrlC_1", v_execCtrl, v_scens,3)); |
| v_clients[2].start(f_EPTF_ExecCtrlClient_Test_TrafficDistribution("ExecCtrlC_2", v_execCtrl, v_scens,22)); |
| t.start(22.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_Test_phaseRegulation() |
| runs on myMTC |
| { |
| |
| f_EPTF_Base_init_CT("MTC"); |
| |
| v_execCtrl := EPTF_ExecCtrl_Test_CT.create("ExecCtrl"); |
| var EPTF_ExecCtrlClient_TestPhaseRegulation_CT vl_client := EPTF_ExecCtrlClient_TestPhaseRegulation_CT.create("ExecCtrlClient"); |
| |
| v_execCtrl.start(f_EPTF_ExecCtrl_Test_phaseRegulation("ExecCtrl", 1)); |
| vl_client.start(f_EPTF_ExecCtrlClient_Test_phaseRegulation("ExecCtrlClient", v_execCtrl, true)); |
| var PhaseRegulator_CTList vl_phaseRegs := {}; |
| for(var integer i:=0; i<sizeof(tsp_ExecCtrl_Test_phaseRegulationConfig.phaseRegulators); i:=i+1) { |
| vl_phaseRegs[i] := PhaseRegulator_CT.create(tsp_ExecCtrl_Test_phaseRegulationConfig.phaseRegulators[i].regulatorName); |
| vl_phaseRegs[i].start( |
| f_EPTF_ExecCtrl_Test_PhaseRegulator_behavior( |
| tsp_ExecCtrl_Test_phaseRegulationConfig.phaseRegulators[i].regulatorName, |
| v_execCtrl, |
| tsp_ExecCtrl_Test_phaseRegulationConfig.phaseRegulators[i].targetValue |
| ) ); |
| } |
| // f_EPTF_Base_wait4Shutdown(); |
| t.start(600.0); |
| t.timeout; |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| // HL20955: setting CPS to zero and then back to anything: no Call is generated |
| testcase tc_EPTF_ExecCtrl_Test_HL20955() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlClient"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_Test_HL20955("ExecCtrl", 1, self,tsp_ExecCtrl_Test_HL20955Config,v_clients[0])); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_HL20955("ExecCtrlClient", v_execCtrlUI)); |
| |
| f_EPTF_ExecCtrl_Test_waitForGUIDone(); |
| |
| t.start(40.0); |
| alt { |
| [] t.timeout { |
| setverdict(fail); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| // test if the execTime condition is fulfilled too early |
| testcase tc_EPTF_ExecCtrl_Test_ExecTimeForSmallCPS() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlClient"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_Test_ExecTimeForSmallCPS("ExecCtrl", 1, self,tsp_ExecCtrl_Test_ExecTimeForSmallCPSConfig,v_clients[0])); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_ExecTimeForSmallCPS("ExecCtrlClient", v_execCtrlUI)); |
| |
| f_EPTF_ExecCtrl_Test_waitForGUIDone(); |
| |
| t.start(40.0); |
| alt { |
| [] t.timeout { |
| action("ExecTime condition not fired at all! Test FAILED!"); |
| setverdict(fail); // execTime not fired at all |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| // test if the execTime condition is fulfilled too early |
| testcase tc_EPTF_ExecCtrl_Test_ExecTimeForZeroCPS() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrl"); |
| v_clients[0] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlClient"); |
| |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_Test_ExecTimeForSmallCPS("ExecCtrl", 1, self,tsp_ExecCtrl_Test_ExecTimeForZeroCPSConfig,v_clients[0])); |
| v_clients[0].start(f_EPTF_ExecCtrlClient_Test_ExecTimeForSmallCPS("ExecCtrlClient", v_execCtrlUI)); |
| |
| f_EPTF_ExecCtrl_Test_waitForGUIDone(); |
| |
| t.start(40.0); |
| alt { |
| [] t.timeout { |
| action("ExecTime condition not fired at all! Test FAILED!"); |
| setverdict(fail); // execTime not fired at all |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| group HL45980 { |
| |
| type component myMTC_UI_HL45980 extends myMTC_UI { |
| timer t_subscribe := 2.0; |
| const charstring c_EPTF_ExecCtrl_Test_HL45980_simple_startsVarName := |
| ""&c_EPTF_ExecCtrl_statisticsRoot&".EG."&"grpSimpleFSM"&".SC."&"SC1"&".TC."&"TC_post" &"."&c_EPTF_ExecCtrl_tcStatNames[c_EPTF_ExecCtrl_tcStatId_Success]; |
| } |
| |
| altstep as_EPTF_ExecCtrl_Test_HL45980_simple_checkResult() runs on myMTC_UI_HL45980 { |
| [] t_subscribe.timeout { |
| var integer vl_idx := f_EPTF_Var_getId(c_EPTF_ExecCtrl_Test_HL45980_simple_startsVarName); |
| if (vl_idx != -1) { |
| var integer vl_success := f_EPTF_Var_getIntValue(vl_idx); |
| if (vl_success == 500) { |
| action("Test PASSED: Traffic cases started in scenario group and calls were generated successfully."); |
| f_EPTF_Base_stopAll(pass); |
| } |
| } |
| t_subscribe.start; |
| repeat; |
| } |
| } |
| |
| // test if the execTime condition is fulfilled too early |
| testcase tc_EPTF_ExecCtrl_Test_HL45980_simple() runs on myMTC_UI_HL45980 |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrl"); |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_Test_HL45980_ExecCtrlBehaviour("ExecCtrl")); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 30.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config[tc_EPTF_ExecCtrl_Test_HL45980_simple:v_ready]"); |
| } |
| [v_ready] T_alt.timeout{} |
| }; |
| |
| var integer vl_idx; |
| f_EPTF_Var_subscribeRemote( |
| pl_remoteCompRef := v_execCtrlUI, |
| pl_remoteProviderVarName := c_EPTF_ExecCtrl_Test_HL45980_simple_startsVarName, |
| pl_subscriptionMode := realtime, |
| pl_idx := vl_idx, |
| pl_localName := c_EPTF_ExecCtrl_Test_HL45980_simple_startsVarName); |
| |
| f_EPTF_UIHandler_createGUIFromFile(tsp_ExecCtrl_DS_guiXmlName,""); |
| |
| t_subscribe.start; |
| var default def := activate(as_EPTF_ExecCtrl_Test_HL45980_simple_checkResult()); |
| |
| t.start(60.0); |
| alt { |
| [] t.timeout { |
| action("Test FAILED: Traffic was not generated in the scenario"); |
| setverdict(fail); // execTime not fired at all |
| } |
| } |
| setverdict(pass); |
| f_EPTF_Base_cleanup_CT(); |
| |
| } |
| |
| } // group HL45980 |
| |
| /**********************************************************************/ |
| |
| group Action { |
| |
| |
| modulepar EPTF_ExecCtrl_Test_HL20955Config tsp_ExecCtrl_Test_Action_Config := { |
| eGroups := { |
| {name := "eGrpHL20955", eType := "Entity_A", eCount := 100} |
| }, |
| sc2eGroups := { |
| {eGrpName:="eGrpHL20955", scenarioNames:={"ScHL20955", "WScHL20955"}} |
| }, |
| tcTypes := { |
| {name := "TcTypeHL20955", fsmName := "DUMMY_FSM", entityType := "Entity_A", customEntitySucc := ""} |
| }, |
| scTypes := { |
| { |
| name := "ScHL20955", |
| tcList := { |
| { |
| tcName := "Tc1", |
| tcParamsList := { |
| {tcTypeName := "TcTypeHL20955"}, |
| {target := { cpsToReach := 5.0 }}, |
| {enableEntitiesAtStart := true}, |
| {enabledAtStart := true}, |
| {trafficStartFinish := {}}, |
| {trafficFinishedActions := {}} |
| } |
| } |
| }, |
| scParamsList := { |
| } |
| }, |
| { |
| name := "WScHL20955", |
| tcList := { |
| { |
| tcName := "Tc1", |
| tcParamsList := { |
| {tcTypeName := "TcTypeHL20955"}, |
| {target := { trafficWeight := 1.0 }}, |
| {enableEntitiesAtStart := true}, |
| {enabledAtStart := true}, |
| {trafficStartFinish := {}}, |
| {trafficFinishedActions := {}} |
| } |
| } |
| }, |
| scParamsList := { |
| {weightedScData := { |
| cpsToReach := 4.0, |
| lockCPS := false, |
| deterministicMix := true, |
| scheduler := omit |
| } |
| } |
| } |
| } |
| }, |
| timeProfileDescrList := {}, |
| timeProfileList := {}, |
| timeProfile2TcList := {} |
| }; |
| |
| /**********************************************************************/ |
| |
| //====================================================== |
| //f_EPTF_ExecCtrl_Test_initItselfAndGui |
| //====================================================== |
| function f_EPTF_ExecCtrl_Test_initItselfAndGui() runs on myMTC_UI |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandlerXUL_init_CT("ExecCtrl_UIHandler_Test", true, vl_wndLayout,self); |
| |
| f_EPTF_UIHandler_clearGUI(); |
| f_EPTF_UIHandler_addWindow(); |
| |
| v_ready := false; |
| f_EPTF_DataSource_registerReadyCallback(refers(f_EPTF_ExecCtrl_Test_DataSourceClientReady )); |
| |
| } |
| |
| //====================================================== |
| //f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients |
| //====================================================== |
| function f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients( |
| in EPTF_ExecCtrl_Test_HL20955Config pl_cfg, |
| in integer pl_nofClients, |
| in boolean pl_stop4FirstAction:=true, |
| in integer pl_expectedValue:=-1 //the number of Successess, Fails etc, default:sizeof(pl_cfg.scTypes); |
| ) |
| runs on myMTC_UI |
| { |
| |
| var integer i:=-1; |
| |
| v_execCtrlUI := EPTF_ExecCtrl_UIHandler_Test_CT.create("ExecCtrl"); |
| for(i:=0;i<pl_nofClients;i:=i+1) { |
| v_clients[i] := EPTF_ExecCtrlClient_Test_CT.create("ExecCtrlClient"&int2str(i)); |
| } |
| if(pl_stop4FirstAction) { |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_Test_Action_stop4FirstAction("ExecCtrl", pl_nofClients, self, pl_cfg, v_clients)); |
| } else { |
| v_execCtrlUI.start(f_EPTF_ExecCtrl_Test_Action_stop4Condition("ExecCtrl", pl_nofClients, self, pl_cfg, v_clients,pl_expectedValue)); |
| } |
| |
| for(i:=0;i<pl_nofClients;i:=i+1) { |
| v_clients[i].start(f_EPTF_ExecCtrlClient_Test_Action("ExecCtrlClient"&int2str(i), v_execCtrlUI)); |
| } |
| |
| |
| // start the guard timer when the GUIDone led turns green: |
| f_EPTF_ExecCtrl_Test_waitForGUIDone(); |
| |
| t.start(40.0); |
| alt { |
| [] all component.done {} |
| [] t.timeout { |
| setverdict(fail, "Timeout occured"); |
| } |
| } |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| |
| const integer c_EPTF_ExecCtrl_Test_trafficStartFinishIdx:=4; |
| const integer c_EPTF_ExecCtrl_Test_trafficFinishedActionsIdx:=5; |
| const integer c_EPTF_ExecCtrl_Test_entityFinishConditionIdx:=6; |
| |
| // Based on tc_EPTF_ExecCtrl_Test_HL20955 HL20955: setting CPS to zero and then back to anything: no Call is generated |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_execTime |
| // Passed if twice (=number of execCtrlClients) called the action function after nrOfSuccess==100 / trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_execTime() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| {execTime := {time := 20.0,actions := { |
| {customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"} |
| }}} |
| }; |
| }//for |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); //<===just apply if want check! |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfExecStart |
| // Passed if twice (=number of execCtrlClients) called the action function after nrOfSuccess==100 / trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfExecStart() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| { nrOfExecStart := {count := 1, actions := { {customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| { execTime := {time := 120.0, actions := { /*{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}*/}}} |
| } |
| }//for |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfSuccesses |
| // Passed if twice (=number of execCtrlClients) called the action function after nrOfSuccess==100 / trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfSuccesses() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| {nrOfSuccesses := { |
| count := 100, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| {execTime := { |
| time := 120.0, |
| actions := {/*{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"} */}}} |
| }; |
| }//for |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfFails |
| // Passed if twice (=number of execCtrlClients) called the action function after nrOfFails==0 / trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfFails() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| {nrOfFails := { |
| count := 0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| {execTime := { |
| time := 120.0, |
| actions := {/*{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}*/}}} |
| }; |
| }//for |
| |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfRangeLoop |
| // Passed if twice (=number of execCtrlClients) called the action function after nrOfFails==0 / trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfRangeLoop() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| {nrOfRangeLoop := { |
| count := 0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| {execTime := { |
| time := 120.0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}}}} |
| }; |
| }//for |
| |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfErrors |
| // Passed if twice (=number of execCtrlClients) called the action function after nrOfFails==0 / trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfErrors() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| {nrOfErrors := { |
| count := 0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| {execTime := { |
| time := 120.0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}}}} |
| }; |
| }//for |
| |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfTimeouts |
| // Passed if twice (=number of execCtrlClients) called the action function after nrOfTimeouts==0 / trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_nrOfTimeouts() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| {nrOfTimeouts := { |
| count := 0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| {execTime := { |
| time := 120.0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}}}} |
| } |
| }//for |
| |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_entitiesFinished |
| // Passed if twice (=number of execCtrlClients) called the action function after entitiesFinished / trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_entitiesFinished() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_entityFinishConditionIdx].entityFinishConditions:= { {nrOfExecStart := 1} } |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| { |
| entitiesFinished := { |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}} |
| }, |
| { |
| execTime := { |
| time := 120.0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}} |
| } |
| } |
| }; |
| }//for |
| |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_availableEntitiesFinished |
| // Passed if twice (=number of execCtrlClients) called the action function after availableEntitiesFinished/ trafficStartFinish |
| // Status:Passed, HL56376 fixed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_availableEntitiesFinished() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_entityFinishConditionIdx].entityFinishConditions:= { {nrOfExecStart := 1}}; |
| |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| {availableEntitiesFinished := { |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| {execTime := { |
| time := 120.0, |
| actions := {{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}}}} |
| }; |
| }//for |
| |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_anythingFinished |
| // Passed if twice (=number of execCtrlClients) called the action function after nrOfSuccess==100 / trafficStartFinish |
| // Status: Passed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_anythingFinished() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| |
| { anythingFinished := { |
| actions:= { {customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| { execTime := { |
| time := 30.0, |
| actions:= { /*{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}*/}}} |
| }; |
| //vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficFinishedActionsIdx].trafficFinishedActions:={ {testFinished:={}} }; |
| }//for |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_customFinish |
| // Passed if customFinish condition is fulfilled |
| // Status: Passed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficStartFinish_customFinish() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| |
| { customFinish := { |
| functionName := "f_EPTF_ExecCtrlClient_Test_Action_customFinishCondition", actions:= { {customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}}}}, |
| { execTime := { |
| time := 30.0, |
| actions:= { {customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_fail"}}}} |
| }; |
| //vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficFinishedActionsIdx].trafficFinishedActions:={ {testFinished:={}} }; |
| }//for |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg, 2, pl_stop4FirstAction:=false/*,pl_expectedValue := 100*/); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficFinishedActions_customFinishFunction |
| // Status: Passed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficFinishedActions_customFinishFunction() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| { |
| nrOfSuccesses := { |
| count := 100, |
| actions := {/*{customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"}*/} |
| } |
| } |
| }; |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficFinishedActionsIdx].trafficFinishedActions:= { |
| {customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"} |
| }; |
| }//for |
| |
| //log(">>> cfg: ",vl_cfg); |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg,2, pl_stop4FirstAction:=false); |
| } |
| |
| //====================================================== |
| // tc_EPTF_ExecCtrl_Test_Action_trafficFinishedActions_testFinished |
| // Status: Passed |
| //====================================================== |
| testcase tc_EPTF_ExecCtrl_Test_Action_trafficFinishedActions_testFinished() runs on myMTC_UI |
| { |
| |
| f_EPTF_ExecCtrl_Test_initItselfAndGui(); |
| |
| //==== Configuration===== |
| var EPTF_ExecCtrl_Test_HL20955Config vl_cfg:= tsp_ExecCtrl_Test_Action_Config; |
| |
| for(var integer i:=0;i<sizeof(vl_cfg.scTypes);i:=i+1) { |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficStartFinishIdx].trafficStartFinish:= { |
| { |
| nrOfSuccesses := { |
| count := 100, |
| actions := {} |
| } |
| } |
| }; |
| vl_cfg.scTypes[i].tcList[0].tcParamsList[c_EPTF_ExecCtrl_Test_trafficFinishedActionsIdx].trafficFinishedActions:= { |
| {testFinished := { }}, |
| {customFinishFunction := "f_EPTF_ExecCtrlClient_Test_Action_pass"} |
| }; |
| }//for |
| |
| f_EPTF_ExecCtrl_Test_startsExecCtrlAndExecCtrlClients(vl_cfg,2, pl_stop4FirstAction:=false); |
| } |
| }//group Action |
| |
| group HL65581{ |
| //Error message in case of invalid scenario in scenario group declaration of the config |
| const charstring c_EPTF_ExecCtrl_HL65581Test_behaviorName := "ExectrTesterBehavior" |
| const charstring c_EPTF_ExecCtrl_HL65581Test_eTypeName := "ExectrTesterEType" |
| const EPTF_LGenBase_FsmTableDeclarator c_EPTF_ExecCtrl_HL65581Test_simpleResponseFSM := |
| { |
| name := "simpleResponseFSM", |
| fsmParams := { |
| {stateList := {"idle"}} |
| }, |
| table := { |
| classicTable := { |
| { eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_startTC,fsm}, |
| cellRow := {{{ |
| {c_EPTF_LGenBase_stepName_trafficSuccess, omit} |
| }, omit, omit}} |
| }, |
| { eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_stopTC,fsm}, |
| cellRow := {{{ |
| {c_EPTF_LGenBase_stepName_entityStopped, omit} |
| }, omit, omit}} |
| }, |
| { eventToListen := {c_EPTF_LGenBase_behavior,c_EPTF_LGenBase_inputName_testMgmt_abortTC,fsm}, |
| cellRow := {{{ |
| {c_EPTF_LGenBase_stepName_entityAborted, omit} |
| }, omit, omit}} |
| } |
| } |
| } |
| } |
| |
| const charstring c_EPTF_ExecCtrl_HL65581Test_eGrpName := "eg0" |
| const charstring c_EPTF_ExecCtrl_HL65581Test_scNameNormal := "normalScenario" |
| const charstring c_EPTF_ExecCtrl_HL65581Test_scNameWeighted := "weightedScenario" |
| const charstring c_EPTF_ExecCtrl_HL65581Test_tcNameTc1 := "tcII" |
| const charstring c_EPTF_ExecCtrl_HL65581Test_tcNameTc2 := "tcI" |
| |
| const charstring c_EPTF_ExecCtrl_HL65581Test_tcNorm1Name := c_EPTF_ExecCtrl_HL65581Test_eGrpName&"."&c_EPTF_ExecCtrl_HL65581Test_scNameNormal&"."&c_EPTF_ExecCtrl_HL65581Test_tcNameTc1 |
| const charstring c_EPTF_ExecCtrl_HL65581Test_tcNorm2Name := c_EPTF_ExecCtrl_HL65581Test_eGrpName&"."&c_EPTF_ExecCtrl_HL65581Test_scNameNormal&"."&c_EPTF_ExecCtrl_HL65581Test_tcNameTc2 |
| const charstring c_EPTF_ExecCtrl_HL65581Test_tcWeighted1Name := c_EPTF_ExecCtrl_HL65581Test_eGrpName&"."&c_EPTF_ExecCtrl_HL65581Test_scNameWeighted&"."&c_EPTF_ExecCtrl_HL65581Test_tcNameTc1 |
| const charstring c_EPTF_ExecCtrl_HL65581Test_tcWeighted2Name := c_EPTF_ExecCtrl_HL65581Test_eGrpName&"."&c_EPTF_ExecCtrl_HL65581Test_scNameWeighted&"."&c_EPTF_ExecCtrl_HL65581Test_tcNameTc2 |
| |
| const EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList c_EPTF_ExecCtrl_HL65581Test_ExectrTesterEGrp :={{ |
| name := c_EPTF_ExecCtrl_HL65581Test_eGrpName, |
| eType := c_EPTF_ExecCtrl_HL65581Test_eTypeName, |
| eCount := 100 |
| }} |
| |
| const EPTF_LGenBase_TcMgmt_Scenarios2GrpList c_EPTF_ExecCtrl_HL65581Test_Scenarios2GrpList := { |
| { |
| eGrpName := c_EPTF_ExecCtrl_HL65581Test_eGrpName, |
| scenarioNames := { |
| c_EPTF_ExecCtrl_HL65581Test_scNameNormal |
| } |
| }, |
| { |
| eGrpName := c_EPTF_ExecCtrl_HL65581Test_eGrpName, |
| scenarioNames := { |
| c_EPTF_ExecCtrl_HL65581Test_scNameWeighted |
| } |
| } |
| } |
| |
| const EPTF_ExecCtrl_ScenarioInstanceTypeList c_EPTF_ExecCtrl_HL65581Test_ScenarioInstanceTypeList := { |
| {c_EPTF_ExecCtrl_HL65581Test_scNameNormal, c_EPTF_ExecCtrl_HL65581Test_eGrpName, c_EPTF_ExecCtrl_HL65581Test_scNameNormal}, |
| {c_EPTF_ExecCtrl_HL65581Test_scNameWeighted, c_EPTF_ExecCtrl_HL65581Test_eGrpName, c_EPTF_ExecCtrl_HL65581Test_scNameWeighted} |
| } |
| |
| const EPTF_LGenBase_TcMgmt_tcTypeDeclarator2 c_EPTF_ExecCtrl_HL65581Test_simpleResponseTCType := { |
| name := "simpleResponseTCType", |
| fsmName := "simpleResponseFSM", |
| entityType := c_EPTF_ExecCtrl_HL65581Test_eTypeName, |
| customEntitySucc := "" |
| } |
| |
| const EPTF_LGenBase_ScenarioTypeDeclarator c_EPTF_ExecCtrl_HL65581Test_normalScenario := { |
| name := c_EPTF_ExecCtrl_HL65581Test_scNameNormal, |
| tcList := { |
| { |
| tcName := c_EPTF_ExecCtrl_HL65581Test_tcNameTc1, |
| tcParamsList := { |
| {tcTypeName := "simpleResponseTCType"}, |
| {enableEntitiesAtStart := true}, |
| {enabledAtStart := true}, |
| {target := {cpsToReach := 10.0} } |
| } |
| }, |
| { |
| tcName := c_EPTF_ExecCtrl_HL65581Test_tcNameTc2, |
| tcParamsList := { |
| {tcTypeName := "simpleResponseTCType"}, |
| {enableEntitiesAtStart := true}, |
| {enabledAtStart := true}, |
| {target := {cpsToReach := 10.0} } |
| } |
| } |
| }, |
| scParamsList := { |
| {enabled := true} |
| } |
| } |
| |
| const charstring c_EPTF_ExecCtrl_HL65581Test_PhaseListName := "phl1" |
| const EPTF_LGenBase_PhaseList_Declarators c_EPTF_ExecCtrl_HL65581Test_PhaseLists := { |
| {c_EPTF_ExecCtrl_HL65581Test_PhaseListName, {{"load",true}}} |
| } |
| const EPTF_LGenBase_ScenarioTypeDeclarator c_EPTF_ExecCtrl_HL65581Test_weightedScenario := { |
| name := c_EPTF_ExecCtrl_HL65581Test_scNameWeighted, |
| tcList := { |
| { |
| tcName := c_EPTF_ExecCtrl_HL65581Test_tcNameTc1, |
| tcParamsList := { |
| {tcTypeName := "simpleResponseTCType"}, |
| {enableEntitiesAtStart := true}, |
| {enabledAtStart := true}, |
| {target := {trafficWeight := 25.0} } |
| } |
| }, |
| { |
| tcName := c_EPTF_ExecCtrl_HL65581Test_tcNameTc2, |
| tcParamsList := { |
| {tcTypeName := "simpleResponseTCType"}, |
| {enableEntitiesAtStart := true}, |
| {enabledAtStart := true}, |
| {target := {trafficWeight := 75.0} } |
| } |
| } |
| }, |
| scParamsList := { |
| {weightedScData := { |
| cpsToReach := 10.0, |
| lockCPS := false, |
| deterministicMix := false, |
| scheduler := omit |
| } |
| }, |
| {enabled := true} |
| } |
| } |
| |
| const EPTF_LGenBase_ScenarioTypeParamsList c_EPTF_ExecCtrl_HL65581Test_scPhaseParams := { |
| {phaseListName := c_EPTF_ExecCtrl_HL65581Test_PhaseListName}, |
| {phaseFinishConditions := {}}, |
| {phaseStateChangeActions := { |
| { |
| phase := "load", |
| state := RUNNING, |
| actions := { |
| {startScenario := c_EPTF_ExecCtrl_HL65581Test_scNameNormal}, |
| {startScenario := c_EPTF_ExecCtrl_HL65581Test_scNameWeighted} |
| } |
| }, |
| { |
| phase := "load", |
| state := STOPPING, |
| actions := { |
| {stopScenario := c_EPTF_ExecCtrl_HL65581Test_scNameNormal}, |
| {stopScenario := c_EPTF_ExecCtrl_HL65581Test_scNameWeighted} |
| } |
| } |
| } |
| } |
| |
| } |
| |
| const EPTF_ExecCtrl_ScenarioGroup_Declarators c_EPTF_ExecCtrl_HL65581Test_scGrps:={ |
| { |
| name := "SCG0", |
| execMode := MANUAL, |
| scenarioNames := {c_EPTF_ExecCtrl_HL65581Test_scNameNormal, c_EPTF_ExecCtrl_HL65581Test_scNameWeighted&"bubu"}, |
| phaseListName := c_EPTF_ExecCtrl_HL65581Test_PhaseListName |
| } |
| } |
| type component EPTF_ExecCtrl_HL65581Test_CT extends EPTF_ExecCtrl_CT{ |
| } |
| |
| testcase tc_ExecCtrl_HL65581Test() runs on EPTF_ExecCtrl_CT{ |
| |
| f_EPTF_Base_init_CT("HL65581Test") |
| f_EPTF_Base_setExpectedErrorMsg("Error: EPTF_ExecCtrl: f_EPTF_ExecCtrl_Phase_createScenarioGroups: Couldn't create scenario group instance: ? name := \"SCG0\", execMode := MANUAL ?1?, scenarioNames := ? \"normalScenario\", \"weightedScenariobubu\" ?, phaseListName := \"phl1\" ? at declarator index: 0 : One or more scenarios in the scenarioNames does not exist.") |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_HL65581Test_ExectrTesterEGrp, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_HL65581Test_Scenarios2GrpList, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_HL65581Test_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_HL65581Test_normalScenario,c_EPTF_ExecCtrl_HL65581Test_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:=c_EPTF_ExecCtrl_HL65581Test_PhaseLists, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_HL65581Test_scGrps, |
| pl_EPTF_ExecCtrl_RegulatorNames:={}, |
| pl_EPTF_ExecCtrl_RegulatedItems:={}) |
| f_EPTF_ExecCtrl_setManualControl(true) |
| f_EPTF_ExecCtrl_init_CT("HL65581Test", 1, false) |
| f_EPTF_Base_cleanup_CT() |
| } |
| } |
| |
| group HL59515 { |
| |
| type component ExecCtrl_Regulator_Test_AddSameRegulatedItem_Main_CT extends EPTF_UIHandler_CLI_CT, EPTF_ExecCtrl_UIHandler_CT { |
| } |
| |
| const EPTF_ExecCtrl_RegulatedItems c_EPTF_ExecCtrl_RegulatedItems_AddSameRegulatedItem := { |
| { |
| idName := { |
| cps_TC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameNormal, |
| tcName := c_EPTF_ExecCtrl_DefaultScenarios_tcNameTc1 |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "Regulator1" |
| }, |
| { |
| idName := { |
| cps_TC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameNormal, |
| tcName := c_EPTF_ExecCtrl_DefaultScenarios_tcNameTc1 |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "Regulator1" |
| }, |
| { |
| idName := { |
| cps_SC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameWeighted |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "Regulator2" |
| } |
| } |
| |
| testcase tc_ExecCtrl_Regulator_Test_AddSameRegulatedItem() runs on ExecCtrl_Regulator_Test_AddSameRegulatedItem_Main_CT |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("AddSameRegulatedItem", true, vl_wndLayout); |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario}, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:={}, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:={}, |
| pl_EPTF_ExecCtrl_RegulatorNames:={"Regulator1","Regulator2"}, |
| pl_EPTF_ExecCtrl_RegulatedItems:=c_EPTF_ExecCtrl_RegulatedItems_AddSameRegulatedItem |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| f_EPTF_ExecCtrl_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| // start the regulators: |
| var EPTF_LoadRegulator_CT vl_regulator1 := EPTF_LoadRegulator_CT.create; |
| vl_regulator1.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator1",self,10.0)); |
| var EPTF_LoadRegulator_CT vl_regulator2 := EPTF_LoadRegulator_CT.create; |
| vl_regulator2.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator2",self,10.0)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.0 ); |
| T_alt.start( 10.0 ); |
| T_alt.timeout; // to wait for the regulators to start up |
| 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{} |
| }; |
| |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| const EPTF_ExecCtrl_RegulatedItems c_EPTF_ExecCtrl_RegulatedItems_AddSameRegulatedItem2 := { |
| { |
| idName := { |
| cps_TC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameNormal, |
| tcName := c_EPTF_ExecCtrl_DefaultScenarios_tcNameTc1 |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "Regulator1" |
| }, |
| { |
| idName := { |
| cps_TC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameNormal, |
| tcName := c_EPTF_ExecCtrl_DefaultScenarios_tcNameTc1 |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "Regulator2" |
| }, |
| { |
| idName := { |
| cps_SC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameWeighted |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "Regulator2" |
| } |
| } |
| |
| testcase tc_ExecCtrl_Regulator_Test_AddSameRegulatedItem2() runs on ExecCtrl_Regulator_Test_AddSameRegulatedItem_Main_CT |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("AddSameRegulatedItem", true, vl_wndLayout); |
| f_EPTF_Base_setExpectedErrorMsg("*f_EPTF_ExecCtrl_Regulator_registerItem: Cannot set regulator name*"); |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario}, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:={}, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:={}, |
| pl_EPTF_ExecCtrl_RegulatorNames:={"Regulator1","Regulator2"}, |
| pl_EPTF_ExecCtrl_RegulatedItems:=c_EPTF_ExecCtrl_RegulatedItems_AddSameRegulatedItem2 |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| f_EPTF_ExecCtrl_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| // start the regulators: |
| var EPTF_LoadRegulator_CT vl_regulator1 := EPTF_LoadRegulator_CT.create; |
| vl_regulator1.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator1",self,10.0)); |
| var EPTF_LoadRegulator_CT vl_regulator2 := EPTF_LoadRegulator_CT.create; |
| vl_regulator2.start(f_ExecCtrl_Regulator_Test_RegulatorBehaviour("Regulator2",self,10.0)); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.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{} |
| }; |
| |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| |
| } // ~group HL59515 |
| |
| |
| group HL58678 { |
| |
| testcase tc_ExecCtrl_HL58678_Test_StopScGroup() runs on ExecCtrl_Regulator_Test_AddSameRegulatedItem_Main_CT |
| { |
| f_EPTF_CLI_init_CT("StopScGroup"); |
| |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={}, |
| pl_EPTF_ExecCtrl_RegulatedItems:={} |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| f_EPTF_ExecCtrl_CLI_init_CT( |
| pl_selfName := f_EPTF_Base_selfName(), |
| pl_nrOfClients := 0, |
| pl_createLGenPools := true, |
| pl_CLI_compRef := self, |
| pl_loadModulepars := false, |
| pl_autoStart := true, |
| pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config:checkReadyToRun"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| |
| |
| f_EPTF_CLI_executeCommand("startExec scGroup DefaultScGroup"); |
| |
| var integer vl_scGrpStateIdx := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.DefaultEGrp.SC.DefaultWScInScGrp.SCGrp.GroupStatusLED"); |
| const charstring cl_scGroupStateVarName := "Var.Execution_Control.PhaseLists.tabbox.DefaultPhases.tab.DefaultScGroup.GroupStatus"; |
| if (vl_scGrpStateIdx==-1){ |
| vl_scGrpStateIdx := f_EPTF_Var_getId(cl_scGroupStateVarName); |
| } |
| if (vl_scGrpStateIdx==-1) { |
| setverdict(fail,"Error in test: The scenario group status var not found!"); |
| f_EPTF_Base_stopAll(); |
| } |
| action("tc_ExecCtrl_HL58678_Test_StopScGroup: getStatusLEDValue[",vl_scGrpStateIdx,"]:",f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx)); |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during start scGroup"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx) == { color := led_green, text := "phase2 - RUNNING" }] T_alt.timeout{} |
| }; |
| |
| f_EPTF_CLI_executeCommand("stopExec scGroup DefaultScGroup"); |
| |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during stop scGroup"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx) == { color := led_red, text := "phase2 - STOPPING" }] T_alt.timeout{} |
| }; |
| |
| // check if CPS goes down to 0 |
| T_guard.start( 20.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"The CPS of the scenario in the group is not zero after stop!"); |
| f_EPTF_Base_stopAll(); |
| } |
| [str2float(regexp(f_EPTF_CLI_executeCommand("getcurrentcps sc DefaultEGrp.DefaultWScInScGrp"),"*: (*)",0)) != 0.0] T_alt.timeout{} |
| }; |
| |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_HL58678_Test_TerminateScGroup() runs on ExecCtrl_Regulator_Test_AddSameRegulatedItem_Main_CT |
| { |
| f_EPTF_CLI_init_CT("TerminateScGroup"); |
| |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={}, |
| pl_EPTF_ExecCtrl_RegulatedItems:={} |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| f_EPTF_ExecCtrl_CLI_init_CT( |
| pl_selfName := f_EPTF_Base_selfName(), |
| pl_nrOfClients := 0, |
| pl_createLGenPools := true, |
| pl_CLI_compRef := self, |
| pl_loadModulepars := false, |
| pl_autoStart := true, |
| pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.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{} |
| }; |
| |
| f_EPTF_CLI_executeCommand("startExec scGroup DefaultScGroup"); |
| |
| var integer vl_scGrpStateIdx := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.DefaultEGrp.SC.DefaultWScInScGrp.SCGrp.DefaultScGroup.GroupStatusLED"); |
| if (vl_scGrpStateIdx==-1) { |
| setverdict(fail,"Error in test: The scenario group status var not found!"); |
| f_EPTF_Base_stopAll(); |
| } |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during start scGroup"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx) == { color := led_green, text := "phase2 - RUNNING" }] T_alt.timeout{} |
| }; |
| |
| f_EPTF_CLI_executeCommand("terminateExec scGroup DefaultScGroup"); |
| |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during stop scGroup"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx) == { color := led_blue, text := "phase2 - IDLE" }] T_alt.timeout{} |
| }; |
| |
| // check if CPS goes down to 0 |
| T_guard.start( 20.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"The CPS of the scenario in the group is not zero after stop!"); |
| f_EPTF_Base_stopAll(); |
| } |
| [str2float(regexp(f_EPTF_CLI_executeCommand("getcurrentcps sc DefaultEGrp.DefaultWScInScGrp"),"*: (*)",0)) != 0.0] T_alt.timeout{} |
| }; |
| |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_HL58678_Test_StopAll() runs on ExecCtrl_Regulator_Test_AddSameRegulatedItem_Main_CT |
| { |
| f_EPTF_CLI_init_CT("StopAll"); |
| |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={}, |
| pl_EPTF_ExecCtrl_RegulatedItems:={} |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| f_EPTF_ExecCtrl_CLI_init_CT( |
| pl_selfName := f_EPTF_Base_selfName(), |
| pl_nrOfClients := 0, |
| pl_createLGenPools := true, |
| pl_CLI_compRef := self, |
| pl_loadModulepars := false, |
| pl_autoStart := true, |
| pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config:checkReadyToRun"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| action("startExec all->{",f_EPTF_CLI_executeCommand("startExec all")); |
| //f_EPTF_CLI_executeCommand("startExec all"); |
| action("} startExec all"); |
| var integer vl_scGrpStateIdx := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.DefaultEGrp.SC.DefaultWScInScGrp.SCGrp.GroupStatusLED"); |
| const charstring cl_scGroupStateVarName := "Var.Execution_Control.PhaseLists.tabbox.DefaultPhases.tab.DefaultScGroup.GroupStatus"; |
| if (vl_scGrpStateIdx==-1){ |
| vl_scGrpStateIdx := f_EPTF_Var_getId(cl_scGroupStateVarName); |
| } |
| if (vl_scGrpStateIdx==-1) { |
| setverdict(fail,"Error in test: The scenario group status var not found!"); |
| f_EPTF_Base_stopAll(); |
| } |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during start scGroup"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx) == { color := led_green, text := "phase2 - RUNNING" }] T_alt.timeout{} |
| }; |
| |
| f_EPTF_CLI_executeCommand("stopExec all"); |
| |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during stop scGroup"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx) == { color := led_red, text := "phase2 - STOPPING" }] T_alt.timeout{} |
| }; |
| |
| // check if CPS goes down to 0 |
| T_guard.start( 20.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"The CPS of the scenario in the group is not zero after stop!"); |
| f_EPTF_Base_stopAll(); |
| } |
| [str2float(regexp(f_EPTF_CLI_executeCommand("getcurrentcps sc DefaultEGrp.DefaultWScInScGrp"),"*: (*)",0)) != 0.0] T_alt.timeout{} |
| }; |
| |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_HL58678_Test_TerminateAll() runs on ExecCtrl_Regulator_Test_AddSameRegulatedItem_Main_CT |
| { |
| f_EPTF_CLI_init_CT("TerminateAll"); |
| |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={}, |
| pl_EPTF_ExecCtrl_RegulatedItems:={} |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| f_EPTF_ExecCtrl_CLI_init_CT( |
| pl_selfName := f_EPTF_Base_selfName(), |
| pl_nrOfClients := 0, |
| pl_createLGenPools := true, |
| pl_CLI_compRef := self, |
| pl_loadModulepars := false, |
| pl_autoStart := true, |
| pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.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{} |
| }; |
| |
| f_EPTF_CLI_executeCommand("startExec all"); |
| |
| var integer vl_scGrpStateIdx := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.DefaultEGrp.SC.DefaultWScInScGrp.SCGrp.DefaultScGroup.GroupStatusLED"); |
| if (vl_scGrpStateIdx==-1) { |
| setverdict(fail,"Error in test: The scenario group status var not found!"); |
| f_EPTF_Base_stopAll(); |
| } |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during start scGroup"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx) == { color := led_green, text := "phase2 - RUNNING" }] T_alt.timeout{} |
| }; |
| |
| f_EPTF_CLI_executeCommand("terminateExec all"); |
| |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during stop scGroup"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_Var_getStatusLEDValue(vl_scGrpStateIdx) == { color := led_blue, text := "phase2 - IDLE" }] T_alt.timeout{} |
| }; |
| |
| // check if CPS goes down to 0 |
| T_guard.start( 20.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"The CPS of the scenario in the group is not zero after stop!"); |
| f_EPTF_Base_stopAll(); |
| } |
| [str2float(regexp(f_EPTF_CLI_executeCommand("getcurrentcps sc DefaultEGrp.DefaultWScInScGrp"),"*: (*)",0)) != 0.0] T_alt.timeout{} |
| }; |
| |
| setverdict(pass); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| } //~group HL58678 |
| |
| group HL79051 { |
| |
| const charstring c_EPTF_ExecCtrl_Test_HL79051LGenPoolName := "HL79051LGenPool"; |
| |
| const EPTF_ExecCtrl_LGenPool_Declarators c_EPTF_ExecCtrl_Test_HL79051_Declarators := { |
| { |
| name := c_EPTF_ExecCtrl_Test_HL79051LGenPoolName, |
| lgenPoolItems := { |
| { |
| hostname := "localhost", |
| num := 2, |
| createFunctionName := "EPTF_ExecCtrl_Test_Functions.f_ExecCtrl_Test_createHL79051LGen" |
| } |
| } |
| } |
| } |
| |
| const EPTF_ExecCtrl_EntityGroup2LGenPool_List c_EPTF_ExecCtrl_HL79051Scenarios_EntityGroup2LGenPool_List := { |
| { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| lgenPoolName := c_EPTF_ExecCtrl_Test_HL79051LGenPoolName |
| } |
| } |
| |
| const EPTF_ExecCtrl_RegulatedItems c_EPTF_ExecCtrl_RegulatedItems_HL79051 := { |
| { |
| idName := { |
| cps_TC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameNormal, |
| tcName := c_EPTF_ExecCtrl_DefaultScenarios_tcNameTc2 |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "RegulatorHL79051" |
| }, |
| { |
| idName := { |
| cps_SC := { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| scName := c_EPTF_ExecCtrl_DefaultScenarios_scNameWeighted |
| } |
| }, |
| weight := 1.0, |
| enabled := true, |
| regulatorName := "RegulatorHL79051" |
| } |
| } |
| |
| // test if when regulator is disabled and CPS is changed on an LGen, the CPS will be overwritten |
| // by mistake by the execCtrl without the regulator target value was updated |
| testcase tc_ExecCtrl_Regulator_Test_HL79051() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("HL79051", true, vl_wndLayout); |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_HL79051_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_HL79051Scenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createHL79051LGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={"RegulatorHL79051"}, |
| pl_EPTF_ExecCtrl_RegulatedItems:=c_EPTF_ExecCtrl_RegulatedItems_HL79051 |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| f_EPTF_ExecCtrl_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| f_EPTF_ExecCtrl_waitForCondition(refers(f_EPTF_ExecCtrl_checkReadyToRun)); |
| timer T_guard, T_alt; |
| setverdict(pass); |
| f_EPTF_ExecCtrl_startAllScenarios(); |
| T_alt.start( 40.0 ); |
| T_alt.timeout; // stop the test after 20 secs |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| } //~group HL79051 |
| |
| group CR_TR00017030 { |
| // do not load modulepars automatically |
| |
| function f_ExecCtrl_Test_CR_TR00017030_loadConfig(in boolean pl_loadModulepars) runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT { |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_HL79051_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_HL79051Scenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createHL79051LGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={"RegulatorHL79051"}, |
| pl_EPTF_ExecCtrl_RegulatedItems:=c_EPTF_ExecCtrl_RegulatedItems_HL79051 |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| } |
| |
| testcase tc_ExecCtrl_Test_CR_TR00017030_DoNotLoadModulepars() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("DoNotLoadModulepars", true, vl_wndLayout); |
| f_ExecCtrl_Test_CR_TR00017030_loadConfig( |
| pl_loadModulepars := false |
| ); |
| |
| f_EPTF_ExecCtrl_init_CT( |
| pl_selfName := f_EPTF_Base_selfName(), |
| pl_nrOfClients := 0, |
| pl_createLGenPools := true, |
| pl_loadModulepars := false, |
| pl_autoStart := true, |
| pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config:checkReadyToRun"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| //f_EPTF_ExecCtrl_startAllScenarios(); |
| // check if modulepars are not loaded: |
| action("tc_ExecCtrl_Test_CR_TR00017030_DoNotLoadModulepars:",f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.grp1.SC.scenario_0.TC.TC0.CurrentCPS")); |
| if (-1!=f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.grp1.SC.scenario_0.TC.TC0.CurrentCPS")) { |
| setverdict(fail,"ExecCtrl module parameters were loaded when loading was disabled."); |
| } else { |
| setverdict(pass); |
| } |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| testcase tc_ExecCtrl_Test_CR_TR00017030_LoadModulepars() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("DoNotLoadModulepars", true, vl_wndLayout); |
| f_ExecCtrl_Test_CR_TR00017030_loadConfig( |
| pl_loadModulepars := true |
| ); |
| |
| f_EPTF_ExecCtrl_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.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{} |
| }; |
| //f_EPTF_ExecCtrl_startAllScenarios(); |
| // check if modulepars are loaded: |
| if (-1==f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.grp1.SC.scenario_0.TC.TC0.CurrentCPS")) { |
| setverdict(fail,"ExecCtrl module parameters were not loaded properly."); |
| } else { |
| setverdict(pass); |
| } |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| } //~group CR_TR00017030 |
| |
| group CR_TR00017092 { |
| |
| const EPTF_ExecCtrl_EntityGroupDistributionTypeList c_EPTF_ExecCtrl_EntityGroupDistributionTypeList := { |
| { |
| eGrpName := c_EPTF_ExecCtrl_DefaultScenarios_eGrpName, |
| lgenWeights := { |
| { |
| lgenName := "LGen0.LGenDefaultPool.localhost", |
| weight := 1.0 |
| }, |
| { |
| lgenName := "LGen1.LGenDefaultPool.localhost", |
| weight := 2.0 |
| }, |
| { |
| lgenName := "LGen2.LGenDefaultPool.localhost", |
| weight := 3.0 |
| }, |
| { |
| lgenName := "LGen3.LGenDefaultPool.localhost", |
| weight := 4.0 |
| } |
| } |
| } |
| } |
| |
| const EPTF_ExecCtrl_LGenPool_Declarators c_EPTF_ExecCtrl_LGenWithLimitedEntitiesLGenPool_Declarators := { |
| { |
| name := c_EPTF_ExecCtrl_Test_defaultLGenPoolName, |
| lgenPoolItems := { |
| { |
| hostname := "localhost", |
| num := 2, |
| createFunctionName := "EPTF_ExecCtrl_Test_Functions.f_ExecCtrl_Test_createLGenWithLimitedEntities" |
| }, |
| { |
| hostname := "localhost", |
| num := 2, |
| createFunctionName := "EPTF_ExecCtrl_Test_Functions.f_EPTF_ExecCtrl_LGenWithUnLimitedEntitiesBehaviour" |
| } |
| } |
| } |
| } |
| |
| // tests if the entities are distributed according to the configured entityDistribution setting |
| testcase tc_ExecCtrl_Test_WeightedEntityGroup() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("SetTargetCPSInAutoOff", true, vl_wndLayout); |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_LGenWithLimitedEntitiesLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={ |
| { |
| name := omit, |
| fn := refers(f_EPTF_ExecCtrl_LGenWithUnLimitedEntitiesBehaviour) |
| }, |
| { |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createLGenWithLimitedEntities) |
| } |
| }, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={}, |
| pl_EPTF_ExecCtrl_RegulatedItems:={}, |
| pl_EPTF_ExecCtrl_EntityGroupDistributionTypeList := c_EPTF_ExecCtrl_EntityGroupDistributionTypeList |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| f_EPTF_ExecCtrl_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.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{} |
| }; |
| |
| // check if the allocated entities on the LGens are correct: |
| var integer vl_eGrpIdx := f_EPTF_ExecCtrl_getEntityGroupIdx(c_EPTF_ExecCtrl_DefaultScenarios_eGrpName); |
| var EPTF_ExecCtrl_EntityGroupDistributionList vl_lgenList := f_EPTF_ExecCtrl_eGrp_lgenList(vl_eGrpIdx); |
| for(var integer lgenIdx:=0; lgenIdx<sizeof(vl_lgenList); lgenIdx:=lgenIdx+1) { |
| var integer vl_lgenIdx := vl_lgenList[lgenIdx].lgenIdx; |
| var charstring vl_lgenName := f_EPTF_ExecCtrl_getLGenName(vl_lgenIdx); |
| |
| var float vl_sumWeight := 0.0; |
| var float vl_lgenWeight := 0.0; |
| for(var integer i:=0; i<sizeof(c_EPTF_ExecCtrl_EntityGroupDistributionTypeList); i:=i+1) { |
| if (c_EPTF_ExecCtrl_EntityGroupDistributionTypeList[i].eGrpName != c_EPTF_ExecCtrl_DefaultScenarios_eGrpName) { |
| continue; // not for the given entity group |
| } |
| for(var integer j:=0; j<sizeof(c_EPTF_ExecCtrl_EntityGroupDistributionTypeList[i].lgenWeights); j:=j+1) { |
| if (c_EPTF_ExecCtrl_EntityGroupDistributionTypeList[i].lgenWeights[j].lgenName==vl_lgenName) { |
| vl_lgenWeight := c_EPTF_ExecCtrl_EntityGroupDistributionTypeList[i].lgenWeights[j].weight; |
| } |
| vl_sumWeight := vl_sumWeight + c_EPTF_ExecCtrl_EntityGroupDistributionTypeList[i].lgenWeights[j].weight; |
| } |
| } |
| if (vl_sumWeight!=0.0) { |
| vl_lgenWeight := vl_lgenWeight/vl_sumWeight; |
| } |
| |
| var integer vl_expectedEntityNum := float2int(vl_lgenWeight*int2float(c_EPTF_ExecCtrl_DefaultScenarios_eGrpSize)); |
| var integer vl_allocatedEntityNum := vl_lgenList[lgenIdx].eCount; |
| |
| if (vl_expectedEntityNum != vl_allocatedEntityNum) { |
| setverdict(fail, "Entity number allocated on LGen "&vl_lgenName&" is incorrect. Expecting "&int2str(vl_expectedEntityNum)&" but got "& |
| int2str(vl_allocatedEntityNum)); |
| f_EPTF_Base_cleanup_CT(); |
| stop; // This line is never reached |
| } |
| } |
| setverdict(pass); |
| //f_EPTF_ExecCtrl_startAllScenarios(); |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| } //~group CR_TR00017092 |
| |
| group LoadConfigAfterInit { |
| |
| function f_ExecCtrl_Test_LoadConfigAfterInit_loadConfig() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT { |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| }, |
| pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}, |
| pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| pl_EPTF_ExecCtrl_RegulatorNames:={c_EPTF_ExecCtrl_DefaultRegulatorName}, |
| pl_EPTF_ExecCtrl_RegulatedItems:=c_EPTF_ExecCtrl_DefaultRegulatedItems |
| ); |
| f_EPTF_ExecCtrl_setManualControl(true); |
| } |
| |
| // tests if config can be loaded after ExecCtrl init |
| testcase tc_ExecCtrl_Test_LoadConfigAfterInit() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("LoadConfigAfterInit", true, vl_wndLayout); |
| |
| f_ExecCtrl_Test_LoadConfigAfterInit_loadConfig(); |
| |
| f_EPTF_ExecCtrl_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| timer T_guard, T_alt; |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config[checkReadyToRun]"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| |
| // start after loadconfig |
| // 2013.04.08. f_EPTF_ExecCtrl_start(pl_createLGenPools := true); |
| |
| f_EPTF_ExecCtrl_startAllScenarios(); |
| |
| // check if modulepars are loaded: |
| var integer vl_idx := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.DefaultEGrp.SC.DefaultSc.TC.DefaultTC2.CurrentCPS"); |
| if (-1==vl_idx) { |
| action("tc_ExecCtrl_Test_LoadConfigAfterInit[",vl_idx,"]"); |
| setverdict(fail,"ExecCtrl module parameters were not loaded."); |
| f_EPTF_Base_stopAll(); |
| } else { |
| action("tc_ExecCtrl_Test_LoadConfigAfterInit[",vl_idx,"]=",f_EPTF_Var_getFloatValue(vl_idx)); |
| T_guard.start( 30.0 ); |
| T_alt.start( 0.0 ); |
| alt { |
| [10.0-f_EPTF_Var_getFloatValue(vl_idx)<0.01] T_alt.timeout { |
| setverdict(pass); |
| } |
| [] T_guard.timeout { |
| setverdict(fail,"Timeout after start: target CPS is not reached in time"); |
| f_EPTF_Base_stopAll(); |
| } |
| } |
| |
| } |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| } //~group LoadConfigAfterInit |
| |
| group LoadConfigFromClient { |
| |
| function f_ExecCtrl_Test_LoadConfigFromClient_loadConfig( in charstring pl_selfName, in EPTF_DataSource_CT pl_dataSource, EPTF_CLI_CT pl_compRef) runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT { |
| f_ExecCtrl_Test_createDefaultLGen("host","comp"); |
| |
| f_EPTF_ExecCtrl_loadConfig( |
| // pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := c_EPTF_ExecCtrl_DefaultScenarios_EGrpList, |
| // pl_EPTF_LGenBase_TcMgmt_Scenarios2GrpList := c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList& |
| // c_EPTF_ExecCtrl_DefaultScenarios_Scenarios2GrpList_scGroups, |
| // pl_EPTF_LGenBase_ScenarioDeclaratorList := {}, |
| // pl_EPTF_LGenBase_tcTypeDeclaratorList := {}, |
| // pl_EPTF_LGenBase_TcMgmt_tcTypeDeclaratorList := {c_EPTF_ExecCtrl_DefaultScenarios_defaultTCType}, |
| // 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_DefaultScenarios_normalScenario,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenario, |
| // c_EPTF_ExecCtrl_DefaultScenarios_normalScenarioInScGrp,c_EPTF_ExecCtrl_DefaultScenarios_weightedScenarioInScGrp |
| // }, |
| // pl_EPTF_ExecCtrl_ScenarioInstanceTypeList:={}, |
| // pl_EPTF_ExecCtrl_LGenPool_Declarators:=c_EPTF_ExecCtrl_Test_defaultLGenPool_Declarators, |
| // pl_EPTF_ExecCtrl_EntityGroup2LGenPool_List:=c_EPTF_ExecCtrl_DefaultScenarios_EntityGroup2LGenPool_List, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createDefaultLGen) |
| }}//, |
| // pl_EPTF_ExecCtrl_PhaseList_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_phases, |
| // pl_EPTF_ExecCtrl_ScenarioGroup_Declarators:=c_EPTF_ExecCtrl_DefaultScenarios_scGroups, |
| // pl_EPTF_ExecCtrl_RegulatorNames:={c_EPTF_ExecCtrl_DefaultRegulatorName}, |
| // pl_EPTF_ExecCtrl_RegulatedItems:=c_EPTF_ExecCtrl_DefaultRegulatedItems |
| ); |
| |
| f_EPTF_ExecCtrl_setManualControl(true); |
| |
| var EPTF_ExecCtrlClient_CT vl_clientComp := EPTF_ExecCtrlClient_CT.create; |
| vl_clientComp.start( f_EPTF_ExecCtrl_LoadConfigFromClient_behaviour("LGen_LoadCfg_"&log2str(vl_clientComp),self) ); |
| } |
| |
| // tests if config can be loaded after ExecCtrl init (CR_TR00017275) |
| testcase tc_ExecCtrl_Test_LoadConfigFromClient() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("LoadConfigFromClient", true, vl_wndLayout); |
| |
| f_EPTF_ExecCtrl_init_CT( |
| pl_selfName := f_EPTF_Base_selfName(), |
| pl_nrOfClients := 2, |
| pl_createLGenPools := true, |
| pl_loadModulepars := false, |
| pl_autoStart := false, |
| pl_dataSource_compRef := self); |
| |
| f_ExecCtrl_Test_LoadConfigFromClient_loadConfig("LoadConfigFromClient", self, self); |
| |
| timer T_guard, T_alt; |
| T_alt.start(10.0); T_alt.timeout; // just to wait if ExecCtrlUIHandler creates an error and to let time for client loadconfigs to arrive |
| |
| // start after loadconfig |
| f_EPTF_ExecCtrl_start(pl_createLGenPools := true); |
| |
| T_guard.start( 100.0 ); |
| T_alt.start( 0.0 ); |
| alt{ |
| [] T_guard.timeout{ |
| setverdict(fail,"Timeout during config:checkReadyToRun"); |
| f_EPTF_Base_stopAll(); |
| } |
| [f_EPTF_ExecCtrl_checkReadyToRun()] T_alt.timeout{} |
| }; |
| |
| f_EPTF_ExecCtrl_startAllScenarios(); |
| |
| // check if modulepars are loaded: |
| var integer vl_idx := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.DefaultEGrp.SC.DefaultSc.TC.DefaultTC2.CurrentCPS"); |
| var integer vl_idx2 := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.LoadedGroup.SC.DefaultSc.TC.DefaultTC2.CurrentCPS"); |
| if (-1==vl_idx or -1==vl_idx2) { |
| setverdict(fail,"ExecCtrl module parameters were not loaded."); |
| // f_EPTF_Base_stopAll(); |
| } else { |
| T_guard.start( 30.0 ); |
| T_alt.start( 0.0 ); |
| alt { |
| [10.0-f_EPTF_Var_getFloatValue(vl_idx)<0.01 and 10.0-f_EPTF_Var_getFloatValue(vl_idx2)<0.01] T_alt.timeout { |
| setverdict(pass); |
| } |
| [] T_guard.timeout { |
| setverdict(fail,"Timeout after start: target CPS is not reached in time"); |
| // f_EPTF_Base_stopAll(); |
| } |
| } |
| |
| } |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| // tests if configuration loaded after start or from LGen pools generates a warning |
| testcase tc_ExecCtrl_Test_Manual_LoadConfigFromClient_Warnings() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT |
| { |
| |
| var charstring vl_wndLayout := c_EPTF_ExecCtrl_Test_defaultMainWindow_str; |
| f_EPTF_UIHandler_CLI_init_CT("LoadConfigFromClient_Warnings", true, vl_wndLayout); |
| |
| f_EPTF_ExecCtrl_init_CT(f_EPTF_Base_selfName(), 0, pl_dataSource_compRef := self); |
| |
| f_ExecCtrl_Test_LoadConfigFromClient_loadConfig(f_EPTF_Base_selfName(), self, self); |
| |
| // load an LGen pool in which loadconfig will be called (to generate warning) |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_ExecCtrl_LGenPool_Declarators:={ |
| { |
| name := "LoadConfigInPool", |
| lgenPoolItems := { |
| { |
| hostname := "localhost", |
| num := 1, |
| createFunctionName := "EPTF_ExecCtrl_Test_Functions.f_ExecCtrl_Test_createLoadConfigLGen" |
| } |
| } |
| } |
| }, |
| pl_EPTF_ExecCtrl_LGenFunction_Entry_List:={{ |
| name := omit, |
| fn := refers(f_ExecCtrl_Test_createLoadConfigLGen) |
| }} |
| ); |
| |
| // create an LGen in which config is loaded after readyTostart: |
| var EPTF_ExecCtrlClient_CT vl_clientComp := EPTF_ExecCtrlClient_CT.create; |
| vl_clientComp.start( f_EPTF_ExecCtrl_LoadConfigFromClientAfterStart_behaviour("LGen_LoadCfgAfterStart_"&log2str(vl_clientComp),self) ); |
| |
| timer T_guard, T_alt; |
| T_alt.start(10.0); T_alt.timeout; // just to wait if ExecCtrlUIHandler creates an error and to let time for client loadconfigs to arrive |
| |
| // start after loadconfig |
| f_EPTF_ExecCtrl_start(pl_createLGenPools := true); |
| |
| // LGen loads config properly, but LGen created after start: LGen was started too late => warning is generated: |
| vl_clientComp := EPTF_ExecCtrlClient_CT.create; |
| vl_clientComp.start( f_EPTF_ExecCtrl_LoadConfigFromClient_behaviour("LGen_LoadCfgTooLate_"&log2str(vl_clientComp),self) ); |
| |
| // this should generate a warning |
| f_EPTF_ExecCtrl_loadConfig( |
| pl_EPTF_LGenBase_TcMgmt_EntityGrpDeclaratorList := {{ |
| name := "EGrpLoadedAfterStart", |
| eType := c_EPTF_ExecCtrl_Test_defaultETypeName, |
| eCount := c_EPTF_ExecCtrl_DefaultScenarios_eGrpSize |
| }} |
| ); |
| |
| T_guard.start( 100.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{} |
| }; |
| f_EPTF_ExecCtrl_startAllScenarios(); |
| |
| // check if modulepars are loaded: |
| var integer vl_idx := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.DefaultEGrp.SC.DefaultSc.TC.DefaultTC2.CurrentCPS"); |
| var integer vl_idx2 := f_EPTF_Var_getId("EPTF_ExecCtrl.Statistics.EG.LoadedGroup.SC.DefaultSc.TC.DefaultTC2.CurrentCPS"); |
| if (-1==vl_idx or -1==vl_idx2) { |
| setverdict(fail,"ExecCtrl module parameters were not loaded."); |
| } else { |
| T_guard.start( 30.0 ); |
| T_alt.start( 0.0 ); |
| alt { |
| [10.0-f_EPTF_Var_getFloatValue(vl_idx)<0.01 and 10.0-f_EPTF_Var_getFloatValue(vl_idx2)<0.01] T_alt.timeout { |
| setverdict(pass); |
| } |
| [] T_guard.timeout { |
| setverdict(fail,"Timeout after start: target CPS is not reached in time"); |
| f_EPTF_Base_stopAll(); |
| } |
| } |
| |
| } |
| //f_EPTF_Base_wait4Shutdown(); |
| f_EPTF_Base_cleanup_CT(); |
| } |
| |
| } //~group LoadConfigFromClient |
| |
| testcase tc_ExecCtrl_Test_wrongTimeProfileName() runs on ExecCtrl_Regulator_Test_SetTargetCPSInAutoOff_Main_CT{ |
| f_EPTF_ExecCtrl_loadConfig(pl_EPTF_ExecCtrl_TimeProfile2TcList := {{ |
|