ItsGeoNetworking_TestCases.ttcn 913 KB
Newer Older
filatov's avatar
filatov committed
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_LOS_BV_10)
                 */
                function f_GEONW_PON_LOS_BV_10_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                    
                    // Test Body
                    tc_ac.start;
                     alt {
                         [] geoNetworkingPort.receive(
                             mw_geoNwInd(
                                 mw_geoNwPdu(
                                     mw_geoNwLsRequestPacket(
                                         ?,
                                         v_longPosVectorNodeB.gnAddr.mid
                                     ),
                                     -,
                                     c_defaultHopLimit - 1
                                 )
                             )
                         ) {
                             tc_ac.stop;
                             log("*** " & testcasename() & ": PASS: Re-broadcasted LS Request received with HL field decreased by 1 ***");
                             f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                         }
                         [] tc_ac.timeout {
                             log("*** " & testcasename() & ": FAIL: LS Request was not re-broadcasted ***");
                             f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                         }
                     }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_LOS_BV_10_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_LOS_BV_10)
                 */
                function f_GEONW_PON_LOS_BV_10_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(
                                m_geoNwLsRequestPacket(
                                    f_getPosition(c_compNodeA),
                                    vc_localSeqNumber,
                                    f_getPosition(c_compNodeB).gnAddr
                                ),
                                -,
                                c_defaultHopLimit
                            )
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_LOS_BV_10_nodeC
                
            } // end GEONW_PON_LOS_BV_10
            
            group GEONW_PON_LOS_BV_11 {
                
                /**
                 * @desc    Test of LS Reply forwarding
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF03
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT having received Beacon information from ItsNodeB and
                 *      the IUT having received Beacon information from ItsNodeC
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT receives a LS_REPLY packet from ItsNodeC addressed to ItsNodeB
                 *              containing Basic Header
                 *                  containing RHL field
                 *                      indicating value greater than 1
                 *      }
                 *      then {
                 *          the IUT forwards the received LS_REPLY packet to ItsNodeB
                 *              containing Basic Header
                 *                  containing RHL field
                 *                      indicating value decreased by 1
                 *      }
                 *  }
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOS/BV/11
filatov's avatar
filatov committed
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.7.2
                 */
                testcase TC_GEONW_PON_LOS_BV_11() runs on ItsMtc system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    
                    // Test control
                    
                    // Test component configuration
                    f_cf03Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_LOS_BV_11_nodeB());
                    v_nodeC.start(f_GEONW_PON_LOS_BV_11_nodeC());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end TC_GEONW_PON_LOS_BV_11
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_LOS_BV_11)
                 */
                function f_GEONW_PON_LOS_BV_11_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                    
                    // Test Body
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwLsReplyPacket(
                                        mw_longPosVectorPosition(v_longPosVectorNodeA),
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB))
                                    ),
                                    -,
                                    c_defaultHopLimit - 1
                                )
                            )
                        ) {
                            log("*** " & testcasename() & ": PASS: Forwarded LS Reply received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: LS Reply was not forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_LOS_BV_11_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_LOS_BV_11)
                 */
                function f_GEONW_PON_LOS_BV_11_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(
                                m_geoNwLsReplyPacket(
                                    f_getPosition(c_compNodeA),
                                    f_longPosVector2ShortPosVector(f_getPosition(c_compNodeB)),
                                    vc_localSeqNumber
                                ),
                                -,
                                c_defaultHopLimit
                            )
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_LOS_BV_11_nodeC
                
            } // end GEONW_PON_LOS_BV_11
            
            /**
             * @desc    Test flushing of the LS buffer, initiated by the processing of a common header from the target destination
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT having no Location Table Entry for ItsNodeA and
             *      the IUT having been requested to send a GeoUnicast packet ItsNodeA
             *          containing LT field
             *              indicating LT1 and
             *      the IUT having sent a LS_REQUEST packet
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT receives a GeoUnicast packet addressed to it from ItsNodeA before expiry of LT1
filatov's avatar
filatov committed
             *      }
             *      then {
             *          the IUT sends the waiting GeoUnicast packet to ItsNodeA
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOS/BV/12
filatov's avatar
filatov committed
             * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.7.1.2 and 7.4.2
             */
            testcase TC_GEONW_PON_LOS_BV_12() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeA;
                var LongPosVector v_longPosVectorIut;
                var UInt16 v_seqNbr := vc_localSeqNumber;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                 if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
filatov's avatar
filatov committed
                }
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_ac.stop;
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
filatov's avatar
filatov committed
                    }
                }
                
                // Test Body
                f_sendGeoNetMessage(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwUnicastPacket(
                                v_longPosVectorNodeA,
                                f_longPosVector2ShortPosVector(v_longPosVectorIut),
                                vc_localSeqNumber
                            )
                        )
                    )
                );
                
                tc_ac.start;
                alt {
                    [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: GeoUnicast packet received correctly ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_LOS_BV_12
            
            /**
             * @desc    Test of LS buffer characteristics: FIFO type and Lifetime
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT having no Location Table Entry for ItsNodeA and
             *      the IUT having been requested to send a GeoUnicast packet to ItsNodeA
             *          containing TrafficClass.SCF set to 1
             *          containing LT field
             *              indicating value LT1
             *          containing payload field
             *              indicating value PL1 and
             *      the IUT having sent a LS_REQUEST packet and
             *      the IUT having been requested to send a second GeoUnicast packet to ItsNodeA
             *          containing TrafficClass.SCF set to 1
             *          containing LT field
             *              indicating LT2 lower than LT1
             *          containing payload field
             *              indicating value PL2
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT receives the LS_REPLY packet from ItsNodeA
             *              after expiry of LT2
             *              before expiry of LT1
             *      }
             *      then {
             *          the IUT sends GeoUnicast packet addressed to ItsNodeA
             *              containing payload field
             *                  indicating value PL1
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOS/BV/13
             * @reference   EN 302 636-4-1 [1], clauses 7.4.3, 9.3.7.1.2
filatov's avatar
filatov committed
             */
            testcase TC_GEONW_PON_LOS_BV_13() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeA;
                var LongPosVector v_longPosVectorIut;
                var integer v_lt1 := f_getLsMaxRetrans()*float2int(f_getLsRetransmitTimer());
                var integer v_lt2 := float2int(int2float(v_lt1)/2.0);
                var octetstring v_payload1 := char2oct("PAYLOAD_1");
                var octetstring v_payload2 := char2oct("PAYLOAD_2");
                var boolean v_msg1Received := false;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                
                 if ( not f_utTriggerEvent(m_generateGeoUnicastMessageWithLifetimeWithPayload(v_longPosVectorNodeA.gnAddr, v_lt2*1000, v_payload2)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
filatov's avatar
filatov committed
                }
                 if ( not f_utTriggerEvent(m_generateGeoUnicastMessageWithLifetimeWithPayload(v_longPosVectorNodeA.gnAddr, v_lt1*1000, v_payload1)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
filatov's avatar
filatov committed
                }
                
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_ac.stop;
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                    }
                        
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                
                // Test Body
                //Send LS-REPLY after LT2 expiry
                f_sleepIgnoreDef(int2float(v_lt2));
                
                f_sendGeoNetMessage(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwLsReplyPacket(
                                v_longPosVectorNodeA,
                                f_longPosVector2ShortPosVector(v_longPosVectorIut),
                                vc_localSeqNumber
                            )
                        )
                    )
                );
                
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        log("*** " & testcasename() & ": INFO: LS Request retransmission ignored ***");
                        repeat;
                    }
                    [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            ),
                            f_adaptPayload_mw(v_payload1)
                        )
                    ) {
                        v_msg1Received := true;
                        repeat;
                    }
                    [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacket(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                                        ?
                                    )
                                )
                            ),
                            f_adaptPayload_mw(v_payload2)
                        )
                    ) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": FAIL: message with elapsed lifetime received ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                    }
                    [] tc_ac.timeout {
                        if(v_msg1Received == true) {
                            log("*** " & testcasename() & ": PASS: message with running lifetime received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                        }
                        else {
                            log("*** " & testcasename() & ": FAIL: message with running lifetime not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                        }
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_LOS_BV_13
            
            /**
             * @desc    Test that GeoNetworking packets in LS buffer are discarded when LS does not complete
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT having no Location Table Entry for ItsNodeA and
             *      the IUT having been requested to send a GeoUnicast packet to ItsNodeA
             *          containing TrafficClass.SCF set to 1
             *          containing LT field
             *              indicating value LT1 higher than (itsGnLocationServiceTimer * itsGnLocationServiceMaxRetrans) and
             *      the IUT having sent a LS_REQUEST packet itsGnLocationServiceMaxRetrans times
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT receives a GUC packet from ItsNodeA
             *              before expiration of LT1
             *      }
             *      then {
             *          the IUT does not send any packet to ItsNodeA (see note)
             *      }
             *  }
             *  NOTE: Stored GeoUnicast packets have been discarded upon LS failure
             *  
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOS/BV/14
             * @reference   EN 302 636-4-1 [1], clauses 7.4.3
filatov's avatar
filatov committed
             */
            testcase TC_GEONW_PON_LOS_BV_14() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeA;
                var LongPosVector v_longPosVectorIut;
                var integer v_maxNbrRetrans := f_getLsMaxRetrans();
                var integer v_nbLsReceived := 0;
                var UInt16 v_LT1;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                v_LT1 := float2int(int2float(v_maxNbrRetrans + 2) * f_getLsRetransmitTimer() * 1000.0);
                 if ( not f_utTriggerEvent(m_generateGeoUnicastMessageWithLifetime(v_longPosVectorNodeA.gnAddr,v_LT1)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
filatov's avatar
filatov committed
                }
                
                tc_wait.start(int2float(v_LT1));
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_ac.stop;
                        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": Pre-conditions: Expected message not received ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
filatov's avatar
filatov committed
                    }
                }
                
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_ac.stop;
                        v_nbLsReceived := v_nbLsReceived + 1;
                        if(v_nbLsReceived > v_maxNbrRetrans) {
                            //first LS request is not counted as a retransmission
                            log("*** " & testcasename() & ": Pre-conditions: LS_REQUEST retransmitted more than itsGnLocationServiceMaxRetrans times ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_error);
filatov's avatar
filatov committed
                        }
                        else {
                            tc_ac.start;
                            repeat;
                        }
                    }
                    [] tc_ac.timeout {
                        if(v_nbLsReceived == (v_maxNbrRetrans)) {
                            //first LS request is not counted as a retransmission
                            log("*** " & testcasename() & ": Pre-conditions: LS_REQUEST retransmitted itsGnLocationServiceMaxRetrans times ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                        }
                        else {
                            log("*** " & testcasename() & ": Pre-conditions: LS_REQUEST retransmitted less than itsGnLocationServiceMaxRetrans times ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_error);
filatov's avatar
filatov committed
                        }
                    }
                }
                
                // Test Body
                if (tc_wait.running) {
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(
                                m_geoNwUnicastPacket(
                                    v_longPosVectorNodeA,
                                    f_longPosVector2ShortPosVector(v_longPosVectorIut),
                                    vc_localSeqNumber
                                )
                            )
                        )
                    );
                    tc_wait.stop;
                    
                    tc_noac.start;
                    alt {
                        // no check for ItsNodeA address as no other trigger for messages exists
                        [] geoNetworkingPort.receive {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: Unexpected message received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: No message was sent ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    log("*** " & testcasename() & ": FAIL: LT1 expired ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_LOS_BV_14

            /**
             * @desc    Test flushing of the LS buffer, initiated by the processing of a common header from the target destination
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *  	the IUT being in the "initial state" and
             *  	the IUT having no Location Table Entry for ItsNodeA and
             *  	the IUT having been requested to send a GeoUnicast packet ItsNodeA
             *  		containing LT field
             *  			indicating LT1 and
             *  	the IUT having sent a LS_REQUEST packet
             *  }
             * Expected behaviour:
             *  ensure that {
             *  	when {
             *  		the IUT receives a GeoUnicast packet addressed to ItsNodeB from ItsNodeA before expiry of LT1
             *  	}
             *  	then {
             *  		the IUT sends the waiting GeoUnicast packet to ItsNodeA
             *  	}
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOS/BV/15
             * @reference   EN 302 636-4-1 [1], clauses 9.3.8.3, 9.3.7.1.2 and 7.4.2
             */
            testcase TC_GEONW_PON_LOS_BV_15() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeA;
                var LongPosVector v_longPosVectorNodeB;
                var LongPosVector v_longPosVectorIut;
                var UInt16 v_seqNbr := vc_localSeqNumber;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                }
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_ac.stop;
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                    }
                }
                
                // Test Body
                f_sendGeoNetMessage(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwUnicastPacket(
                                v_longPosVectorNodeA,
                                f_longPosVector2ShortPosVector(v_longPosVectorNodeB),
                                vc_localSeqNumber
                            )
                        )
                    )
                );
                
                tc_ac.start;
                alt {
                    [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: GeoUnicast packet received correctly ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_LOS_BV_15

            /**
             * @desc    Test of LS Request retransmission termination when indirect response is received
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *  	the IUT being in the "initial state" and
             *  	the IUT having no Location Table Entry for ItsNodeA and
             *  	the IUT having been requested to send a GeoUnicast packet to ItsNodeA
             *  		containing TrafficClass.SCF set to 1
             *  		containing LT field
             *  			indicating value LT1 higher than (itsGnLocationServiceTimer * itsGnLocationServiceMaxRetrans) and
             *  	the IUT having sent a LS_REQUEST packet
             *  	the IUT having retransmitted the LS_REQUEST packet less than itsGnLocationServiceMaxRetrans
             *  }
             * Expected behaviour:
             *  ensure that {
             *  	when {
             *  		the IUT receives a GeoUnicast packet addressed to it from ItsNodeA before expiry of LT1
             *  	}
             *  	then {
             *  		the IUT does not retransmits the LS_REQUEST packet
             *  	}
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOS/BV/16
             * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.7.1.2, 9.3.7.1.3 and 9.3.8.2
             */
            testcase TC_GEONW_PON_LOS_BV_16() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeA;
                var LongPosVector v_longPosVectorNodeB;
                var LongPosVector v_longPosVectorIut;
                var UInt16 v_seqNbr := vc_localSeqNumber;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                }
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_ac.stop;
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                    }
                }
                
                // Test Body
                f_sendGeoNetMessage(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwUnicastPacket(
                                v_longPosVectorNodeA,
                                f_longPosVector2ShortPosVector(v_longPosVectorIut),
                                vc_localSeqNumber
                            )
                        )
                    )
                );
                
                tc_noac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_noac.stop;
                        log("*** " & testcasename() & ": FAIL: LS Request retransmitted ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                    }
                    [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) {
                        log("*** " & testcasename() & ": INFO: GeoUnicast packet received ***");
                        repeat;
                    }
                    [] tc_noac.timeout {
                        log("*** " & testcasename() & ": PASS: LS Request not retransmitted ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_LOS_BV_16

            /**
             * @desc    Test of LS Request retransmission termination when indirect response is received
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *  	the IUT being in the "initial state" and
             *  	the IUT having no Location Table Entry for ItsNodeA and
             *  	the IUT having been requested to send a GeoUnicast packet to ItsNodeA
             *  		containing TrafficClass.SCF set to 1
             *  		containing LT field
             *  			indicating value LT1 higher than (itsGnLocationServiceTimer * itsGnLocationServiceMaxRetrans) and
             *  	the IUT having sent a LS_REQUEST packet
             *  	the IUT having retransmitted the LS_REQUEST packet less than itsGnLocationServiceMaxRetrans
             *  }
             * Expected behaviour:
             *  ensure that {
             *  	when {
             *  		the IUT receives a GeoUnicast packet addressed to ItsNodeB from ItsNodeA before expiry of LT1
             *  	}
             *  	then {
             *  		the IUT does not retransmits the LS_REQUEST packet
             *  	}
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOS/BV/17
             * @reference   EN 302 636-4-1 [1], clauses 9.3.8.3, 9.3.7.1.2, 9.3.7.1.3 and 9.3.8.2
             */
            testcase TC_GEONW_PON_LOS_BV_17() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeA;
                var LongPosVector v_longPosVectorNodeB;
                var LongPosVector v_longPosVectorIut;
                var UInt16 v_seqNbr := vc_localSeqNumber;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeA.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                }
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_ac.stop;
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Pre-conditions: LS Request not received ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                    }
                }
                
                // Test Body
                f_sendGeoNetMessage(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwUnicastPacket(
                                v_longPosVectorNodeA,
                                f_longPosVector2ShortPosVector(v_longPosVectorNodeB),
                                vc_localSeqNumber
                            )
                        )
                    )
                );
                
                tc_noac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeA.gnAddr.mid, v_longPosVectorIut) {
                        tc_noac.stop;
                        log("*** " & testcasename() & ": FAIL: LS Request retransmitted ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                    }
                    [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA))) {
                        log("*** " & testcasename() & ": INFO: GeoUnicast packet received ***");
                        repeat;
                    }
                    [] tc_noac.timeout {
                        log("*** " & testcasename() & ": PASS: LS Request not retransmitted ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_LOS_BV_17
filatov's avatar
filatov committed
            
        } // end geoLocationService
        
        // 6.2.2.5
        group geoForwardingPacketBuffer {
            
            group GEONW_PON_FPB_BV_01 {
                
                /**
                 * @desc    Test of Source packet buffering into UC forwarding buffer for unreachable Unicast destinations
                 *          (absence of a suitable next hop candidate)
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF03
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT not having received any Beacon information from ItsNodeB and
                 *      the IUT having a Location Table Entry for ItsNodeA (see note) and
                 *      the IUT having been requested to send a GeoUnicast packet addressed to ItsNodeA
                 *          containing TrafficClass.SCF set to 1
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT receives a Beacon packet from ItsNodeB
                 *      }
                 *      then {
                 *          the IUT selects the ItsNodeB as the next hop and
                 *          the IUT sends the buffered GeoUnicast packet
                 *      }
                 *  }
                 *  NOTE: Location Table Entry is created by sending any GeoNetworking packet, originated by ItsNodeA, from ItsNodeC to IUT
                 *  
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/FPB/BV/01
                 * @reference   EN 302 636-4-1 [1], clauses 7.5.3, 9.3.6.3, 9.3.4.2 and 9.3.8.3
filatov's avatar
filatov committed
                 */
                testcase TC_GEONW_PON_FPB_BV_01() runs on ItsMtc system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    
                    // Test control
                    
                    // Test component configuration
                    f_cf03Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeB.start(f_GEONW_PON_FPB_BV_01_nodeB());
                    v_nodeC.start(f_GEONW_PON_FPB_BV_01_nodeC());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf03Down();
                    
                } // end TC_GEONW_PON_FPB_BV_01
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_FPB_BV_01)
                 */
                function f_GEONW_PON_FPB_BV_01_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prDefault(); // NodeB is not yet a neighbour
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                    
                    // Test Body
                    f_sleepIgnoreDef(1.0);
                    f_startBeingNeighbour();
                    
                    tc_ac.start;
                    alt {
                        [] a_receiveAnyLsRequest() {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": INCONC: Received Location Service Request ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                        }
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket(
                            mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)),
                            ?)))) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: packet correctly forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);