From 2e7bb2ec1bfa59de60ea88ac9fe134fbbda96f80 Mon Sep 17 00:00:00 2001 From: reinaortega <miguelangel.reinaortega@etsi.org> Date: Wed, 21 Feb 2018 10:58:13 +0100 Subject: [PATCH] Fixing f_CSE_DMR_DEL_004. Closing #28 Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org> --- LibOneM2M/OneM2M_Functions.ttcn | 35 ++++++++++++++++++++++++++++++++ OneM2M_PermutationFunctions.ttcn | 8 ++++++++ 2 files changed, 43 insertions(+) diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 86bc310..9ceec5c 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -1393,6 +1393,41 @@ module OneM2M_Functions { //mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted } //end f_subscriptionVerificationHandler + + /** + * @desc Default handling message exchange for the notification procedure + * @verdict + */ + function f_cse_notifyProcedure_defaultHandler() runs on AeSimu { + // Local variables + var ResponsePrimitive v_responsePrimitive; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_ae(); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { + tc_ac.stop; + + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + + //Send response in any case + v_responsePrimitive := valueof(m_responseNotification(int2001, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + mcaPortIn.send(m_response(v_responsePrimitive)); + tc_ac.start; + repeat; + } + [] mcaPortIn.receive{ + tc_ac.stop; + setverdict(inconc, __SCOPE__ & ":ERROR: unexpected message received"); + tc_ac.start; + repeat; + } + } + + } //end f_cse_notifyProcedure_defaultHandler /** * @desc Handling message exchange for the notification procedure diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 49bb2a4..61cbe47 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -4982,9 +4982,17 @@ module OneM2M_PermutationFunctions { v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitiveChildResource, p_childResourceType); + v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); + if((p_resourceType == int23) or (p_childResourceType == int23)) { + vc_ae2.start(f_cse_notifyProcedure_defaultHandler()); + } + f_cse_deleteResource(v_resourceIndex); + + f_checkAeSimuStatus(); // Test Body mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); -- GitLab