Loading BTP/LibItsBtp_Functions.ttcn +105 −8 Original line number Diff line number Diff line Loading @@ -13,18 +13,115 @@ import from LibCommon_VerdictControl all; // LibIts import from LibIts_Interface all; import from LibItsCommon_Functions all; import from LibItsBtp_TestSystem all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Templates all; import from LibItsBtp_Pixits all; import from LibItsCommon_Functions all; group utFuntions { /** * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsBtp { utPort.send(p_init); tc_wait.start; alt { [] utPort.receive(UtResult:true) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } [] utPort.receive { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] tc_wait.timeout { log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } [else] { // Shortcut defaults repeat; } } } /** * @desc Triggers event from the application layer * @param p_event The event to trigger. */ function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsBtp { var template (value) UtTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); alt { [] utPort.receive(UtResult:true) { tc_wait.stop; } [] utPort.receive { tc_wait.stop; } [] tc_wait.timeout { } [else] { // Shortcut defaults repeat; } } } /** * @desc Checks that the event was indicated at the application layer * @param p_event The event to check. * @param p_discard The event should not appear. Default value: FALSE. */ function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsBtp { var template (value) UtCheck v_utMsg := { p_event }; utPort.send(v_utMsg); tc_wait.start; alt { [] utPort.receive(UtResult:true) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***"); } else { log("*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***"); f_selfOrClientSyncAndVerdict("error", e_error); } } [] utPort.receive(UtResult:false) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***"); f_selfOrClientSyncAndVerdict("error", e_error); } else { log("*** f_utCheckEvent: INFO: Event not indicated at application layer***"); } } [] tc_wait.timeout { log("*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } [else] { // Shortcut defaults repeat; } } } } // End of group utFunctions group configurationFunctions { /** * @desc Setups default configuration */ function f_cfUp() runs on ItsNt { function f_cfUp() runs on ItsBtp { map(self:utPort, system:utPort); map(self:btpPort, system:btpPort); Loading @@ -35,7 +132,7 @@ /** * @desc Deletes default configuration */ function f_cfDown() runs on ItsNt { function f_cfDown() runs on ItsBtp { unmap(self:utPort, system:utPort); unmap(self:btpPort, system:btpPort); Loading @@ -50,7 +147,7 @@ /** * @desc The base default. */ altstep a_default() runs on ItsNt { altstep a_default() runs on ItsBtp { [] btpPort.receive { log("*** a_default: ERROR: Received an unexpected message ***"); Loading Loading @@ -78,14 +175,14 @@ /** * @desc The default preamble. */ function f_prDefault() runs on ItsNt { function f_prDefault() runs on ItsBtp { activate(a_default()); } /** * @desc Brings the IUT into an initial state. */ function f_prInitialState() runs on ItsNt { function f_prInitialState() runs on ItsBtp { f_utInitializeIut(m_btpInitialize); f_prDefault(); Loading @@ -100,7 +197,7 @@ /** * @desc The default postamble. */ function f_poDefault() runs on ItsNt { function f_poDefault() runs on ItsBtp { //empty } Loading BTP/LibItsBtp_Pixits.ttcn +0 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ module LibItsBtp_Pixits { // LibIts import from LibIts_Interface all; import from LibItsBtp_TypesAndValues all; Loading BTP/LibItsBtp_Templates.ttcn +1 −2 Original line number Diff line number Diff line Loading @@ -8,10 +8,9 @@ module LibItsBtp_Templates { // LibIts import from LibIts_Interface all; import from LibItsBtp_TestSystem all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Pixits all; import from LibItsCommon_TypesAndValues all; group btpPrimitivesTemplates { Loading BTP/LibItsBtp_TypesAndValues.ttcn +40 −1 Original line number Diff line number Diff line Loading @@ -98,6 +98,45 @@ module LibItsBtp_TypesAndValues { group utPrimitives { group utCommonPrimitives { /** * @desc Upper Tester message to initialize IUT */ type union UtInitialize { UtBtpInitialize utBtpInitialize } /** * @desc Upper Tester message describing an action/event */ type union UtEvent { UtBtpEvent utBtpEvent } /** * @desc Upper Tester message to trigger an action on IUT */ type record UtTrigger { UtEvent utEvent } /** * @desc Upper Tester message to check event/status on IUT */ type record UtCheck { UtEvent utEvent } /** * @desc Upper Tester response message */ type boolean UtResult; } with { encode "LibItsCommon_TypesAndValues" } /** * @desc Upper Tester message to initialize BTP IUT */ Loading CAM/LibItsCam_Functions.ttcn +104 −11 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ * @author ETSI / STF405 * @version $URL$ * $Id$ * @desc Module containing common functions for ITS * @desc Module containing common functions for ITS CAM * */ module LibItsCam_Functions { Loading @@ -12,8 +12,7 @@ module LibItsCam_Functions { import from LibCommon_VerdictControl all; // LibIts import from LibIts_TestSystem all; import from LibIts_Interface all; import from LibItsCam_TestSystem all; import from LibItsCam_Templates all; import from LibItsCam_Pixits all; import from LibItsCam_TypesAndValues all; Loading @@ -21,15 +20,109 @@ module LibItsCam_Functions { import from CAM_PDU_Descriptions language "ASN.1:1997" all; import from DENM_PDU_Descriptions language "ASN.1:1997" all; // LibCommon import from LibCommon_VerdictControl all; group utFuntions { /** * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsCam { utPort.send(p_init); tc_wait.start; alt { [] utPort.receive(UtResult:true) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } [] utPort.receive { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] tc_wait.timeout { log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } [else] { // Shortcut defaults repeat; } } } /** * @desc Triggers event from the application layer * @param p_event The event to trigger. */ function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsCam { var template (value) UtTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); alt { [] utPort.receive(UtResult:true) { tc_wait.stop; } [] utPort.receive { tc_wait.stop; } [] tc_wait.timeout { } [else] { // Shortcut defaults repeat; } } } /** * @desc Checks that the event was indicated at the application layer * @param p_event The event to check. * @param p_discard The event should not appear. Default value: FALSE. */ function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsCam { var template (value) UtCheck v_utMsg := { p_event }; utPort.send(v_utMsg); tc_wait.start; alt { [] utPort.receive(UtResult:true) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***"); } else { log("*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***"); f_selfOrClientSyncAndVerdict("error", e_error); } } [] utPort.receive(UtResult:false) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***"); f_selfOrClientSyncAndVerdict("error", e_error); } else { log("*** f_utCheckEvent: INFO: Event not indicated at application layer***"); } } [] tc_wait.timeout { log("*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } [else] { // Shortcut defaults repeat; } } } } // End of group utFunctions group camConfigurationFunctions { /** * @desc Setups default configuration */ function f_cfUp() runs on ItsFa { function f_cfUp() runs on ItsCam { map(self:utPort, system:utPort); map(self:camPort, system:camPort); Loading @@ -40,7 +133,7 @@ module LibItsCam_Functions { /** * @desc Deletes default configuration */ function f_cfDown() runs on ItsFa { function f_cfDown() runs on ItsCam { unmap(self:utPort, system:utPort); unmap(self:camPort, system:camPort); Loading @@ -55,7 +148,7 @@ module LibItsCam_Functions { /** * @desc basic default behaviour handling */ altstep a_default() runs on ItsFa { altstep a_default() runs on ItsCam { [] camPort.receive(mw_camInd ( mw_camMsg_any )){ log("*** a_default: INFO: CAM message received in default ***"); Loading Loading @@ -88,7 +181,7 @@ module LibItsCam_Functions { * @desc Initialize the IUT * @remark No specific actions specified in the base standard */ function f_prInitialState() runs on ItsFa { function f_prInitialState() runs on ItsCam { f_utInitializeIut(m_camInitialize); Loading @@ -104,7 +197,7 @@ module LibItsCam_Functions { /** * @desc The default postamble. */ function f_poDefault() runs on ItsFa { function f_poDefault() runs on ItsCam { //empty } Loading Loading
BTP/LibItsBtp_Functions.ttcn +105 −8 Original line number Diff line number Diff line Loading @@ -13,18 +13,115 @@ import from LibCommon_VerdictControl all; // LibIts import from LibIts_Interface all; import from LibItsCommon_Functions all; import from LibItsBtp_TestSystem all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Templates all; import from LibItsBtp_Pixits all; import from LibItsCommon_Functions all; group utFuntions { /** * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsBtp { utPort.send(p_init); tc_wait.start; alt { [] utPort.receive(UtResult:true) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } [] utPort.receive { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] tc_wait.timeout { log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } [else] { // Shortcut defaults repeat; } } } /** * @desc Triggers event from the application layer * @param p_event The event to trigger. */ function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsBtp { var template (value) UtTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); alt { [] utPort.receive(UtResult:true) { tc_wait.stop; } [] utPort.receive { tc_wait.stop; } [] tc_wait.timeout { } [else] { // Shortcut defaults repeat; } } } /** * @desc Checks that the event was indicated at the application layer * @param p_event The event to check. * @param p_discard The event should not appear. Default value: FALSE. */ function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsBtp { var template (value) UtCheck v_utMsg := { p_event }; utPort.send(v_utMsg); tc_wait.start; alt { [] utPort.receive(UtResult:true) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***"); } else { log("*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***"); f_selfOrClientSyncAndVerdict("error", e_error); } } [] utPort.receive(UtResult:false) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***"); f_selfOrClientSyncAndVerdict("error", e_error); } else { log("*** f_utCheckEvent: INFO: Event not indicated at application layer***"); } } [] tc_wait.timeout { log("*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } [else] { // Shortcut defaults repeat; } } } } // End of group utFunctions group configurationFunctions { /** * @desc Setups default configuration */ function f_cfUp() runs on ItsNt { function f_cfUp() runs on ItsBtp { map(self:utPort, system:utPort); map(self:btpPort, system:btpPort); Loading @@ -35,7 +132,7 @@ /** * @desc Deletes default configuration */ function f_cfDown() runs on ItsNt { function f_cfDown() runs on ItsBtp { unmap(self:utPort, system:utPort); unmap(self:btpPort, system:btpPort); Loading @@ -50,7 +147,7 @@ /** * @desc The base default. */ altstep a_default() runs on ItsNt { altstep a_default() runs on ItsBtp { [] btpPort.receive { log("*** a_default: ERROR: Received an unexpected message ***"); Loading Loading @@ -78,14 +175,14 @@ /** * @desc The default preamble. */ function f_prDefault() runs on ItsNt { function f_prDefault() runs on ItsBtp { activate(a_default()); } /** * @desc Brings the IUT into an initial state. */ function f_prInitialState() runs on ItsNt { function f_prInitialState() runs on ItsBtp { f_utInitializeIut(m_btpInitialize); f_prDefault(); Loading @@ -100,7 +197,7 @@ /** * @desc The default postamble. */ function f_poDefault() runs on ItsNt { function f_poDefault() runs on ItsBtp { //empty } Loading
BTP/LibItsBtp_Pixits.ttcn +0 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,6 @@ module LibItsBtp_Pixits { // LibIts import from LibIts_Interface all; import from LibItsBtp_TypesAndValues all; Loading
BTP/LibItsBtp_Templates.ttcn +1 −2 Original line number Diff line number Diff line Loading @@ -8,10 +8,9 @@ module LibItsBtp_Templates { // LibIts import from LibIts_Interface all; import from LibItsBtp_TestSystem all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Pixits all; import from LibItsCommon_TypesAndValues all; group btpPrimitivesTemplates { Loading
BTP/LibItsBtp_TypesAndValues.ttcn +40 −1 Original line number Diff line number Diff line Loading @@ -98,6 +98,45 @@ module LibItsBtp_TypesAndValues { group utPrimitives { group utCommonPrimitives { /** * @desc Upper Tester message to initialize IUT */ type union UtInitialize { UtBtpInitialize utBtpInitialize } /** * @desc Upper Tester message describing an action/event */ type union UtEvent { UtBtpEvent utBtpEvent } /** * @desc Upper Tester message to trigger an action on IUT */ type record UtTrigger { UtEvent utEvent } /** * @desc Upper Tester message to check event/status on IUT */ type record UtCheck { UtEvent utEvent } /** * @desc Upper Tester response message */ type boolean UtResult; } with { encode "LibItsCommon_TypesAndValues" } /** * @desc Upper Tester message to initialize BTP IUT */ Loading
CAM/LibItsCam_Functions.ttcn +104 −11 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ * @author ETSI / STF405 * @version $URL$ * $Id$ * @desc Module containing common functions for ITS * @desc Module containing common functions for ITS CAM * */ module LibItsCam_Functions { Loading @@ -12,8 +12,7 @@ module LibItsCam_Functions { import from LibCommon_VerdictControl all; // LibIts import from LibIts_TestSystem all; import from LibIts_Interface all; import from LibItsCam_TestSystem all; import from LibItsCam_Templates all; import from LibItsCam_Pixits all; import from LibItsCam_TypesAndValues all; Loading @@ -21,15 +20,109 @@ module LibItsCam_Functions { import from CAM_PDU_Descriptions language "ASN.1:1997" all; import from DENM_PDU_Descriptions language "ASN.1:1997" all; // LibCommon import from LibCommon_VerdictControl all; group utFuntions { /** * @desc Requests to bring the IUT in an initial state * @param p_init The initialisation to trigger. */ function f_utInitializeIut(template (value) UtInitialize p_init) runs on ItsCam { utPort.send(p_init); tc_wait.start; alt { [] utPort.receive(UtResult:true) { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); } [] utPort.receive { tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT could not be initialized ***"); f_selfOrClientSyncAndVerdict("error", e_error); } [] tc_wait.timeout { log("*** f_utInitializeIut: INFO: IUT could not be initialized in time ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } [else] { // Shortcut defaults repeat; } } } /** * @desc Triggers event from the application layer * @param p_event The event to trigger. */ function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsCam { var template (value) UtTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); alt { [] utPort.receive(UtResult:true) { tc_wait.stop; } [] utPort.receive { tc_wait.stop; } [] tc_wait.timeout { } [else] { // Shortcut defaults repeat; } } } /** * @desc Checks that the event was indicated at the application layer * @param p_event The event to check. * @param p_discard The event should not appear. Default value: FALSE. */ function f_utCheckEvent(template (value) UtEvent p_event, boolean p_discard) runs on ItsCam { var template (value) UtCheck v_utMsg := { p_event }; utPort.send(v_utMsg); tc_wait.start; alt { [] utPort.receive(UtResult:true) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: INFO: Event correctly indicated at application layer ***"); } else { log("*** f_utCheckEvent: ERROR: Event indicated at application layer where it should be discarded ***"); f_selfOrClientSyncAndVerdict("error", e_error); } } [] utPort.receive(UtResult:false) { tc_wait.stop; if (p_discard == false) { log("*** f_utCheckEvent: ERROR: Event not correctly indicated at application layer ***"); f_selfOrClientSyncAndVerdict("error", e_error); } else { log("*** f_utCheckEvent: INFO: Event not indicated at application layer***"); } } [] tc_wait.timeout { log("*** f_utCheckEvent: ERROR: Timeout while waiting for event check result ***"); f_selfOrClientSyncAndVerdict("error", e_timeout); } [else] { // Shortcut defaults repeat; } } } } // End of group utFunctions group camConfigurationFunctions { /** * @desc Setups default configuration */ function f_cfUp() runs on ItsFa { function f_cfUp() runs on ItsCam { map(self:utPort, system:utPort); map(self:camPort, system:camPort); Loading @@ -40,7 +133,7 @@ module LibItsCam_Functions { /** * @desc Deletes default configuration */ function f_cfDown() runs on ItsFa { function f_cfDown() runs on ItsCam { unmap(self:utPort, system:utPort); unmap(self:camPort, system:camPort); Loading @@ -55,7 +148,7 @@ module LibItsCam_Functions { /** * @desc basic default behaviour handling */ altstep a_default() runs on ItsFa { altstep a_default() runs on ItsCam { [] camPort.receive(mw_camInd ( mw_camMsg_any )){ log("*** a_default: INFO: CAM message received in default ***"); Loading Loading @@ -88,7 +181,7 @@ module LibItsCam_Functions { * @desc Initialize the IUT * @remark No specific actions specified in the base standard */ function f_prInitialState() runs on ItsFa { function f_prInitialState() runs on ItsCam { f_utInitializeIut(m_camInitialize); Loading @@ -104,7 +197,7 @@ module LibItsCam_Functions { /** * @desc The default postamble. */ function f_poDefault() runs on ItsFa { function f_poDefault() runs on ItsCam { //empty } Loading