ItsSecurity_TestCases.ttcn 1.59 MB
Newer Older
//             *                                      not containing the CURRENT_IUT_LOCATION
//             *   } then {
//             *       the IUT discards the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_DENM_13_05_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.2
//             */
//            testcase TC_SEC_ITSS_RCV_DENM_13_05_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnRawPayload v_sentRawPayload;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY)) {
//                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf01Up();
//                
//                // Test adapter configuration
//                
//                // Preamble
//                f_prNeighbour();
//                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                
//                // Test Body
//                v_securedGnPdu := f_sendSecuredDenm(cc_taCertMsg1305_BO, omit, e_certificate);
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(v_securedGnPdu.gnPacket.packet.payload);
//                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
//                    // Empty on purpose 
//                }
//                if (i < lengthof(vc_utInds)) {
//                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer***");
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
//                }
//                else {
//                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer***");
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                }
//                
//                // Postamble
//                f_poNeighbour();
//                f_cf01Down();
//            } // End of testcase TC_SEC_ITSS_RCV_DENM_13_05_BO
//            
//            /**
//             * @desc    Check that IUT discards secured DENM when IUT location is outside the identified validity restriction of the signing certificate
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * }
//             * ensure that {
//             *     when {
//             *          the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_DENM_A)
//             *              containing header_fields['signer_info'].signer 
//             *                  containing certificate (CERT_TS_MSG_13_06_BO_AT)
//             *                      containing validity_restrictions['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'id'
//             *                              and containing id_region
//             *                                  indicating REGION
//             *                                      not containing the CURRENT_IUT_LOCATION
//             *   } then {
//             *       the IUT discards the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_DENM_13_06_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.2
//             */
//            testcase TC_SEC_ITSS_RCV_DENM_13_06_BO() runs on ItsGeoNetworking system ItsSecSystem {
//                
//                // Local variables
//                var integer i;
//                var GeoNetworkingPdu v_securedGnPdu;
//                var GnRawPayload v_sentRawPayload;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY)) {
//                    log("*** " & testcasename() & ":ERROR: 'PICS_GN_SECURITY' required for executing the TC ***");
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf01Up();
//                
//                // Test adapter configuration
//                
//                // Preamble
//                f_prNeighbour();
//                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                
//                // Test Body
//                v_securedGnPdu := f_sendSecuredDenm(cc_taCertMsg1306_BO, omit, e_certificate);
//                
//                f_sleep(PX_TNOAC);
//                v_sentRawPayload := valueof(v_securedGnPdu.gnPacket.packet.payload);
//                for (i := 0; i < lengthof(vc_utInds) and not match(vc_utInds[i].rawPayload, v_sentRawPayload); i := i + 1) {
//                    // Empty on purpose 
//                }
//                if (i < lengthof(vc_utInds)) {
//                    log("*** " & testcasename() & ": FAIL: GN was transmitted to upper layer***");
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
//                }
//                else {
//                    log("*** " & testcasename() & ": PASS: GN was not transmitted to upper layer***");
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                }
//                
//                // Postamble
//                f_poNeighbour();
//                f_cf01Down();
//            } // End of testcase TC_SEC_ITSS_RCV_DENM_13_06_BO
        } // End of group recvDenmProfile
        
        /**
         * @desc Receiving behaviour test cases for Other profile
garciay's avatar
garciay committed
         * @see ETSI TS 103 096-2 V1.3.32 (2018-01) Clause 5.3.4 Generic Signed Message Profile
         */
        group recvOtherProfile {
             * @desc Function used to verify the IUT has forwarded or discarded the received secured message sent by the TA
            group commonFunctions {
//                /**
//                 * @desc    Behavior function for NodeD in case of forwarding is expected
//                 * @see     TC_GEONW_PON_GBC_BV_01
//                 */
//                function f_TC_SEC_ITSS_RCV_GENMSG_xxx_BV_nodeD() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
//                    
//                    // Test Body
//                    tc_ac.start;
//                    alt {
//                        [] geoNetworkingPort.receive(
//                            mw_geoNwInd(
//                                mw_geoNwSecPdu(
//                                    mw_ieee1609Dot2Data_dummy, 
//                                    mw_geoNwBroadcastPacketWithArea(
//                                        mw_longPosVectorPosition(
//                                            v_longPosVectorNodeB
//                                        ),
//                                        ?,
//                                        f_getGeoBroadcastArea(c_area1)
//                        )))) {
//                            tc_ac.stop;
//                            log("*** " & testcasename() & ": PASS: Beacon message was forwarded ***");
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                        }
//                        [] geoNetworkingPort.receive(
//                            mw_geoNwInd(
//                                mw_geoNwSecPdu(
//                                    mw_ieee1609Dot2Data_dummy
//                        ))) {
//                            // Do not restart tc_ac timer
//                            log("*** " & testcasename() & ": INFO: Unexpected GN message ignored ***");
//                            repeat;
//                        }
//                        [] tc_ac.timeout {
//                            log("*** " & testcasename() & ": FAIL: GBC message not received ***");
//                            f_selfOrClientSyncAndVerdict(c_tbDone, e_error);
//                        }
//                    }
//                    
//                    // Postamble
//                    f_poNeighbour();
//                    
//                } // End of function f_TC_SEC_ITSS_RCV_GENMSG_xxx_BV_nodeD
//                
//                /**
//                 * @desc    Behavior function for NodeD in case of forwarding is not expected
//                 * @see     TC_GEONW_PON_GBC_BV_01
//                 */
//                function f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var LongPosVector v_longPosVectorIut := f_getPosition(c_compIut);
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
//                    
//                    // Test Body
//                    tc_noac.start;
//                    alt {
//                        [] geoNetworkingPort.receive(
//                            mw_geoNwInd(
//                                mw_geoNwSecPdu(
//                                    mw_ieee1609Dot2Data_dummy, 
//                                    mw_geoNwBroadcastPacketWithArea(
//                                        mw_longPosVectorPosition(
//                                            v_longPosVectorIut
//                                        ),
//                                        ?,
//                                        f_getGeoBroadcastArea(c_area1)
//                        )))) {
//                            tc_noac.stop;
//                            log("*** " & testcasename() & ": FAIL: Beacon message shall ot be forwarded ***");
//                            f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_error);
//                        }
//                        [] geoNetworkingPort.receive(
//                            mw_geoNwInd(
//                                mw_geoNwSecPdu(
//                                    mw_ieee1609Dot2Data_dummy
//                        ))) {
//                            // Do not restart tc_ac timer
//                            log("*** " & testcasename() & ": INFO: Unexpected GN message ignored ***");
//                            repeat;
//                        }
//                        [] tc_noac.timeout {
//                            log("*** " & testcasename() & ": PASS: Secured message was discarded ***");
//                            f_selfOrClientSyncAndVerdict(c_tbDone, e_success);
//                        }
//                    }
//                    
//                    // Postamble
//                    f_poNeighbour();
//                    
//                } // End of function f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD
            } // End of goup commonFunctions
//            /**
//             * @desc    Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate without region validity restriction
//             * @remark  The message defined in this test purpose is used in the subsequent test purposes with the snippet name ‘MSG_SEC_RCV_GENMSG_C’. Only differences to this snippet are mentioned in subsequent test purposes
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data
//             *          containing header_fields[0]
//             *              containing type 
//             *                  indicating 'signer_info'
//             *              and containing signer
//             *                  containing type
garciay's avatar
garciay committed
//             *                      containing certificate
//             *                  and containing certificate (CERT_AT_A)
//             *                      containing subject_info.subject_type
//             *                          indicating 'authorization_ticket' (2)
//             *                      and containing subject_attributes['verification key'] (KEY)
//             *                      and containing validity_restrictions['time_start_and_end']
//             *                          indicating CERT_TS_AT_TIME_VALIDITY
//             *             and not containing validity_restrictions['region']
//             *       and containing header_fields [1]
//             *         containing type 
//             *           indicating 'generation_time'
//             *              containing generation_time
//             *                  indicating CURRENT_TIME
//             *                      inside CERT_TS_AT_TIME_VALIDITY
//             *       and containing header_fields [2]
//             *           containing type 
//             *               indicating 'generation_location'
//             *                   containing generation_location
//             *           and containing generation_location
//             *       and containing header_fields[3]
//             *           containing type 
//             *               indicating 'its_aid'
//             *           and containing its_aid
//             *              indicating 'AID_BEACON'
//             *          and containing payload_field 
//             *               containing type
//             *                  indicating 'signed'
//             *              containing data
//             *                  indicating length > 0
//             *          and containing trailer_fields 
//             *              containing single instance of type TrailerField 
//             *                  containing type
//             *                      indicating 'signature'
//             *                  containing signature
//             *                      verifiable using KEY
//             *   } then {
//             *     the IUT accepts the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_01_01_BV
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_01_01_BV() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV_nodeB(cc_taCert_A));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BV_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_01_01_BV
//            
//            /**
//             * @desc    Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate with a circular region validity restriction
//             * @remark  The message defined in this test purpose is used in the subsequent test purposes with the snippet name ‘MSG_SEC_RCV_GENMSG_C’. Only differences to this snippet are mentioned in subsequent test purposes
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_B_AT
//             *   and the IUT current location is inside the region validity period of CERT_TS_B_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data
//             *         containing protocol_version 
//             *             indicating value '2'
//             *         and containing header_fields[0]
//             *              containing type 
//             *                  indicating 'signer_info'
//             *              and containing signer
//             *                  containing type
garciay's avatar
garciay committed
//             *                      containing certificate
//             *                  and containing certificate (CERT_TS_B_AT)
//             *                      containing subject_info.subject_type
//             *                          indicating 'authorization_ticket' (2)
//             *                      and containing subject_attributes['verification key'] (KEY)
//             *                      and containing validity_restrictions['time_start_and_end']
//             *                          indicating CERT_TS_AT_TIME_VALIDITY
//             *                      and containing validity_restrictions['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'circle'
//             *                              and containing circular_region
//             *                                  indicating REGION
//             *       and containing header_fields [1]
//             *         containing type 
//             *           indicating 'generation_time'
//             *              containing generation_time
//             *                  indicating CURRENT_TIME
//             *       and containing header_fields [2]
//             *           containing type 
//             *               indicating 'generation_location'
//             *           and containing generation_location
//             *       and containing header_fields[3]
//             *           containing type 
//             *               indicating 'its_aid'
//             *           and containing its_aid
//             *               indicating 'AID_BEACON'
//             *          and containing payload_field 
//             *               containing type
//             *                  indicating 'signed'
//             *              containing data
//             *                  indicating length > 0
//             *          and containing trailer_fields 
//             *              containing single instance of type TrailerField 
//             *                  containing type
//             *                      indicating 'signature'
//             *                  containing signature
//             *                      verifiable using KEY
//             *   } then {
//             *     the IUT accepts the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_01_02_BV
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_01_02_BV() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV_nodeB(cc_taCert_B));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BV_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_01_02_BV
//            
//            /**
//             * @desc    Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate with a rectangular region validity restriction
//             * @remark  The message defined in this test purpose is used in the subsequent test purposes with the snippet name ‘MSG_SEC_RCV_GENMSG_C’. Only differences to this snippet are mentioned in subsequent test purposes
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_C_AT
//             *   and the IUT current location is inside the region validity period of CERT_TS_C_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data
//             *         containing protocol_version 
//             *             indicating value '2'
//             *         and containing header_fields[0]
//             *              containing type 
//             *                  indicating 'signer_info'
//             *              and containing signer
//             *                  containing type
garciay's avatar
garciay committed
//             *                      containing certificate
//             *                  and containing certificate (CERT_TS_C_AT)
//             *                      containing subject_info.subject_type
//             *                          indicating 'authorization_ticket' (2)
//             *                      and containing subject_attributes['verification key'] (KEY)
//             *                      and containing validity_restrictions['time_start_and_end']
//             *                          indicating CERT_TS_AT_TIME_VALIDITY
//             *                      and containing validity_restrictions['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'rectangle'
//             *                              and containing rectangular_region
//             *                                  indicating REGION
//             *       and containing header_fields [1]
//             *         containing type 
//             *           indicating 'generation_time'
//             *              containing generation_time
//             *                  indicating CURRENT_TIME
//             *       and containing header_fields [2]
//             *           containing type 
//             *               indicating 'generation_location'
//             *           and containing generation_location
//             *       and containing header_fields[3]
//             *           containing type 
//             *               indicating 'its_aid'
//             *           and containing its_aid
//             *               indicating 'AID_BEACON'
//             *          and containing payload_field 
//             *               containing type
//             *                  indicating 'signed'
//             *              containing data
//             *                  indicating length > 0
//             *          and containing trailer_fields 
//             *              containing single instance of type TrailerField 
//             *                  containing type
//             *                      indicating 'signature'
//             *                  containing signature
//             *                      verifiable using KEY
//             *   } then {
//             *     the IUT accepts the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_01_03_BV
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_01_03_BV() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV_nodeB(cc_taCert_C));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BV_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_01_03_BV
//            
//            /**
//             * @desc    Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate with a rectangular region validity restriction
//             * @remark  The message defined in this test purpose is used in the subsequent test purposes with the snippet name ‘MSG_SEC_RCV_GENMSG_C’. Only differences to this snippet are mentioned in subsequent test purposes
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_D_AT
//             *   and the IUT current location is inside the region validity period of CERT_TS_D_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data
//             *         containing protocol_version 
//             *             indicating value '2'
//             *         and containing header_fields[0]
//             *              containing type 
//             *                  indicating 'signer_info'
//             *              and containing signer
//             *                  containing type
garciay's avatar
garciay committed
//             *                      containing certificate
//             *                  and containing certificate (CERT_TS_D_AT)
//             *                      containing subject_info.subject_type
//             *                          indicating 'authorization_ticket' (2)
//             *                      and containing subject_attributes['verification key'] (KEY)
//             *                      and containing validity_restrictions['time_start_and_end']
//             *                          indicating CERT_TS_AT_TIME_VALIDITY
//             *                      and containing validity_restrictions['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'polygon'
//             *                              and containing polygonal_region
//             *                                  indicating REGION
//             *       and containing header_fields [1]
//             *         containing type 
//             *           indicating 'generation_time'
//             *              containing generation_time
//             *                  indicating CURRENT_TIME
//             *       and containing header_fields [2]
//             *           containing type 
//             *               indicating 'generation_location'
//             *           and containing generation_location
//             *       and containing header_fields[3]
//             *           containing type 
//             *               indicating 'its_aid'
//             *           and containing its_aid
//             *               indicating 'AID_BEACON'
//             *          and containing payload_field 
//             *               containing type
//             *                  indicating 'signed'
//             *              containing data
//             *                  indicating length > 0
//             *          and containing trailer_fields 
//             *              containing single instance of type TrailerField 
//             *                  containing type
//             *                      indicating 'signature'
//             *                  containing signature
//             *                      verifiable using KEY
//             *   } then {
//             *     the IUT accepts the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_01_04_BV
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_01_04_BV() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV_nodeB(cc_taCert_D));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BV_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_01_04_BV
//            
//            /**
//             * @desc    Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate with a rectangular region validity restriction
//             * @remark  The message defined in this test purpose is used in the subsequent test purposes with the snippet name ‘MSG_SEC_RCV_GENMSG_C’. Only differences to this snippet are mentioned in subsequent test purposes
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_E_AT
//             *   and the IUT current location is inside the region validity period of CERT_TS_E_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data
//             *         containing protocol_version 
//             *             indicating value '2'
//             *         and containing header_fields[0]
//             *              containing type 
//             *                  indicating 'signer_info'
//             *              and containing signer
//             *                  containing type
garciay's avatar
garciay committed
//             *                      containing certificate
//             *                  and containing certificate (CERT_TS_E_AT)
//             *                      containing subject_info.subject_type
//             *                          indicating 'authorization_ticket' (2)
//             *                      and containing subject_attributes['verification key'] (KEY)
//             *                      and containing validity_restrictions['time_start_and_end']
//             *                          indicating CERT_TS_AT_TIME_VALIDITY
//             *                      and containing validity_restrictions['region']
//             *                          containing region
//             *                              containing region_type
//             *                                  indicating 'id_region'
//             *                              and containing id_region
//             *                                  indicating REGION
//             *       and containing header_fields [1]
//             *         containing type 
//             *           indicating 'generation_time'
//             *              containing generation_time
//             *                  indicating CURRENT_TIME
//             *       and containing header_fields [2]
//             *           containing type 
//             *               indicating 'generation_location'
//             *           and containing generation_location
//             *       and containing header_fields[3]
//             *           containing type 
//             *               indicating 'its_aid'
//             *           and containing its_aid
//             *               indicating 'AID_BEACON'
//             *          and containing payload_field 
//             *               containing type
//             *                  indicating 'signed'
//             *              containing data
//             *                  indicating length > 0
//             *          and containing trailer_fields 
//             *              containing single instance of type TrailerField 
//             *                  containing type
//             *                      indicating 'signature'
//             *                  containing signature
//             *                      verifiable using KEY
//             *   } then {
//             *     the IUT accepts the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_01_05_BV
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_01_05_BV() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV_nodeB(cc_taCert_E));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BV_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_01_05_BV
//            
//            group g_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV {
//                
//                /**
//                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                 */
//                function f_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV_nodeB(
//                                                                 in charstring p_taCert
//                ) runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
//                    
//                    // Test Body
//                    v_securedGnPdu := f_sendSecuredBeacon(p_taCert, omit, e_certificate);
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
//                    
//                } // End of function f_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV_nodeB
//                
//            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_01_0x_BV
//            
//            /**
//             * @desc    Check that IUT discards a Secured GN Message containing protocol version set to a value less than 2
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data
//             *         containing protocol_version 
//             *             indicating 1
//             *   } then {
//             *     the IUT discards the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_02_01_BO
//             * @reference    ETSI TS 103 097 [1] Clause 5.1
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_02_01_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_02_0x_BO_nodeB(PX_WRONG_PROTOCOL_VERSION));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_02_01_BO
//            
//            /**
//             * @desc    Check that IUT discards a Secured GN Message containing protocol version set to a value greater than 2
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * Config Id: CF01
//             * Expected behavior:
//             * with {
//             *   the IUT being in the 'authorized' state
//             *   and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * }
//             * ensure that {
//             *   when {
//             *     the IUT is receiving a Ieee1609Dot2Data
//             *         containing protocol_version 
//             *             indicating 3
//             *   } then {
//             *     the IUT discards the message
//             *   }
//             * }
//             * </pre>
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_02_02_BO
//             * @reference    ETSI TS 103 097 [1] Clause 5.1
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_02_02_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_02_0x_BO_nodeB(PX_WRONG_PROTOCOL_VERSION));
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_02_02_BO
//            
//            group g_TC_SEC_ITSS_RCV_GENMSG_02_0x_BO {
//                
//                /**
//                 * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                 */
//                function f_TC_SEC_ITSS_RCV_GENMSG_02_0x_BO_nodeB(
//                                                                 in UInt8 p_protocolVersion
//                ) runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdict(c_prDone, e_success);
//                    
//                    // Test Body
//                    v_securedGnPdu := f_sendSecuredBeacon_Bo(cc_taCert_A, p_protocolVersion);
//                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
//                    
//                    // Postamble
//                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
//                    
//                } // End of function f_TC_SEC_ITSS_RCV_GENMSG_02_0x_BO_nodeB
//                
//            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_02_0x_BV
//            
//            /**
//             * @desc    Check that IUT discards a secured GN Message if the header_fields contains more than one header field of type 'signer_info'
//             * <pre>
//             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC
//             * Config Id: CF01
//             * Initial conditions:
//             * with { 
//             *    the IUT being in the 'authorized' state 
//             *    and the IUT current time is inside the time validity period of CERT_TS_A_AT
//             * } 
//             * ensure that { 
//             *  when { 
//             *      the IUT is receiving a Ieee1609Dot2Data (MSG_SEC_RCV_GENMSG_A) 
//             *          containing header_fields[0].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[1].type
//             *              indicating 'signer_info'
//             *          and containing header_fields[2].type
//             *              indicating 'generation_time'
//             *          and containing header_fields[3].type
//             *              indicating ''generation_location''
//             *          and containing header_fields[4].type
//             *              containing its_aid
//             *                  indicating 'AID_BEACON'
//             *          and not containing other header fields
//             *  } then { 
//             *      the IUT discards the message 
//             *  } 
//             * } 
//             * </pre>
//             *
garciay's avatar
garciay committed
//             * @see          ETSI TS 103 096-2 v1.3.2 TP_SEC_ITSS_RCV_GENMSG_04_01_BO
//             * @reference    ETSI TS 103 097 [1] Clause 7.3
//             */
//            testcase TC_SEC_ITSS_RCV_GENMSG_04_01_BO() runs on ItsMtc system ItsSecSystem {
//                
//                // Local variables
//                var ItsGeoNetworking v_nodeB;
//                var ItsGeoNetworking v_nodeD;
//                
//                // Test control
//                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
//                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY and PICS_GN_GBC_SRC' required for executing the TC ***");
//                    setverdict(inconc);
//                    stop;
//                }
//                
//                // Test component configuration
//                f_cf02Up();
//                
//                // Preamble
//                
//                // Start components
//                v_nodeB := f_getComponent(c_compNodeB);
//                v_nodeD := f_getComponent(c_compNodeD);
//                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_04_01_BO());
//                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
//                
//                // Synchronization
//                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
//                
//                // Cleanup
//                f_cf02Down();
//                
//            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_04_01_BO
//            
//            group g_TC_SEC_ITSS_RCV_GENMSG_04_01_BO {
//                
//                    /**
//                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
//                     */
//                function f_TC_SEC_ITSS_RCV_GENMSG_04_01_BO() runs on ItsGeoNetworking {
//                    
//                    // Local variables
//                    var GeoNetworkingPdu v_securedGnPdu;
//                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
//                    
//                    // Test component configuration
//                    f_cf01Up();
//                    
//                    // Test adapter configuration
//                    
//                    // Preamble
//                    f_prNeighbour();
//                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
//                    
//                    // Test Body
//                    v_securedGnPdu := f_prepareSecuredBeacon(