ItsGeoNetworking_TestCases.ttcn 872 KB
Newer Older
filatov's avatar
filatov committed
/**
 *  @author     ETSI / STF405 / STF449
 *  @version    $URL$
 *              $Id$
 *  @desc       GeoNetworking Testcases (TP version: 0.0.11)
 *
 */
module ItsGeoNetworking_TestCases {
    
    // Libcommon
    import from LibCommon_BasicTypesAndValues all;
    import from LibCommon_Time all;
    import from LibCommon_VerdictControl all;
    import from LibCommon_Sync all;
    
    // LibIts
    import from LibItsCommon_Functions all;
    import from LibItsGeoNetworking_TestSystem all;
    import from LibItsGeoNetworking_Functions all;
    import from LibItsGeoNetworking_Templates all;
    import from LibItsGeoNetworking_TypesAndValues all;
    import from LibItsGeoNetworking_Pics all;

    // 6.2.1
    group geoFormatingAndDataValidity {
        
        // 6.2.1.1
        group geoFdvBasicHeader {
            
            /**
             * @desc    Testing defined values of default Gn parameters in the basic header
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a GeoUnicast packet
             *      }
             *      then {
             *          the IUT sends a GeoUnicast packet
             *              containing a correctly formatted Basic Header
             *                  containing version field
             *                      set to itsGnProtocolVersion MIB parameter
             *                  containing RHL field
             *                      set to itsGnDefaultHopLimit MIB parameter
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/BAH/BV/01
             * @reference   EN 302 636-4-1 [1], clauses 9.3.2 , 8.6.2 and Annex G
             */
            testcase TC_GEONW_FDV_BAH_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(vc_componentName);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                }
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwUnicastPacket(?, ?), -, f_getDefaultHopLimit()))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: Basic Header correctly formatted ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_BAH_BV_01
            
            /**
             * @desc    Testing discard of packet having incorrect version
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT receives the SHB packet from ItsNodeB
             *              containing a correctly formatted Basic Header
             *                  containing version field
             *                      set to value not equal to itsGnProtocolVersion MIB parameter
             *      }
             *      then {
             *          the IUT discards the received SHB packet
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/BAH/BV/02
             * @reference   EN 302 636-4-1 [1], clauses 9.3.3
             */
            testcase TC_GEONW_FDV_BAH_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var template (value) GeoNetworkingPdu v_gnPacket;
                var integer i;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_gnPacket := m_geoNwPdu(m_geoNwShbPacket(v_longPosVectorNodeB));
                v_gnPacket.basicHeader.version := valueof(v_gnPacket.basicHeader.version) + 1;
filatov's avatar
filatov committed
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000
                
                f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_gnPacket));
                
                f_sleep(PX_TAC);
                for(i:=0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_gnPacket.gnPacket.packet.payload.rawPayload); i:=i+1) {
                    // empty on purpose 
                }
                if(i < lengthof(vc_utInds)) {
                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                }
                else {
                    log("*** " & testcasename() & ": PASS: GN was discarded and not transmitted to upper layer ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_BAH_BV_02
            
        } // end geoFdvBasicHeader
        
        // 6.2.1.2
        group geoFdvCommonHeader {
            
            /**
             * @desc    Common GeoNetworking header validity test (PL field)
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT generates a Beacon message
             *      }
             *      then {
             *          the IUT sends a GeoNetworking message
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '1' (BEACON)
             *                  containing HST field
             *                      set to '0' (UNSPECIFIED)
             *                  containing PL field
             *                      set to '0'
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/COH/BV/01
             * @reference   EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 8.8.6 and 9.3.6
             */
            testcase TC_GEONW_FDV_COH_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader));
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(?))))  {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: Common Header correclty formatted ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                f_acTriggerEvent(m_stopPassBeaconing);
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_COH_BV_01
            
            /**
             * @desc    Common GeoNetworking header validity test (PL field)
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a SHB packet
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '5' (TSB)
             *                  containing HST field
             *                      set to '0' (SINGLE_HOP)
             *                  containing MHL field
             *                      set to '1'
             *                  containing PL field
             *                      set to the length of the included payload
             *              containing a payload
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/COH/BV/02
             * @reference   EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 8.8.4, 9.3.4 and 9.3.10
             */
            testcase TC_GEONW_FDV_COH_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var GeoNetworkingInd v_geoNwInd;
                var octetstring v_payload := char2oct("PAYLOAD");
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                if ( not f_utTriggerEvent(m_generateShbMessageWithPayload(v_payload)) ) {
                	log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                	f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_timeout);
                }
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwShbPacket))) -> value v_geoNwInd {
                        tc_ac.stop;
                        if(ispresent(v_geoNwInd.msgIn.gnPacket.packet.payload)) {
                            if(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength == lengthof(v_geoNwInd.msgIn.gnPacket.packet.payload.rawPayload)) {
                                log("*** " & testcasename() & ": PASS: PL field correctly indicates payload size ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            }
                            else {
                                log("*** " & testcasename() & ": FAIL: PL does correctly not indicate payload size ("
                                    & int2str(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength)
                                    & " != "
                                    & int2str(lengthof(v_geoNwInd.msgIn.gnPacket.packet.payload.rawPayload))
                                    & ")***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                            }
                        }
                        else {
                            if(v_geoNwInd.msgIn.gnPacket.packet.commonHeader.plLength == 0) {
                                log("*** " & testcasename() & ": PASS: PL field correctly indicates empty payload ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                            }
                            else {
                                log("*** " & testcasename() & ": FAIL: PL does not indicate empty payload ***");
                                f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                            }
                        }
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_COH_BV_02
            
            /**
             * @desc    Testing defined values of default Gn parameters in the common header
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *       the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a GeoUnicast packet
             *      }
             *      then {
             *          the IUT sends a GeoUnicast packet
             *              containing a correctly formatted Common Header
             *                  containing Flags field
             *                      indicating value equalling the itsGnIsMobile MIB parameter
             *                  containing MHL field
             *                      set to itsGnDefaultHopLimit MIB parameter
             *     }
             *  }
             * </pre>
             *
             * @version 0.0.11
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/COH/BV/03
             * @reference   EN 302 636-4-1 [1], clauses 8.7.2, 8.8.2, 9.3.4 and Annex G
             */
            testcase TC_GEONW_FDV_COH_BV_03() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorNodeB := f_getPosition(vc_componentName);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                }
                 
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(
                            mw_geoNwUnicastPacketWithHlAndFlags(?, ?, f_getDefaultHopLimit(), f_isMobile())))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: Correct GeoNetworking Common Header received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] a_receiveAnyGeoUnicast() {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": FAIL: Incorrect GeoNetworking Common Header received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_COH_BV_03
            
            group GEONW_FDV_COH_BV_04 {
                
                /**
                 * @desc    Test that a received TSB packet is discarded if received with RHL > MHL
                 * <pre>
                 * Pics Selection: none
                 * Config Id: CF02
                 * Initial conditions:
                 *  with {
                 *       the IUT being in the "initial state" and
                 *       the IUT having received Beacon information from ItsNodeD and
                 *       the IUT having received Beacon information from ItsNodeB
                 *  }
                 * Expected behaviour:
                 *  ensure that {
                 *      when {
                 *          the IUT receives a TSB packet
                 *              containing Basic Header
                 *                  containing RHL field
                 *                      indicating HL1 higher than MHL1
                 *              containing Common Header
                 *                  containing MHL field
                 *                      indicating MHL1
                 *      }
                 *      then {
                 *          the IUT discards the TSB packet
                 *     }
                 *  }
                 * </pre>
                 *
                 * @version 0.0.11
                 * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/COH/BV/04
                 * @reference   EN 302 636-4-1 [1], clauses 9.3.5
                 */
                testcase TC_GEONW_FDV_COH_BV_04() runs on ItsMtc system ItsGeoNetworkingSystem {
                    
                    // Local variables
                    var ItsGeoNetworking v_nodeB;
                    var ItsGeoNetworking v_nodeD;
                    
                    // Test control
                    
                    // 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_FDV_COH_BV_04_nodeB());
                    v_nodeD.start(f_GEONW_FDV_COH_BV_04_nodeD());
                    
                    // Synchronization
                    f_serverSync2ClientsAndStop({c_prDone, c_tbDone});
                    
                    // Cleanup
                    f_cf02Down();
                    
                } // end TC_GEONW_FDV_COH_BV_04
                
                /**
                 * @desc    Behavior function for NodeB (TC_GEONW_FDV_COH_BV_04)
                 */
                function f_GEONW_FDV_COH_BV_04_nodeB() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    var UInt8 v_hopLimit := f_getDefaultHopLimit();
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
                    // Test Body
                    f_sendGeoNetMessage(
                        m_geoNwReq_linkLayerBroadcast(
                            m_geoNwPdu(
                                m_geoNwTsbPacket(
                                    vc_localSeqNumber,
                                    v_longPosVectorNodeB,
                                    v_hopLimit-1
                                ),
                                -,
                                v_hopLimit
                            )
                        )
                    );
                    
                    tc_noac.start;
                    alt {
                        [] geoNetworkingPort.receive(
                                mw_geoNwInd(
                                    mw_geoNwPdu(
                                        mw_geoNwTsbPacket(
                                            ?,
                                            mw_longPosVectorPosition(v_longPosVectorNodeB)
                                        )
                                    )
                                )
                            ) {
                            tc_noac.stop;
                            log("*** " & testcasename() & ": FAIL: TSB packet was not discarded  ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: TSB was correctly discarded ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_FDV_COH_BV_04_nodeB
                
                /**
                 * @desc    Behavior function for NodeD (TC_GEONW_FDV_COH_BV_04)
                 */
                function f_GEONW_FDV_COH_BV_04_nodeD() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdictPreamble(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 packet was not discarded  ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
                        }
                        [] tc_noac.timeout {
                            log("*** " & testcasename() & ": PASS: TSB was correctly discarded ***");
                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                        }
                    }
                    
                    // Postamble
                    f_poNeighbour();
                    
                } // end f_GEONW_FDV_COH_BV_04_nodeD
                
            } // end GEONW_FDV_COH_BV_04
            
        } // end geoFdvCommonHeader
        
        // 6.2.1.3
        group geoFdvBeacon {
            
            /**
             * @desc    Beacon header validity test
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT generates a Beacon packet
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '1' (BEACON)
             *                  containing HST field
             *                      set to '0' (UNSPECIFIED)
             *                  containing NH field
             *                      set to '0' (UNSPECIFIED)
             *              containing Extended Header
             *                  containing SOPV
             *                      indicating LPV of the IUT
             *      }
             *    }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/BEA/BV/01
             * @reference   EN 302 636-4-1 [1], clauses 8.7.2, 8.8.6 and 9.3.6
             */
            testcase TC_GEONW_FDV_BEA_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader));
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(mw_longPosVectorPosition(v_longPosVectorIut), e_any)))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: Common Header correclty formatted ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_BEA_BV_01
            
            /**
             * @desc    GeoNetworking address validity test
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *    the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT generates a Beacon packet
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing SOPV field
             *                  containing GN_ADDR field
             *                      containing ST field
             *                          indicating the ITS Station type
             *                      containing SCC field
             *                          indicating the ITS Station country code
             *      }
             *  }
             *  NOTE: Correct Source GeoNetworking address value: itsGnLocalGnAddr MIB parameter value.
             *  
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/BEA/BV/02
             * @reference   EN 302 636-4-1 [1], clauses 6.3 and 8.8.6.2
             */
            testcase TC_GEONW_FDV_BEA_BV_02() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader));
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(
                            mw_longPosVectorAny(f_getIutGnLocalAddress()))))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: GN address correctly received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_BEA_BV_02
            
            /**
             * @desc    Local Position Vector validity test, involving comparison against sensor input data
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT generates a Beacon packet
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correct SOPV field
             *                  indicating the latest position of the IUT
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/BEA/BV/03
             * @reference   EN 302 636-4-1 [1], clauses 8.5.2.2 and 8.8.6.2
             */
            testcase TC_GEONW_FDV_BEA_BV_03() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader));
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(mw_longPosVectorPosition_withDelta(v_longPosVectorIut))))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: Position equaling GN-MNGT primitive value received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_BEA_BV_03
            
            /**
             * @desc    Local Position Vector validity test, involving timestamp comparison against sensor input data
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state"
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT generates a Beacon packet
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correct SOPV field
             *                  indicating the timestamp value corresponding to the sensor acquisition time of position data
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/BEA/BV/04
             * @reference   EN 302 636-4-1 [1], clauses 8.5.2.2 and 8.8.6.2
             */
            testcase TC_GEONW_FDV_BEA_BV_04() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorIut;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                v_longPosVectorIut := f_getPosition(c_compIut);
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_acTriggerEvent(m_startPassBeaconing(m_beaconHeader(v_longPosVectorIut).beaconHeader));
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(mw_geoNwInd(mw_geoNwPdu(mw_geoNwBeaconPacket(mw_longPosVectorPosition_withDelta(v_longPosVectorIut))))) {
                        tc_ac.stop;
                        log("*** " & testcasename() & ": PASS: Timestamp equaling GN-MNGT primitive value received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_BEA_BV_04
            
        } // end geoFdvBeacon
        
        // 6.2.1.4
        group geoFdvGeoUnicast {
            
            /**
             * @desc    GeoUnicast header validity
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT having received Beacon information from ItsNodeB
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a GeoUnicast packet to ItsNodeB
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '2' (GEOUNICAST)
             *                  containing HST field
             *                      set to '0' (UNSPECIFIED)
             *              containing GeoUnicast Extended Header
             *                  containing DEPV field
             *                      indicating position of the ItsNodeB
             *                  containing SOPV field
             *                      indicating position of the IUT
             *      }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/GUC/BV/01
             * @reference   EN 302 636-4-1 [1], clauses 8.7.2, 8.8.2.2 and 9.3.8
             */
            testcase TC_GEONW_FDV_GUC_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var LongPosVector v_longPosVectorIut;
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                v_longPosVectorIut := f_getPosition(c_compIut);
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                if ( not f_utTriggerEvent(m_generateGeoUnicastMessage(v_longPosVectorNodeB.gnAddr)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                }
                
                tc_ac.start;
                alt {
                    [] geoNetworkingPort.receive(
                            mw_geoNwInd(
                                mw_geoNwPdu(
                                    mw_geoNwUnicastPacketWithSourcePv(
                                        mw_shortPosVectorPosition_withDelta(f_longPosVector2ShortPosVector(v_longPosVectorNodeB)), // DEPV
                                        ?, // sequence number
                                        mw_longPosVectorPosition_withDelta(v_longPosVectorIut) //SOPV
                                    )
                                )
                            )
                        ) {
                        tc_ac.stop;
                        
                        log("*** " & testcasename() & ": PASS: Fields of the received GeoUnicast message correctly set ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    }
                    [] tc_ac.timeout {
                        log("*** " & testcasename() & ": INCONC: GeoUnicast message not received ***");
                        f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                    }
                }
                
                // Postamble
                f_poNeighbour();
                f_cf01Down();
                
            } // end TC_GEONW_FDV_GUC_BV_01
            
        } // end geoFdvGeoUnicast
        
        // 6.2.1.5
        group geoFdvGeoBroadcast {
            
            /**
             * @desc    GeoBroadcast header validity
             * <pre>
             * Pics Selection: none
             * Config Id: CF01
             * Initial conditions:
             *  with {
             *      the IUT being in the "initial state" and
             *      the IUT having received Beacon information from the ItsNodeB
             *  }
             * Expected behaviour:
             *  ensure that {
             *      when {
             *          the IUT is requested to send a GeoBroadcast packet
             *      }
             *      then {
             *          the IUT sends a GeoNetworking packet
             *              containing a correctly formatted Common Header
             *                  containing HT field
             *                      set to '4' (GEOBROADCAST)
             *              containing GeoBroadcast Extended Header
             *                  containing SOPV field
             *                      indicating position of the IUT
             *       }
             *  }
             * </pre>
             *
             * @see         ETSI TS 102 871-2 v2.1.1 TP/GEONW/FDV/GBC/BV/01
             * @reference   EN 302 636-4-1 [1], clauses 8.7.2, 8.7.4, 8.8.5.2 and 9.3.11
             */
            testcase TC_GEONW_FDV_GBC_BV_01() runs on ItsGeoNetworking system ItsGeoNetworkingSystem {
                
                // Local variables
                var LongPosVector v_longPosVectorNodeB;
                var LongPosVector v_longPosVectorIut;
                var octetstring v_payload := char2oct("PAYLOAD");
                
                // Test control
                
                // Test component configuration
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                v_longPosVectorNodeB := f_getPosition(c_compNodeB);
                v_longPosVectorIut := f_getPosition(c_compIut);
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                if ( not f_utTriggerEvent(m_generateGeoBroadcastMessageWithPayload(f_getArea(c_area1), v_payload)) ) {
                    log("*** " & testcasename() & ": INCONC: Trigger failed ***");
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_timeout);
                }
                tc_ac.start;