Loading ttcn/BTP/LibItsBtp_Functions.ttcn +37 −55 Original line number Original line Diff line number Diff line Loading @@ -10,10 +10,14 @@ // LibCommon // LibCommon import from LibCommon_Sync all; import from LibCommon_Sync all; import from LibCommon_Time all; import from LibCommon_VerdictControl all; import from LibCommon_VerdictControl all; // LibIts // LibItsCommon import from LibItsCommon_Functions all; import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; // LibItsBtp import from LibItsBtp_TestSystem all; import from LibItsBtp_TestSystem all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Templates all; import from LibItsBtp_Templates all; Loading @@ -30,7 +34,7 @@ utPort.send(p_init); utPort.send(p_init); tc_wait.start; tc_wait.start; alt { alt { [] utPort.receive(UtResult:true) { [] utPort.receive(UtInitializeResult:true) { tc_wait.stop; tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); log("*** f_utInitializeIut: INFO: IUT initialized ***"); } } Loading @@ -44,6 +48,7 @@ f_selfOrClientSyncAndVerdict("error", e_timeout); f_selfOrClientSyncAndVerdict("error", e_timeout); } } [else] { // Shortcut defaults [else] { // Shortcut defaults //f_sleep(0.050); // 50 ms repeat; repeat; } } } } Loading @@ -54,12 +59,11 @@ * @desc Triggers event from the application layer * @desc Triggers event from the application layer * @param p_event The event to trigger. * @param p_event The event to trigger. */ */ function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsBtp { function f_utTriggerEvent(template (value) UtBtpTrigger p_event) runs on ItsBtp { var template (value) UtTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); utPort.send(p_event); alt { alt { [] utPort.receive(UtResult:true) { [] utPort.receive(UtBtpTriggerResult:true) { tc_wait.stop; tc_wait.stop; } } [] utPort.receive { [] utPort.receive { Loading @@ -68,47 +72,7 @@ [] tc_wait.timeout { [] tc_wait.timeout { } } [else] { // Shortcut defaults [else] { // Shortcut defaults repeat; //f_sleep(0.050); // 50 ms } } } /** * @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; repeat; } } } } Loading Loading @@ -168,6 +132,23 @@ stop; stop; } } } } /** * @desc The default for handling upper tester messages. */ altstep a_utDefault() runs on ItsBtp { var UtBtpEventInd v_ind; [] utPort.receive(UtBtpEventInd:?) -> value v_ind { //store every upper tester indication received vc_utEvents[lengthof(vc_utEvents)] := v_ind; repeat; } [] utPort.receive { log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); repeat; } } } //end btpAltsteps } //end btpAltsteps group preambles { group preambles { Loading @@ -177,6 +158,7 @@ */ */ function f_prDefault() runs on ItsBtp { function f_prDefault() runs on ItsBtp { activate(a_default()); activate(a_default()); activate(a_utDefault()); } } /** /** Loading ttcn/BTP/LibItsBtp_Templates.ttcn +38 −48 Original line number Original line Diff line number Diff line Loading @@ -11,6 +11,7 @@ module LibItsBtp_Templates { import from LibItsBtp_TestSystem all; import from LibItsBtp_TestSystem all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Pixits all; import from LibItsBtp_Pixits all; import from LibItsCommon_TypesAndValues all; group btpPrimitivesTemplates { group btpPrimitivesTemplates { Loading Loading @@ -40,8 +41,7 @@ module LibItsBtp_Templates { * @desc Initializes the BTP IUT. * @desc Initializes the BTP IUT. */ */ template (value) UtInitialize m_btpInitialize := { template (value) UtInitialize m_btpInitialize := { utBtpInitialize := { hashedId8 := '0000000000000000'O } } } /** /** Loading @@ -49,9 +49,9 @@ module LibItsBtp_Templates { * @param p_destPort The destination port * @param p_destPort The destination port * @param p_srcPort The source port * @param p_srcPort The source port */ */ template (value) UtEvent m_generateBtpA(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { template (value) UtBtpTrigger m_generateBtpA(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { utBtpEvent := { btpA := { btpA := { btpAHeader := { destinationPort := p_destPort, destinationPort := p_destPort, sourcePort := p_srcPort sourcePort := p_srcPort } } Loading @@ -63,25 +63,15 @@ module LibItsBtp_Templates { * @param p_destPort The destination port * @param p_destPort The destination port * @param p_destPortInfo The destination port information * @param p_destPortInfo The destination port information */ */ template (value) UtEvent m_generateBtpB(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { template (value) UtBtpTrigger m_generateBtpB(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { utBtpEvent := { btpB := { btpB := { btpBHeader := { destinationPort := p_destPort, destinationPort := p_destPort, destinationPortInfo := p_destPortInfo destinationPortInfo := p_destPortInfo } } } } } } /** * @desc Upper Tester template for checking that BTP payload has been transmitted to upper layer * @param p_payload Payload to be checked */ template (value) UtEvent m_checkPayload(in BtpPayload p_payload) := { utBtpEvent := { payload := p_payload } } } // end utPrimitives } // end utPrimitives } // btpPrimitivesTemplates } // btpPrimitivesTemplates Loading ttcn/BTP/LibItsBtp_TestSystem.ttcn +5 −2 Original line number Original line Diff line number Diff line Loading @@ -13,6 +13,7 @@ module LibItsBtp_TestSystem { // LibIts // LibIts import from LibItsCommon_TestSystem all; import from LibItsCommon_TestSystem all; import from LibItsCommon_TypesAndValues all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_TypesAndValues all; group portDefinitions { group portDefinitions { Loading @@ -22,9 +23,9 @@ module LibItsBtp_TestSystem { */ */ type port UpperTesterPort message { type port UpperTesterPort message { out out UtInitialize, UtTrigger, UtCheck; UtInitialize, UtBtpTrigger; in in UtResult; UtInitializeResult, UtBtpTriggerResult, UtBtpEventInd; } // end UpperTesterPort } // end UpperTesterPort } // end portDefinitions } // end portDefinitions Loading Loading @@ -77,6 +78,8 @@ module LibItsBtp_TestSystem { // timers // timers var UtBtpEventIndList vc_utEvents := {}; } // End of component ItsBtp } // End of component ItsBtp group networkAndTransportPrimitives { group networkAndTransportPrimitives { Loading ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +25 −31 Original line number Original line Diff line number Diff line Loading @@ -117,58 +117,52 @@ module LibItsBtp_TypesAndValues { group utCommonPrimitives { group utCommonPrimitives { /** /** * @desc Upper Tester message to initialize IUT * @desc UT primitives for BTP * @member btpA - * @member btpB - */ */ type union UtInitialize { type union UtBtpTrigger { UtBtpInitialize utBtpInitialize GenerateBtpA btpA, GenerateBtpB btpB } } /** type boolean UtBtpTriggerResult; * @desc Upper Tester message describing an action/event */ type union UtEvent { UtBtpEvent utBtpEvent } /** /** * @desc Upper Tester message to trigger an action on IUT * @desc Upper Tester message to request triggering of an BTPA message at IUT */ */ type record UtTrigger { type record GenerateBtpA { UtEvent utEvent BtpAHeader btpAHeader } } /** /** * @desc Upper Tester message to check event/status on IUT * @desc Upper Tester message to request triggering of an BTPB message at IUT */ */ type record UtCheck { type record GenerateBtpB { UtEvent utEvent BtpBHeader btpBHeader } } /** /** * @desc Upper Tester response message * @desc Upper Tester message to check event/status on BTP IUT */ */ type boolean UtResult; type record UtBtpEventInd { } BtpRawPayload rawPayload with { encode "LibItsCommon" } } /** /** * @desc Upper Tester message to initialize BTP IUT * @desc List of Upper Tester messages to check event/status on CAM IUT */ */ type record UtBtpInitialize { type record of UtBtpEventInd UtBtpEventIndList; } } // with { // encode "LibItsCommon" // } /** * @desc Upper Tester message generating BTP packet */ type union UtBtpEvent { BtpAHeader btpA, BtpBHeader btpB, BtpPayload payload } } // end utPrimitives } // end utPrimitives with { encode "UpperTester" } } } with { with { Loading ttcn/CALM/ATSP/LibItsAtsp_Functions.ttcn3 +3 −1 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,7 @@ module LibItsAtsp_Functions { type FncRetCode type FncRetCode }; }; import from LibCommon_Time { import from LibCommon_Time { function f_sleepIgnoreDef function f_sleep, f_sleepIgnoreDef }; }; import from LibCommon_BasicTypesAndValues { import from LibCommon_BasicTypesAndValues { type UInt6, UInt8 type UInt6, UInt8 Loading Loading @@ -99,6 +99,7 @@ module LibItsAtsp_Functions { f_selfOrClientSyncAndVerdict("error", e_timeout); f_selfOrClientSyncAndVerdict("error", e_timeout); } } [else] { // Shortcut defaults [else] { // Shortcut defaults //f_sleep(0.050); // 50 ms repeat; repeat; } } } // End of 'alt' statement } // End of 'alt' statement Loading Loading @@ -210,6 +211,7 @@ module LibItsAtsp_Functions { f_selfOrClientSyncAndVerdict("error", e_timeout); f_selfOrClientSyncAndVerdict("error", e_timeout); } } [else] { // Shortcut defaults [else] { // Shortcut defaults //f_sleep(0.050); // 50 ms repeat; repeat; } } } // End of 'alt' statement } // End of 'alt' statement Loading Loading
ttcn/BTP/LibItsBtp_Functions.ttcn +37 −55 Original line number Original line Diff line number Diff line Loading @@ -10,10 +10,14 @@ // LibCommon // LibCommon import from LibCommon_Sync all; import from LibCommon_Sync all; import from LibCommon_Time all; import from LibCommon_VerdictControl all; import from LibCommon_VerdictControl all; // LibIts // LibItsCommon import from LibItsCommon_Functions all; import from LibItsCommon_Functions all; import from LibItsCommon_TypesAndValues all; // LibItsBtp import from LibItsBtp_TestSystem all; import from LibItsBtp_TestSystem all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Templates all; import from LibItsBtp_Templates all; Loading @@ -30,7 +34,7 @@ utPort.send(p_init); utPort.send(p_init); tc_wait.start; tc_wait.start; alt { alt { [] utPort.receive(UtResult:true) { [] utPort.receive(UtInitializeResult:true) { tc_wait.stop; tc_wait.stop; log("*** f_utInitializeIut: INFO: IUT initialized ***"); log("*** f_utInitializeIut: INFO: IUT initialized ***"); } } Loading @@ -44,6 +48,7 @@ f_selfOrClientSyncAndVerdict("error", e_timeout); f_selfOrClientSyncAndVerdict("error", e_timeout); } } [else] { // Shortcut defaults [else] { // Shortcut defaults //f_sleep(0.050); // 50 ms repeat; repeat; } } } } Loading @@ -54,12 +59,11 @@ * @desc Triggers event from the application layer * @desc Triggers event from the application layer * @param p_event The event to trigger. * @param p_event The event to trigger. */ */ function f_utTriggerEvent(template (value) UtEvent p_event) runs on ItsBtp { function f_utTriggerEvent(template (value) UtBtpTrigger p_event) runs on ItsBtp { var template (value) UtTrigger v_utMsg := { p_event }; utPort.send(v_utMsg); utPort.send(p_event); alt { alt { [] utPort.receive(UtResult:true) { [] utPort.receive(UtBtpTriggerResult:true) { tc_wait.stop; tc_wait.stop; } } [] utPort.receive { [] utPort.receive { Loading @@ -68,47 +72,7 @@ [] tc_wait.timeout { [] tc_wait.timeout { } } [else] { // Shortcut defaults [else] { // Shortcut defaults repeat; //f_sleep(0.050); // 50 ms } } } /** * @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; repeat; } } } } Loading Loading @@ -168,6 +132,23 @@ stop; stop; } } } } /** * @desc The default for handling upper tester messages. */ altstep a_utDefault() runs on ItsBtp { var UtBtpEventInd v_ind; [] utPort.receive(UtBtpEventInd:?) -> value v_ind { //store every upper tester indication received vc_utEvents[lengthof(vc_utEvents)] := v_ind; repeat; } [] utPort.receive { log("*** " & testcasename() & ": INFO: Received unhandled/unknown UT message from IUT ***"); repeat; } } } //end btpAltsteps } //end btpAltsteps group preambles { group preambles { Loading @@ -177,6 +158,7 @@ */ */ function f_prDefault() runs on ItsBtp { function f_prDefault() runs on ItsBtp { activate(a_default()); activate(a_default()); activate(a_utDefault()); } } /** /** Loading
ttcn/BTP/LibItsBtp_Templates.ttcn +38 −48 Original line number Original line Diff line number Diff line Loading @@ -11,6 +11,7 @@ module LibItsBtp_Templates { import from LibItsBtp_TestSystem all; import from LibItsBtp_TestSystem all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_Pixits all; import from LibItsBtp_Pixits all; import from LibItsCommon_TypesAndValues all; group btpPrimitivesTemplates { group btpPrimitivesTemplates { Loading Loading @@ -40,8 +41,7 @@ module LibItsBtp_Templates { * @desc Initializes the BTP IUT. * @desc Initializes the BTP IUT. */ */ template (value) UtInitialize m_btpInitialize := { template (value) UtInitialize m_btpInitialize := { utBtpInitialize := { hashedId8 := '0000000000000000'O } } } /** /** Loading @@ -49,9 +49,9 @@ module LibItsBtp_Templates { * @param p_destPort The destination port * @param p_destPort The destination port * @param p_srcPort The source port * @param p_srcPort The source port */ */ template (value) UtEvent m_generateBtpA(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { template (value) UtBtpTrigger m_generateBtpA(in BtpPortId p_destPort, in BtpPortId p_srcPort) := { utBtpEvent := { btpA := { btpA := { btpAHeader := { destinationPort := p_destPort, destinationPort := p_destPort, sourcePort := p_srcPort sourcePort := p_srcPort } } Loading @@ -63,25 +63,15 @@ module LibItsBtp_Templates { * @param p_destPort The destination port * @param p_destPort The destination port * @param p_destPortInfo The destination port information * @param p_destPortInfo The destination port information */ */ template (value) UtEvent m_generateBtpB(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { template (value) UtBtpTrigger m_generateBtpB(in BtpPortId p_destPort, in BtpPortInfo p_destPortInfo) := { utBtpEvent := { btpB := { btpB := { btpBHeader := { destinationPort := p_destPort, destinationPort := p_destPort, destinationPortInfo := p_destPortInfo destinationPortInfo := p_destPortInfo } } } } } } /** * @desc Upper Tester template for checking that BTP payload has been transmitted to upper layer * @param p_payload Payload to be checked */ template (value) UtEvent m_checkPayload(in BtpPayload p_payload) := { utBtpEvent := { payload := p_payload } } } // end utPrimitives } // end utPrimitives } // btpPrimitivesTemplates } // btpPrimitivesTemplates Loading
ttcn/BTP/LibItsBtp_TestSystem.ttcn +5 −2 Original line number Original line Diff line number Diff line Loading @@ -13,6 +13,7 @@ module LibItsBtp_TestSystem { // LibIts // LibIts import from LibItsCommon_TestSystem all; import from LibItsCommon_TestSystem all; import from LibItsCommon_TypesAndValues all; import from LibItsBtp_TypesAndValues all; import from LibItsBtp_TypesAndValues all; group portDefinitions { group portDefinitions { Loading @@ -22,9 +23,9 @@ module LibItsBtp_TestSystem { */ */ type port UpperTesterPort message { type port UpperTesterPort message { out out UtInitialize, UtTrigger, UtCheck; UtInitialize, UtBtpTrigger; in in UtResult; UtInitializeResult, UtBtpTriggerResult, UtBtpEventInd; } // end UpperTesterPort } // end UpperTesterPort } // end portDefinitions } // end portDefinitions Loading Loading @@ -77,6 +78,8 @@ module LibItsBtp_TestSystem { // timers // timers var UtBtpEventIndList vc_utEvents := {}; } // End of component ItsBtp } // End of component ItsBtp group networkAndTransportPrimitives { group networkAndTransportPrimitives { Loading
ttcn/BTP/LibItsBtp_TypesAndValues.ttcn +25 −31 Original line number Original line Diff line number Diff line Loading @@ -117,58 +117,52 @@ module LibItsBtp_TypesAndValues { group utCommonPrimitives { group utCommonPrimitives { /** /** * @desc Upper Tester message to initialize IUT * @desc UT primitives for BTP * @member btpA - * @member btpB - */ */ type union UtInitialize { type union UtBtpTrigger { UtBtpInitialize utBtpInitialize GenerateBtpA btpA, GenerateBtpB btpB } } /** type boolean UtBtpTriggerResult; * @desc Upper Tester message describing an action/event */ type union UtEvent { UtBtpEvent utBtpEvent } /** /** * @desc Upper Tester message to trigger an action on IUT * @desc Upper Tester message to request triggering of an BTPA message at IUT */ */ type record UtTrigger { type record GenerateBtpA { UtEvent utEvent BtpAHeader btpAHeader } } /** /** * @desc Upper Tester message to check event/status on IUT * @desc Upper Tester message to request triggering of an BTPB message at IUT */ */ type record UtCheck { type record GenerateBtpB { UtEvent utEvent BtpBHeader btpBHeader } } /** /** * @desc Upper Tester response message * @desc Upper Tester message to check event/status on BTP IUT */ */ type boolean UtResult; type record UtBtpEventInd { } BtpRawPayload rawPayload with { encode "LibItsCommon" } } /** /** * @desc Upper Tester message to initialize BTP IUT * @desc List of Upper Tester messages to check event/status on CAM IUT */ */ type record UtBtpInitialize { type record of UtBtpEventInd UtBtpEventIndList; } } // with { // encode "LibItsCommon" // } /** * @desc Upper Tester message generating BTP packet */ type union UtBtpEvent { BtpAHeader btpA, BtpBHeader btpB, BtpPayload payload } } // end utPrimitives } // end utPrimitives with { encode "UpperTester" } } } with { with { Loading
ttcn/CALM/ATSP/LibItsAtsp_Functions.ttcn3 +3 −1 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,7 @@ module LibItsAtsp_Functions { type FncRetCode type FncRetCode }; }; import from LibCommon_Time { import from LibCommon_Time { function f_sleepIgnoreDef function f_sleep, f_sleepIgnoreDef }; }; import from LibCommon_BasicTypesAndValues { import from LibCommon_BasicTypesAndValues { type UInt6, UInt8 type UInt6, UInt8 Loading Loading @@ -99,6 +99,7 @@ module LibItsAtsp_Functions { f_selfOrClientSyncAndVerdict("error", e_timeout); f_selfOrClientSyncAndVerdict("error", e_timeout); } } [else] { // Shortcut defaults [else] { // Shortcut defaults //f_sleep(0.050); // 50 ms repeat; repeat; } } } // End of 'alt' statement } // End of 'alt' statement Loading Loading @@ -210,6 +211,7 @@ module LibItsAtsp_Functions { f_selfOrClientSyncAndVerdict("error", e_timeout); f_selfOrClientSyncAndVerdict("error", e_timeout); } } [else] { // Shortcut defaults [else] { // Shortcut defaults //f_sleep(0.050); // 50 ms repeat; repeat; } } } // End of 'alt' statement } // End of 'alt' statement Loading