ItsIpv6OverGeoNetworking_TestCases.ttcn 109 KB
Newer Older
             *      }
             *      then {
             *          the IUT transmits on the virtual interface associated to DGVL1 an Ethernet packet
             *              containing Destination MAC address
             *                  indicating a value derived from the Destination GN_ADDR field
             *              containing Source MAC address
             *                  indicating a value derived from Source GN_ADDR field
             *              containing Ether Type value
             *                  indicating IPv6
             *              containing the IPv6 packet
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MR/GVL/BV/10
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.2
             */
            testcase TC_IPV6GEO_MR_GVL_BV_10() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut, v_longPosVectorNodeB;
                var AddressTableEntry v_addressesIut, v_addressesNodeA;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                
                // Test component configuration
                f_cf01UpGn6();
                v_longPosVectorIut := f_getPosition(c_compIut);
                v_addressesIut := f_getAddresses(c_compIut);
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                v_addressesNodeA := f_getAddresses(c_compNodeA);
                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                f_prConfigureGVL({c_gvl1, c_gvl2, c_gvl3});
                
                v_ipv6Packet := m_ipv6Packet(
                                    f_computeGlobalAddress(c_compNodeA, vc_gvlTable[c_gvl2].prefix, vc_gvlTable[c_gvl2].prefixLength),
                                    f_computeGlobalAddress(c_compIut, vc_gvlTable[c_gvl2].prefix, vc_gvlTable[c_gvl2].prefixLength),
                                    c_noNextHdr, 
                                    omit
                                );
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                f_sendGeoNetMessageWithPayload(
Yann Garcia's avatar
Yann Garcia committed
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwUnicastPacket(
                                v_longPosVectorNodeB,
                                f_longPosVector2ShortPosVector(v_longPosVectorIut),
                                vc_localSeqNumber
                            )
                        )
Yann Garcia's avatar
Yann Garcia committed
                    ),
                    bit2oct(encvalue(v_ipv6Packet))
                );
                
                tc_ac.start;
                alt {
                  [] ipv6OverGeoNetworkingPort.receive(
                        mw_ipv6OverGeoNwInd(
                            complement (f_getGvlInterface(c_gvl1), f_getGvlInterface(c_gvl2), f_getGvlInterface(c_gvl3)),
                            v_addressesNodeA.macAddress,
                            v_addressesIut.macAddress,
                            v_ipv6Packet
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct Ethernet packet ***");
                      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_MR_GVL_BV_10
            
        } //end mrGvl
        
        // 5.2.2.2
        group mrTvl {
            
            /**
             * @desc    Checks handling of a received link-local IPv6 Unicast message, when using a TVL associated 
             *          to an NBMA type virtual interface
             * <pre>    
             * Pics Selection: PICS_TLV
             * Initial conditions: 
             *  with {
             *      the IUT having a configured TVL (TVL1)
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives a TSB message
             *              containing an IPv6 packet
             *      }
             *      then {
             *          the IUT transmits on the virtual interface associated to TVL1 an Ethernet packet
             *              containing Source MAC address
             *                  indicating a value derived from Source GN_ADDR field
             *              containing Ether Type value
             *                  indicating IPv6
             *              containing the IPv6 packet
             *      }
             *  }
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/MR/TVL/BV/01
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.2
             */
            testcase TC_IPV6GEO_MR_TVL_BV_01() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut, v_longPosVectorNodeA;
                var AddressTableEntry v_addressesIut, v_addressesNodeA;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                
                // Test component configuration
                f_cf01UpGn6();
                v_longPosVectorIut := f_getPosition(c_compIut);
                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_acUpdateInterfaces();
                
                v_ipv6Packet := m_ipv6Packet(
                                    v_addressesNodeA.lla,
                                    v_addressesIut.lla,
                                    c_noNextHdr, 
                                    omit
                                );
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                f_sendGeoNetMessageWithPayload(
Yann Garcia's avatar
Yann Garcia committed
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwTsbPacket(
                                vc_localSeqNumber,
                                v_longPosVectorIut
                            )
                        )
Yann Garcia's avatar
Yann Garcia committed
                    ),
                    bit2oct(encvalue(v_ipv6Packet))
                );
                
                tc_ac.start;
                alt {
                  [] ipv6OverGeoNetworkingPort.receive(
                        mw_ipv6OverGeoNwInd(
                            f_getTvlInterface(),
                            v_addressesNodeA.macAddress,
                            ?,
                            v_ipv6Packet
                        )
                    )  {
                      tc_ac.stop;
                      log("*** " & testcasename() & ": PASS: Received correct Ethernet packet ***");
                      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_MR_TVL_BV_01
            
        } // end mrTvl
        
    } // end group messageReception
    
    group virtualInterfaceManagement {
        
        group newVirtualInterfaces {
            
            /**
             * @desc    Checks the Router Advertisement-triggered creation of a new SGVL associated to an Ethernet 
             *          V2.0/IEEE 802.3 LAN type virtual interface
             * <pre>    
             * Pics Selection: PICS_SGVL and PICS_Ethernet
             * Initial conditions: 
             *  with {
             *      the IUT having automatically configured SGVLs (SGVL1 .. SGVLx)
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          the IUT receives a GeoBroadcast message
             *              containing Destination Area parameters not corresponding to any GVLs
             *              containing an ICMPv6 RA payload 
             *      }
             *      then {
             *          the IUT creates a new SGVL and associates to it a new virtual interface (VI1)
             *              having a MAC address
             *                  indicating a value derived from the IUT's GN_ADDR (Note)
             *      }
             *  }
             * Note: reverse EUI-64 generation procedure
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/VM/NVI/BV/01
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.2, 10.2.1
             */
            testcase TC_IPV6GEO_VM_NVI_BV_01() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeA;
                var AddressTableEntry v_addressesNodeA;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                
                // Test component configuration
                f_cf01UpGn6();
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                v_addressesNodeA := f_getAddresses(c_compNodeA);
                                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                //gvl3 handled later
                f_prConfigureGVL({c_gvl1, c_gvl2});
                
                v_ipv6Packet := m_ipv6Packet(
                                    v_addressesNodeA.lla, 
                                    c_allNodesMca, 
                                    c_icmpHdr,
                                    m_rtAdvWithOptions(
                                        m_rtAdvOpt_prefixOpt(
                                            vc_gvlTable[c_gvl3].prefixLength,
                                            c_lFlag1,
                                            c_aFlag1,
                                            c_validLifetime30s,
                                            c_preferredLifetime30s,
                                            vc_gvlTable[c_gvl3].prefix
                                        )
                                    )
                                );
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                f_sendGeoNetMessageWithPayload(
Yann Garcia's avatar
Yann Garcia committed
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwBroadcastPacket(
                                v_longPosVectorNodeA,
                                vc_localSeqNumber,
                                f_getGeoBroadcastArea(vc_gvlTable[c_gvl3].area)
                            )
                        )
Yann Garcia's avatar
Yann Garcia committed
                    ),
                    bit2oct(encvalue(v_ipv6Packet))
                );
                
                f_sleep(PX_T_BUILD_CONFIG);
                f_acUpdateInterfaces();
                
                if(f_getGvlInterface(c_gvl3) != "") {
                    log("*** " & testcasename() & ": PASS: Virtual interface created ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                }
                else {
                    log("*** " & testcasename() & ": FAIL: Virtual interface not created ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                     
            } // end TC_IPV6GEO_VM_NVI_BV_01
            
        } // end group newVirtualInterfaces
        
        group expiredVirtualInterfaces {
            
            /**
             * @desc    Checks the removal of an expired GVL and its associated virtual interface
             * <pre>
             * Pics Selection: PICS_SGVL and PICS_Ethernet
             * Initial conditions: 
             *  with {
             *      the IUT having configured a SGVL (SGVL1) derived from a received RA
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when { 
             *          every prefix entry associated to SGVL1 has expired
             *      }
             *      then {
             *          the IUT removes the expired SGVL SGVL1
             *          the IUT removes the associated virtual interface VI1
             *      }
             *  }
             * Note: reverse EUI-64 generation procedure
             * </pre>
             * 
             * @see         ETSI TS 102 859-2 v2.1.1 TP/IPv6GEO/VM/EVI/BV/01
             * @reference   ETSI EN 302 636-6-1 clauses, 8.2.2
             */
            testcase TC_IPV6GEO_VM_EVI_BV_01() runs on ItsIpv6OverGeoNetworking system ItsIpv6OverGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeA;
                var AddressTableEntry v_addressesNodeA;
                var template (value) Ipv6Packet v_ipv6Packet;
                
                // Test control
                
                // Test component configuration
                f_cf01UpGn6();
                v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                v_addressesNodeA := f_getAddresses(c_compNodeA);
                
                // Test adapter configuration
                
                // Preamble
                f_prIpv6Neighbour();
                f_prConfigureGVL({c_gvl1, c_gvl2});
                
                v_ipv6Packet := m_ipv6Packet(
                                    v_addressesNodeA.lla, 
                                    c_allNodesMca, 
                                    c_icmpHdr,
                                    m_rtAdvWithOptions(
                                        m_rtAdvOpt_prefixOpt(
                                            vc_gvlTable[c_gvl3].prefixLength,
                                            c_lFlag1,
                                            c_aFlag1,
                                            c_validLifetime30s,
                                            c_preferredLifetime30s,
                                            vc_gvlTable[c_gvl3].prefix
                                        )
                                    )
                                );
                                
                f_sendGeoNetMessageWithPayload(
Yann Garcia's avatar
Yann Garcia committed
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwBroadcastPacket(
                                v_longPosVectorNodeA,
                                vc_localSeqNumber,
                                f_getGeoBroadcastArea(vc_gvlTable[c_gvl3].area)
                            )
                        )
Yann Garcia's avatar
Yann Garcia committed
                    ),
                    bit2oct(encvalue(v_ipv6Packet))
                );
                
                f_sleep(PX_T_BUILD_CONFIG);
                f_acUpdateInterfaces();
                
                if(f_getGvlInterface(c_gvl3) == "") {
                    log("*** " & testcasename() & ": INCONC: Virtual interface not created ***");
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_error);
                }
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                f_sleep(int2float(c_validLifetime30s));
                f_acUpdateInterfaces();
                
                if(f_getGvlInterface(c_gvl3) == "") {
                    log("*** " & testcasename() & ": PASS: Virtual interface removed ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success); 
                }
                else {
                    log("*** " & testcasename() & ": FAIL: Virtual interface not removed ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                
                // Postamble
                f_poIpv6Neighbour();
                f_cf01DownGn6();
                
            } // end TC_IPV6GEO_VM_EVI_BV_01
            
        } // end group expiredVirtualInterfaces
        
    } // end virtualInterfaceManagement
    
filatov's avatar
filatov committed
} // end ItsIpv6OverGeoNetworking_TestCases