ItsSecurity_TestCases.ttcn 1.35 MB
Newer Older
                f_cf01Up();
                
                // Test adapter configuration
                
                // Preamble
                f_prNeighbour();
                f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                
                // Test Body
                v_securedGnPdu := f_sendSecuredDenm(
                    cc_taCert_CA, 
                    {
                        m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
                        m_header_field_its_aid_DENM
                    }, 
                    e_certificate
                ); 
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(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_12_04_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards secured DENM signed with the not yet valid certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is before the time validity period of CERT_TS_MSG_13_01_BO_AT
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage (MSG_SEC_RCV_DENM_A)
             *         containing header_fields['signer_info'].signer
             *           containing certificate (CERT_TS_MSG_13_01_BO_AT)
             *             containing validity_restrictions['time_start_and_end']
             *               containing start_validity
             *                 indicating START_VALIDITY_AT > CURRENT_TIME
             *               and containing end_validity
             *                 indicating END_VALIDITY_AT > START_VALIDITY_AT
             *     then
             *       the IUT discards the message
             * </pre>
filatov's avatar
filatov committed
             * @see          ETSI TS 103 096-2 v1.4.1 TP_SEC_ITSS_RCV_DENM_13_01_BO
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_13_01_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_taCertMsg1301_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(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_01_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards secured DENM signed with the expired certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is before the time validity period of CERT_TS_MSG_13_02_BO_AT
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage (MSG_SEC_RCV_DENM_A)
             *         containing header_fields['signer_info'].signer
             *           containing certificate (CERT_TS_MSG_13_02_BO_AT)
             *             containing validity_restrictions['time_start_and_end']
             *               containing start_validity
             *                 indicating START_VALIDITY_AT < CURRENT_TIME
             *               and containing end_validity
             *                 indicating END_VALIDITY_AT < CURRENT_TIME
             *     then
             *       the IUT discards the message
             * </pre>
filatov's avatar
filatov committed
             * @see          ETSI TS 103 096-2 v1.4.1 TP_SEC_ITSS_RCV_DENM_13_02_BO
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_13_02_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_taCertMsg1302_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(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_02_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards secured DENM when IUT location is outside the circular validity restriction of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the validity period of CERT_TS_MSG_13_03_BO_AT
             *     and the IUT current location is set to CURRENT_IUT_LOCATION
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage (MSG_SEC_RCV_DENM_B)
             *         containing header_fields['signer_info'].signer
             *           containing certificate (CERT_TS_MSG_13_03_BO_AT)
             *             containing validity_restrictions['region']
             *               containing region
             *                 containing region_type
             *                   indicating 'circle'
             *                 and containing circular_region
             *                   indicating REGION
             *                     not containing the CURRENT_IUT_LOCATION
             *     then
             *       the IUT discards the message
             * </pre>
filatov's avatar
filatov committed
             * @see          ETSI TS 103 096-2 v1.4.1 TP_SEC_ITSS_RCV_DENM_13_03_BO
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_13_03_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_taCertMsg1303_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(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_03_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards secured DENM when IUT location is outside the rectangular validity restriction of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the validity period of CERT_TS_MSG_13_04_BO_AT
             *     and the IUT current location is set to CURRENT_IUT_LOCATION
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage (MSG_SEC_RCV_DENM_C)
             *         containing header_fields['signer_info'].signer
             *           containing certificate (CERT_TS_MSG_13_04_BO_AT)
             *             containing validity_restrictions['region']
             *               containing region
             *                 containing region_type
             *                   indicating 'rectangle'
             *                 and containing rectangular_regions
             *                   indicating REGION
             *                     not containing the CURRENT_IUT_LOCATION
             *     then
             *       the IUT discards the message
             * </pre>
filatov's avatar
filatov committed
             * @see          ETSI TS 103 096-2 v1.4.1 TP_SEC_ITSS_RCV_DENM_13_04_BO
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_DENM_13_04_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_taCertMsg1304_BO, omit, e_certificate);
                
                f_sleep(PX_TNOAC);
                v_sentRawPayload := f_adaptPayloadForUtInd_m(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_04_BO
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT discards secured DENM when IUT location is outside the polygonal validity restriction of the signing certificate
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the validity period of CERT_TS_MSG_13_05_BO_AT
             *     and the IUT current location is set to CURRENT_IUT_LOCATION
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage (MSG_SEC_RCV_DENM_D)
             *         containing header_fields['signer_info'].signer
             *           containing certificate (CERT_TS_MSG_13_05_BO_AT)
             *             containing validity_restrictions['region']
             *               containing region
             *                 containing region_type
             *                   indicating 'polygon'
             *                 and containing polygonal_region
             *                   indicating REGION
             *                     not containing the CURRENT_IUT_LOCATION
             *     then
             *       the IUT discards the message
             * </pre>
filatov's avatar
filatov committed
             * @see          ETSI TS 103 096-2 v1.4.1 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 := f_adaptPayloadForUtInd_m(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
            
            /**
filatov's avatar
filatov committed
             * @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
filatov's avatar
filatov committed
             * Initial conditions:
             *   with
             *     the IUT being in the 'authorized' state
             *     and the IUT current time is inside the validity period of CERT_TS_MSG_13_06_BO_AT
             *     and the IUT current location is set to CURRENT_IUT_LOCATION
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage (MSG_SEC_RCV_DENM_E)
             *         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>
filatov's avatar
filatov committed
             * @see          ETSI TS 103 096-2 v1.4.1 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 := f_adaptPayloadForUtInd_m(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
         * @see ETSI TS 103 096-2 V1.2.2 (2016-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(
                                    mdw_securedMessage_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(
                                    mdw_securedMessage_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(
                                    mdw_securedMessage_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(
                                    mdw_securedMessage_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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate without region validity restriction
             * <pre>
             * Pics Selection: PICS_GN_SECURITY
             * 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
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage
             *         containing protocol_version
             *           indicating value '2'
             *         and containing header_fields[0]
             *           containing type
             *             indicating 'signer_info'
             *           and containing signer
             *             containing type
             *               indicating 'certificate'
             *             and containing certificate (CERT_TS_A_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               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'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *               inside CERT_TS_AT_TIME_VALIDITY
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
filatov's avatar
filatov committed
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
filatov's avatar
filatov committed
             *             indicating 'AID_BEACON'
             *         and containing payload_field
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *         and containing trailer_fields
             *           containing trailer_fields[0]
             *             containing type
             *               indicating 'signature'
             *             and containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
             * @see          ETSI TS 103 096-2 v1.4.1 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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate with a circular region validity restriction
filatov's avatar
filatov committed
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   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
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage
             *         containing protocol_version
             *           indicating value '2'
             *         and containing header_fields[0]
filatov's avatar
filatov committed
             *           containing type
             *             indicating 'signer_info'
             *           and containing signer
             *             containing type
             *               indicating 'certificate'
             *             and containing certificate (CERT_TS_B_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               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'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
filatov's avatar
filatov committed
             *             indicating position inside the REGION
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
filatov's avatar
filatov committed
             *             indicating 'AID_BEACON'
             *         and containing payload_field
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *         and containing trailer_fields
             *           containing trailer_fields[0]
             *             containing type
             *               indicating 'signature'
             *             and containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
             * @see          ETSI TS 103 096-2 v1.4.1 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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate with a rectangular region validity restriction
filatov's avatar
filatov committed
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   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
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage
             *         containing protocol_version
             *           indicating value '2'
             *         and containing header_fields[0]
filatov's avatar
filatov committed
             *           containing type
             *             indicating 'signer_info'
             *           and containing signer
             *             containing type
             *               indicating 'certificate'
             *             and containing certificate (CERT_TS_C_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               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_regions
             *                     indicating REGIONS
             *         and containing header_fields [1]
             *           containing type
             *             indicating 'generation_time'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
filatov's avatar
filatov committed
             *             indicating position inside the REGION
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
filatov's avatar
filatov committed
             *             indicating 'AID_BEACON'
             *         and containing payload_field
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *         and containing trailer_fields
             *           containing trailer_fields[0]
             *             containing type
             *               indicating 'signature'
             *             containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
             * @see          ETSI TS 103 096-2 v1.4.1 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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate with a polygonal region validity restriction
filatov's avatar
filatov committed
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   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
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage
             *         containing protocol_version
             *           indicating value '2'
             *         and containing header_fields[0]
filatov's avatar
filatov committed
             *           containing type
             *             indicating 'signer_info'
             *           and containing signer
             *             containing type
             *               indicating 'certificate'
             *             and containing certificate (CERT_TS_D_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               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'
             *           and containing generation_time
             *             indicating CURRENT_TIME
             *         and containing header_fields [2]
             *           containing type
             *             indicating 'generation_location'
             *           and containing generation_location
filatov's avatar
filatov committed
             *             indicating position inside the REGION
             *         and containing header_fields[3]
             *           containing type
             *             indicating 'its_aid'
             *           and containing its_aid
filatov's avatar
filatov committed
             *             indicating 'AID_BEACON'
             *         and containing payload_field
             *           containing type
             *             indicating 'signed'
             *           and containing data
             *             indicating length > 0
             *         and containing trailer_fields
             *           containing trailer_fields[0]
             *             containing type
             *               indicating 'signature'
             *             and containing signature
             *               verifiable using KEY
             *     then
             *       the IUT accepts the message
             * </pre>
             * @see          ETSI TS 103 096-2 v1.4.1 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
            
            /**
filatov's avatar
filatov committed
             * @desc  Check that IUT accepts a well-formed Secured GN Beacon signed with the certificate with an identified region validity restriction
filatov's avatar
filatov committed
             * Pics Selection: PICS_GN_SECURITY
             * Config Id: CF01
filatov's avatar
filatov committed
             * Initial conditions:
             *   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
             * Expected results:
             *   ensure that
             *     when
             *       the IUT is receiving a SecuredMessage
             *         containing protocol_version
             *           indicating value '2'
             *         and containing header_fields[0]
             *           containing type
             *             indicating 'signer_info'
             *           and containing signer
             *             containing type
             *               indicating 'certificate'
             *             and containing certificate (CERT_TS_E_AT)
             *               containing subject_info.subject_type
             *                 indicating 'authorization_ticket'
             *               and containing subject_attributes['verification key'] (KEY)
             *               and containing validity_restrictions['time_start_and_end']
             *                 indicating CERT_TS_AT_TIME_VALIDITY