diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 3183e8ad4cc3213e787623e5aaebf14c46a46641..97a05b615bfe0078f34ab93333c8744eafd345a9 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -2020,7 +2020,7 @@ module OneM2M_Functions { [] mcaPortIn.receive(mw_request(mw_notifyAggregatedNotification)) -> value vc_request { tc_ac.stop; if(p_numberOfAggregatedNotification == lengthof(vc_request.primitive.requestPrimitive.primitiveContent.aggregatedNotification.notification_list)){ - if(f_check_notificationContent(vc_response.primitive.requestPrimitive, p_primitiveContent)){ + if(f_check_notificationContent(vc_request.primitive.requestPrimitive, p_primitiveContent)){ setverdict(pass, __SCOPE__ & ": Notification received"); } else{ @@ -2096,7 +2096,8 @@ module OneM2M_Functions { */ function f_cse_notifyProcedure_noNotificationHandler() runs on AeSimu { // Local variables - + var ResponsePrimitive v_responsePrimitive; + //Activate defaults when running on a PTC f_cse_activateDefaults_ae(); @@ -2105,10 +2106,18 @@ module OneM2M_Functions { [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, Non expected notification received"); + //Send response in any case + v_responsePrimitive := valueof(m_responseNotification(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + f_send(e_mca_in_port, m_response(v_responsePrimitive)); } [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(?))) -> value vc_request { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, Non expected notification received"); + //Send response in any case + v_responsePrimitive := valueof(m_responseNotification(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + f_send(e_mca_in_port, m_response(v_responsePrimitive)); } [] tc_ac.timeout { setverdict(pass, __SCOPE__ & ": No notification received"); @@ -3571,7 +3580,16 @@ module OneM2M_Functions { var ResponsePrimitive v_response; [] mcaPortIn.receive(mw_request(mw_notify)) -> value v_request { - log(__SCOPE__&": WARNING: Unexpected NOTIFY message received"); + log(__SCOPE__&": WARNING: Unexpected NOTIFY (single notification) message received"); + + //Send response in any case + v_response := valueof(m_responseNotification(int2000, omit)); + v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + f_send(e_mca_in_port, m_response(v_response)); + repeat; + } + [] mcaPortIn.receive(mw_request(mw_notifyAggregatedNotification)) -> value v_request { + log(__SCOPE__&": WARNING: Unexpected NOTIFY (aggregated notification) message received"); //Send response in any case v_response := valueof(m_responseNotification(int2000, omit)); diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 6861146bb302b39b9f637cdd621338cd023c9435..07969775947ea6bbf4e6ab2addb5b0f2033e4d0d 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -8763,6 +8763,7 @@ module OneM2M_PermutationFunctions { if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRI)){ v_contentResponseRequestResource.request := mw_contentRequestBase; v_requestResourceURI := v_response.primitive.responsePrimitive.primitiveContent.uRI; + v_contentResponseRequestResource.request.primitiveContent := p_requestPrimitive.primitiveContent; if (p_operation == int1){ //create v_statusCode := int2001; v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent); @@ -8774,8 +8775,7 @@ module OneM2M_PermutationFunctions { v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitive.primitiveContent); }else if (p_operation == int4){ //delete v_statusCode := int2002; - v_primitiveContent.container := mw_contentContainer_rc1; - //v_primitiveContent := omit; + v_primitiveContent := omit; } f_send(e_mca_port, m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex)))); tc_ac.start; @@ -9199,7 +9199,7 @@ module OneM2M_PermutationFunctions { f_cse_notifyProcedure_responsePrimitiveHandler(mw_responsePrimitive(p_responseStatusCode)); - vc_ae2.done; + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); // Postamble f_cse_postamble_deleteResources(); diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn index 89944e75bc697bfea41ffa4fb26c1549ca556afc..9687575c0f6bb15bbfbad7334676e5d0e005be14 100644 --- a/OneM2M_Testcases_CSE_Release_2.ttcn +++ b/OneM2M_Testcases_CSE_Release_2.ttcn @@ -2222,7 +2222,7 @@ module OneM2M_Testcases_CSE_Release_2 { tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4101))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5204))) -> value v_response { //SUBSCRIPTION_VERIFICATION_INITIATION_FAILED tc_ac.stop; setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege"); } @@ -2301,7 +2301,7 @@ module OneM2M_Testcases_CSE_Release_2 { tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5205))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5204))) -> value v_response { //SUBSCRIPTION_VERIFICATION_INITIATION_FAILED tc_ac.stop; setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege"); } @@ -2447,6 +2447,25 @@ module OneM2M_Testcases_CSE_Release_2 { v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; f_send(e_mca_in_port, m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(mw_notifyAggregatedNotification({{mw_contentNotification(?)}}))) -> value vc_request { + tc_ac.stop; + if(f_check_notificationContent(vc_request.primitive.requestPrimitive, v_contentResponse)){ + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + v_elapsedTime := t_batchNotificationTimer.read; + t_batchNotificationTimer.stop; + if(v_elapsedTime < 10.0) { + setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired"); + } + } + else{ + setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match"); + } + //Send response in any case + v_responsePrimitive := valueof(m_responseNotification(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + f_send(e_mca_in_port, m_response(v_responsePrimitive)); + } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No notification received"); @@ -3023,7 +3042,7 @@ module OneM2M_Testcases_CSE_Release_2 { // Test Body v_contentResponse.aE.labels := v_labels_3; - vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs + vc_ae2.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, 1)); // check if the notification is well received and if its content matchs v_updateRequest.primitiveContent.aE.labels := v_labels_1; f_cse_updateResource(int2, v_aeIndex, v_updateRequest); // Update request 1