ItsSecurity_TestCases.ttcn3 987 KB
Newer Older
garciay's avatar
garciay committed
             * <pre>
garciay's avatar
garciay committed
             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_ITS_C2C_MODE
garciay's avatar
garciay committed
             * 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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
             *          containing header_fields ['generation_time']
             *              containing generation_time
             *                  indicating TIME_1 (TIME_1 < CUR_TIME - 10min)
garciay's avatar
garciay committed
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_06_03_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_06_03_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
garciay's avatar
garciay committed
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC) or not(PICS_ITS_C2C_MODE)) {
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' and 'PICS_ITS_C2C_MODE' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_06_03_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_06_03_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_06_03_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_06_03_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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(
                        cc_taCert_A, 
                        {
garciay's avatar
garciay committed
                            m_header_field_generation_time( 
                                (1000 * f_getCurrentTime() - 600) * 1000
                            ) // In us
garciay's avatar
garciay committed
                        }, 
garciay's avatar
garciay committed
                        e_certificate
garciay's avatar
garciay committed
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_06_03_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_06_03_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards Secured GN Message if the generation_time is more than 10 minute in the future(C2C only)
garciay's avatar
garciay committed
             * <pre>
garciay's avatar
garciay committed
             * Pics Selection: PICS_GN_SECURITY and PICS_GN_GBC_SRC and PICS_ITS_C2C_MODE
garciay's avatar
garciay committed
             * 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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
             *          containing header_fields ['generation_time']
             *              containing generation_time
             *                  indicating TIME_1 (TIME_1 > CUR_TIME + 10min)
garciay's avatar
garciay committed
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_06_04_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_06_04_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
garciay's avatar
garciay committed
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC) or not(PICS_ITS_C2C_MODE)) {
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' and 'PICS_ITS_C2C_MODE' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_06_04_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_06_04_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_06_04_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_06_04_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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(
                        cc_taCert_A, 
                        {
garciay's avatar
garciay committed
                            m_header_field_generation_time( 
                                (1000 * f_getCurrentTime() + 600) * 1000
                            ) // In us
garciay's avatar
garciay committed
                        }, 
garciay's avatar
garciay committed
                        e_certificate
garciay's avatar
garciay committed
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_06_04_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_06_04_BO 
garciay's avatar
garciay committed
            
            /**
garciay's avatar
garciay committed
             * @desc    Check that IUT discards SecuredMessage when its_aid value is undefined
garciay's avatar
garciay committed
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A)
             *          containing header_fields['its_aid']
             *              indicating indicating 'AID_UNDEFINED'
garciay's avatar
garciay committed
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
garciay's avatar
garciay committed
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_07_01_BO
garciay's avatar
garciay committed
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
garciay's avatar
garciay committed
            testcase TC_SEC_ITSS_RCV_GENMSG_07_01_BO() runs on ItsMtc system ItsSecSystem {
garciay's avatar
garciay committed
                
                // Local variables
                var ItsGeoNetworking v_nodeB;
                var ItsGeoNetworking v_nodeD;
                
                // Test control
                if (not(PICS_GN_SECURITY) or not(PICS_GN_GBC_SRC)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration
                f_cf02Up();
                
                // Preamble
                
                // Start components
                v_nodeB := f_getComponent(c_compNodeB);
                v_nodeD := f_getComponent(c_compNodeD);
garciay's avatar
garciay committed
                v_nodeB.start(f_TC_SEC_ITSS_RCV_GENMSG_07_01_BO());
garciay's avatar
garciay committed
                v_nodeD.start(f_TC_SEC_ITSS_RCV_GENMSG_xxx_BO_nodeD());
                
                // Synchronization
                f_serverSync2ClientsAndStop({c_prDone, c_tbDone, c_poDone});
                
                // Cleanup
                f_cf02Down();
                
garciay's avatar
garciay committed
            } // End of testcase TC_SEC_ITSS_RCV_GENMSG_07_01_BO
garciay's avatar
garciay committed
            
garciay's avatar
garciay committed
            group g_TC_SEC_ITSS_RCV_GENMSG_07_01_BO {
garciay's avatar
garciay committed
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
garciay's avatar
garciay committed
                function f_TC_SEC_ITSS_RCV_GENMSG_07_01_BO() runs on ItsGeoNetworking {
garciay's avatar
garciay committed
                    
                    // 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(
                        cc_taCert_A, 
                        {
                            m_header_field_its_aid_Other
                        }, 
garciay's avatar
garciay committed
                        e_certificate_digest_with_sha256
garciay's avatar
garciay committed
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
garciay's avatar
garciay committed
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_07_01_BO
garciay's avatar
garciay committed
                
garciay's avatar
garciay committed
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_07_01_BO 
garciay's avatar
garciay committed
            
            /**
             * @desc    Check that IUT discards Secured GN Message if the HeaderField generation_location is outside of the circular validity region of the signing certificate
             * <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_B_AT
             *    and the IUT current location is inside the validiti region of CERT_TS_B_AT
             * } 
             * ensure that { 
             *  when { 
             *      the IUT is receiving a SecuredMessage ((MSG_SEC_RCV_GENMSG_B)) 
             *          containing header_fields[0].type
             *              indicating 'signer_info'
             *                  containing certificate (CERT_TS_B_AT)
             *                      containing validity_restrictions ['region']
             *                          containing region
             *                              containing region_type
             *                                  indicating 'circle'
             *                              and containing circular_region
             *                                  indicating REGION
             *          and containing header_fields ['generation_location']
             *              indicating location outside of the REGION
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_08_01_BO
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_GENMSG_08_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)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    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_08_xx_BO(cc_taCert_B));
                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_08_01_BO
            
            /**
             * @desc    Check that IUT discards Secured GN Message if the HeaderField generation_location is outside of the rectangular validity region of the signing certificate
             * <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_C_AT
             *    and the IUT current location is inside the validiti region of CERT_TS_C_AT
             * } 
             * ensure that { 
             *  when { 
             *      the IUT is receiving a SecuredMessage ((MSG_SEC_RCV_GENMSG_C)) 
             *          containing header_fields[0].type
             *              indicating 'signer_info'
             *                  containing certificate (CERT_TS_C_AT)
             *                      containing validity_restrictions ['region']
             *                          containing region
             *                              containing region_type
             *                                  indicating 'rectangle'
             *                              and containing rectanglar_region
             *                                  indicating REGION
             *          and containing header_fields ['generation_location']
             *              indicating location outside of the REGION
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_08_02_BO
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_GENMSG_08_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)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    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_08_xx_BO(cc_taCert_C));
                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_08_02_BO
            
            /**
             * @desc    Check that IUT discards Secured GN Message if the HeaderField generation_location is outside of the rectangular validity region of the signing certificate
             * <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_D_AT
             *    and the IUT current location is inside the validiti region of CERT_TS_D_AT
             * } 
             * ensure that { 
             *  when { 
             *      the IUT is receiving a SecuredMessage ((MSG_SEC_RCV_GENMSG_D)) 
             *          containing header_fields[0].type
             *              indicating 'signer_info'
             *                  containing certificate (CERT_TS_D_AT)
             *                      containing validity_restrictions ['region']
             *                          containing region
             *                              containing region_type
             *                                  indicating 'polygon'
             *                              and containing polygonal_region
             *                                  indicating REGION
             *          and containing header_fields ['generation_location']
             *              indicating location outside of the REGION
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_08_03_BO
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_GENMSG_08_03_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)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    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_08_xx_BO(cc_taCert_D));
                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_08_03_BO
            
            /**
             * @desc    Check that IUT discards Secured GN Message if the optional HeaderField generation_location is outside of the identified validity region of the signing certificate
             * <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_E_AT
             *    and the IUT current location is inside the validiti region of CERT_TS_E_AT
             * } 
             * ensure that { 
             *  when { 
             *      the IUT is receiving a SecuredMessage ((MSG_SEC_RCV_GENMSG_E)) 
             *          containing header_fields[0].type
             *              indicating 'signer_info'
             *                  containing certificate (CERT_TS_E_AT)
             *                      containing validity_restrictions ['region']
             *                          containing region
             *                              containing region_type
             *                                  indicating 'id_region'
             *                              and containing identified_region
             *                                  indicating REGION
             *          and containing header_fields ['generation_location']
             *              indicating location outside of the REGION
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_08_04_BO
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_GENMSG_08_04_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)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    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_08_xx_BO(cc_taCert_E));
                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_08_04_BO
            
            group g_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO {
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
                function f_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO(
                                                           in charstring p_taCert
                ) 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(
                        p_taCert, 
                        {
                            m_header_field_signer_info(
                                m_signerInfo_digest(
                                    vc_atCertificate.signer_info.signerInfo.digest
                            )), 
                            m_header_field_generation_time(1000 * f_getCurrentTime()), // In us
                            m_header_field_generation_location(
                                valueof(m_threeDLocation(
                                    PX_WGSLATITUDE,
                                    PX_WGSLONGITUDE,
                                    '0000'O
                                ))
                            ),
                            m_header_field_its_aid_Other
                        }, 
                        e_certificate_digest_with_sha256,
                        false
                    ); 
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO
                
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_08_xx_BO 
            
            /**
             * @desc    Check that IUT discards the Secured GN Message containing empty payload of type 'signed'
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
garciay's avatar
garciay committed
             *          containing payload_field
             *              containing type
             *                  indicating 'signed'
             *              and containing data
             *                  indicating length 0
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_09_02_BO
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_GENMSG_09_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)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    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_09_02_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_09_02_BO
            
            group g_TC_SEC_ITSS_RCV_GENMSG_09_02_BO {
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
                function f_TC_SEC_ITSS_RCV_GENMSG_09_02_BO() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var GnNonSecuredPacket v_gnNonSecuredPacket;
                    var octetstring v_gnPayload;
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
                    var template (value) SecuredMessage v_securedMessage;
                    var GeoNetworkingPdu v_securedGnPdu;
                    
                    //  Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
                    // Test Body
                    v_gnNonSecuredPacket := valueof(
                        m_geoNwBroadcastPacket(
                            v_longPosVectorNodeB,
                            vc_localSeqNumber,
                            f_getGeoBroadcastArea(
                                c_area1                 // Select area1 (see ETSI TS 102 871-2 Clause 4.2 Configuration 1)
                    )));
                    
                    // Encode it
                    v_gnPayload := bit2oct(
                        encvalue(
                            v_gnNonSecuredPacket
                        )
                    );
                    f_buildGnSecuredOtherMessage(
                        v_securedMessage,
                        m_payload_signed(
                            ''O
                        ),
                        e_certificate_digest_with_sha256,
                        valueof(m_threeDLocation(
                            v_longPosVectorNodeB.latitude,
                            v_longPosVectorNodeB.longitude,
                            '0000'O
                        ))
                    );
                    v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_09_02_BO
                
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_09_02_BO 
            
            /**
             * @desc    Check that IUT discards the Secured GN Message containing payload element of type 'unsecured'
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
garciay's avatar
garciay committed
             *          containing payload_field
             *              containing type
             *                  indicating 'unsecured'
             *              and containing data
             *                  indicating length > 0
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_09_03_BO
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_GENMSG_09_03_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)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    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_09_03_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_09_03_BO
            
            group g_TC_SEC_ITSS_RCV_GENMSG_09_03_BO {
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
                function f_TC_SEC_ITSS_RCV_GENMSG_09_03_BO() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var GnNonSecuredPacket v_gnNonSecuredPacket;
                    var octetstring v_gnPayload;
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
                    var template (value) SecuredMessage v_securedMessage;
                    var GeoNetworkingPdu v_securedGnPdu;
                    
                    //  Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
                    // Test Body
                    v_gnNonSecuredPacket := valueof(
                        m_geoNwBroadcastPacket(
                            v_longPosVectorNodeB,
                            vc_localSeqNumber,
                            f_getGeoBroadcastArea(
                                c_area1                 // Select area1 (see ETSI TS 102 871-2 Clause 4.2 Configuration 1)
                    )));
                    
                    // Encode it
                    v_gnPayload := bit2oct(
                        encvalue(
                            v_gnNonSecuredPacket
                        )
                    );
                    f_buildGnSecuredOtherMessage(
                        v_securedMessage,
                            m_payload_unsecured(
                                v_gnPayload
                        ),
                        e_certificate_digest_with_sha256,
                        valueof(m_threeDLocation(
                            v_longPosVectorNodeB.latitude,
                            v_longPosVectorNodeB.longitude,
                            '0000'O
                        ))
                    );
                    v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_09_03_BO
                
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_09_03_BO 
            
            /**
             * @desc    Check that IUT discards the Secured GN Message containing payload element of type 'encrypted'
             * <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 { 
garciay's avatar
garciay committed
             *      the IUT is receiving a SecuredMessage (MSG_SEC_RCV_GENMSG_A) 
garciay's avatar
garciay committed
             *          containing payload_field
             *              containing type
             *                  indicating 'encrypted'
             *              and containing data
             *                  indicating length > 0
             *  } then { 
             *      the IUT discards the message 
             *  } 
             * } 
             * </pre>
             *
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_09_04_BO
             * @reference    ETSI TS 103 097 [1], clause 7.1
             */
            testcase TC_SEC_ITSS_RCV_GENMSG_09_04_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)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    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_09_04_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_09_04_BO
            
            group g_TC_SEC_ITSS_RCV_GENMSG_09_04_BO {
                
                    /**
                     * @desc    Behavior function for NodeB (TC_GEONW_PON_GBC_BV_01)
                     */
                function f_TC_SEC_ITSS_RCV_GENMSG_09_04_BO() runs on ItsGeoNetworking {
                    
                    // Local variables
                    var GnNonSecuredPacket v_gnNonSecuredPacket;
                    var octetstring v_gnPayload;
                    var LongPosVector v_longPosVectorNodeB := f_getPosition(c_compNodeB); // Use NodeB
                    var template (value) SecuredMessage v_securedMessage;
                    var GeoNetworkingPdu v_securedGnPdu;
                    
                    //  Test component configuration
                    f_cf01Up();
                    
                    // Test adapter configuration
                    
                    // Preamble
                    f_prNeighbour();
                    f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success);
                    
                    // Test Body
                    v_gnNonSecuredPacket := valueof(
                        m_geoNwBroadcastPacket(
                            v_longPosVectorNodeB,
                            vc_localSeqNumber,
                            f_getGeoBroadcastArea(
                                c_area1                 // Select area1 (see ETSI TS 102 871-2 Clause 4.2 Configuration 1)
                    )));
                    
                    // Encode it
                    v_gnPayload := bit2oct(
                        encvalue(
                            v_gnNonSecuredPacket
                        )
                    );
                    f_buildGnSecuredOtherMessage(
                        v_securedMessage,
                            m_payload_encrypted(
                                v_gnPayload
                        ),
                        e_certificate_digest_with_sha256,
                        valueof(m_threeDLocation(
                            v_longPosVectorNodeB.latitude,
                            v_longPosVectorNodeB.longitude,
                            '0000'O
                        ))
                    );
                    v_securedGnPdu := valueof(m_geoNwSecPdu(v_gnNonSecuredPacket, v_securedMessage));
                    f_sendGeoNetMessage(m_geoNwReq_linkLayerBroadcast(v_securedGnPdu));
                    f_selfOrClientSyncAndVerdictTestBody(c_tbDone, e_success);
                    
                    // Postamble
                    f_selfOrClientSyncAndVerdict(c_poDone, e_success);
                    
                } // End of testcase f_TC_SEC_ITSS_RCV_GENMSG_09_04_BO
                
            } // End of group g_TC_SEC_ITSS_RCV_GENMSG_09_04_BO 
            
            /**
             * @desc    Check that IUT discards the Secured GN Message if the message does not contain the trailer field of type 'signature' 
             * <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 SecuredMessage
             *         containing trailer_fields
             *             not containing trailer_fields['signature']
             *   } then {
             *     the IUT discards the message
             *   }
             * }
             * </pre>
             * @see          ETSI TS 103 096-2 v1.2.2 TP_SEC_ITSS_RCV_GENMSG_10_01_BO
             * @reference    ETSI TS 103 097 [1], clause 7.2
             */
            testcase TC_SEC_ITSS_RCV_GENMSG_10_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)) {
garciay's avatar
garciay committed
                    log("*** " & testcasename() & ": 'PICS_GN_SECURITY' and 'PICS_GN_GBC_SRC' required for executing the TC ***");
garciay's avatar
garciay committed
                    setverdict(inconc);
                    stop;
                }
                
                // Test component configuration