ItsIpv6OverGeoNetworking_TestCases.ttcn 111 KB
Newer Older
filatov's avatar
filatov committed
/**
 *  @author   ETSI / STF405 / STF449
 *  @version  $URL$
 *            $Id$
 *  @desc     Testcases for IPv6 over GeoNetworking Protocol (TP version: 0.0.4)
 *
 */
module ItsIpv6OverGeoNetworking_TestCases {
    
    // LibCommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_Sync all;
    import from LibCommon_Time all;
    import from LibCommon_VerdictControl all;
    import from LibCommon_Time {modulepar all;}
    
    // LibIts
    import from LibItsGeoNetworking_Functions all; 
    import from LibItsGeoNetworking_Templates all;
    import from LibItsGeoNetworking_TypesAndValues all;
    import from LibItsIpv6OverGeoNetworking_TestSystem all;
    import from LibItsIpv6OverGeoNetworking_Functions all; 
    import from LibItsIpv6OverGeoNetworking_Templates all; 
    import from LibItsIpv6OverGeoNetworking_TypesAndValues all;
    import from LibItsIpv6OverGeoNetworking_Pixits all;
    import from LibItsIpv6OverGeoNetworking_Pics all;
    import from LibItsExternal_TypesAndValues all;
    
    //5.2.1
    group messageGeneration {
        
        //5.2.1.1
        group mgGvl {
            
            /**
             * @desc    Checks that an IPv6 link-local multicast message is carried out over a GeoBroadcast message 
             *          into the correct geographical area, when send over an SVGL
             * <pre>    
             * Pics Selection: PICS_SGVL
             * Initial conditions: 
             *  with {
             *      the IUT having a configured SGVL(SGVL1)
             *      the IUT's Upper Layer being configured to use the virtual interface associated with SGVL1 to send link-local multicast packets
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives an IPv6 packet from the Upper Layer
             *              containing destination address
             *                  indicating a link-local multicast IPv6 address
             *      }
             *      then {
             *          the IUT sends a valid GeoNetworking GeoBroadcast message
             *              containing the geographical Destination area corresponding to SGVL1
             *              containing NH field
             *                  indicating value '3'
             *              containing HT field
             *                  indicating value '4'
             *              carrying the IPv6 packet received from Upper Layer as payload
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MG/GVL/BV/01
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.1 and 9.2.1
             */
            testcase TC_IPV6GEO_MG_GVL_BV_01() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var template (present) LongPosVector v_longPosVectorIut;
                var AddressTableEntry v_addressesIut;
                var AddressTableEntry v_addressesNodeB;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                
                // Test component configuration
                f_cf01UpGn6();
garciay's avatar
garciay committed
                v_longPosVectorIut := mw_longPosVectorPosition(f_getPosition(c_compIut));
filatov's avatar
filatov committed
                v_addressesIut := f_getAddresses(c_compIut);
                v_addressesNodeB := f_getAddresses(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                f_prConfigureGVL({c_gvl1});
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_ipv6Packet := m_ipv6Packet(
                                    v_addressesIut.lla, 
                                    v_addressesNodeB.solNodeMca, 
                                    c_noNextHdr, 
                                    omit
                                );
                
                ipv6OverGeoNetworkingPort.send(
                    m_ipv6OverGeoNwReq(
                        f_getGvlInterface(c_gvl1),
                        v_addressesIut.macAddress,
                        v_addressesNodeB.macSolNodeMca,
                        v_ipv6Packet
                    )
                );
                
                tc_ac.start;
                alt {
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwBroadcastPacketWithAreaWithNextHeader(
                                        v_longPosVectorIut,
                                        ?,
                                        f_getGeoBroadcastArea(vc_gvlTable[c_gvl1].area),
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct GeoNetworking GeoBroadcast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                  }
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                
            } // end TC_IPV6GEO_MG_GVL_BV_01
            
            /**
             * @desc    Checks that an IPv6 global-scoped unicast-prefix-based multicast message is carried out over 
             *          a GeoBroadcast message into the correct geographical area, when sent over an SGVL 
             * <pre>    
             * Pics Selection: PICS_SGVL
             * Initial conditions: 
             *  with {
             *      the IUT having a configured SGVL (SGVL1)
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives an IPv6 packet from the Upper Layer
             *              containing destination address
             *                  containing a global-scoped unicast-prefix-based multicast IPv6 address
             *                      indicating prefix associated with SGVL1
             *      }
             *      then {
             *          the IUT sends a valid GeoNetworking GeoBroadcast message
             *              containing the geographical Destination area corresponding to SGVL1
             *              containing NH field
             *                  indicating value '3'
             *              containing HT field
             *                  indicating value '4'
             *              carrying the IPv6 packet received from Upper Layer as payload
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MG/GVL/BV/02
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.1 and 9.2.1
             */
            testcase TC_IPV6GEO_MG_GVL_BV_02() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var template (present) LongPosVector v_longPosVectorIut;
                var AddressTableEntry v_addressesIut;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                
                // Test component configuration
                f_cf01UpGn6();
garciay's avatar
garciay committed
                v_longPosVectorIut := mw_longPosVectorPosition(f_getPosition(c_compIut));
filatov's avatar
filatov committed
                v_addressesIut := f_getAddresses(c_compIut);
                                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                f_prConfigureGVL({c_gvl1});
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_ipv6Packet := m_ipv6Packet(
                                    v_addressesIut.lla,
                                    f_computeGlobalScopedUnicastPrefixBasedMulticastIpv6Address(
                                        f_getPrefix(1),
                                        f_getPrefixLength(1),
                                        1
                                    ),
                                    c_noNextHdr,
                                    omit
                                );
                
                ipv6OverGeoNetworkingPort.send(
                    m_ipv6OverGeoNwReq(
                        f_getGvlInterface(c_gvl1),
                        v_addressesIut.macAddress,
                        c_macBroadcastAddr,
                        v_ipv6Packet
                    )
                );
                
                tc_ac.start;
                alt {
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwBroadcastPacketWithAreaWithNextHeader(
                                        v_longPosVectorIut,
                                        ?,
                                        f_getGeoBroadcastArea(vc_gvlTable[c_gvl1].area),
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct GeoNetworking GeoBroadcast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                  }
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                
            } // end TC_IPV6GEO_MG_GVL_BV_02
            
            /**
             * @desc    Checks that an IPv6 Geographic anycast message is carried out over a GeoAnycast message 
             *          into the correct geographical area, when send over an SVGL
             * <pre>    
             * Pics Selection: PICS_SGVL
             * Initial conditions: 
             *  with {
             *      the IUT having a configured SGVL (SGVL1)
             *      the IUT's Upper Layer being configured to use the virtual interface associated with SGVL1 GVL1 to send Geographic anycast packets
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives an IPV6 packet from the Upper Layer
             *              containing destination address
             *                  indicating a Geographic anycast IPv6 address
             *      }
             *      then {
             *          the IUT sends a valid GeoNetworking GeoAnycast message
             *              containing the geographical Destination area corresponding to SGVL1
             *              containing NH field
             *                  indicating value '3'
             *              containing HT field
             *                  indicating value '3'
             *              carrying the IPv6 packet received from Upper Layer as payload
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MG/GVL/BV/03
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.1 and 9.4
             */
            testcase TC_IPV6GEO_MG_GVL_BV_03() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var template (present) LongPosVector v_longPosVectorIut;
                var AddressTableEntry v_addressesIut;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                
                // Test component configuration
                f_cf01UpGn6();
garciay's avatar
garciay committed
                v_longPosVectorIut := mw_longPosVectorPosition(f_getPosition(c_compIut));
filatov's avatar
filatov committed
                v_addressesIut := f_getAddresses(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                f_prConfigureGVL({c_gvl1});
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_ipv6Packet := m_ipv6Packet(
                                    f_computeGlobalAddress(c_compIut, vc_gvlTable[c_gvl1].prefix, vc_gvlTable[c_gvl1].prefixLength),
                                    f_computeGeographicAnycastIpv6Address(
                                        f_getPrefix(1),
                                        f_getPrefixLength(1)
                                    ),
                                    c_noNextHdr, 
                                    omit
                                );
                                
                ipv6OverGeoNetworkingPort.send(
                    m_ipv6OverGeoNwReq(
                        f_getGvlInterface(c_gvl1),
                        v_addressesIut.macAddress,
                        c_macBroadcastAddr,
                        v_ipv6Packet
                    )
                );
                
                tc_ac.start;
                alt {
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwAnycastPacketWithAreaWithNextHeader(
                                        v_longPosVectorIut,
                                        ?,
                                        f_getGeoAnycastArea(vc_gvlTable[c_gvl1].area),
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct GeoNetworking GeoAnycast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                  }
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                
            } // end TC_IPV6GEO_MG_GVL_BV_03
            
            /**
             * @desc    Checks that an IPv6 unicast message is carried out over a GeoUnicast when using an SGVL 
             *          associated to an Ethernet V2.0/IEEE 802.3 LAN type virtual interface with address resolution
             * <pre>    
             * Pics Selection: PICS_SGVL
             * Initial conditions: 
             *  with {
             *      the IUT having a configured SGVL (SGVL1)
             *      the IUT's Upper Layer being configured to use the virtual interface associated with SGVL1
             *      the IUT being configured with MIB attribute itsgn6aslVIResolAddr set to true
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives an IPV6 packet from the Upper Layer
             *              containing destination address
             *                  indicating unicast IPv6 address of the Tester
             *      }
             *      then {
             *          the IUT sends a valid GeoUnicast message
             *              containing DEPV field
             *                  containing GN_ADDR field
             *                      indicating value derived from the unicast IPv6 address IID
             *              containing NH field
             *                  indicating value '3'
             *              containing HT field
             *                  indicating value '2'
             *              carrying the IPv6 packet received from Upper Layer as payload
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MG/GVL/BV/04
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.1 and 10.3
             */
            testcase TC_IPV6GEO_MG_GVL_BV_04() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var template (present) LongPosVector v_longPosVectorIut;
                var LongPosVector v_longPosVectorNodeA;
                var AddressTableEntry v_addressesIut, v_addressesNodeA;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                if(PICS_GN6_ASL_VI_RESOL_ADDR != true) {
                    log("*** " & testcasename() & ": ERROR: PICS_GN6_ASL_VI_RESOL_ADDR == true required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01UpGn6();
garciay's avatar
garciay committed
                v_longPosVectorIut := mw_longPosVectorPosition(f_getPosition(c_compIut));
filatov's avatar
filatov committed
                v_addressesIut := f_getAddresses(c_compIut);
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                v_addressesNodeA := f_getAddresses(c_compNodeA);
                                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                f_prConfigureGVL({c_gvl1});
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_ipv6Packet := m_ipv6Packet(
                                    f_computeGlobalAddress(c_compIut, vc_gvlTable[c_gvl1].prefix, vc_gvlTable[c_gvl1].prefixLength),
                                    f_computeGlobalAddress(c_compNodeA, vc_gvlTable[c_gvl1].prefix, vc_gvlTable[c_gvl1].prefixLength),
                                    c_noNextHdr, 
                                    omit
                                );
                                                
                ipv6OverGeoNetworkingPort.send(
                    m_ipv6OverGeoNwReq(
                        f_getGvlInterface(c_gvl1),
                        v_addressesIut.macAddress,
                        f_gnAddr2MacAddr(f_getPosition(c_compNodeB).gnAddr), // On purpose: IUT should not use this value
                        v_ipv6Packet
                    )
                );
                
                tc_ac.start;
                alt {
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithNextHeader(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeA)), // On purpose: IUT should derive this value fron IPv6 address
                                        ?,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct GeoNetworking GeoUnicast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                  }
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithNextHeader(
                                        ?, 
                                        ?,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received incorrect GeoNetworking GeoUnicast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                  }
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                
            } // end TC_IPV6GEO_MG_GVL_BV_04
            
            /**
             * @desc    Checks that an IPv6 unicast message is carried out over a GeoUnicast when using an SGVL 
             *          associated to an Ethernet V2.0/IEEE 802.3 LAN type virtual interface without address 
             *          resolution
             * <pre>    
             * Pics Selection: PICS_SGVL
             * Initial conditions: 
             *  with {
             *      the IUT having a configured SGVL (SGVL1)
             *      the IUT's Upper Layer being configured to use the virtual interface associated with SGVL1
             *      the IUT being configured with MIB attribute itsgn6aslVIResolAddr set to false
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives an IPV6 packet from the Upper Layer
             *              containing destination address
             *                  indicating unicast IPv6 address of the Tester
             *      }
             *      then {
             *          the IUT sends a valid GeoUnicast message
             *              containing DEPV field
             *                  containing GN_ADDR field
             *                      indicating value derived from the GN6_SAP destination parameter
             *              containing NH field
             *                  indicating value '3'
             *              containing HT field
             *                  indicating value '2'
             *              carrying the IPv6 packet received from Upper Layer as payload
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MG/GVL/BV/05
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.1 and 10.3
             */
            testcase TC_IPV6GEO_MG_GVL_BV_05() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var template (present) LongPosVector v_longPosVectorIut;
                var LongPosVector v_longPosVectorNodeB;
                var AddressTableEntry v_addressesIut, v_addressesNodeB;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                if(PICS_GN6_ASL_VI_RESOL_ADDR != false) {
                    log("*** " & testcasename() & ": ERROR: PICS_GN6_ASL_VI_RESOL_ADDR == false required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01UpGn6();
garciay's avatar
garciay committed
                v_longPosVectorIut := mw_longPosVectorPosition(f_getPosition(c_compIut));
filatov's avatar
filatov committed
                v_addressesIut := f_getAddresses(c_compIut);
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                v_addressesNodeB := f_getAddresses(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                f_prConfigureGVL({c_gvl1});
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_ipv6Packet := m_ipv6Packet(
                                    f_computeGlobalAddress(c_compIut, vc_gvlTable[c_gvl1].prefix, vc_gvlTable[c_gvl1].prefixLength),
                                    f_computeGlobalAddress(c_compNodeA, vc_gvlTable[c_gvl1].prefix, vc_gvlTable[c_gvl1].prefixLength),
                                    c_noNextHdr, 
                                    omit
                                );
                
                ipv6OverGeoNetworkingPort.send(
                    m_ipv6OverGeoNwReq(
                        f_getGvlInterface(c_gvl1),
                        v_addressesIut.macAddress,
                        v_addressesNodeB.macAddress, // On purpose: IUT must use this value
                        v_ipv6Packet
                    )
                );
                
                tc_ac.start;
                alt {
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithNextHeader(
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), // On purpose: IUT should derive this value from SAP dest mac 
                                        ?,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct GeoNetworking GeoUnicast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                  }
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithNextHeader(
                                        ?, 
                                        ?,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received incorrect GeoNetworking GeoUnicast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                  }
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                
            } // end TC_IPV6GEO_MG_GVL_BV_05
            
        } // end mgGvl
        
        // 5.2.1.2
        group mgTvl {
            
            /**
             * @desc    Checks that an IPv6 unicast message is carried out over a GeoUnicast when using a TVL 
             *          virtual interface with address resolution
             * <pre>    
             * Pics Selection: PICS_TVL
             * Initial conditions: 
             *  with {
             *      the IUT having a configured TVL (TVL1)
             *      the IUT's Upper Layer being configured to use the virtual interface associated with TVL1
             *      the IUT being configured with MIB attribute itsgn6aslVIResolAddr set to true
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives an IPV6 packet from the Upper Layer
             *              containing destination address
             *                  indicating unicast IPv6 address of the Tester
             *      }
             *      then {
             *          the IUT sends a valid GeoUnicast message
             *              containing DEPV field
             *                  containing GN_ADDR field
             *                      indicating value derived from the unicast IPv6 address IID
             *              containing NH field
             *                  indicating value '3'
             *              containing HT field
             *                  indicating value '2'
             *              carrying the IPv6 packet received from Upper Layer as payload
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MG/TVL/BV/01
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.1
             */
            testcase TC_IPV6GEO_MG_TVL_BV_01() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var template (present) LongPosVector v_longPosVectorIut;
                var LongPosVector v_longPosVectorNodeA, v_longPosVectorNodeB;
                var AddressTableEntry v_addressesIut, v_addressesNodeA, v_addressesNodeB;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                if(PICS_GN6_ASL_VI_RESOL_ADDR != true) {
                    log("*** " & testcasename() & ": ERROR: PICS_GN6_ASL_VI_RESOL_ADDR == true required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01UpGn6();
garciay's avatar
garciay committed
                v_longPosVectorIut := mw_longPosVectorPosition(f_getPosition(c_compIut));
filatov's avatar
filatov committed
                v_addressesIut := f_getAddresses(c_compIut);
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                v_addressesNodeA := f_getAddresses(c_compNodeA);
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                v_addressesNodeB := f_getAddresses(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                
                f_acUpdateInterfaces();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_ipv6Packet := m_ipv6Packet(
                                    v_addressesIut.lla,
                                    v_addressesNodeB.lla,
                                    c_noNextHdr, 
                                    omit
                                );
                
                ipv6OverGeoNetworkingPort.send(
                    m_ipv6OverGeoNwReq(
                        f_getTvlInterface(),
                        v_addressesIut.macAddress,
                        f_gnAddr2MacAddr(f_getPosition(c_compNodeA).gnAddr), // On purpose: IUT should not use this value
                        v_ipv6Packet
                    )
                );
                
                tc_ac.start;
                alt {
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithNextHeader(
garciay's avatar
garciay committed
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), // On purpose: IUT should derive this value fron IPv6 address
filatov's avatar
filatov committed
                                        ?,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct GeoNetworking GeoUnicast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                  }
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithNextHeader(
                                        ?,
                                        ?,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received incorrect GeoNetworking GeoUnicast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                  }
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                
            } // end TC_IPV6GEO_MG_TVL_BV_01
            
            /**
             * @desc    Checks that an IPv6 unicast message is carried out over a GeoUnicast when using a TVL 
             *          virtual interface without address resolution
             * <pre>    
             * Pics Selection: PICS_TVL
             * Initial conditions: 
             *  with {
             *      the IUT having a configured TVL (TVL1)
             *      the IUT's Upper Layer being configured to use the virtual interface associated with TVL1
             *      the IUT being configured with MIB attribute itsgn6aslVIResolAddr set to false
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives an IPV6 packet from the Upper Layer
             *              containing destination address
             *                  indicating unicast IPv6 address of the Tester
             *      }
             *      then {
             *          the IUT sends a valid GeoUnicast message
             *              containing DEPV field
             *                  containing GN_ADDR field
             *                      indicating value derived from the GN6_SAP destination parameter
             *              containing NH field
             *                  indicating value '3'
             *              containing HT field
             *                  indicating value '2'
             *              carrying the IPv6 packet received from Upper Layer as payload
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MG/TVL/BV/02
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.1
             */
            testcase TC_IPV6GEO_MG_TVL_BV_02() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var template (present) LongPosVector v_longPosVectorIut;
                var LongPosVector v_longPosVectorNodeA;
                var LongPosVector v_longPosVectorNodeB;
                var AddressTableEntry v_addressesIut, v_addressesNodeA;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                if(PICS_GN6_ASL_VI_RESOL_ADDR != false) {
                    log("*** " & testcasename() & ": ERROR: PICS_GN6_ASL_VI_RESOL_ADDR == false required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01UpGn6();
garciay's avatar
garciay committed
                v_longPosVectorIut := mw_longPosVectorPosition(f_getPosition(c_compIut));
filatov's avatar
filatov committed
                v_addressesIut := f_getAddresses(c_compIut);
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                v_addressesNodeA := f_getAddresses(c_compNodeA);
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                
                f_acUpdateInterfaces();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_ipv6Packet := m_ipv6Packet(
                                    v_addressesIut.lla,
                                    v_addressesNodeA.lla,
                                    c_noNextHdr, 
                                    omit
                                );
                
                ipv6OverGeoNetworkingPort.send(
                    m_ipv6OverGeoNwReq(
                        f_getTvlInterface(),
                        v_addressesIut.macAddress,
                        f_getAddresses(c_compNodeB).macAddress, // On purpose: IUT must use this value
                        v_ipv6Packet
                    )
                );
                
                tc_ac.start;
                alt {
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithNextHeader(
garciay's avatar
garciay committed
                                        mw_shortPosVectorPosition(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), // On purpose: IUT should derive this value from SAP dest mac 
filatov's avatar
filatov committed
                                        ?,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct GeoNetworking GeoUnicast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                  }
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithNextHeader(
                                        ?, 
                                        ?,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received incorrect GeoNetworking GeoUnicast ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                  }
                  [] tc_ac.timeout {
                      log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                  }
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                
            } // end TC_IPV6GEO_MG_TVL_BV_02
            
            /**
             * @desc    Checks that an IPv6 link-local multicast message is carried out over a GeoBroadcast message 
             *          into the correct geographical area, when sent over a TVL 
             * <pre>    
             * Pics Selection: PICS_TVL
             * Initial conditions: 
             *  with {
             *      the IUT having a configured TVL (TVL1)
             *      the IUT's Upper Layer being configured to use the virtual interface associated with TVL1 to send link-local multicast packets
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives an IPV6 packet from the Upper Layer
             *              containing destination address
             *                  indicating link-local multicast IPv6 address
             *      }
             *      then {
             *          the IUT sends a valid GeoNetworking TSB message
             *              containing NH field
             *                  indicating value '3'
             *              containing HT field
             *                  indicating value '5'
             *              carrying the IPv6 packet received from Upper Layer as payload
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MG/TVL/BV/03
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.1 and 9.2.1
             */
            testcase TC_IPV6GEO_MG_TVL_BV_03() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var template (present) LongPosVector v_longPosVectorIut;
                var LongPosVector v_longPosVectorNodeB;
                var AddressTableEntry v_addressesIut, v_addressesNodeB;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                if(PICS_GN6_ASL_VI_RESOL_ADDR != true) {
                    log("*** " & testcasename() & ": ERROR: PICS_GN6_ASL_VI_RESOL_ADDR == true required for executing the TC ***");
                    stop;
                }
                
                // Test component configuration
                f_cf01UpGn6();
garciay's avatar
garciay committed
                v_longPosVectorIut := mw_longPosVectorPosition(f_getPosition(c_compIut));
filatov's avatar
filatov committed
                v_addressesIut := f_getAddresses(c_compIut);
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                v_addressesNodeB := f_getAddresses(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                
                f_acUpdateInterfaces();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_ipv6Packet := m_ipv6Packet(
                                    v_addressesIut.lla,
                                    v_addressesNodeB.solNodeMca,
                                    c_noNextHdr, 
                                    omit
                                );
                
                ipv6OverGeoNetworkingPort.send(
                    m_ipv6OverGeoNwReq(
                        f_getTvlInterface(),
                        v_addressesIut.macAddress,
                        f_gnAddr2MacAddr(f_getPosition(c_compNodeB).gnAddr),
                        v_ipv6Packet
                    )
                );
                
                tc_ac.start;
                alt {
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwTsbPacketWithNextHeader(
                                        ?,
                                        v_longPosVectorIut,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct GeoNetworking TSB ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                  }
                  [] geoNetworkingPort.receive(
                        f_receiveGeoNetMessageWithPayload(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwTsbPacketWithNextHeader(
                                        ?,
                                        v_longPosVectorIut,
                                        e_ipv6
                                    )
                                )
                            ),
                            mw_ipv6Payload(v_ipv6Packet)
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": FAIL: Received incorrect GeoNetworking TSB ***");
                      f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error); 
                  }
                  [] tc_ac.timeout {