Loading ttcn/DCC/LibItsDcc_Functions.ttcn3 +86 −98 Original line number Original line Diff line number Diff line Loading @@ -17,61 +17,55 @@ module LibItsDcc_Functions { * @desc Setups default configuration * @desc Setups default configuration */ */ function f_cfUp(out UtComp p_utComp, function f_cfUp(out UtComp p_utComp, out ItsDcc p_itsDcc) runs on ServerSyncComp { out ItsInDcc p_itsInDcc, out ItsRrxDcc p_itsRrxDcc, in template (value) UtTrigger p_trigger) runs on ServerSyncComp { // Create // Create p_utComp := UtComp.create; p_utComp := UtComp.create("Upper Tester") alive; p_itsDcc := ItsDcc.create; p_itsInDcc := ItsInDcc.create("IN_SAP"); p_itsRrxDcc := ItsRrxDcc.create("RRX"); // Connect // Connect connect(p_utComp:syncPort, self:syncPort); connect(p_utComp:syncPort, self:syncPort); connect(p_itsDcc:syncPort, self:syncPort); connect(p_itsInDcc:syncPort, self:syncPort); connect(p_itsRrxDcc:syncPort, self:syncPort); //Map //Map map(p_utComp:utPort, system:utPort); map(p_utComp:utPort, system:utPort); map(p_itsDcc:inPort, system:inPort); map(p_itsInDcc:inPort, system:inPort); map(p_itsRrxDcc:rrxPort, system:rrxPort); // Initialize radio equipment p_utComp.start(f_utInitializeIut(m_utInitialize(m_utRadioInitialize))); p_utComp.done; // Put channel(s) into defined state p_utComp.start(f_utTriggerEvent(p_trigger)); p_utComp.done; } // end f_cfUp } // end f_cfUp /** /** * @desc Deletes default configuration * @desc Deletes default configuration */ */ function f_cfDown(in UtComp p_utComp, function f_cfDown(in UtComp p_utComp, in ItsDcc p_itsDcc) runs on ServerSyncComp { in ItsInDcc p_itsInDcc, in ItsRrxDcc p_itsRrxDcc) runs on ServerSyncComp { f_serverWaitForAllClientsToStop(); f_serverWaitForAllClientsToStop(); // Disconnect // Disconnect disconnect(p_utComp:syncPort, self:syncPort); disconnect(p_utComp:syncPort, self:syncPort); disconnect(p_itsDcc:syncPort, self:syncPort); disconnect(p_itsInDcc:syncPort, self:syncPort); disconnect(p_itsRrxDcc:syncPort, self:syncPort); // Unmap // Unmap unmap(p_utComp:utPort, system:utPort); unmap(p_utComp:utPort, system:utPort); unmap(p_itsDcc:inPort, system:inPort); unmap(p_itsInDcc:inPort, system:inPort); unmap(p_itsRrxDcc:rrxPort, system:rrxPort); } // end f_cfDown } // end f_cfDown } // end of dccConfigurationFunctions } // end of dccConfigurationFunctions /* @desc Implements synchronization of 2 clients from server side * on one or more synchronization points. * If problem occurs, then server sends STOP to all clients. * Waits for PX_TSYNC_TIME_LIMIT to let clients * finish executing their behavior until this * synchronization point. * @remark The use of this function requires prior connection of * the server sync ports! * @param p_syncPointIds list of synchronization point name/ids * @return execution status */ function f_serverSync2Clients( in SyncPointList p_syncPointIds ) runs on ServerSyncComp { var integer i, v_noOfSyncIds := sizeof(p_syncPointIds); for ( i := 0; i < v_noOfSyncIds; i := i+1 ) { f_serverSyncClientsTimed(2,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT); } } /** /** * @desc Upper tester functions * @desc Upper tester functions */ */ Loading Loading @@ -132,65 +126,30 @@ module LibItsDcc_Functions { } } } } } // End of group utFunctions /** group rrxFunctions { * @desc Capture the next event sent to the Upper Tester * @param p_event Receive template of the expected event * @param p_result Return the value of the received event if template matchs */ function f_utCommandIndication( in template UtCommandIndication p_event, out UtCommandIndication p_result ) runs on UtComp { tc_wait.start; alt { [] utPort.receive(p_event) -> value p_result { tc_wait.stop; } [] utPort.receive { tc_wait.stop; log("*** f_utCommandIndication: INFO: Another event indicated at application layer, repeating check ***"); } [] tc_wait.timeout { log("*** f_utCommandIndication: ERROR: Timeout while waiting for event check result ***"); } } // end of 'alt' statement } // End of function f_utCommandIndication /** /** * @desc Receive frames via the radio link and check that all frames are sent with * @desc Receive frames via the radio link and check that all frames are sent with * the requested Tx power and inter-packet spacing on the chosen channel * the requested Tx power and inter-packet spacing on the chosen channel * @param p_testDuration Overall test duration * @param p_testDuration Overall test duration * @param p_tOff Requested Toff value * @param p_tOff Requested Toff value * @param p_requestedTxPower Requested Tx send power value * @param p_requestedTxPower Requested Tx send power value * @param p_dCCProfileIdentifier Requested DCC profile * @param p_channel Channel on which the frame has been sent * @param p_channel Channel on which the frame has been sent */ */ function f_ut_AllRequestedFramesSent(float p_testDuration, function f_rrx_AllRequestedFramesSent(float p_testDuration, float p_tOff, float p_tOff, ChannelState p_cch, ChannelState p_sch1, ChannelState p_sch2, ChannelState p_sch3, ChannelState p_sch4, integer p_requestedTxPower, integer p_requestedTxPower, Channel p_channel) runs on UtComp { Channel p_channel) runs on ItsRrxDcc { var integer v_frameReceivedCount := 0; var integer v_frameReceivedCount := 0; timer tc_testDuration := p_testDuration; timer tc_testDuration := p_testDuration; timer tc_tOff := p_tOff; // Initialize radio equipment f_utInitializeIut(m_utInitialize(m_utRadioInitialize)); // Put channel(s) into defined state f_utTriggerEvent(m_utRadioEvent(p_cch, p_sch1, p_sch2, p_sch3, p_sch4)); f_selfOrClientSyncAndVerdict(c_prDone, e_success); f_selfOrClientSyncAndVerdict(c_prDone, e_success); } // End of function f_ut_AllRequestedFramesSent } // End of group utFunctions } // End of function f_rrx_AllRequestedFramesSent } // End of group rrxFunctions /** /** * @desc IN SAP functions * @desc IN SAP functions Loading @@ -210,7 +169,7 @@ module LibItsDcc_Functions { float p_tOff, float p_tOff, integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier, integer p_dCCProfileIdentifier, Channel p_channel) runs on ItsDcc { Channel p_channel) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; Loading @@ -235,7 +194,8 @@ module LibItsDcc_Functions { v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if(v_inSta.achievedSendPower != p_requestedTxPower) if(v_inSta.achievedSendPower != p_requestedTxPower) {setverdict(fail)} { log("*** function f_iN_AllRequestedFramesSent: FAIL: The achieved Tx power is different to the requested Tx power. ***"); setverdict(fail)} tc_tOff.start; tc_tOff.start; repeat; repeat; } } Loading @@ -260,20 +220,26 @@ module LibItsDcc_Functions { true)) -> value v_inSta { true)) -> value v_inSta { tc_tOff.stop; tc_tOff.stop; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if((v_inSta.achievedSendPower != p_requestedTxPower) if(v_inSta.achievedSendPower != p_requestedTxPower) or (v_frameAcknowledgedCount != v_frameRequestedCount)) { log("*** function f_iN_AllRequestedFramesSent: FAIL: The achieved Tx power is different to the requested Tx power. ***"); {setverdict(fail)} setverdict(fail)} else if(v_frameAcknowledgedCount != v_frameRequestedCount) { log("*** function f_iN_AllRequestedFramesSent: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail)} else else {setverdict(pass)} {setverdict(pass)} } } [] tc_tOff.timeout { [] tc_tOff.timeout { setverdict(fail)} log("*** function f_iN_AllRequestedFramesSent: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail) } } } } } } } } f_selfOrClientSyncAndVerdict(c_prDone, e_success); } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } // End of function f_iN_AllRequestedFramesSent } // End of function f_iN_AllRequestedFramesSent /** /** Loading @@ -291,7 +257,7 @@ module LibItsDcc_Functions { integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier, integer p_dCCProfileIdentifier, Channel p_channel, Channel p_channel, integer p_maxTxPower) runs on ItsDcc { integer p_maxTxPower) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; Loading @@ -316,7 +282,8 @@ module LibItsDcc_Functions { v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if(v_inSta.achievedSendPower >= p_maxTxPower) if(v_inSta.achievedSendPower >= p_maxTxPower) {setverdict(fail)} { log("*** function f_iN_FramesSentTxPowerReduction: FAIL: The achieved Tx power is higher than the maximum allowed Tx power. ***"); setverdict(fail)} tc_tOff.start; tc_tOff.start; repeat; repeat; } } Loading @@ -341,20 +308,26 @@ module LibItsDcc_Functions { true)) -> value v_inSta { true)) -> value v_inSta { tc_tOff.stop; tc_tOff.stop; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if((v_inSta.achievedSendPower >= p_maxTxPower) if(v_inSta.achievedSendPower >= p_maxTxPower) or (v_frameAcknowledgedCount != v_frameRequestedCount)) { log("*** function f_iN_FramesSentTxPowerReduction: FAIL: The achieved Tx power is higher than the maximum allowed Tx power. ***"); {setverdict(fail)} setverdict(fail)} else if(v_frameAcknowledgedCount != v_frameRequestedCount) { log("*** function f_iN_FramesSentTxPowerReduction: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail)} else else {setverdict(pass)} {setverdict(pass)} } } [] tc_tOff.timeout { [] tc_tOff.timeout { setverdict(fail)} log("*** function f_iN_FramesSentTxPowerReduction: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail) } } } } } } } } f_selfOrClientSyncAndVerdict(c_prDone, e_success); } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } // End of function f_iN_FramesSentTxPowerReduction } // End of function f_iN_FramesSentTxPowerReduction /** /** Loading @@ -367,7 +340,7 @@ module LibItsDcc_Functions { function f_iN_AllRequestedFramesDropped(float p_testDuration, function f_iN_AllRequestedFramesDropped(float p_testDuration, float p_tOff, float p_tOff, integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier) runs on ItsDcc { integer p_dCCProfileIdentifier) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; Loading @@ -389,7 +362,8 @@ module LibItsDcc_Functions { ?)) -> value v_inSta { ?)) -> value v_inSta { v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; if(v_inSta.transmissionSuccessStatus) if(v_inSta.transmissionSuccessStatus) {setverdict(fail)} { log("*** function f_iN_AllRequestedFramesDropped: FAIL: A frame that should have been dropped is achnowledged as successfully sent. ***"); setverdict(fail)} tc_tOff.start; tc_tOff.start; repeat; repeat; } } Loading @@ -407,6 +381,7 @@ module LibItsDcc_Functions { } } } } f_selfOrClientSyncAndVerdict(c_prDone, e_success); f_selfOrClientSyncAndVerdict(c_prDone, e_success); } // End of function f_iN_AllRequestedFramesDropped } // End of function f_iN_AllRequestedFramesDropped /** /** Loading @@ -422,12 +397,13 @@ module LibItsDcc_Functions { float p_tOff, float p_tOff, integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier, integer p_dCCProfileIdentifier, Channel p_channel) runs on ItsDcc { Channel p_channel) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; var integer v_frameRequestedCount := 1; var integer v_frameRequestedCount := 1; var integer v_frameAcknowledgedCount := 0; var integer v_frameAcknowledgedCount := 0; var integer v_frameSentCount := 0; var boolean v_frameSent, v_frameDropped := false; var boolean v_frameSent, v_frameDropped := false; timer tc_testDuration := p_testDuration; timer tc_testDuration := p_testDuration; Loading @@ -447,6 +423,7 @@ module LibItsDcc_Functions { true)) -> value v_inSta { true)) -> value v_inSta { v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameSentCount := v_frameSentCount + 1; v_frameSent := true; v_frameSent := true; tc_tOff.start; tc_tOff.start; repeat; repeat; Loading @@ -473,7 +450,8 @@ module LibItsDcc_Functions { [] tc_testDuration.timeout { [] tc_testDuration.timeout { if(not v_frameSent and v_frameDropped) if(not v_frameSent and v_frameDropped) {setverdict(fail)} { log("*** function f_iN_SomeRequestedFramesSent: FAIL: There are either no sent frames or no dropped frames acknowledged. ***"); setverdict(fail)} if(v_frameAcknowledgedCount == v_frameRequestedCount) if(v_frameAcknowledgedCount == v_frameRequestedCount) {setverdict(pass)} {setverdict(pass)} else else Loading @@ -484,19 +462,25 @@ module LibItsDcc_Functions { ?)) -> value v_inSta { ?)) -> value v_inSta { tc_tOff.stop; tc_tOff.stop; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if(v_inSta.transmissionSuccessStatus) { v_frameSentCount := v_frameSentCount + 1;} if(v_frameAcknowledgedCount != v_frameRequestedCount) if(v_frameAcknowledgedCount != v_frameRequestedCount) {setverdict(fail)} { log("*** function f_iN_SomeRequestedFramesSent: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail)} else else {setverdict(pass)} {setverdict(pass)} } } [] tc_tOff.timeout { [] tc_tOff.timeout { setverdict(fail)} log("*** function f_iN_SomeRequestedFramesSent: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail) } } } } } } } } f_selfOrClientSyncAndVerdict(c_prDone, e_success); } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } // End of function f_iN_SomeRequestedFramesSent } // End of function f_iN_SomeRequestedFramesSent /** /** Loading @@ -514,7 +498,7 @@ module LibItsDcc_Functions { integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier, integer p_dCCProfileIdentifier, Channel p_channel_1, Channel p_channel_1, Channel p_channel_2) runs on ItsDcc { Channel p_channel_2) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; Loading Loading @@ -565,7 +549,8 @@ module LibItsDcc_Functions { [] tc_testDuration.timeout { [] tc_testDuration.timeout { if(not v_channel_1 and v_channel_2) if(not v_channel_1 and v_channel_2) {setverdict(fail)} { log("*** function f_iN_AllRequestedFramesSentOn2Channels: FAIL: All frames have been sent via the same channel. ***"); setverdict(fail)} if(v_frameAcknowledgedCount == v_frameRequestedCount) if(v_frameAcknowledgedCount == v_frameRequestedCount) {setverdict(pass)} {setverdict(pass)} else else Loading @@ -577,13 +562,16 @@ module LibItsDcc_Functions { tc_tOff.stop; tc_tOff.stop; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if(v_frameAcknowledgedCount != v_frameRequestedCount) if(v_frameAcknowledgedCount != v_frameRequestedCount) {setverdict(fail)} { log("*** function f_iN_AllRequestedFramesSentOn2Channels: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail)} else else {setverdict(pass)} {setverdict(pass)} } } [] tc_tOff.timeout { [] tc_tOff.timeout { setverdict(fail)} log("*** function f_iN_AllRequestedFramesSentOn2Channels: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail) } } } } } } } Loading ttcn/DCC/LibItsDcc_Templates.ttcn3 +3 −3 Original line number Original line Diff line number Diff line Loading @@ -50,7 +50,7 @@ module LibItsDcc_Templates { /** /** * @desc UtRadioCommandIndication Primitive template * @desc UtRadioCommandIndication Primitive template */ */ template UtRadioCommandIndication m_utRadioCommandIndication(Channel p_channel, template RrxInd m_rrxInd(Channel p_channel, template integer p_measuredPower, template integer p_measuredPower, template integer p_interPacketSpacing_Toff) := template integer p_interPacketSpacing_Toff) := {channel := p_channel, {channel := p_channel, Loading ttcn/DCC/LibItsDcc_TestSystem.ttcn +57 −46 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,6 @@ module LibItsDcc_TestSystem { import from LibItsDcc_TypesAndValues all; import from LibItsDcc_TypesAndValues all; group adapterInterface { group portDefinitions { group portDefinitions { Loading @@ -28,19 +27,9 @@ module LibItsDcc_TestSystem { out out UtInitialize, UtTrigger; UtInitialize, UtTrigger; in in UtResult, UtCommandIndication UtResult } // end UpperTesterPort } // end UpperTesterPort } // end portDefinitions } // end adapterInterface group interfaceComponents { } // End of group interfaceComponents group interfacePorts { /** /** * @desc IN Port used to trigger events at the access layer and to monitor the results * @desc IN Port used to trigger events at the access layer and to monitor the results */ */ Loading @@ -49,7 +38,14 @@ module LibItsDcc_TestSystem { out InReq; out InReq; } // End of port InPort } // End of port InPort } // End of group interfacePorts /** * @desc RRX Port used to receive events at the radio access */ type port RrxPort message { in RrxInd; } // End of port InPort } // end portDefinitions group componentDefinitions { group componentDefinitions { Loading @@ -60,17 +56,37 @@ module LibItsDcc_TestSystem { port UpperTesterPort utPort; port UpperTesterPort utPort; port InPort inPort; port InPort inPort; port RrxPort rrxPort; port SyncPort syncPort; port SyncPort syncPort; } // End of component ItsDccSystem } // End of component ItsDccSystem /** * @desc Test component for configuration of the channel traffic states */ type component UtComp extends ItsBaseComponent { port UpperTesterPort utPort; //timers //component variables //default var default vc_default := null; //global variables } // End of component UtComp /** /** * @desc Test component for ITS Access layer * @desc Test component for ITS Access layer */ */ type component ItsDcc extends ItsBaseComponent { type component ItsInDcc extends ItsBaseComponent { // IN ports // IN ports port InPort inPort; port InPort inPort; //timers //timers //component variables //component variables Loading @@ -80,14 +96,15 @@ module LibItsDcc_TestSystem { //global variables //global variables } // End of component ItsDcc } // End of component ItsInDcc /** /** * @desc Test component for ITS Access layer * @desc Test component for ITS Access layer */ */ type component UtComp extends ItsBaseComponent { type component ItsRrxDcc extends ItsBaseComponent { port UpperTesterPort utPort; // IN ports port RrxPort rrxPort; //timers //timers Loading @@ -98,7 +115,8 @@ module LibItsDcc_TestSystem { //global variables //global variables } // End of component UtComp } // End of component ItsInDcc } // End of group componentDefinitions } // End of group componentDefinitions group upperTester { group upperTester { Loading @@ -117,13 +135,6 @@ module LibItsDcc_TestSystem { UtRadioEvent utRadioEvent UtRadioEvent utRadioEvent } } /** * @desc Upper Tester message describing an action/event */ type union UtCommandIndication { UtRadioCommandIndication utRadioCommandIndication } /** /** * @desc Upper Tester response message * @desc Upper Tester response message */ */ Loading @@ -134,4 +145,4 @@ module LibItsDcc_TestSystem { with { with { encode "LibIts_Interface" encode "LibIts_Interface" } // End of group interfacePrimitives } // End of group interfacePrimitives } // End of module LibItsDtt_TestSystem } // End of module LibItsDcc_TestSystem No newline at end of file No newline at end of file ttcn/DCC/LibItsDcc_TypesAndValues.ttcn3 +5 −2 Original line number Original line Diff line number Diff line Loading @@ -30,16 +30,19 @@ module LibItsDcc_TypesAndValues { ChannelState sch4ChannelState optional ChannelState sch4ChannelState optional } } } // End of group utRadioPrimitives group rrxSapPrimitives { /** /** * @desc Receive an indication related to frames sent by the IUT at the radio interface. * @desc Receive an indication related to frames sent by the IUT at the radio interface. */ */ type record UtRadioCommandIndication { type record RrxInd { Channel channel, Channel channel, integer measuredPower, integer measuredPower, integer interPacketSpacing_Toff integer interPacketSpacing_Toff } } } // End of group utRadioPrimitives } // End of group rrxSapPrimitives group inSapPrimitives { group inSapPrimitives { Loading Loading
ttcn/DCC/LibItsDcc_Functions.ttcn3 +86 −98 Original line number Original line Diff line number Diff line Loading @@ -17,61 +17,55 @@ module LibItsDcc_Functions { * @desc Setups default configuration * @desc Setups default configuration */ */ function f_cfUp(out UtComp p_utComp, function f_cfUp(out UtComp p_utComp, out ItsDcc p_itsDcc) runs on ServerSyncComp { out ItsInDcc p_itsInDcc, out ItsRrxDcc p_itsRrxDcc, in template (value) UtTrigger p_trigger) runs on ServerSyncComp { // Create // Create p_utComp := UtComp.create; p_utComp := UtComp.create("Upper Tester") alive; p_itsDcc := ItsDcc.create; p_itsInDcc := ItsInDcc.create("IN_SAP"); p_itsRrxDcc := ItsRrxDcc.create("RRX"); // Connect // Connect connect(p_utComp:syncPort, self:syncPort); connect(p_utComp:syncPort, self:syncPort); connect(p_itsDcc:syncPort, self:syncPort); connect(p_itsInDcc:syncPort, self:syncPort); connect(p_itsRrxDcc:syncPort, self:syncPort); //Map //Map map(p_utComp:utPort, system:utPort); map(p_utComp:utPort, system:utPort); map(p_itsDcc:inPort, system:inPort); map(p_itsInDcc:inPort, system:inPort); map(p_itsRrxDcc:rrxPort, system:rrxPort); // Initialize radio equipment p_utComp.start(f_utInitializeIut(m_utInitialize(m_utRadioInitialize))); p_utComp.done; // Put channel(s) into defined state p_utComp.start(f_utTriggerEvent(p_trigger)); p_utComp.done; } // end f_cfUp } // end f_cfUp /** /** * @desc Deletes default configuration * @desc Deletes default configuration */ */ function f_cfDown(in UtComp p_utComp, function f_cfDown(in UtComp p_utComp, in ItsDcc p_itsDcc) runs on ServerSyncComp { in ItsInDcc p_itsInDcc, in ItsRrxDcc p_itsRrxDcc) runs on ServerSyncComp { f_serverWaitForAllClientsToStop(); f_serverWaitForAllClientsToStop(); // Disconnect // Disconnect disconnect(p_utComp:syncPort, self:syncPort); disconnect(p_utComp:syncPort, self:syncPort); disconnect(p_itsDcc:syncPort, self:syncPort); disconnect(p_itsInDcc:syncPort, self:syncPort); disconnect(p_itsRrxDcc:syncPort, self:syncPort); // Unmap // Unmap unmap(p_utComp:utPort, system:utPort); unmap(p_utComp:utPort, system:utPort); unmap(p_itsDcc:inPort, system:inPort); unmap(p_itsInDcc:inPort, system:inPort); unmap(p_itsRrxDcc:rrxPort, system:rrxPort); } // end f_cfDown } // end f_cfDown } // end of dccConfigurationFunctions } // end of dccConfigurationFunctions /* @desc Implements synchronization of 2 clients from server side * on one or more synchronization points. * If problem occurs, then server sends STOP to all clients. * Waits for PX_TSYNC_TIME_LIMIT to let clients * finish executing their behavior until this * synchronization point. * @remark The use of this function requires prior connection of * the server sync ports! * @param p_syncPointIds list of synchronization point name/ids * @return execution status */ function f_serverSync2Clients( in SyncPointList p_syncPointIds ) runs on ServerSyncComp { var integer i, v_noOfSyncIds := sizeof(p_syncPointIds); for ( i := 0; i < v_noOfSyncIds; i := i+1 ) { f_serverSyncClientsTimed(2,p_syncPointIds[i], PX_TSYNC_TIME_LIMIT); } } /** /** * @desc Upper tester functions * @desc Upper tester functions */ */ Loading Loading @@ -132,65 +126,30 @@ module LibItsDcc_Functions { } } } } } // End of group utFunctions /** group rrxFunctions { * @desc Capture the next event sent to the Upper Tester * @param p_event Receive template of the expected event * @param p_result Return the value of the received event if template matchs */ function f_utCommandIndication( in template UtCommandIndication p_event, out UtCommandIndication p_result ) runs on UtComp { tc_wait.start; alt { [] utPort.receive(p_event) -> value p_result { tc_wait.stop; } [] utPort.receive { tc_wait.stop; log("*** f_utCommandIndication: INFO: Another event indicated at application layer, repeating check ***"); } [] tc_wait.timeout { log("*** f_utCommandIndication: ERROR: Timeout while waiting for event check result ***"); } } // end of 'alt' statement } // End of function f_utCommandIndication /** /** * @desc Receive frames via the radio link and check that all frames are sent with * @desc Receive frames via the radio link and check that all frames are sent with * the requested Tx power and inter-packet spacing on the chosen channel * the requested Tx power and inter-packet spacing on the chosen channel * @param p_testDuration Overall test duration * @param p_testDuration Overall test duration * @param p_tOff Requested Toff value * @param p_tOff Requested Toff value * @param p_requestedTxPower Requested Tx send power value * @param p_requestedTxPower Requested Tx send power value * @param p_dCCProfileIdentifier Requested DCC profile * @param p_channel Channel on which the frame has been sent * @param p_channel Channel on which the frame has been sent */ */ function f_ut_AllRequestedFramesSent(float p_testDuration, function f_rrx_AllRequestedFramesSent(float p_testDuration, float p_tOff, float p_tOff, ChannelState p_cch, ChannelState p_sch1, ChannelState p_sch2, ChannelState p_sch3, ChannelState p_sch4, integer p_requestedTxPower, integer p_requestedTxPower, Channel p_channel) runs on UtComp { Channel p_channel) runs on ItsRrxDcc { var integer v_frameReceivedCount := 0; var integer v_frameReceivedCount := 0; timer tc_testDuration := p_testDuration; timer tc_testDuration := p_testDuration; timer tc_tOff := p_tOff; // Initialize radio equipment f_utInitializeIut(m_utInitialize(m_utRadioInitialize)); // Put channel(s) into defined state f_utTriggerEvent(m_utRadioEvent(p_cch, p_sch1, p_sch2, p_sch3, p_sch4)); f_selfOrClientSyncAndVerdict(c_prDone, e_success); f_selfOrClientSyncAndVerdict(c_prDone, e_success); } // End of function f_ut_AllRequestedFramesSent } // End of group utFunctions } // End of function f_rrx_AllRequestedFramesSent } // End of group rrxFunctions /** /** * @desc IN SAP functions * @desc IN SAP functions Loading @@ -210,7 +169,7 @@ module LibItsDcc_Functions { float p_tOff, float p_tOff, integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier, integer p_dCCProfileIdentifier, Channel p_channel) runs on ItsDcc { Channel p_channel) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; Loading @@ -235,7 +194,8 @@ module LibItsDcc_Functions { v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if(v_inSta.achievedSendPower != p_requestedTxPower) if(v_inSta.achievedSendPower != p_requestedTxPower) {setverdict(fail)} { log("*** function f_iN_AllRequestedFramesSent: FAIL: The achieved Tx power is different to the requested Tx power. ***"); setverdict(fail)} tc_tOff.start; tc_tOff.start; repeat; repeat; } } Loading @@ -260,20 +220,26 @@ module LibItsDcc_Functions { true)) -> value v_inSta { true)) -> value v_inSta { tc_tOff.stop; tc_tOff.stop; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if((v_inSta.achievedSendPower != p_requestedTxPower) if(v_inSta.achievedSendPower != p_requestedTxPower) or (v_frameAcknowledgedCount != v_frameRequestedCount)) { log("*** function f_iN_AllRequestedFramesSent: FAIL: The achieved Tx power is different to the requested Tx power. ***"); {setverdict(fail)} setverdict(fail)} else if(v_frameAcknowledgedCount != v_frameRequestedCount) { log("*** function f_iN_AllRequestedFramesSent: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail)} else else {setverdict(pass)} {setverdict(pass)} } } [] tc_tOff.timeout { [] tc_tOff.timeout { setverdict(fail)} log("*** function f_iN_AllRequestedFramesSent: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail) } } } } } } } } f_selfOrClientSyncAndVerdict(c_prDone, e_success); } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } // End of function f_iN_AllRequestedFramesSent } // End of function f_iN_AllRequestedFramesSent /** /** Loading @@ -291,7 +257,7 @@ module LibItsDcc_Functions { integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier, integer p_dCCProfileIdentifier, Channel p_channel, Channel p_channel, integer p_maxTxPower) runs on ItsDcc { integer p_maxTxPower) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; Loading @@ -316,7 +282,8 @@ module LibItsDcc_Functions { v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if(v_inSta.achievedSendPower >= p_maxTxPower) if(v_inSta.achievedSendPower >= p_maxTxPower) {setverdict(fail)} { log("*** function f_iN_FramesSentTxPowerReduction: FAIL: The achieved Tx power is higher than the maximum allowed Tx power. ***"); setverdict(fail)} tc_tOff.start; tc_tOff.start; repeat; repeat; } } Loading @@ -341,20 +308,26 @@ module LibItsDcc_Functions { true)) -> value v_inSta { true)) -> value v_inSta { tc_tOff.stop; tc_tOff.stop; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if((v_inSta.achievedSendPower >= p_maxTxPower) if(v_inSta.achievedSendPower >= p_maxTxPower) or (v_frameAcknowledgedCount != v_frameRequestedCount)) { log("*** function f_iN_FramesSentTxPowerReduction: FAIL: The achieved Tx power is higher than the maximum allowed Tx power. ***"); {setverdict(fail)} setverdict(fail)} else if(v_frameAcknowledgedCount != v_frameRequestedCount) { log("*** function f_iN_FramesSentTxPowerReduction: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail)} else else {setverdict(pass)} {setverdict(pass)} } } [] tc_tOff.timeout { [] tc_tOff.timeout { setverdict(fail)} log("*** function f_iN_FramesSentTxPowerReduction: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail) } } } } } } } } f_selfOrClientSyncAndVerdict(c_prDone, e_success); } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } // End of function f_iN_FramesSentTxPowerReduction } // End of function f_iN_FramesSentTxPowerReduction /** /** Loading @@ -367,7 +340,7 @@ module LibItsDcc_Functions { function f_iN_AllRequestedFramesDropped(float p_testDuration, function f_iN_AllRequestedFramesDropped(float p_testDuration, float p_tOff, float p_tOff, integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier) runs on ItsDcc { integer p_dCCProfileIdentifier) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; Loading @@ -389,7 +362,8 @@ module LibItsDcc_Functions { ?)) -> value v_inSta { ?)) -> value v_inSta { v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; if(v_inSta.transmissionSuccessStatus) if(v_inSta.transmissionSuccessStatus) {setverdict(fail)} { log("*** function f_iN_AllRequestedFramesDropped: FAIL: A frame that should have been dropped is achnowledged as successfully sent. ***"); setverdict(fail)} tc_tOff.start; tc_tOff.start; repeat; repeat; } } Loading @@ -407,6 +381,7 @@ module LibItsDcc_Functions { } } } } f_selfOrClientSyncAndVerdict(c_prDone, e_success); f_selfOrClientSyncAndVerdict(c_prDone, e_success); } // End of function f_iN_AllRequestedFramesDropped } // End of function f_iN_AllRequestedFramesDropped /** /** Loading @@ -422,12 +397,13 @@ module LibItsDcc_Functions { float p_tOff, float p_tOff, integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier, integer p_dCCProfileIdentifier, Channel p_channel) runs on ItsDcc { Channel p_channel) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; var integer v_frameRequestedCount := 1; var integer v_frameRequestedCount := 1; var integer v_frameAcknowledgedCount := 0; var integer v_frameAcknowledgedCount := 0; var integer v_frameSentCount := 0; var boolean v_frameSent, v_frameDropped := false; var boolean v_frameSent, v_frameDropped := false; timer tc_testDuration := p_testDuration; timer tc_testDuration := p_testDuration; Loading @@ -447,6 +423,7 @@ module LibItsDcc_Functions { true)) -> value v_inSta { true)) -> value v_inSta { v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_commandReference := (v_commandReference + 1) mod c_maxCommandReference; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameSentCount := v_frameSentCount + 1; v_frameSent := true; v_frameSent := true; tc_tOff.start; tc_tOff.start; repeat; repeat; Loading @@ -473,7 +450,8 @@ module LibItsDcc_Functions { [] tc_testDuration.timeout { [] tc_testDuration.timeout { if(not v_frameSent and v_frameDropped) if(not v_frameSent and v_frameDropped) {setverdict(fail)} { log("*** function f_iN_SomeRequestedFramesSent: FAIL: There are either no sent frames or no dropped frames acknowledged. ***"); setverdict(fail)} if(v_frameAcknowledgedCount == v_frameRequestedCount) if(v_frameAcknowledgedCount == v_frameRequestedCount) {setverdict(pass)} {setverdict(pass)} else else Loading @@ -484,19 +462,25 @@ module LibItsDcc_Functions { ?)) -> value v_inSta { ?)) -> value v_inSta { tc_tOff.stop; tc_tOff.stop; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if(v_inSta.transmissionSuccessStatus) { v_frameSentCount := v_frameSentCount + 1;} if(v_frameAcknowledgedCount != v_frameRequestedCount) if(v_frameAcknowledgedCount != v_frameRequestedCount) {setverdict(fail)} { log("*** function f_iN_SomeRequestedFramesSent: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail)} else else {setverdict(pass)} {setverdict(pass)} } } [] tc_tOff.timeout { [] tc_tOff.timeout { setverdict(fail)} log("*** function f_iN_SomeRequestedFramesSent: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail) } } } } } } } } f_selfOrClientSyncAndVerdict(c_prDone, e_success); } f_selfOrClientSyncAndVerdict(c_tbDone, e_success); } // End of function f_iN_SomeRequestedFramesSent } // End of function f_iN_SomeRequestedFramesSent /** /** Loading @@ -514,7 +498,7 @@ module LibItsDcc_Functions { integer p_requestedTxPower, integer p_requestedTxPower, integer p_dCCProfileIdentifier, integer p_dCCProfileIdentifier, Channel p_channel_1, Channel p_channel_1, Channel p_channel_2) runs on ItsDcc { Channel p_channel_2) runs on ItsInDcc { var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var integer v_commandReference := float2int(int2float(c_maxCommandReference)*rnd()); var InSta v_inSta; var InSta v_inSta; Loading Loading @@ -565,7 +549,8 @@ module LibItsDcc_Functions { [] tc_testDuration.timeout { [] tc_testDuration.timeout { if(not v_channel_1 and v_channel_2) if(not v_channel_1 and v_channel_2) {setverdict(fail)} { log("*** function f_iN_AllRequestedFramesSentOn2Channels: FAIL: All frames have been sent via the same channel. ***"); setverdict(fail)} if(v_frameAcknowledgedCount == v_frameRequestedCount) if(v_frameAcknowledgedCount == v_frameRequestedCount) {setverdict(pass)} {setverdict(pass)} else else Loading @@ -577,13 +562,16 @@ module LibItsDcc_Functions { tc_tOff.stop; tc_tOff.stop; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; v_frameAcknowledgedCount := v_frameAcknowledgedCount + 1; if(v_frameAcknowledgedCount != v_frameRequestedCount) if(v_frameAcknowledgedCount != v_frameRequestedCount) {setverdict(fail)} { log("*** function f_iN_AllRequestedFramesSentOn2Channels: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail)} else else {setverdict(pass)} {setverdict(pass)} } } [] tc_tOff.timeout { [] tc_tOff.timeout { setverdict(fail)} log("*** function f_iN_AllRequestedFramesSentOn2Channels: FAIL: Not all requested frames have been acknowledged. ***"); setverdict(fail) } } } } } } } Loading
ttcn/DCC/LibItsDcc_Templates.ttcn3 +3 −3 Original line number Original line Diff line number Diff line Loading @@ -50,7 +50,7 @@ module LibItsDcc_Templates { /** /** * @desc UtRadioCommandIndication Primitive template * @desc UtRadioCommandIndication Primitive template */ */ template UtRadioCommandIndication m_utRadioCommandIndication(Channel p_channel, template RrxInd m_rrxInd(Channel p_channel, template integer p_measuredPower, template integer p_measuredPower, template integer p_interPacketSpacing_Toff) := template integer p_interPacketSpacing_Toff) := {channel := p_channel, {channel := p_channel, Loading
ttcn/DCC/LibItsDcc_TestSystem.ttcn +57 −46 Original line number Original line Diff line number Diff line Loading @@ -17,7 +17,6 @@ module LibItsDcc_TestSystem { import from LibItsDcc_TypesAndValues all; import from LibItsDcc_TypesAndValues all; group adapterInterface { group portDefinitions { group portDefinitions { Loading @@ -28,19 +27,9 @@ module LibItsDcc_TestSystem { out out UtInitialize, UtTrigger; UtInitialize, UtTrigger; in in UtResult, UtCommandIndication UtResult } // end UpperTesterPort } // end UpperTesterPort } // end portDefinitions } // end adapterInterface group interfaceComponents { } // End of group interfaceComponents group interfacePorts { /** /** * @desc IN Port used to trigger events at the access layer and to monitor the results * @desc IN Port used to trigger events at the access layer and to monitor the results */ */ Loading @@ -49,7 +38,14 @@ module LibItsDcc_TestSystem { out InReq; out InReq; } // End of port InPort } // End of port InPort } // End of group interfacePorts /** * @desc RRX Port used to receive events at the radio access */ type port RrxPort message { in RrxInd; } // End of port InPort } // end portDefinitions group componentDefinitions { group componentDefinitions { Loading @@ -60,17 +56,37 @@ module LibItsDcc_TestSystem { port UpperTesterPort utPort; port UpperTesterPort utPort; port InPort inPort; port InPort inPort; port RrxPort rrxPort; port SyncPort syncPort; port SyncPort syncPort; } // End of component ItsDccSystem } // End of component ItsDccSystem /** * @desc Test component for configuration of the channel traffic states */ type component UtComp extends ItsBaseComponent { port UpperTesterPort utPort; //timers //component variables //default var default vc_default := null; //global variables } // End of component UtComp /** /** * @desc Test component for ITS Access layer * @desc Test component for ITS Access layer */ */ type component ItsDcc extends ItsBaseComponent { type component ItsInDcc extends ItsBaseComponent { // IN ports // IN ports port InPort inPort; port InPort inPort; //timers //timers //component variables //component variables Loading @@ -80,14 +96,15 @@ module LibItsDcc_TestSystem { //global variables //global variables } // End of component ItsDcc } // End of component ItsInDcc /** /** * @desc Test component for ITS Access layer * @desc Test component for ITS Access layer */ */ type component UtComp extends ItsBaseComponent { type component ItsRrxDcc extends ItsBaseComponent { port UpperTesterPort utPort; // IN ports port RrxPort rrxPort; //timers //timers Loading @@ -98,7 +115,8 @@ module LibItsDcc_TestSystem { //global variables //global variables } // End of component UtComp } // End of component ItsInDcc } // End of group componentDefinitions } // End of group componentDefinitions group upperTester { group upperTester { Loading @@ -117,13 +135,6 @@ module LibItsDcc_TestSystem { UtRadioEvent utRadioEvent UtRadioEvent utRadioEvent } } /** * @desc Upper Tester message describing an action/event */ type union UtCommandIndication { UtRadioCommandIndication utRadioCommandIndication } /** /** * @desc Upper Tester response message * @desc Upper Tester response message */ */ Loading @@ -134,4 +145,4 @@ module LibItsDcc_TestSystem { with { with { encode "LibIts_Interface" encode "LibIts_Interface" } // End of group interfacePrimitives } // End of group interfacePrimitives } // End of module LibItsDtt_TestSystem } // End of module LibItsDcc_TestSystem No newline at end of file No newline at end of file
ttcn/DCC/LibItsDcc_TypesAndValues.ttcn3 +5 −2 Original line number Original line Diff line number Diff line Loading @@ -30,16 +30,19 @@ module LibItsDcc_TypesAndValues { ChannelState sch4ChannelState optional ChannelState sch4ChannelState optional } } } // End of group utRadioPrimitives group rrxSapPrimitives { /** /** * @desc Receive an indication related to frames sent by the IUT at the radio interface. * @desc Receive an indication related to frames sent by the IUT at the radio interface. */ */ type record UtRadioCommandIndication { type record RrxInd { Channel channel, Channel channel, integer measuredPower, integer measuredPower, integer interPacketSpacing_Toff integer interPacketSpacing_Toff } } } // End of group utRadioPrimitives } // End of group rrxSapPrimitives group inSapPrimitives { group inSapPrimitives { Loading