Commit 125c349d authored by garciay's avatar garciay
Browse files

Add AcSecPrimitive support for IS

parent f4b960ed
Loading
Loading
Loading
Loading
+81 −33
Original line number Diff line number Diff line
@@ -123,6 +123,54 @@ module ItsSrem_TestCases {
                
            } // End of group sreEventGeneration
            
            group sreEventUpdate {
                
                /**
                 * @desc Check that the IUT increments the sequenceNumber when a SREM update is generated
                 * <pre>
                 * Pics Selection: not PICS_RSU and PICS_SREM_GENERATION
                 * Initial conditions: 
                 *   with {
                 *        the IUT being in the "initial state"
                 *        and the IUT having generate a SREM
                 *            containing srm
                 *                containing sequenceNumber
                 *                    indicating SREM_SN_1
                 *                and containing requests[0]
                 *                    containing request
                 *                        containing requestID
                 *                            indicating SREM_RID_1
                 *    }
                 * Expected behaviour:
                 *    ensure that {
                 *        when { 
                 *            the IUT receives an AppSREM_update request
                 *        }
                 *        then {
                 *            the IUT sends a valid SREM
                 *            containing ssm
                 *                containing sequenceNumber
                 *                    indicating SREM_SN_1+ 1
                 *                and containing requests[0]
                 *                    containing request
                 *                        containing requestID
                 *                            indicating SREM_RID_1
                 *        }
                 *    }
                 * </pre>
                 * 
                 * @version   1.0.4
                 * @see       ETSI TS 103 191-2 v0.0.1 TP_IS_TLC_EVUP_BV_01
                 * @reference ETSI TS 103 301 V1.0.4 Clause 8.4.1
                 */
                testcase TC_IS_TLC_EVUP_BV_01 () runs on ItsSremSsem system ItsSremSsemSystem {
                    
                    f_IS_TLC_EVUP_BV_01();
                    
                } // End of testcase TC_IS_TLC_EVUP_BV_01
                
            } // End of group sreEventUpdate
            
            group sreCommunication {
                
                /**
+74 −6
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ module ItsSrem_TpFunctions {
                        m_utTriggerEvent(PX_BASICEVEHICLEROLE, PX_REQUESTIMPORTANCELEVEL)
                    }
                    var boolean v_success := true;
                    var RequestIDList v_requestIDLists;
                    var RequestIDList v_requestIDList;
                    var SremInds v_sremInds := {};
                    var integer i;
                    
@@ -172,7 +172,7 @@ module ItsSrem_TpFunctions {
                    for (i := 0; i < lengthof(v_utTriggers) - 1; i := i + 1) {
                        f_utTriggerEvent(v_utTriggers[i]);
                        f_awaitSreMessage(mw_sremInd(mw_sremPdu(mw_sremWellFormatted)), v_sremInds[i]);
                        v_requestIDLists[i] := v_sremInds[i].msgIn.srm.requests[0].request.requestID;
                        v_requestIDList[i] := v_sremInds[i].msgIn.srm.requests[0].request.requestID;
                    }
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
@@ -181,11 +181,11 @@ module ItsSrem_TpFunctions {
                    
                    f_utTriggerEvent(v_utTriggers[lengthof(v_utTriggers) - 1]);
                    f_awaitSreMessage(mw_sremInd(mw_sremPdu(mw_sremWellFormatted)), v_sremInds[i]);
                    v_requestIDLists[lengthof(v_requestIDLists) - 1] := v_sremInds[i].msgIn.srm.requests[0].request.requestID;
                    v_requestIDList[lengthof(v_requestIDList) - 1] := v_sremInds[i].msgIn.srm.requests[0].request.requestID;
                    
                    //check the action id
                    for (i := 0; i < lengthof(v_requestIDLists) - 1; i := i + 1) {
                        if (v_requestIDLists[lengthof(v_requestIDLists) - 1] == v_requestIDLists[i]) {
                    for (i := 0; i < lengthof(v_requestIDList) - 1; i := i + 1) {
                        if (v_requestIDList[lengthof(v_requestIDList) - 1] == v_requestIDList[i]) {
                            v_success := false;
                        }
                    }
@@ -210,6 +210,74 @@ module ItsSrem_TpFunctions {
                
            } // End of group sreEventGeneration 
            
            group sreEventUpdate {
                
                /**
                 * @desc    TP Function for TC_IS_TLC_EVUP_BV_01
                 */
                function f_IS_TLC_EVUP_BV_01 () runs on ItsSremSsem {
                    
                    // Local variables
                    var SremInd v_sremInd;
                    var RequestID v_requestID;
                    var MsgCount v_sequenceNumber;
                    
                    // Test control
                    if (PICS_RSU_ROLE or not PICS_SREM_GENERATION) {
                        log("*** " & testcasename() & ": not PICS_RSU_ROLE  and PICS_SREM_GENERATION required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cfUp();
                        
                    // Preamble
                    f_prInitialState();
                    f_utTriggerEvent(m_utTriggerEvent(PX_BASICEVEHICLEROLE, PX_REQUESTIMPORTANCELEVEL));
                    f_awaitSreMessage(mw_sremInd(mw_sremPdu(mw_sremWellFormatted)), v_sremInd);
                    f_sendSseMessage(v_sremInd.msgIn.srm);
                    v_requestID := v_sremInd.msgIn.srm.requests[0].request.requestID;
                    v_sequenceNumber := v_sremInd.msgIn.srm.sequenceNumber;
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
                    // Test Body
                    f_utUpdateEvent(m_utUpdateEvent(v_requestID, PX_BASICEVEHICLEROLE, PX_REQUESTIMPORTANCELEVEL));
                    
                    tc_ac.start;
                    alt {
                        [] sremSsemPort.receive(
                            mw_sremInd(
                                mw_sremPdu(
                                    mw_srem_sequenceNumber(
                                        (v_sequenceNumber + 1) mod 128 // See MsgCount declaration
                                    )
                        ))) -> value v_sremInd { 
                            tc_ac.stop;
                            // Send SSEM
                            f_sendSseMessage(v_sremInd.msgIn.srm);
                            if (not match(v_requestID, v_sremInd.msgIn.srm.requests[0].request.requestID)) {
                                log("*** " & testcasename() & ": FAIL: requestID mismatch. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            } else {
                                log("*** " & testcasename() & ": PASS: Successfully received SREM PDU header. ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: Timeout while awaiting the reception of a message. ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                        }
                    }
                    
                    // Postamble
                    f_poDefault();
                    f_cfDown();
                    
                } // End of function f_IS_TLC_EVUP_BV_01
                
            } // End of group sreEventUpdate 
            
            group sreCommunication {
                
                /**