ItsIpv6OverGeoNetworking_TestCases.ttcn 111 KB
Newer Older
filatov's avatar
filatov committed
2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409
             *                      containing a source address IPV6_SRC
             *              containing Source position coordinates contained in SGVLa, SGVLb and SGVLc
             *      }
             *      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(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwUnicastPacket(
                                v_longPosVectorNodeB,
                                f_longPosVector2ShortPosVector(v_longPosVectorIut),
                                vc_localSeqNumber
                            )
                        )
                    ),
                    m_ipv6Payload(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(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwTsbPacket(
                                vc_localSeqNumber,
                                v_longPosVectorIut
                            )
                        )
                    ),
                    m_ipv6Payload(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(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwBroadcastPacket(
                                v_longPosVectorNodeA,
                                vc_localSeqNumber,
                                f_getGeoBroadcastArea(vc_gvlTable[c_gvl3].area)
                            )
                        )
                    ),
                    m_ipv6Payload(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(
                    m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(
                            m_geoNwBroadcastPacket(
                                v_longPosVectorNodeA,
                                vc_localSeqNumber,
                                f_getGeoBroadcastArea(vc_gvlTable[c_gvl3].area)
                            )
                        )
                    ),
                    m_ipv6Payload(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
    
} // end ItsIpv6OverGeoNetworking_TestCases