ItsGeoNetworking_TpFunctions.ttcn 718 KB
Newer Older
10001 10002 10003 10004 10005 10006 10007 10008 10009 10010 10011 10012 10013 10014 10015 10016 10017 10018 10019 10020 10021 10022 10023 10024 10025 10026 10027 10028 10029 10030 10031 10032 10033 10034 10035 10036 10037 10038 10039 10040 10041 10042 10043 10044 10045 10046 10047 10048 10049 10050 10051 10052 10053 10054 10055 10056 10057 10058 10059 10060 10061 10062 10063 10064 10065 10066 10067 10068 10069 10070 10071 10072 10073 10074 10075 10076 10077 10078 10079 10080 10081 10082 10083 10084 10085 10086 10087 10088 10089 10090 10091 10092 10093 10094 10095 10096 10097 10098 10099 10100 10101 10102 10103 10104 10105 10106 10107 10108 10109 10110 10111 10112 10113 10114 10115 10116 10117 10118 10119 10120 10121 10122 10123 10124 10125 10126 10127 10128 10129 10130 10131 10132 10133 10134 10135 10136 10137 10138 10139 10140 10141 10142 10143 10144 10145 10146 10147 10148 10149 10150 10151 10152 10153 10154 10155 10156 10157 10158 10159 10160 10161 10162 10163 10164 10165 10166 10167 10168 10169 10170 10171 10172 10173 10174 10175 10176 10177 10178 10179 10180 10181 10182 10183 10184 10185 10186 10187 10188 10189 10190 10191 10192 10193 10194 10195 10196 10197 10198 10199 10200 10201 10202 10203 10204 10205 10206 10207 10208 10209 10210 10211 10212 10213 10214 10215 10216 10217 10218 10219 10220 10221 10222 10223 10224 10225 10226 10227 10228 10229 10230 10231 10232 10233 10234 10235 10236 10237 10238 10239 10240 10241 10242 10243 10244 10245 10246 10247 10248 10249 10250 10251 10252 10253 10254 10255 10256 10257 10258 10259 10260 10261 10262 10263 10264 10265 10266 10267 10268 10269 10270 10271 10272 10273 10274 10275 10276 10277 10278 10279 10280 10281 10282 10283 10284 10285 10286 10287 10288 10289 10290 10291 10292 10293 10294 10295 10296 10297 10298 10299 10300 10301 10302 10303 10304 10305 10306 10307 10308 10309 10310 10311 10312 10313 10314 10315 10316 10317 10318 10319 10320 10321 10322 10323 10324 10325 10326 10327 10328 10329 10330 10331 10332 10333 10334 10335 10336 10337 10338 10339 10340 10341 10342 10343 10344 10345 10346 10347 10348 10349 10350 10351 10352 10353 10354 10355 10356 10357 10358 10359 10360 10361 10362 10363 10364 10365 10366 10367 10368 10369 10370 10371 10372 10373 10374 10375 10376 10377 10378 10379 10380 10381 10382 10383 10384 10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472
                            log("*** " & testcasename() & ": PASS: TSB packet received correctly  ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected TSB message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BV_02_nodeD
                
            } // end GEONW_PON_TSB_BV_02
            
            group GEONW_PON_TSB_BO_03 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_TSB_BO_03 
                 */
                function f_GEONW_PON_TSB_BO_03() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_TSB_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_TSB_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_TSB_BO_03_nodeB());
                    v_nodeD.start(f_GEONW_PON_TSB_BO_03_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end f_GEONW_PON_TSB_BO_03
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_TSB_BO_03)
                 */
                function f_GEONW_PON_TSB_BO_03_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    var template (present) GeoNetworkingPdu v_gnPacket;
                    
                    // Preamble
                    f_prNeighbour();
                    v_gnPacket := m_geoNwPdu(
                                      m_geoNwTsbPacket(
                                          vc_localSeqNumber,
                                          v_longPosVectorNodeB
                                      ),
                                      -,
                                      c_defaultHopLimit
                                  );
                    
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(valueof(v_gnPacket)));
                    v_gnPacket.basicHeader.routerHopLimit := ?;
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        )
                                    )
                                )
                            ) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": PASS: Pre-conditions: TSB packet received correctly  ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": INCONC: Pre-conditions: Expected TSB message not received ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                        }
                    }
                    
                    // Test Body
                    tc_noac.start;
                    alt {
                        []  geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        )
                                    )
                                )
                            ) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: The same TSB packet was re-broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: The same TSB packet was not re-broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BO_03_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_TSB_BO_03)
                 */
                function f_GEONW_PON_TSB_BO_03_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    var template (value) GeoNetworkingInd v_msgInd;
                    
                    // Preamble
                    f_prNeighbour();
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        )
                                    )
                                )
                            ) -> value v_msgInd {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: Pre-conditions: TSB packet received correctly  ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: Pre-conditions: Expected TSB message not received ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                        }
                    }
                    
                    // Test Body
                    v_msgInd.msgIn.basicHeader.routerHopLimit := valueof(v_msgInd.msgIn.basicHeader.routerHopLimit) -1;
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_msgInd.msgIn));
                    
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(v_msgInd) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: The same TSB packet was re-broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: The same TSB packet was not re-broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BO_03_nodeD
                
            } // end GEONW_PON_TSB_BO_03
            
            group GEONW_PON_TSB_BV_04 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_TSB_BV_04
                 */
                function f_GEONW_PON_TSB_BV_04() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_TSB_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_TSB_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);                    
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_TSB_BV_04_nodeB());
                    v_nodeD.start(f_GEONW_PON_TSB_BV_04_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end f_GEONW_PON_TSB_BV_04
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_TSB_BV_04)
                 */
                function f_GEONW_PON_TSB_BV_04_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(
                                m_geoNwTsbPacket(
                                    vc_localSeqNumber,
                                    v_longPosVectorNodeB,
                                    c_defaultHopLimit
                                ),
                                -,
                                c_defaultHopLimit
                            )
                        )
                    );
                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        ),
                                        -,
                                        c_defaultHopLimit - 1
                                    )
                                )
                            ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: TSB packet received correctly ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        ),
                                        -,
                                        ?
                                    )
                                )
                            ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": FAIL: TSB packet received with incorrect HopLimit ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: Expected TSB message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BV_04_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_TSB_BV_04)
                 */
                function f_GEONW_PON_TSB_BV_04_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacketWithHl(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB),
                                            c_defaultHopLimit
                                        ),
                                        -,
                                        c_defaultHopLimit - 1
                                    )
                                )
                            ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: TSB packet received correctly ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        ),
                                        -,
                                        ?
                                    )
                                )
                            ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": FAIL: TSB packet received with incorrect HopLimit ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: Expected TSB message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BV_04_nodeD
                
            } // end GEONW_PON_TSB_BV_04
            
            group GEONW_PON_TSB_BO_05 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_TSB_BO_05
                 */
                function f_GEONW_PON_TSB_BO_05() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_TSB_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_TSB_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);                    
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_TSB_BO_05_nodeB());
                    v_nodeD.start(f_GEONW_PON_TSB_BO_05_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end f_GEONW_PON_TSB_BO_05
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_TSB_BO_05)
                 */
                function f_GEONW_PON_TSB_BO_05_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(
                                m_geoNwTsbPacket(
                                    vc_localSeqNumber,
                                    v_longPosVectorNodeB
                                ),
                                -,
                                1
                            )
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BO_05_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_TSB_BO_05)
                 */
                function f_GEONW_PON_TSB_BO_05_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        )
                                    )
                                )
                            ) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: TSB message was re-broadcasted  ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: TSB message was not re-broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BO_05_nodeD
                
            } // end GEONW_PON_TSB_BO_05
            
            /**
             * @desc    TP Function for TC_GEONW_PON_TSB_BV_06
             */
            function f_GEONW_PON_TSB_BV_06() runs on ItsGeoNetworking {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var template (value) GeoNetworkingPdu v_gnPacket;
                var integer i;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not PICS_GN_TSB_DST) {
                    log("*** " & testcasename() & ": PICS_GN_TSB_DST required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prDefault();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                
                // Test Body
                v_gnPacket := m_geoNwPdu(m_geoNwTsbPacket(
                                            vc_localSeqNumber,
                                            v_longPosVectorNodeB
                                        )
                                    );
                f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket));
                
                f_sleep(PX_TAC);
                
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
                for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
                    // empty on purpose 
                }
                if(i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                }
                
                log("*** " & testcasename() & ": TSB packet passed to Upper Layer  ***");
                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                
                // Postamble
                f_poDefault();
                f_cf01Down();
                
            } // end f_GEONW_PON_TSB_BV_06
            
            group GEONW_PON_TSB_BO_07 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_TSB_BV_06
                 */
                function f_GEONW_PON_TSB_BO_07() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_TSB_DST) {
                        log("*** " & testcasename() & ": PICS_GN_TSB_DST required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up(c_compNodeB);
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_TSB_BO_07_nodeB());
                    v_nodeD.start(f_GEONW_PON_TSB_BO_07_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end f_GEONW_PON_TSB_BO_07
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_TSB_BO_07)
                 */
                function f_GEONW_PON_TSB_BO_07_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    var template (value) GeoNetworkingPdu v_gnPacket;
                    var integer i;
                    var GnRawPayload v_sentRawPayload;
                    
                    // Preamble
                    f_prNeighbour();
                    v_gnPacket := m_geoNwPdu(m_geoNwTsbPacket(
                                                vc_localSeqNumber,
                                                v_longPosVectorNodeB
                                            ),
                                            -,
                                            c_defaultHopLimit
                                        );
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(valueof(v_gnPacket)));
                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        )
                                    )
                                )
                            ) {
                            tc_ac.stop;
                            
                            f_sleep(PX_TAC);
                            
                            v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
                            for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
                                // empty on purpose 
                            }
                            if(i < lengthof(vc_utInds)) {
                                log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly rebroadcasted and passed to Upper Layer ***");
                                vc_utInds := {};
                                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                            }
                            else {
                                log("*** " & testcasename() & ": INCONC: TSB was not transmitted to upper layer ***");
                                f_selfOrClientSyncAndVerdict(c_prDone, e_error);
                            }
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: Pre-conditions: TSB not rebroadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                        }
                    }
                    
                    // Test Body
                    f_sleep(PX_TAC);
                    
                    v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
                    for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
                        // empty on purpose 
                    }
                    if(i < lengthof(vc_utInds)) {
                        log("*** " & testcasename() & ": FAIL: Same TSB packet was transmitted to upper layer ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                    }
                    else {
                        log("*** " & testcasename() & ": PASS: Same TSB packet was not passed to Upper Layer  ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BO_07_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_TSB_BO_07)
                 */
                function f_GEONW_PON_TSB_BO_07_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    var template (value) GeoNetworkingInd v_msgInd;
                    var integer i;
                    var template (value) GeoNetworkingPdu v_gnPacket;
                    
                    // Preamble
                    f_prNeighbour();
                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        )
                                    )
                                )
                            ) -> value v_msgInd {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: Pre-conditions: TSB correctly rebroadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": INCONC: Pre-conditions: TSB not rebroadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_prDone, e_timeout);
                        }
                    }
                    
                    // Test Body
                    v_msgInd.msgIn.basicHeader.routerHopLimit := valueof(v_msgInd.msgIn.basicHeader.routerHopLimit) - 1;
                    v_gnPacket := v_msgInd.msgIn;
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_msgInd.msgIn));
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_TSB_BO_07_nodeD
                
            } // end GEONW_PON_TSB_BO_07
            
        } // end geoTopologicallyScopedBroadcast
        
        // 6.2.2.11
        group geoSingleHopBroadcast {
            
            group GEONW_PON_SHB_BV_01 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_SHB_BV_01
                 */
                function f_GEONW_PON_SHB_BV_01() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_SHB_SRC) {
                        log("*** " & testcasename() & ": PICS_GN_SHB_SRC required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
                    // Test component configuration
                    f_cf02Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_SHB_BV_01_nodeB());
                    v_nodeD.start(f_GEONW_PON_SHB_BV_01_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end f_GEONW_PON_SHB_BV_01
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_SHB_BV_01)
                 */
                function f_GEONW_PON_SHB_BV_01_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    if ( not f_utTriggerEvent(m_generateShbMessage) ) {
                        log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                    }
                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
garciay's avatar
garciay committed
                                        mw_geoNwShbPacket(mw_longPosVectorPosition(v_longPosVectorIut))
                                    )
                                )
                            ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: SHB packet received correctly  ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected SHB message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_SHB_BV_01_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_SHB_BV_01)
                 */
                function f_GEONW_PON_SHB_BV_01_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
garciay's avatar
garciay committed
                                        mw_geoNwShbPacket(mw_longPosVectorPosition(v_longPosVectorIut))
                                    )
                                )
                            ) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: SHB packet received correctly  ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected SHB message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_SHB_BV_01_nodeD
                
            } // end GEONW_PON_SHB_BV_01
            
            /**
             * @desc    TP Function for TC_GEONW_PON_SHB_BV_02
             */
            function f_GEONW_PON_SHB_BV_02() runs on ItsGeoNetworking {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var template (value) GeoNetworkingPdu v_gnPacket;
                var integer i;
                var GnRawPayload v_sentRawPayload;
                
                // Test control
                if (not PICS_GN_SHB_DST) {
                    log("*** " & testcasename() & ": PICS_GN_SHB_DST required for executing the TC ***");
                    setverdict(inconc);
                    stop;
                }
                 
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB:= f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                
                // Test Body
                v_gnPacket := m_geoNwPdu(m_geoNwShbPacket(v_longPosVectorNodeB));
                f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket));
                
                f_sleep(PX_TAC);
                
                v_sentRawPayload := f_adaptPayloadForUtInd_m(v_gnPacket.gnPacket.packet.payload);
                for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i:=i+1) {
                    // empty on purpose 
                }
                if(i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": PASS: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                }
                else {
                    log("*** " & testcasename() & ": FAIL: GN was not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end f_GEONW_PON_SHB_BV_02
            
        } // end geoSingleHopBroadcast
        
        // 6.2.2.12
        group geoGeoAnycast {
            
            group GEONW_PON_GAC_BV_01 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GAC_BV_01
                 */
                function f_GEONW_PON_GAC_BV_01() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_GAC_SRC) {
                        log("*** " & testcasename() & ": PICS_GN_GAC_SRC required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                     
                    // Test component configuration
                    f_cf02Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_GAC_BV_01_nodeB());
                    v_nodeD.start(f_GEONW_PON_GAC_BV_01_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end f_GEONW_PON_GAC_BV_01
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GAC_BV_01)
                 */
                function f_GEONW_PON_GAC_BV_01_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    if ( not f_utTriggerEvent(m_generateGeoAnycastMessage(f_getArea(c_area1))) ) {
                        log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                        f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout);
                    }
                    
                    tc_ac.start;
                    alt {
                        [] a_receiveGeoAnycastWithArea(
garciay's avatar
garciay committed
                                mw_longPosVectorPosition(v_longPosVectorIut),
                                ?,
                                f_getGeoAnycastArea(c_area1)) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: GAC message received correctly ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GAC message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GAC_BV_01_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_GAC_BV_01)
                 */
                function f_GEONW_PON_GAC_BV_01_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {
                        [] a_receiveGeoAnycastWithArea(
garciay's avatar
garciay committed
                                mw_longPosVectorPosition(v_longPosVectorIut),
                                ?,
                                f_getGeoAnycastArea(c_area1)) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: GAC message received correctly ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GAC message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_GAC_BV_01_nodeD
                
            } // end GEONW_PON_GAC_BV_01
            
            group GEONW_PON_GAC_BV_02 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_GAC_BV_02
                 */
                function f_GEONW_PON_GAC_BV_02() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_GAC_SRC) {
                        log("*** " & testcasename() & ": PICS_GN_GAC_SRC required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                     if ((f_getGeoBroadcastForwardingAlgorithm() != e_simple) and (f_getGeoBroadcastForwardingAlgorithm() != e_unspecified)) {
                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == ( e_simple or e_unspecified ) required for executing the TC ***");