ItsGeoNetworking_TestCases.ttcn 913 KB
Newer Older
filatov's avatar
filatov committed
                 */
                function f_TP_GEONW_PON_LOT_BV_03_main(in template (value) LongPosVector p_longPosVectorNodeA) runs on ItsGeoNetworking {
                    
                    // Test Body
                    if ( not  f_utTriggerEvent(m_generateGeoUnicastMessage(valueof(p_longPosVectorNodeA.gnAddr))) ) {
filatov's avatar
filatov committed
                        log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                    }
                    
                    tc_ac.start;
                    alt {
                        [] a_receiveAnyLsRequest() {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": FAIL: Received Location Service Request ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_longPosVectorNodeA)))) {
filatov's avatar
filatov committed
                            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() & ": INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                        }
                    }
                        
                    // Postamble
                    f_poNeighbour();
                    f_cf01Down();
                    
                } // end f_TP_GEONW_PON_LOT_BV_03_main
                
            } //end GEONW_PON_LOT_BV_03
            
            /**
             * @desc    Test of handling entries expiring from location table
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT having received Beacons information from ItsNodeB and
             *      the IUT not having received beacons from ItsNodeB for the duration of itsGnLifetimeLocTE parameter (20 sec)
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a LS_REQUEST
             *                  containing Request field
             *                      indicating GN_ADDR of ItsNodeB
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOT/BV/04
filatov's avatar
filatov committed
             * @reference   EN 302 636-4-1 [1], clauses 7.1.3, 9.3.8.2, 9.3.7.1.2 and Annex G
             */
            testcase TC_GEONW_PON_LOT_BV_04() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var LongPosVector v_longPosVectorIut;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Preamble
                f_prDefault(); // NodeB will send Beacon only once
                f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu(m_geoNwBeaconPacket(f_getPosition(c_compNodeB)), -, c_hopLimit1)));
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                
                // Test Body
                f_sleep(f_getLifetimeLocTableEntry());
                if ( not  f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                }
                
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(?, v_longPosVectorNodeB.gnAddr.mid, v_longPosVectorIut ) {
                        log("*** " & testcasename() & ": PASS: LS Request received correctly ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: LS Request not received ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                    }
                }
                
                // Postamble
                f_poDefault();
                f_cf01Down();
                
            } // end TC_GEONW_PON_LOT_BV_04
            
            group GEONW_PON_LOT_BV_05 {
                
                /**
                 * @desc    Test of updating entries in location table with most up-to-date position data extracted
                 *          from common header processing (including timestamp comparison before updating)
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF01
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT having received Beacon information from ItsNodeB and
                 *      the IUT having received a MESSAGE from ItsNodeB,
                 *          containing Extended Header
                 *              containing SOPV field
                 *                  indicating an older timestamp than the last Beacon packet and
                 *                  indicating a different position than the position of the last Beacon packet
                 *  }
                 *  MESSAGE: GUC packet
                 *
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
                 *      }
                 *      then {
                 *          the IUT does not send a GeoNetworking packet
                 *              containing a LS_REQUEST
                 *                  containing Request field
                 *                      indicating GN_ADDR of ItsNodeB
                 *          the IUT sends a GeoNetworking packet
                 *              containing a correctly formatted Common Header
                 *                  containing HT field
                 *                      set to '2' (GEOUNICAST)
                 *              containing GUC Extended Header
                 *                  containing DEPV field
                 *                      indicating same position as the SOPV value of the Beacon information received
                 *      }
                 *  }
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOT/BV/05
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2
filatov's avatar
filatov committed
                 */
                testcase TC_GEONW_PON_LOT_BV_05_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB;
                    var LongPosVector v_obsoleteLongPosVectorNodeB;
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_2(
                        m_geoNwUnicastPacket(
                            v_obsoleteLongPosVectorNodeB,
                            f_getIutShortPosVector(),
                            vc_localSeqNumber
                        )
                    );
                    
                    f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                } // end TC_GEONW_PON_LOT_BV_05_01
                
                /**
                 * @desc    Test of updating entries in location table with most up-to-date position data extracted
                 *          from common header processing (including timestamp comparison before updating)
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF01
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT having received Beacon information from ItsNodeB and
                 *      the IUT having received a MESSAGE from ItsNodeB,
                 *          containing Extended Header
                 *              containing SOPV field
                 *                  indicating an older timestamp than the last Beacon packet and
                 *                  indicating a different position than the position of the last Beacon packet
                 *  }
                 *  MESSAGE: GAC packet
                 *
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
                 *      }
                 *      then {
                 *          the IUT does not send a GeoNetworking packet
                 *              containing a LS_REQUEST
                 *                  containing Request field
                 *                      indicating GN_ADDR of ItsNodeB
                 *          the IUT sends a GeoNetworking packet
                 *              containing a correctly formatted Common Header
                 *                  containing HT field
                 *                      set to '2' (GEOUNICAST)
                 *              containing GUC Extended Header
                 *                  containing DEPV field
                 *                      indicating same position as the SOPV value of the Beacon information received
                 *      }
                 *  }
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOT/BV/05
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2
filatov's avatar
filatov committed
                 */
                testcase TC_GEONW_PON_LOT_BV_05_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB;
                    var LongPosVector v_obsoleteLongPosVectorNodeB;
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_2(
                        m_geoNwAnycastPacket(
                            v_obsoleteLongPosVectorNodeB,
                            vc_localSeqNumber,
                            f_getGeoAnycastArea(c_area1)
                        )
                    );
                    
                    f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                } // end TC_GEONW_PON_LOT_BV_05_02
                
                /**
                 * @desc    Test of updating entries in location table with most up-to-date position data extracted
                 *          from common header processing (including timestamp comparison before updating)
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF01
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT having received Beacon information from ItsNodeB and
                 *      the IUT having received a MESSAGE from ItsNodeB,
                 *          containing Extended Header
                 *              containing SOPV field
                 *                  indicating an older timestamp than the last Beacon packet and
                 *                  indicating a different position than the position of the last Beacon packet
                 *  }
                 *  MESSAGE: GBC packet
                 *
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
                 *      }
                 *      then {
                 *          the IUT does not send a GeoNetworking packet
                 *              containing a LS_REQUEST
                 *                  containing Request field
                 *                      indicating GN_ADDR of ItsNodeB
                 *          the IUT sends a GeoNetworking packet
                 *              containing a correctly formatted Common Header
                 *                  containing HT field
                 *                      set to '2' (GEOUNICAST)
                 *              containing GUC Extended Header
                 *                  containing DEPV field
                 *                      indicating same position as the SOPV value of the Beacon information received
                 *      }
                 *  }
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOT/BV/05
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2
filatov's avatar
filatov committed
                 */
                testcase TC_GEONW_PON_LOT_BV_05_03() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB;
                    var LongPosVector v_obsoleteLongPosVectorNodeB;
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_2(
                        m_geoNwBroadcastPacket(
                            v_obsoleteLongPosVectorNodeB,
                            vc_localSeqNumber,
                            f_getGeoBroadcastArea(c_area1)
                        )
                    );
                    
                    f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                } // end TC_GEONW_PON_LOT_BV_05_03
                
                /**
                 * @desc    Test of updating entries in location table with most up-to-date position data extracted
                 *          from common header processing (including timestamp comparison before updating)
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF01
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT having received Beacon information from ItsNodeB and
                 *      the IUT having received a MESSAGE from ItsNodeB,
                 *          containing Extended Header
                 *              containing SOPV field
                 *                  indicating an older timestamp than the last Beacon packet and
                 *                  indicating a different position than the position of the last Beacon packet
                 *  }
                 *  MESSAGE: TSB packet
                 *
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
                 *      }
                 *      then {
                 *          the IUT does not send a GeoNetworking packet
                 *              containing a LS_REQUEST
                 *                  containing Request field
                 *                      indicating GN_ADDR of ItsNodeB
                 *          the IUT sends a GeoNetworking packet
                 *              containing a correctly formatted Common Header
                 *                  containing HT field
                 *                      set to '2' (GEOUNICAST)
                 *              containing GUC Extended Header
                 *                  containing DEPV field
                 *                      indicating same position as the SOPV value of the Beacon information received
                 *      }
                 *  }
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOT/BV/05
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2
filatov's avatar
filatov committed
                 */
                testcase TC_GEONW_PON_LOT_BV_05_04() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB;
                    var LongPosVector v_obsoleteLongPosVectorNodeB;
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_2(
                        m_geoNwTsbPacket(
                            vc_localSeqNumber,
                            v_obsoleteLongPosVectorNodeB
                        )
                    );
                    
                    f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                } // end TC_GEONW_PON_LOT_BV_05_04
                
                /**
                 * @desc    Test of updating entries in location table with most up-to-date position data extracted
                 *          from common header processing (including timestamp comparison before updating)
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF01
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT having received Beacon information from ItsNodeB and
                 *      the IUT having received a MESSAGE from ItsNodeB,
                 *          containing Extended Header
                 *              containing SOPV field
                 *                  indicating an older timestamp than the last Beacon packet and
                 *                  indicating a different position than the position of the last Beacon packet
                 *  }
                 *  MESSAGE: SHB packet
                 *
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
                 *      }
                 *      then {
                 *          the IUT does not send a GeoNetworking packet
                 *              containing a LS_REQUEST
                 *                  containing Request field
                 *                      indicating GN_ADDR of ItsNodeB
                 *          the IUT sends a GeoNetworking packet
                 *              containing a correctly formatted Common Header
                 *                  containing HT field
                 *                      set to '2' (GEOUNICAST)
                 *              containing GUC Extended Header
                 *                  containing DEPV field
                 *                      indicating same position as the SOPV value of the Beacon information received
                 *      }
                 *  }
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOT/BV/05
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2
filatov's avatar
filatov committed
                 */
                testcase TC_GEONW_PON_LOT_BV_05_05() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB;
                    var LongPosVector v_obsoleteLongPosVectorNodeB;
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_2(
                        m_geoNwShbPacket(
                            v_obsoleteLongPosVectorNodeB
                        )
                    );
                    
                    f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                } // end TC_GEONW_PON_LOT_BV_05_05
                
                /**
                 * @desc    Test of updating entries in location table with most up-to-date position data extracted
                 *          from common header processing (including timestamp comparison before updating)
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF01
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT having received Beacon information from ItsNodeB and
                 *      the IUT having received a MESSAGE from ItsNodeB,
                 *          containing Extended Header
                 *              containing SOPV field
                 *                  indicating an older timestamp than the last Beacon packet and
                 *                  indicating a different position than the position of the last Beacon packet
                 *  }
                 *  MESSAGE: LS Request packet
                 *
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
                 *      }
                 *      then {
                 *          the IUT does not send a GeoNetworking packet
                 *              containing a LS_REQUEST
                 *                  containing Request field
                 *                      indicating GN_ADDR of ItsNodeB
                 *          the IUT sends a GeoNetworking packet
                 *              containing a correctly formatted Common Header
                 *                  containing HT field
                 *                      set to '2' (GEOUNICAST)
                 *              containing GUC Extended Header
                 *                  containing DEPV field
                 *                      indicating same position as the SOPV value of the Beacon information received
                 *      }
                 *  }
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOT/BV/05
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2
filatov's avatar
filatov committed
                 */
                testcase TC_GEONW_PON_LOT_BV_05_06() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB;
                    var LongPosVector v_obsoleteLongPosVectorNodeB;
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                    activate(a_receiveAnyLsReply());
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_2(
                        m_geoNwLsRequestPacket(
                            v_obsoleteLongPosVectorNodeB,
                            vc_localSeqNumber,
                            f_getIutGnLocalAddress()
                        )
                    );
                    
                    f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                } // end TC_GEONW_PON_LOT_BV_05_06
                
                /**
                 * @desc    Test of updating entries in location table with most up-to-date position data extracted
                 *          from common header processing (including timestamp comparison before updating)
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF01
                 * Initial conditions:
                 *  with {
                 *      the IUT being in the "initial state" and
                 *      the IUT having received Beacon information from ItsNodeB and
                 *      the IUT having received a MESSAGE from ItsNodeB,
                 *          containing Extended Header
                 *              containing SOPV field
                 *                  indicating an older timestamp than the last Beacon packet and
                 *                  indicating a different position than the position of the last Beacon packet
                 *  }
                 *  MESSAGE: LS Reply packet
                 *
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
                 *      }
                 *      then {
                 *          the IUT does not send a GeoNetworking packet
                 *              containing a LS_REQUEST
                 *                  containing Request field
                 *                      indicating GN_ADDR of ItsNodeB
                 *          the IUT sends a GeoNetworking packet
                 *              containing a correctly formatted Common Header
                 *                  containing HT field
                 *                      set to '2' (GEOUNICAST)
                 *              containing GUC Extended Header
                 *                  containing DEPV field
                 *                      indicating same position as the SOPV value of the Beacon information received
                 *      }
                 *  }
                 * </pre>
                 *
                 * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOT/BV/05
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.8.4, 9.3.12.3, 9.3.11.3, 9.3.9.3, 9.3.7.3, 9.3.8.2 and Annex C2
filatov's avatar
filatov committed
                 */
                testcase TC_GEONW_PON_LOT_BV_05_07() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB;
                    var LongPosVector v_obsoleteLongPosVectorNodeB;
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_1(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                    f_TP_GEONW_PON_LOT_BV_05_pre_2(
                        m_geoNwLsReplyPacket(
                            v_obsoleteLongPosVectorNodeB,
                            f_getIutShortPosVector(),
                            vc_localSeqNumber
                        )
                    );
                    
                    f_TP_GEONW_PON_LOT_BV_05_main(v_longPosVectorNodeB, v_obsoleteLongPosVectorNodeB);
                    
                } // end TC_GEONW_PON_LOT_BV_05_07
                
                /**
                 * @desc    Function including first preamble part (TC_GEONW_PON_LOT_BV_05)
                 */
                function f_TP_GEONW_PON_LOT_BV_05_pre_1(out LongPosVector p_longPosVectorNodeB, out LongPosVector p_obsoleteLongPosVectorNodeB) runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Test control
                    
                    // Test component configuration
                    f_cf01Up();
                    p_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    p_obsoleteLongPosVectorNodeB := p_longPosVectorNodeB;
                    p_obsoleteLongPosVectorNodeB.timestamp := p_obsoleteLongPosVectorNodeB.timestamp - 1000;
                    p_obsoleteLongPosVectorNodeB.latitude := p_obsoleteLongPosVectorNodeB.latitude - 1;
                    
                    // Test adapter configuration
                    
                    // Preamble
                    f_prDefault();
                    
                    // Act as a neighbor and send one beacon
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(m_geoNwPdu(m_geoNwBeaconPacket(f_getPosition(c_compNodeB)), -, c_hopLimit1)));
                } // end f_TP_GEONW_PON_LOT_BV_05_pre_1
                
                /**
                 * @desc    Function including second preamble part (TC_GEONW_PON_LOT_BV_05)
                 */
                function f_TP_GEONW_PON_LOT_BV_05_pre_2(in template (value) GnNonSecuredPacket p_packet) runs on ItsGeoNetworking {
                    
                    //preamble part II
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(m_geoNwPdu(p_packet))
                    );
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                } // end f_TP_GEONW_PON_LOT_BV_05_pre_2
                
                /**
                 * @desc    Function including test body and postamble part (TC_GEONW_PON_LOT_BV_05)
                 */
                function f_TP_GEONW_PON_LOT_BV_05_main(in template (value) LongPosVector p_longPosVectorNodeB, in template (value) LongPosVector p_obsoleteLongPosVectorNodeB) runs on ItsGeoNetworking {
                    
                    // Test Body
                    if ( not  f_utTriggerEvent(m_generateGeoUnicastMessage(valueof(p_longPosVectorNodeB.gnAddr)))) {
filatov's avatar
filatov committed
                        log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                    }
                    
                    tc_ac.start;
                    alt {
                        [] a_receiveAnyLsRequest() {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": FAIL: Received Location Service Request ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_obsoleteLongPosVectorNodeB)))) {
filatov's avatar
filatov committed
                            tc_ac.stop;
                            log("*** " & testcasename() & ": FAIL: GeoUnicast received with obsolete Destination Position Vector ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        [] a_receiveGeoUnicastWithDestination(mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(valueof(p_longPosVectorNodeB)))) {
filatov's avatar
filatov committed
                            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() & ": INCONC: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                        }
                    }
                    
                    // Postamble
                    f_poDefault();
                    f_cf01Down();
                    
                } // end f_TP_GEONW_PON_LOT_BV_05_main
                
            } // end group GEONW_PON_LOT_BV_05
            
        } // end geoLocationTable
        
        // 6.2.2.2
        group geoLocalPositionVector {
            
            /**
             * @desc    Test of the updating of the Local position vector
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT having changed its position
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT generates eventually a Beacon packet
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '1' (BEACON)
             *                  containing HST field
             *                      set to '0' (UNSPECIFIED)
             *                  containing Extended Header
             *                      containing SOPV field
             *                          indicating the new position
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LPV/BV/01
filatov's avatar
filatov committed
             * @reference   EN 302 636-4-1 [1], clauses 7.2.3, 9.2.2.2, 9.3.6.1 and Annex G
             */
            testcase TC_GEONW_PON_LPV_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                var template LongPosVector v_previouslongPosVectorIut;
                var GeoNetworkingInd v_geoNwInd;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                v_previouslongPosVectorIut := v_longPosVectorIut;
                v_previouslongPosVectorIut.timestamp := ?;
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader));
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(
                            mw_geoNwBeaconPacket(
                                mw_longPosVectorAny(v_longPosVectorIut.gnAddr)
                            )
                        ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": Pre-conditions: Beacon received ***");
                        v_longPosVectorIut := v_geoNwInd.msgIn.gnPacket.packet.extendedHeader.beaconHeader.srcPosVector;
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": Pre-conditions: Expected message not received ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
filatov's avatar
filatov committed
                    }
                }
                f_utChangePosition();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                
                // Test Body
                geoNetworkingPort.clear;
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(
                            mw_geoNwBeaconPacket(
                                mw_longPosVectorAny(v_longPosVectorIut.gnAddr)
                            )
                        ))) -> value v_geoNwInd {
                        tc_ac.stop;
                        //check if the position vector has changed
                        if (match(v_geoNwInd.msgIn.gnPacket.packet.extendedHeader.beaconHeader.srcPosVector, v_previouslongPosVectorIut)) {
                            log("*** " & testcasename() & ": FAIL: Sender Postion Vector not correctly updated ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                        }
                        else {
                            log("*** " & testcasename() & ": PASS: Sender Postion Vector correctly updated ***");
                            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);
filatov's avatar
filatov committed
                    }
                }
                f_acTriggerEvent(m_stopPassBeaconing);
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_LPV_BV_01
            
        } // end geoLocalPositionVector
        
        // 6.2.2.3
        group geoSequenceNumber {
            
            /**
             * @desc    Test of the initial sequence number assignment
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT not having sent any GUC and
filatov's avatar
filatov committed
             *      the IUT having received Beacon information from ItsNodeB
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '2' (GEOUNICAST)
             *                  containing HST field
             *                      set to '0' (UNSPECIFIED)
             *              containing GeoUnicast Extended Header
             *                  containing SN field
             *                      indicating value '0'
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/SQN/BV/01
filatov's avatar
filatov committed
             * @reference   EN 302 636-4-1 [1], clauses 7.2.3, 9.3.8.2
             */
            testcase TC_GEONW_PON_SQN_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var UInt16 v_expectedSequenceNumber := 0;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                
                // Test Body
                if ( not  f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                }
                
                tc_ac.start;
                alt {
                    [] a_receiveGeoUnicast(mw_shortPosVectorPosition_anyPos(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), v_expectedSequenceNumber) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: GeoUnicast packet received correctly ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                    }
                    [] a_receiveGeoUnicast(mw_shortPosVectorPosition_anyPos(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), ?) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": FAIL: GeoUnicast packet received with incorrect sequence number ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_SQN_BV_01
            
            /**
             * @desc    Test of the local sequence number incrementing
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT having received Beacon information from ItsNodeB and
             *      the IUT having sent a GeoUnicast packet to the ItsNodeB
             *          containing the Sequence Number field
             *              indicating value SN1
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '2' (GEOUNICAST)
             *              containing GeoUnicast Extended Header
             *                  containing SN field
             *                      indicating value SN1 + 1
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/SQN/BV/02
filatov's avatar
filatov committed
             * @reference   EN 302 636-4-1 [1], clauses 7.2.3, 9.3.8.2
             */
            testcase TC_GEONW_PON_SQN_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var UInt16 v_expectedSequenceNumber := 0;
                var integer v_nbReceivedPackets := 0;
                var GeoNetworkingInd v_geoNwInd;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_sleep(10.0);
                // receive first packet
                if ( not  f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
filatov's avatar
filatov committed
                }
                tc_ac.start;
                alt {
                    
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket(
                            mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)),
                            ?)))) -> value v_geoNwInd {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": Pre-conditions: First GeoUnicast packet received  ***");
                        v_expectedSequenceNumber := v_geoNwInd.msgIn.gnPacket.packet.extendedHeader.geoUnicastHeader.seqNumber + 1;
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": Pre-conditions: Expected message not received ***");
                        f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                
                // Test Body
                if ( not  f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                }
                tc_ac.start;
                alt {
                    [] a_receiveGeoUnicast(mw_shortPosVectorPosition_anyPos(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), v_expectedSequenceNumber) {
                        tc_ac.stop;
                        v_nbReceivedPackets := v_nbReceivedPackets + 1;
                        if(v_nbReceivedPackets >= vc_multipleMessagesCount) {
                            log("*** " & testcasename() & ": PASS: GeoUnicast packets received with correct sequence numbers ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
filatov's avatar
filatov committed
                        }
                        else {
                            v_expectedSequenceNumber := v_expectedSequenceNumber + 1;
				            if ( not  f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
				                log("*** " & testcasename() & ": INCONC: Trigger failed ***");
				                f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
				            }
                            tc_ac.start;
                            repeat;
                        }
                    }
                    [] a_receiveGeoUnicast(mw_shortPosVectorPosition_anyPos(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), ?) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": FAIL: GeoUnicast packet received with incorrect sequence number ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
filatov's avatar
filatov committed
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_PON_SQN_BV_02
        
        } // end geoSequenceNumber
        
        // 6.2.2.4
        group geoLocationService {
            
            /**
             * @desc    Test of first LS invocation for unknown Destination nodes
             * <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
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a GeoUnicast packet to ItsNodeA
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '6' (LS)
             *                  containing HST field
             *                      set to '0' (LS_REQUEST)
             *                  containing NH field
             *                      set to '0' (UNSPECIFIED)
             *              containing LS_REQUEST Extended Header
             *                  containing Request field
             *                      indicating GN_ADDR of ItsNodeA
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v1.3.1 TP/GEONW/PON/LOS/BV/01
             * @reference   EN 302 636-4-1 [1], clauses 9.3.8.2, 9.2.4, 6.3 and 9.3.7.1.2
filatov's avatar
filatov committed
             */
            testcase TC_GEONW_PON_LOS_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                var GN_Address v_gnAddressNodeA;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_gnAddressNodeA := f_getPosition(c_compNodeA).gnAddr;
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
filatov's avatar
filatov committed
                
                // Test Body
                if ( not  f_utTriggerEvent(m_generateGeoUnicastMessage(v_gnAddressNodeA)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
filatov's avatar
filatov committed
                }
                
                tc_ac.start;
                alt {
                    [] a_receiveLsRequest(
                            ?,
                            v_gnAddressNodeA.mid,
                            v_longPosVectorIut
                        ) {
                        tc_ac.stop;