diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 64d051186f1bd47d3d5f518654ab680c92f97603..25adc20be8404187bea582c8ee1d0e84a37623fe 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -2316,7 +2316,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{ @@ -2392,7 +2392,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(); @@ -2401,10 +2402,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_mcaPortIn, 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_mcaPortIn, m_response(v_responsePrimitive)); } [] tc_ac.timeout { setverdict(pass, __SCOPE__ & ": No notification received"); @@ -4109,7 +4118,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_mcaPortIn, 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_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn index 1d5c8c87bddb4f57fe9a7957c79ed7456ded35c3..abe335f009e4493763fdf603736c3e55252446ec 100644 --- a/OneM2M_Testcases_CSE_Release_2.ttcn +++ b/OneM2M_Testcases_CSE_Release_2.ttcn @@ -2447,6 +2447,25 @@ module OneM2M_Testcases_CSE_Release_2 { v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; f_send(e_mcaPortIn, 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_mcaPortIn, m_response(v_responsePrimitive)); + } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No notification received");