ItsGeoNetworking_TpFunctions.ttcn 718 KB
Newer Older
                    v_nodeF.start(f_GEONW_PON_BAA_BV_03_nodeF());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf06Down();
                    
                } // end f_GEONW_PON_BAA_BV_03
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_BAA_BV_03)
                 */
                function f_GEONW_PON_BAA_BV_03_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(m_geoNwBroadcastPacket(
                                v_longPosVectorNodeB,
                                0,
                                f_getGeoBroadcastArea(c_area1)
                            )
                        )
                    ));
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body                 
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeB),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: GBC message received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GBC message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_03_nodeB
                
                /**
                 * @desc    Behavior function for NodeF (TC_GEONW_PON_BAA_BV_03)
                 */
                function f_GEONW_PON_BAA_BV_03_nodeF() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    var LongPosVector v_longPosVectorNodeF := f_getPosition(c_compNodeF);                    
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    timer t_toCbf := (int2float(f_getGeoBroadcastCbfMaxTime())
                        + (
                            int2float(f_getGeoBroadcastCbfMinTime() - f_getGeoBroadcastCbfMaxTime())
                            / int2float(f_getCbfMaxCommunicationRange())
                        ) * f_distance(v_longPosVectorNodeF, v_longPosVectorIut)) * 0.95 / 1000.0;
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(
                        m_geoNwPdu(m_geoNwBroadcastPacket(
                                v_longPosVectorNodeB,
                                0,
                                f_getGeoBroadcastArea(c_area1)
                            )
                        )
                    ));
                    t_toCbf.start;                    
                    tc_ac.start;
                    alt {
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeB),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;                           
                            
                            if(t_toCbf.running) {                            	
                                t_toCbf.stop;
                                log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                            else {
                                log("*** " & testcasename() & ": PASS: GBC message received ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                        }
                        [] t_toCbf.timeout {
                            log("*** " & testcasename() & ": INFO: CBF timer elapsed ***");
                            repeat;
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: GBC message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_03_nodeF
                
            } // end GEONW_PON_BAA_BV_03
            
            group GEONW_PON_BAA_BV_04 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_BAA_BV_04
                 */
                function f_GEONW_PON_BAA_BV_04() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeE;
                    
                    // Test control
                    if (not PICS_GN_GBC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoBroadcastForwardingAlgorithm() != e_advanced) {
                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
garciay's avatar
garciay committed
//                    if (f_getGeoBroadcastCbfMinTime() < 300) {
//                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***");
//                        setverdict(inconc);
//                        stop;
//                    }
                    
                    // Test component configuration
                    f_cf05Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeE := f_getComponent(c_compNodeE);
                    v_nodeB.start(f_GEONW_PON_BAA_BV_04_nodeB());
                    v_nodeE.start(f_GEONW_PON_BAA_BV_04_nodeE());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf05Down();
                    
                } // end f_GEONW_PON_BAA_BV_04
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_BAA_BV_04)
                 */
                function f_GEONW_PON_BAA_BV_04_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {                    	
                    	[] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeA),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: packet correctly forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_04_nodeB
                
                /**
                 * @desc    Behavior function for NodeE (TC_GEONW_PON_BAA_BV_04)
                 */
                function f_GEONW_PON_BAA_BV_04_nodeE() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
	                    m_geoNwReq_withLinkLayerDestination(
	                        m_geoNwPdu(m_geoNwBroadcastPacket(
	                                v_longPosVectorNodeA,
	                                0,
	                                f_getGeoBroadcastArea(c_area1)
	                            )
	                        ),
	                        f_getIutMacAddress()
	                    )
                    );
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_04_nodeE
                
            } // end GEONW_PON_BAA_BV_04

            group GEONW_PON_BAA_BV_05 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_BAA_BV_05
                 */
                function f_GEONW_PON_BAA_BV_05() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeE;
                    
                    // Test control
                    if (not PICS_GN_GBC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoBroadcastForwardingAlgorithm() != e_advanced) {
                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
garciay's avatar
garciay committed
//                    if (f_getGeoBroadcastCbfMinTime() < 300) {
//                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***");
//                        setverdict(inconc);
//                        stop;
//                    }
                    
                    // Test component configuration
                    f_cf05Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeE := f_getComponent(c_compNodeE);
                    v_nodeB.start(f_GEONW_PON_BAA_BV_05_nodeB());
                    v_nodeE.start(f_GEONW_PON_BAA_BV_05_nodeE());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf05Down();
                    
                } // end f_GEONW_PON_BAA_BV_05
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_BAA_BV_05)
                 */
                function f_GEONW_PON_BAA_BV_05_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {                    	
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeA),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: packet correctly broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_05_nodeB
                
                /**
                 * @desc    Behavior function for NodeE (TC_GEONW_PON_BAA_BV_05)
                 */
                function f_GEONW_PON_BAA_BV_05_nodeE() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeA := f_getPosition(c_compNodeA);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_withLinkLayerDestination(
                            m_geoNwPdu(m_geoNwBroadcastPacket(
                                    v_longPosVectorNodeA,
                                    0,
                                    f_getGeoBroadcastArea(c_area1)
                                )
                            ),
                            f_getIutMacAddress()
                        )
                    );
                    tc_ac.start;
                    alt {                    	
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeA),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: packet correctly broadcasted ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_05_nodeE
                
            } // end GEONW_PON_BAA_BV_05
                        
            group GEONW_PON_BAA_BV_06 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_BAA_BV_06
                 */
                function f_GEONW_PON_BAA_BV_06() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeE;
                                        
                    // Test control
                    if (not PICS_GN_GBC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoBroadcastForwardingAlgorithm() != e_advanced) {
                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
garciay's avatar
garciay committed
//                    if (f_getGeoBroadcastCbfMinTime() < 300) {
//                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***");
//                        setverdict(inconc);
//                        stop;
//                    }
                    
                    // Test component configuration
                    f_cf05Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeE := f_getComponent(c_compNodeE);
                    v_nodeB.start(f_GEONW_PON_BAA_BV_06_nodeB());
                    v_nodeE.start(f_GEONW_PON_BAA_BV_06_nodeE());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf05Down();
                    
                } // end f_GEONW_PON_BAA_BV_06
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_BAA_BV_06)
                 */
                function f_GEONW_PON_BAA_BV_06_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeE := f_getPosition(c_compNodeE);
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    timer t_toCbf := (int2float(f_getGeoBroadcastCbfMaxTime())
                        + (
                            int2float(f_getGeoBroadcastCbfMinTime() - f_getGeoBroadcastCbfMaxTime())
                            / int2float(f_getCbfMaxCommunicationRange())
                        ) * f_distance(v_longPosVectorNodeE, v_longPosVectorIut)) * 0.95 / 1000.0;
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    t_toCbf.start;
                    tc_ac.start;
                    alt {                        
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeE),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;
                            
                            if(t_toCbf.running) {
                                t_toCbf.stop;  
                                log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***");                              
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                            else {
                                log("*** " & testcasename() & ": PASS: GBC message received ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                        }
                        [] t_toCbf.timeout {
                            log("*** " & testcasename() & ": INFO: CBF timer elapsed ***");
                            repeat;
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_06_nodeB
                
                /**
                 * @desc    Behavior function for NodeE (TC_GEONW_PON_BAA_BV_06)
                 */
                function f_GEONW_PON_BAA_BV_06_nodeE() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeE := f_getPosition(c_compNodeE);
                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
                    timer t_toCbf := (int2float(f_getGeoBroadcastCbfMaxTime())
                        + (
                            int2float(f_getGeoBroadcastCbfMinTime() - f_getGeoBroadcastCbfMaxTime())
                            / int2float(f_getCbfMaxCommunicationRange())
                        ) * f_distance(v_longPosVectorNodeE, v_longPosVectorIut)) * 0.95 / 1000.0;
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(m_geoNwBroadcastPacket(
                                    v_longPosVectorNodeE,
                                    0,
                                    f_getGeoBroadcastArea(c_area1)
                                )
                            )
                        )
                    );
                    
                    t_toCbf.start;
                    tc_ac.start;
                    alt {                        
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeE),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;
                            
                            if(t_toCbf.running) {
                                t_toCbf.stop;
                                log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                            else {
                                log("*** " & testcasename() & ": PASS: GBC message received ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                        }
                        [] t_toCbf.timeout {
                            log("*** " & testcasename() & ": INFO: CBF timer elapsed ***");
                            repeat;
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_06_nodeE
                
            } // end GEONW_PON_BAA_BV_06
            
            group GEONW_PON_BAA_BV_07 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_BAA_BV_07
                 */
                function f_GEONW_PON_BAA_BV_07() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    var ItsGeoNetworking v_nodeD;
                                                           
                    // Test control
                    if (not PICS_GN_GBC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoBroadcastForwardingAlgorithm() != e_advanced) {
                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
garciay's avatar
garciay committed
//                    if (f_getGeoBroadcastCbfMinTime() < 300) {
//                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***");
//                        setverdict(inconc);
//                        stop;
//                    }
                    
                    // Test component configuration
                    f_cf04Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_BAA_BV_07_nodeB());
                    v_nodeC.start(f_GEONW_PON_BAA_BV_07_nodeC());
                    v_nodeD.start(f_GEONW_PON_BAA_BV_07_nodeD());
                    
                    // Synchronization
                    f_serverSync3ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf04Down();
                    
                } // end f_GEONW_PON_BAA_BV_07
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_BAA_BV_07)
                 */
                function f_GEONW_PON_BAA_BV_07_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_ac.start;
                    alt {                       
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeC),
                                ?,
                                f_getGeoBroadcastArea(c_area2)
                            )))) {
                            tc_ac.stop;
                            log("*** " & testcasename() & ": PASS: packet correctly forwarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_07_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_BAA_BV_07)
                 */
                function f_GEONW_PON_BAA_BV_07_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeC := f_getPosition(c_compNodeC);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(m_geoNwBroadcastPacket(
                                    v_longPosVectorNodeC,
                                    0,
                                    f_getGeoBroadcastArea(c_area2)
                                )
                            )
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_07_nodeC
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_BAA_BV_07)
                 */
                function f_GEONW_PON_BAA_BV_07_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: Message not discarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: No message received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_07_nodeD
                
            } // end GEONW_PON_BAA_BV_07
            
            group GEONW_PON_BAA_BO_08 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_BAA_BO_08
                 */
                function f_GEONW_PON_BAA_BO_08() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    var ItsGeoNetworking v_nodeD;
                                        
                    // Test control
                    if (not PICS_GN_GBC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoBroadcastForwardingAlgorithm() != e_advanced) {
                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
garciay's avatar
garciay committed
//                    if (f_getGeoBroadcastCbfMinTime() < 300) {
//                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***");
//                        setverdict(inconc);
//                        stop;
//                    }
                    
                    // Test component configuration
                    f_cf04Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeC := f_getComponent(c_compNodeC);
                    v_nodeD := f_getComponent(c_compNodeD);
                    v_nodeB.start(f_GEONW_PON_BAA_BO_08_nodeB());
                    v_nodeC.start(f_GEONW_PON_BAA_BO_08_nodeC());
                    v_nodeD.start(f_GEONW_PON_BAA_BO_08_nodeD());
                    
                    // Synchronization
                    f_serverSync3ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf04Down();
                    
                } // end f_GEONW_PON_BAA_BO_08
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_BAA_BO_08)
                 */
                function f_GEONW_PON_BAA_BO_08_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: Message not discarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: No message received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BO_08_nodeB
                
                /**
                 * @desc    Behavior function for NodeC (TC_GEONW_PON_BAA_BO_08)
                 */
                function f_GEONW_PON_BAA_BO_08_nodeC() runs on ItsGeoNetworking {
                    
                    // Local variables
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(?))) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: Message not discarded ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: No message received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BO_08_nodeC
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_PON_BAA_BO_08)
                 */
                function f_GEONW_PON_BAA_BO_08_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeD := f_getPosition(c_compNodeD);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(m_geoNwBroadcastPacket(
                                    v_longPosVectorNodeD,
                                    0,
                                    f_getGeoBroadcastArea(c_area2)
                                )
                            )
                        )
                    );
                    f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BO_08_nodeD
                
            } // end GEONW_PON_BAA_BO_08
            
            group GEONW_PON_BAA_BV_09 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_BAA_BV_09
                 */
                function f_GEONW_PON_BAA_BV_09() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeE;
                    
                    // Test control
                    if (not PICS_GN_GBC_FWD) {
                        log("*** " & testcasename() & ": PICS_GN_GBC_FWD required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    if (f_getGeoBroadcastForwardingAlgorithm() != e_advanced) {
                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_FORWARDING_ALGORITHM == e_advanced required for executing the TC ***");
                        setverdict(inconc);
                        stop;
                    }
                    
garciay's avatar
garciay committed
//                    if (f_getGeoBroadcastCbfMinTime() < 300) {
//                        log("*** " & testcasename() & ": PICS_GN_GEOBROADCAST_CBF_MIN_TIME >= 300 required for executing the TC ***");
//                        setverdict(inconc);
//                        stop;
//                    }
                    
                    // Test component configuration
                    f_cf05Up();
                    
                    // Preamble
                    
                    // Start components
                    v_nodeB := f_getComponent(c_compNodeB);
                    v_nodeE := f_getComponent(c_compNodeE);
                    v_nodeB.start(f_GEONW_PON_BAA_BV_09_nodeB());
                    v_nodeE.start(f_GEONW_PON_BAA_BV_09_nodeE());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf05Down();
                    
                } // end f_GEONW_PON_BAA_BV_09
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_PON_BAA_BV_09)
                 */
                function f_GEONW_PON_BAA_BV_09_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    timer t_toCbf := int2float(f_getGeoBroadcastCbfMaxTime()) * 0.95 / 1000.0;
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    t_toCbf.start;
                    tc_ac.start;
                    alt {                        
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeB),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;
                            
                            if(t_toCbf.running) {
                            	t_toCbf.stop;
                                log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                            else {
                                log("*** " & testcasename() & ": PASS: GBC message received ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                        }
                        [] t_toCbf.timeout {
                            log("*** " & testcasename() & ": INFO: CBF timer elapsed ***");
                            repeat;
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_06_nodeB
                
                /**
                 * @desc    Behavior function for NodeE (TC_GEONW_PON_BAA_BV_09)
                 */
                function f_GEONW_PON_BAA_BV_09_nodeE() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    timer t_toCbf := int2float(f_getGeoBroadcastCbfMaxTime()) * 0.95 / 1000.0;
                    
                    // Preamble
                    f_prNonNeighbour();
                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(m_geoNwBroadcastPacket(
                                    v_longPosVectorNodeB,
                                    0,
                                    f_getGeoBroadcastArea(c_area1)
                                )
                            )
                        )
                    );
                    
                    t_toCbf.start;
                    tc_ac.start;
                    alt {                        
                        [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBroadcastPacketWithArea(
                                mw_longPosVectorPosition(v_longPosVectorNodeB),
                                ?,
                                f_getGeoBroadcastArea(c_area1)
                            )))) {
                            tc_ac.stop;
                            
                            if(t_toCbf.running) {
                                t_toCbf.stop;
                                log("*** " & testcasename() & ": FAIL: GBC retransmitted before CBF timer expiration ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                            }
                            else {
                                log("*** " & testcasename() & ": PASS: GBC message received ***");
                                f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
                            }
                        }
                        [] t_toCbf.timeout {
                            log("*** " & testcasename() & ": INFO: CBF timer elapsed ***");
                            repeat;
                        }
                        [] tc_ac.timeout {
                            log("*** " & testcasename() & ": FAIL: Expected message not received ***");
                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_PON_BAA_BV_09_nodeE
                
            } // end GEONW_PON_BAA_BV_09
            
            group GEONW_PON_BAA_BV_10 {
                
                /**
                 * @desc    TP Function for TC_GEONW_PON_BAA_BV_10
                 */
                function f_GEONW_PON_BAA_BV_10() runs on ItsMtc {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeC;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    if (not PICS_GN_GBC_FWD) {