diff --git a/ttcn/AtsCAM/ItsCam_TestCases.ttcn b/ttcn/AtsCAM/ItsCam_TestCases.ttcn index cdd64b29d14b1aaf94c31d8cc11f5def42e2fdf4..2eca3bc6219fc52372ca6a042b2b34073b734d79 100644 --- a/ttcn/AtsCAM/ItsCam_TestCases.ttcn +++ b/ttcn/AtsCAM/ItsCam_TestCases.ttcn @@ -12,7 +12,7 @@ module ItsCam_TestCases { import from LibItsCam_TestSystem all; // Ats Its - import from ItsCam_TpFunctions all; + import from ItsCam_TpFunctions all; // 5.2.1 group camMessageDissemination { @@ -2177,6 +2177,111 @@ module ItsCam_TestCases { } // end TC_CAM_MSD_PAR_BV_03 } // end group camLowerLayerParameters + + group camGenerationSSP { + + /** + * @desc Check that the IUT does not send a CAM + * when its content is not permitted by signing certificate + *
+             * Pics Selection: PICS_CAM_GENERATION AND PICS_IS_IUT_SECURED
+             * Initial conditions: 
+             *		with {                                                                   
+             *			the IUT being in the "initial state"                                 	
+             *      	the IUT is authorized to sign CAMs with the certificate
+             *      		containing CAM SSP
+             *      			indicating bit at position '1' set to 0
+             *      }                                                                        
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a CAM
+             *          	containing CenDsrcTollingZone
+             *      }
+             *      then {
+             *          the IUT does not send this CAM
+             *      }
+             *  } 
+             * 
+ * + * @see ETSI TS 102 868-2 TP/CAM/MSD/SSP/BO-01 + * @reference ETSI EN 302 637-2 , clause 6.2.2.1 + */ + testcase TC_CAM_MSD_SSP_BO_01() runs on ItsCam system ItsCamSystem { + + f_CAM_MSD_SSP_BO_01(); + + } // end TC_CAM_MSD_SSP_BO_01 + + /** + * @desc Check that the IUT does not send a CAM + * when its content is not permitted by signing certificate + *
+             * Pics Selection: PICS_CAM_GENERATION AND PICS_IS_IUT_SECURED
+             *                 AND PICS_SPECIALVEHICLECONTAINER AND PICS_PUBLICTRANS
+             * Initial conditions: 
+             *		with {                                                                   
+             *			the IUT being in the "initial state"                                 	
+             *      	the IUT is authorized to sign CAMs with the certificate
+             *      		containing CAM SSP
+             *      			indicating bit at position '2' set to 0
+             *      }                                                                        
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a CAM
+             *          	containing publicTransportContainer
+             *      }
+             *      then {
+             *          the IUT does not send this CAM
+             *      }
+             *  } 
+             * 
+ * + * @see ETSI TS 102 868-2 TP/CAM/MSD/SSP/BO-02 + * @reference ETSI EN 302 637-2 , clause 6.2.2.1 + */ + testcase TC_CAM_MSD_SSP_BO_02() runs on ItsCam system ItsCamSystem { + + f_CAM_MSD_SSP_BO_02(); + + } // end TC_CAM_MSD_SSP_BO_02 + + /** + * @desc Check that the IUT does not send a CAM + * when its content is not permitted by signing certificate + *
+             * Pics Selection: PICS_CAM_GENERATION AND PICS_IS_IUT_SECURED
+             *                 AND PICS_SPECIALVEHICLECONTAINER AND PICS_SPECIALTRANS
+             * Initial conditions: 
+             *		with {                                                                   
+             *			the IUT being in the "initial state"                                 	
+             *      	the IUT is authorized to sign CAMs with the certificate
+             *      		containing CAM SSP
+             *      			indicating bit at position '3' set to 0
+             *      }                                                                        
+             * Expected behaviour:
+             *  ensure that {
+             *      when {
+             *          the IUT generates a CAM
+             *          	containing specialTransportContainer
+             *      }
+             *      then {
+             *          the IUT does not send this CAM
+             *      }
+             *  } 
+             * 
+ * + * @see ETSI TS 102 868-2 TP/CAM/MSD/SSP/BO-03 + * @reference ETSI EN 302 637-2 , clause 6.2.2.1 + */ + testcase TC_CAM_MSD_SSP_BO_03() runs on ItsCam system ItsCamSystem { + + f_CAM_MSD_SSP_BO_03(); + + } // end TC_CAM_MSD_SSP_BO_03 + + } // end group camGenerationSSP } // end group camMessageDissemination @@ -2212,6 +2317,114 @@ module ItsCam_TestCases { } // end TC_CAM_MSP_BV_01 + group camProcessingSSP { + /** + * @desc Check that IUT discards CAM if SSP value of the signing certificate + * is not consistent with the provided containers. + *
+             * Pics Selection: PICS_CAM_RECEPTION AND PICS_IS_IUT_SECURED
+             * Initial conditions: 
+             *     with {
+             *         the IUT being in the "initial state"
+             *     }
+             * Expected behaviour:
+             *     ensure that {
+             *     	   when {
+             * 		       the IUT receives a secured CAM
+             * 			       containing CenDsrcTollingZone/ProtectedCommunicationZonesRSU
+             * 			       signed with certificate
+             * 				       containing CAM SSP bit at position 0
+             * 	                       indicating 0
+             * 	       }
+             * 	       then {
+             * 		       the IUT discards the CAM
+             * 		       and the IUT does not forward the CAM content to upper layers
+             * 		       and the IUT does not forward the CAM content to other facilities
+             * 	       }
+             *     }
+             * 
+ * + * @see ETSI TS 102 868-2 TP/CAM/MSP/SSP/BV-01-01 + * @reference ETSI EN 302 637-2 , clause 6.2.2.1 + */ + testcase TC_CAM_MSP_SSP_BV_01() runs on ItsCam system ItsCamSystem { + + f_CAM_MSP_SSP_BV_01(); + + } // end TC_CAM_MSP_BV_01 + + /** + * @desc Check that IUT discards CAM if SSP value of the signing certificate + * is not consistent with the provided containers. + *
+             * Pics Selection: PICS_CAM_RECEPTION AND PICS_IS_IUT_SECURED 
+             * Initial conditions: 
+             * 		with {
+             *			the IUT being in the "initial state"
+             *		}
+             * Expected behaviour:
+             *		ensure that {
+             *			when {
+             *				the IUT receives a secured CAM
+             *					containing publicTransportContainer
+             *					and signed with certificate
+             *						containing CAM SSP bit at position 1
+             *							indicating 0
+             * 	       }
+             * 	       then {
+             * 		       the IUT discards the CAM
+             * 		       and the IUT does not forward the CAM content to upper layers
+             * 		       and the IUT does not forward the CAM content to other facilities
+             * 	       }
+             *     }
+             * 
+ * + * @see ETSI TS 102 868-2 TP/CAM/MSP/SSP/BV-01-02 + * @reference ETSI EN 302 637-2 , clause 6.2.2.1 + */ + testcase TC_CAM_MSP_SSP_BV_02() runs on ItsCam system ItsCamSystem { + + f_CAM_MSP_SSP_BV_02(); + + } // end TC_CAM_MSP_BV_02 + + /** + * @desc Check that IUT discards CAM if SSP value of the signing certificate + * is not consistent with the provided containers. + *
+             * Pics Selection: PICS_CAM_RECEPTION AND PICS_IS_IUT_SECURED 
+             * Initial conditions: 
+             * 		with {
+             *			the IUT being in the "initial state"
+             *		}
+             * Expected behaviour:
+             *		ensure that {
+             *			when {
+             *				the IUT receives a secured CAM
+             *					containing specialTransportContainer
+             *					and signed with certificate
+             *						containing CAM SSP bit at position 2
+             *							indicating 0
+             * 	       }
+             * 	       then {
+             * 		       the IUT discards the CAM
+             * 		       and the IUT does not forward the CAM content to upper layers
+             * 		       and the IUT does not forward the CAM content to other facilities
+             * 	       }
+             *     }
+             * 
+ * + * @see ETSI TS 102 868-2 TP/CAM/MSP/SSP/BV-01-03 + * @reference ETSI EN 302 637-2 , clause 6.2.2.1 + */ + testcase TC_CAM_MSP_SSP_BV_03() runs on ItsCam system ItsCamSystem { + + f_CAM_MSP_SSP_BV_03(); + + } // end TC_CAM_MSP_BV_03 + + }// end group camProcessingSSP + } // end group camMessageProcessing } // end ItsCam_TestCases diff --git a/ttcn/AtsCAM/ItsCam_TestControl.ttcn b/ttcn/AtsCAM/ItsCam_TestControl.ttcn index 999b01e10b4f251fc0b6e57b8a92fa9a2be3b910..ee83f1cf39ec57736a0769b4450fd7a194644427 100644 --- a/ttcn/AtsCAM/ItsCam_TestControl.ttcn +++ b/ttcn/AtsCAM/ItsCam_TestControl.ttcn @@ -94,10 +94,23 @@ module ItsCam_TestControl { execute(TC_CAM_MSD_PAR_BV_02()); execute(TC_CAM_MSD_PAR_BV_03()); + if (PICS_IS_IUT_SECURED) { + if (PICS_PUBLICTRANS) { + execute(TC_CAM_MSD_SSP_BO_02()); + } + if (PICS_SPECIALTRANS) { + execute(TC_CAM_MSD_SSP_BO_02()); + } + } } if(PICS_CAM_RECEPTION) { execute(TC_CAM_MSP_BV_01()); + + if (PICS_IS_IUT_SECURED) { + execute(TC_CAM_MSP_SSP_BV_02()); + execute(TC_CAM_MSP_SSP_BV_03()); + } } } diff --git a/ttcn/AtsCAM/ItsCam_TpFunctions.ttcn b/ttcn/AtsCAM/ItsCam_TpFunctions.ttcn index 01017a5fbdb8e20d723284832879b192fc3d0985..8666c54494be56a46a386820cb500a0f377b991d 100644 --- a/ttcn/AtsCAM/ItsCam_TpFunctions.ttcn +++ b/ttcn/AtsCAM/ItsCam_TpFunctions.ttcn @@ -15,6 +15,8 @@ module ItsCam_TpFunctions { import from LibCommon_VerdictControl all; import from LibCommon_Time all; import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; + // LibItsCommon import from LibItsCommon_Pixits all; @@ -25,7 +27,8 @@ module ItsCam_TpFunctions { import from LibItsCam_Functions all; import from LibItsCam_Templates all; import from LibItsCam_TypesAndValues all; - import from LibItsCam_Pics {modulepar all}; + import from LibItsCam_Pics {modulepar all;} + import from LibItsCam_Pixits {modulepar all;} // ASN.1 import from ITS_Container language "ASN.1:1997" all; import from CAM_PDU_Descriptions language "ASN.1:1997" all; @@ -53,9 +56,8 @@ module ItsCam_TpFunctions { f_cfUp(); // Test adapter configuration - - // Preamble - f_prInitialState(); + // Preamble + f_prInitialState(); f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); // Test Body @@ -2987,11 +2989,106 @@ module ItsCam_TpFunctions { f_poDefault(); f_cfDown(); - } // end f_CAM_MSD_PAR_BV_03 - + } // end f_CAM_MSD_PAR_BV_03 } // end group camLowerLayerParameters - - } // end group camMessageDissemination + + group camGenerationSSP{ + function f_CAM_MSD_SSP_BO_XX( + in Oct8 p_certHashedId8, + in template(value) UtCamTrigger p_utEvent, + in template(present) CAM pmw_CamMsg + ) runs on ItsCam { + + // Local variables + + // Test control + if (not PICS_CAM_GENERATION) { + log("*** " & testcasename() & ": PICS_CAM_GENERATION required for executing the TC ***"); + setverdict(inconc); + stop; + } + + if (not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + // TODO: initialize IUT with given certificate + f_prInitialState( e_staticPosition, true, { + hashedId8 := p_certHashedId8 + }); + + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // execute UT Command + f_utTriggerEvent(p_utEvent); + + // Test Body + tc_ac.start; + alt { + [] camPort.receive(mw_camInd ( pmw_CamMsg )) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Expected CAM message received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": PASS: CAM message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poDefault(); + f_cfDown(); + + } // end f_CAM_MSD_SSP_BO_XX + + + function f_CAM_MSD_SSP_BO_01() runs on ItsCam { + + // TODO: make template for tolling + log("*** " & testcasename() & ": This TC is not implemented yet ***"); + setverdict(inconc); + stop; + + } // end f_CAM_MSD_SSP_BO_01 + + function f_CAM_MSD_SSP_BO_02() runs on ItsCam { + + if (not PICS_SPECIALVEHICLECONTAINER and not PICS_PUBLICTRANS) { + testcase.stop(testcasename() + & ": PICS_SPECIALVEHICLECONTAINER and PICS_PUBLICTRANS need to be set to true"); + } + + f_CAM_MSD_SSP_BO_XX(PX_CERT_IUT_CAM_02, + m_setVehicleRole(c_vehicleRole_publicTransport), + mw_camMsg_SVC ( mw_publicTransport_any ) + ); + + } // end f_CAM_MSD_SSP_BO_02 + + function f_CAM_MSD_SSP_BO_03() runs on ItsCam { + + if (not PICS_SPECIALVEHICLECONTAINER and not PICS_SPECIALTRANS) { + testcase.stop(testcasename() + & ": PICS_SPECIALVEHICLECONTAINER and PICS_SPECIALTRANS need to be set to true"); + } + + f_CAM_MSD_SSP_BO_XX(PX_CERT_IUT_CAM_03, + m_setVehicleRole(c_vehicleRole_specialTransport), + mw_camMsg_SVC ( mw_specialTransport_any ) + ); + } // end f_CAM_MSD_SSP_BO_03 + } + + } // end group camSSP group camMessageProcessing { @@ -3051,6 +3148,102 @@ module ItsCam_TpFunctions { } // end f_CAM_MSP_BV_01 + group camProcessingSSP{ + + /** + * @desc TP Function for TC_CAM_MSP_SSP_BV_XX + * @param p_certName Certificate to be used to sign the CAM message + * @param p_camMsg CAM value template to be sent to IUT + */ + function f_CAM_MSP_SSP_BV_XX( + in charstring p_certName, + in template (value) CAM p_camMsg + ) runs on ItsCam { + + // Local variables + var CamReq v_camReq; + var integer i; + + // Test control + if (not PICS_CAM_RECEPTION) { + log("*** " & testcasename() & ": PICS_CAM_RECEPTION required for executing the TC ***"); + setverdict(inconc); + stop; + } + + if (not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + // TODO: instruct adapter to use certName to sign the message + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + v_camReq := valueof( + m_camReq( + p_camMsg + ) + ); + camPort.send( v_camReq ) ; + + f_sleep(PX_TNOAC); + for(i:=0; i < lengthof(vc_utEvents) and not match(v_camReq.msgOut, vc_utEvents[i].camMsg); i:=i+1) { + // empty on purpose + } + if(i < lengthof(vc_utEvents)) { + log("*** " & testcasename() & ": FAIL: CAM was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: CAM was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poDefault(); + f_cfDown(); + + } // end f_CAM_MSP_SSP_BV_XX + + function f_CAM_MSP_SSP_BV_01() runs on ItsCam { + + // TODO: make template for tolling + log("*** " & testcasename() & ": This TC is not implemented yet ***"); + setverdict(inconc); + stop; + } // end f_CAM_MSP_SSP_BV_01 + + function f_CAM_MSP_SSP_BV_02() runs on ItsCam { + + f_CAM_MSP_SSP_BV_XX("CERT_TS_CAM_02", + m_camMsg_publicTransport( + f_getTsStationId(), + f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime + m_tsPosition + ) + ); + } // end f_CAM_MSP_SSP_BV_03 + + function f_CAM_MSP_SSP_BV_03() runs on ItsCam { + + f_CAM_MSP_SSP_BV_XX("CERT_TS_CAM_03", + m_camMsg_specialTransport( + f_getTsStationId(), + f_getCurrentTime() mod 65536, // See ETSI EN 302 637-2 V1.3.0 - Clause B.3 generationDelatTime + m_tsPosition + ) + ); + } // end f_CAM_MSP_SSP_BV_03 + }// end group camProcessingSSP } // end group camMessageProcessing } // end ItsCam_TpFunctions diff --git a/ttcn/AtsDENM/ItsDenm_TestCases.ttcn b/ttcn/AtsDENM/ItsDenm_TestCases.ttcn index 652ca942cc4d59c879d74f1ca96c4db041403bdf..ec330fa63827a3c427e7cd644f0f3decc7aa8313 100644 --- a/ttcn/AtsDENM/ItsDenm_TestCases.ttcn +++ b/ttcn/AtsDENM/ItsDenm_TestCases.ttcn @@ -1269,7 +1269,79 @@ module ItsDenm_TestCases { } // end TC_DEN_PAR_BV_02 } // end denMessageLowerLayerParameters - + + group denMessageSSP { + + /** + * @desc Check that IUT does not send a DENM if it is not permitted by signing certificate + * + *
+         * PICS Selection: PICS_DENM_GENERATION AND PICS_SECURITY
+         * Initial conditions:
+         *    with {
+         * 	      the IUT being in the "initial state"
+         * 	      the IUT is authorized to sign DENMs with the certificate
+         * 		      containing DENM SSP
+         * 		          not containing pemisions to send trafficCondition cause code
+         *    }
+         * Expected behaviour:
+         *    ensure that {
+         *    	when {
+         *    		the IUT receives an AppDENM_trigger request from the application layer
+         *    			containing situation container
+         *    				containing eventType
+         *    					containing causeCode
+         *    						indicating trafficCondition
+         *    	}
+         *    	then {
+         *    		the IUT does not send this DENM
+         *    	}
+         *    }
+         * 
+ * + * @see ETSI TS 102 869-2 v1.4.1 TP/DEN/SSP/BV-01, ETSI EN 302 637-3, clause 8.4.2 + */ + testcase TC_DEN_SSP_BV_01() runs on ItsDenm system ItsDenmSystem { + + f_DEN_SSP_BV_01(); + + } // end TC_DEN_SSP_BV_01 + + /** + * @desc Check that IUT does not send a DENM if it is not permitted by signing certificate + * + *
+         * PICS Selection: PICS_DENM_GENERATION AND PICS_SECURITY
+         * Initial conditions:
+         *    with {
+         * 	      the IUT being in the "initial state"
+         * 	      the IUT is authorized to sign DENMs with the certificate
+         * 		      containing DENM SSP
+         * 		          not containing pemisions to send 'accident' cause code
+         *    }
+         * Expected behaviour:
+         *    ensure that {
+         *    	when {
+         *    		the IUT receives an AppDENM_trigger request from the application layer
+         *    			containing situation container
+         *    				containing eventType
+         *    					containing causeCode
+         *    						indicating 'accident'
+         *    	}
+         *    	then {
+         *    		the IUT does not send this DENM
+         *    	}
+         *    }
+         * 
+ * + * @see ETSI TS 102 869-2 v1.4.1 TP/DEN/SSP/BV-01, ETSI EN 302 637-3, clause 8.4.2 + */ + testcase TC_DEN_SSP_BV_02() runs on ItsDenm system ItsDenmSystem { + + f_DEN_SSP_BV_02(); + + } // end TC_DEN_SSP_BV_02 + } } // end denMessageTransmission // 5.2.2 @@ -1543,6 +1615,199 @@ module ItsDenm_TestCases { } // end TC_DEN_MSRV_BV_07 + group denMessageReceptionSSP { + + /** + * @desc Check that receiving ITS-S discards DENM for new event + * if SSP value of the signing certificate is not consistent with the causeCode + * + *
+             * PICS Selection: none
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *  	when {
+             *  		the IUT receives a secured DENM
+             *  			containing situation container
+             *  				containing eventType
+             *  					containing causeCode
+             *  						indicating 'trafficCondition'
+             *  			containing signing certificate
+             *  				containing SSP
+             *  					not permitting to send DENM
+             *  						containing causeCode
+             *  							indicating 'trafficCondition'
+             *  	}
+             *  	then {
+             *  		the IUT discards the DENM
+             *  		and the IUT does not forward the DENM content to upper layer
+             *  	}
+             *  }
+             * 
+ * + * @see ETSI TS 102 869-2 v1.4.1 TP/DEN/MSRV/BV-08-01, ETSI EN 302 637-3, clause 8.4.2 + */ + testcase TC_DEN_MSRV_BO_08_01() runs on ItsDenm system ItsDenmSystem { + + f_DEN_MSRV_BO_08_01(); + + } // end TC_DEN_MSRV_BO_08_01 + + /** + * @desc Check that receiving ITS-S discards DENM for new event + * if SSP value of the signing certificate is not consistent with the causeCode + * + *
+             * PICS Selection: none
+             * Initial conditions:
+             *  with {
+             *      the IUT being in the "initial state"
+             *  }
+             * Expected behaviour:
+             *  ensure that {
+             *  	when {
+             *  		the IUT receives a secured DENM
+             *  			containing situation container
+             *  				containing eventType
+             *  					containing causeCode
+             *  						indicating 'accident'
+             *  			containing signing certificate
+             *  				containing SSP
+             *  					not permitting to send DENM
+             *  						containing causeCode
+             *  							indicating 'accident'
+             *  	}
+             *  	then {
+             *  		the IUT discards the DENM
+             *  		and the IUT does not forward the DENM content to upper layer
+             *  	}
+             *  }
+             * 
+ * + * @see ETSI TS 102 869-2 v1.4.1 TP/DEN/MSRV/BV-08-02, ETSI EN 302 637-3, clause 8.4.2 + */ + testcase TC_DEN_MSRV_BO_08_02() runs on ItsDenm system ItsDenmSystem { + + f_DEN_MSRV_BO_08_02(); + + } // end TC_DEN_MSRV_BO_08_02 + + /** + * @desc Check that receiving ITS-S discards DENM for existing event + * if SSP value of the signing certificate is not consistent with the causeCode + * + *
+             * PICS Selection: none
+             * Initial conditions:
+             *   with {
+             *   	the IUT being in the "initial state"
+             *   	and the IUT having received a secured DENM
+             * 			containing management container
+             * 				containing actionID
+             * 					indicating ACTION_ID1
+             *   		containing situation container
+             *   			containing eventType
+             *   				containing causeCode
+             *   					indicating 'trafficCondition'
+             *   		containing signing certificate
+             *  			containing SSP
+             *  				permitting to send DENM
+             *  					containing causeCode
+             *  						indicating 'trafficCondition'
+             *   }
+             * Expected behaviour:
+             *   ensure that {
+             *   	when {
+             *   		the IUT receives a secured DENM
+             *   			containing management container
+             *   				containing actionID
+             *   					indicating ACTION_ID1
+             *   			containing situation container
+             *   				containing eventType
+             *   					containing causeCode
+             *   						indicating 'trafficCondition'
+             *   			containing signing certificate
+             *  				containing SSP
+             *  					permitting to send DENM
+             *  						containing causeCode
+             *  							indicating 'trafficCondition'
+             *   	}
+             *   	then {
+             *   		the IUT discards the DENM
+             *   		and the IUT does not forward the DENM content to upper layer
+             *   	}
+             *   }
+             * 
+ * + * @see ETSI TS 102 869-2 v1.4.1 TP/DEN/MSRV/BV-09-01, ETSI EN 302 637-3, clause 8.4.2 + */ + testcase TC_DEN_MSRV_BO_09_01() runs on ItsDenm system ItsDenmSystem { + + f_DEN_MSRV_BO_09_01(); + + } // end TC_DEN_MSRV_BO_09_01 + + /** + * @desc Check that receiving ITS-S discards DENM for existing event + * if SSP value of the signing certificate is not consistent with the causeCode + * + *
+			 * PICS Selection: none
+			 * Initial conditions:
+			 *   with {
+			 *   	the IUT being in the "initial state"
+			 *   	and the IUT having received a secured DENM
+			 * 			containing management container
+			 * 				containing actionID
+			 * 					indicating ACTION_ID1
+			 *   		containing situation container
+			 *   			containing eventType
+			 *   				containing causeCode
+			 *   					indicating 'accident'
+			 *   		containing signing certificate
+			 *  			containing SSP
+			 *  				permitting to send DENM
+			 *  					containing causeCode
+			 *  						indicating 'accident'
+			 *   }
+			 * Expected behaviour:
+			 *   ensure that {
+			 *   	when {
+			 *   		the IUT receives a secured DENM
+			 *   			containing management container
+			 *   				containing actionID
+			 *   					indicating ACTION_ID1
+			 *   			containing situation container
+			 *   				containing eventType
+			 *   					containing causeCode
+			 *   						indicating 'accident'
+			 *   			containing signing certificate
+			 *  				containing SSP
+			 *  					permitting to send DENM
+			 *  						containing causeCode
+			 *  							indicating 'accident'
+			 *   	}
+			 *   	then {
+			 *   		the IUT discards the DENM
+			 *   		and the IUT does not forward the DENM content to upper layer
+			 *   	}
+			 *   }
+			 * 
+ * + * @see ETSI TS 102 869-2 v1.4.1 TP/DEN/MSRV/BV-09-02, ETSI EN 302 637-3, clause 8.4.2 + */ + testcase TC_DEN_MSRV_BO_09_02() runs on ItsDenm system ItsDenmSystem { + + f_DEN_MSRV_BO_09_02(); + + } // end TC_DEN_MSRV_BO_09_02 + + } // end denMessageReceptionSSP + + /** * @desc Check that receiving ITS-S replies to requestResponseIndication * @@ -1585,6 +1850,7 @@ module ItsDenm_TestCases { } // end TC_DEN_MSRV_BV_10 + } // end denMessageReception // 5.2.3 diff --git a/ttcn/AtsDENM/ItsDenm_TestControl.ttcn b/ttcn/AtsDENM/ItsDenm_TestControl.ttcn index 2830233b4ffedae97d566128a6959790b0c7e3d9..7a9ba0595e0d5fb22bb1aec6af4b1fadca34329c 100644 --- a/ttcn/AtsDENM/ItsDenm_TestControl.ttcn +++ b/ttcn/AtsDENM/ItsDenm_TestControl.ttcn @@ -8,7 +8,7 @@ module ItsDenm_TestControl { // ATS DENM - import from ItsDenm_TestCases {testcase all}; + import from ItsDenm_TestCases {testcase all;} // LibIts import from LibItsDenm_Pics all; @@ -71,6 +71,11 @@ module ItsDenm_TestControl { execute(TC_DEN_PAR_BV_02()); } + if(PICS_IS_IUT_SECURED) { + execute(TC_DEN_SSP_BV_01()); + execute(TC_DEN_SSP_BV_02()); + } + if(PICS_DENM_RECEPTION) { execute(TC_DEN_MSRV_BV_01()); execute(TC_DEN_MSRV_BV_02()); @@ -80,6 +85,13 @@ module ItsDenm_TestControl { execute(TC_DEN_MSRV_BO_06()); execute(TC_DEN_MSRV_BV_07()); + if(PICS_IS_IUT_SECURED) { + execute(TC_DEN_MSRV_BO_08_01()); + execute(TC_DEN_MSRV_BO_08_02()); + + execute(TC_DEN_MSRV_BO_09_01()); + execute(TC_DEN_MSRV_BO_09_02()); + } if(PICS_IMPACT_REDUCTION) { execute(TC_DEN_MSRV_BV_10()); } diff --git a/ttcn/AtsDENM/ItsDenm_TpFunctions.ttcn b/ttcn/AtsDENM/ItsDenm_TpFunctions.ttcn index a609bd9e57fffb55d87e2e2ba004a458777c0223..c6d52fd857d42ccddfb80e75d28e2fda1b981d30 100644 --- a/ttcn/AtsDENM/ItsDenm_TpFunctions.ttcn +++ b/ttcn/AtsDENM/ItsDenm_TpFunctions.ttcn @@ -12,6 +12,7 @@ module ItsDenm_TpFunctions { import from LibCommon_Time all; import from LibCommon_VerdictControl all; import from LibCommon_BasicTypesAndValues all; + import from LibCommon_DataStrings all; // LibIts import from LibItsCommon_Functions all; @@ -20,7 +21,8 @@ module ItsDenm_TpFunctions { import from LibItsDenm_Functions all; import from LibItsDenm_Templates all; import from LibItsDenm_TypesAndValues all; - import from LibItsDenm_Pics all; + import from LibItsDenm_Pics all; + import from LibItsDenm_Pixits all; import from DENM_PDU_Descriptions language "ASN.1:1997" all; import from ITS_Container language "ASN.1:1997" all; @@ -2288,7 +2290,96 @@ module ItsDenm_TpFunctions { } // end TC_DEN_PAR_BV_02 - } // end denMessageLowerLayerParameters + } // end denMessageLowerLayerParameters + + group denMessageSSP { + + function f_DEN_SSP_BV_XX( in Oct8 p_certHashedId8, + in template (value) SituationContainer p_situation, + in template (present) bitstring pmw_ssp) + runs on ItsDenm { + + var ActionID v_actionId; + var DenmInd v_denmInd; + + // Test control + if (not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + if (not PICS_DENM_GENERATION) { + log("*** " & testcasename() & ": PICS_DENM_GENERATION required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // Preamble + f_prInitialState(e_staticPosition, { + hashedId8 := p_certHashedId8 + }); + + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + v_actionId := f_utTriggerEvent(m_utTriggerEvent(p_situation)); + + tc_ac.start; + alt { + [] denmPort.receive( + mw_denmInd_SSP( + mw_denmPdu( + mw_denm( + mw_anyDenmMgmtCon, + p_situation + ) + ), + pmw_ssp + ) + ) { + tc_ac.stop; + log("*** " & testcasename() & ": FAIL: Received an unexpected DENM. ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + [] denmPort.receive(mw_denmInd(mw_anyDenmPdu)) { + log("*** " & testcasename() & ": INFO: Received a DENM with other cause code. ***"); + repeat; + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": PASS: No unexpected DENM received. ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + + // Postamble + f_poCancelEvent(e_iut, v_actionId); + f_cfDown(); + + } // end TC_DEN_SSP_BV_XX + + function f_DEN_SSP_BV_01( ) runs on ItsDenm { + f_DEN_SSP_BV_XX ( + PX_CERT_IUT_DENM_01, + m_situation(CauseCodeType_trafficCondition_, TrafficConditionSubCauseCode_unavailable_), + mw_sspTrafficCondition + ); + } + + function f_DEN_SSP_BV_02( ) runs on ItsDenm { + f_DEN_SSP_BV_XX ( + PX_CERT_IUT_DENM_02, + m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_), + mw_sspAccident + ); + } + + } // end group denMessageSSP } // end denMessageTransmission @@ -2763,6 +2854,185 @@ module ItsDenm_TpFunctions { } // end TC_DEN_MSRV_BV_07 + group denMessageSSP { + + function f_DEN_MSRV_BO_08_XX( + in charstring p_certName, + in template (value) SituationContainer p_situation + ) runs on ItsDenm { + + // Local variables + var ActionID v_actionId; + var integer i; + + // Test control + if (not PICS_DENM_RECEPTION) { + log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + // TODO: instruct adapter to use p_certName to sign message + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + v_actionId := f_sendDenMessage( + m_denm( + m_denmMgmtCon( + m_tsActionId + ), + p_situation, + m_denmLocation_zeroDelta + ) + ); + + f_sleep(PX_TNOAC); + for ( i := 0; i < lengthof(vc_utEvents) and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID); i := i + 1) { + // empty on purpose + } + if (i < lengthof(vc_utEvents)) { + log("*** " & testcasename() & ": FAIL: DENM was treated as valid and transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": PASS: DENM was treated as invalid and was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poCancelEvent(e_ets, v_actionId); + f_cfDown(); + + } // end TC_DEN_MSRV_BV_01 + + function f_DEN_MSRV_BO_08_01 () runs on ItsDenm { + + f_DEN_MSRV_BO_08_XX( + "CERT_TS_DENM_01", + m_situation(CauseCodeType_trafficCondition_, TrafficConditionSubCauseCode_unavailable_) + ); + } + + function f_DEN_MSRV_BO_08_02 () runs on ItsDenm { + + f_DEN_MSRV_BO_08_XX( + "CERT_TS_DENM_02", + m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_) + ); + } + + function f_DEN_MSRV_BO_09_XX( + in charstring p_certName, + in template (value) SituationContainer p_situation1, + in template (value) SituationContainer p_situation2 + ) runs on ItsDenm { + + // Local variables + var TimestampIts v_referenceTime2; + var ActionID v_actionId; + var integer i; + + // Test control + if (not PICS_DENM_RECEPTION) { + log("*** " & testcasename() & ": PICS_DENM_RECEPTION required for executing the TC ***"); + setverdict(inconc); + stop; + } + if (not PICS_IS_IUT_SECURED) { + log("*** " & testcasename() & ": PICS_IS_IUT_SECURED required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cfUp(); + + // Test adapter configuration + + // TODO: instruct adapter to use c_certName_FullSSP to sign message + + // Preamble + f_prInitialState(); + f_selfOrClientSyncAndVerdictPreamble(c_prDone, e_success); + + // Test Body + v_actionId := f_sendDenMessage( + m_denm( + m_denmMgmtCon( + m_tsActionId + ), + p_situation1, + m_denmLocation_zeroDelta + ) + ); + + f_sleep(1.0); + // TODO: instruct adapter to use p_certName to sign message + v_referenceTime2 := f_getCurrentTime(); + v_actionId := f_sendDenMessage( + m_denm( + m_denmMgmtCon( + v_actionId, + -, -, -, v_referenceTime2 + ), + p_situation2, + m_denmLocation_zeroDelta + ) + ); + + f_sleep(PX_TAC); + for ( i := 0; i < lengthof(vc_utEvents) + and not match(v_actionId, vc_utEvents[i].denMsg.denm.management.actionID) + and vc_utEvents[i].denMsg.denm.management.referenceTime != v_referenceTime2; i := i + 1) { + // empty on purpose + } + if (i < lengthof(vc_utEvents)) { + log("*** " & testcasename() & ": FAIL: DENM was treated as valid and was transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_error); + } + else { + log("*** " & testcasename() & ": FAIL: DENM was treated as invalid and was not transmitted to upper layer ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + + // Postamble + f_poCancelEvent(e_ets, v_actionId); + f_cfDown(); + + } // end TC_DEN_MSRV_BV_09_XX + + function f_DEN_MSRV_BO_09_01 () runs on ItsDenm { + + f_DEN_MSRV_BO_09_XX( + "CERT_TS_DENM_01", + m_situation(CauseCodeType_trafficCondition_, TrafficConditionSubCauseCode_unavailable_), + m_situation(CauseCodeType_trafficCondition_, TrafficConditionSubCauseCode_trafficJamIncreasing_) + ); + } + + function f_DEN_MSRV_BO_09_02 () runs on ItsDenm { + + f_DEN_MSRV_BO_09_XX( + "CERT_TS_DENM_02", + m_situation(CauseCodeType_accident_, AccidentSubCauseCode_unavailable_), + m_situation(CauseCodeType_accident_, AccidentSubCauseCode_multiVehicleAccident_) + ); + } + } + + /** * @desc TP Function for TC_DEN_MSRV_BV_10 */