diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 5f3c722cc048d7d18d93fa05601938bae853cc47..d3027cdeb9f831ed897e24070e70a678ab24775a 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -2605,50 +2605,6 @@ module OneM2M_Functions { f_checkCseSimuStatus(); } //end f_cse_notifyProcedure_notify - - /** - * @desc Handling of valid NOTIFY and send to POINT_OF_ACCESS to finish a notification procedure - * @verdict - */ - function f_cse_notifyProcedure_SendtoPOA() 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(int2000, omit)); - v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; - v_responsePrimitive.to_ := f_getLocalPoA(vc_aeSimuDesc.mcaPortIn); - f_send(e_mcaPortIn, m_response(v_responsePrimitive)); - tc_ac.start; - repeat; - } - [] 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)); - } - [] mcaPortIn.receive{ - tc_ac.stop; - setverdict(inconc, __SCOPE__ & ":ERROR: unexpected message received"); - tc_ac.start; - repeat; - } - } - - } //end f_cse_notifyProcedure_SendtoPOA /** * @desc Handling message exchange for the dynamic authorization procedure diff --git a/OneM2M_Testcases_CSE_Release_3.ttcn b/OneM2M_Testcases_CSE_Release_3.ttcn index 483cda1315183d0c12b0f41528419f4ed62eed99..b5406eae207dc1b377b02a26df66dd16016e4dd2 100644 --- a/OneM2M_Testcases_CSE_Release_3.ttcn +++ b/OneM2M_Testcases_CSE_Release_3.ttcn @@ -8591,28 +8591,56 @@ module OneM2M_Testcases_CSE_Release_3 { function f_CSE_SUB_NTF_007() runs on AeSimu system CseSystem { // Local variables - var MsgIn v_response; var integer v_aeIndex := -1; var RequestPrimitive v_request; - var template RequestPrimitive v_requestCreateAE := m_createAe(vc_aeSimuDesc.appId, omit, vc_aeSimuDesc.aeIdStem, c_defaultAe1ResourceName, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn)}); + var ResponsePrimitive v_responsePrimitive; var RequestPrimitive v_reqNotify; // Test control // Test component configuration f_cf02Up(); - + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, -, {f_getLocalPoA()}))); // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAeWithRequestReachability(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); // Test Body v_reqNotify := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification(PX_TS_CSE1.cseId))); vc_cse1.start(f_cse_notifyProcedure_notify(v_reqNotify)); //Message exchange for notification - - vc_cse1.start(f_cse_notifyProcedure_SendtoPOA()); //The IUT sends the valid NOTIFY to POINT_OF_ACCESS + + 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(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + v_responsePrimitive.to_ := f_getLocalPoA(vc_aeSimuDesc.mcaPortIn); + f_send(e_mcaPortIn, m_response(v_responsePrimitive)); + tc_ac.start; + repeat; + } + [] 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)); + } + [] mcaPortIn.receive{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received"); + tc_ac.start; + repeat; + } + } f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); @@ -8637,117 +8665,71 @@ module OneM2M_Testcases_CSE_Release_3 { } function f_CSE_SUB_NTF_008() runs on AeSimu system CseSystem { - // Local variables - var MsgIn v_response, v_resp2; - var integer v_aeIndex := -1; - var RequestPrimitive v_request, v_req3; - var ResponsePrimitive v_req2; - var template RequestPrimitive v_requestCreateAE := m_createAe(vc_aeSimuDesc.appId, omit, vc_aeSimuDesc.aeIdStem, c_defaultAe1ResourceName, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn)}); + var integer v_aeIndex, v_remoteCseIndex := -1; + var ResponsePrimitive v_responsePrimitive; + //var template RequestPrimitive v_requestCreateAE := m_createAe(vc_aeSimuDesc.appId, omit, vc_aeSimuDesc.aeIdStem, c_defaultAe1ResourceName, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn)}); var RequestPrimitive v_reqNotify; // Test control // Test component configuration - f_cf02Up(); + f_cf02UpCseSimuMaster(); // Test adapter configuration // Preamble - f_cse_activateDefaults_ae(); //Activate defaults when running on a PTC - - v_requestCreateAE.primitiveContent.aE.requestReachability := true; - v_request := f_getCreateRequestPrimitive(int2, valueof(v_requestCreateAE), -1);//c_CRUDNDi - f_send(e_mcaPort, m_request(v_request)); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass,__SCOPE__&":INFO: Application registered successfuly"); - if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)) { - - f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive); - - v_aeIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); - - if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.aE.aE_ID)){ - f_sendAcPrimitive("AE-ID_changed", v_aeIndex); - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(inconc, __SCOPE__&":INFO: Error while registering application"); - stop; - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No answer while registering resource"); - stop; - } - } - - f_checkAeSimuStatus(); + v_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, -, {f_getLocalPoA()})); + vc_ae1.start(f_cse_preamble_registerAe()); + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + // Test Body + v_aeIndex := f_getLatestResource(vc_ae1); v_reqNotify := valueof(m_notifyNotification(f_getResourceAddress(v_aeIndex), m_contentNotification_subscriptionVerification(PX_TS_CSE1.cseId))); - vc_cse1.start(f_cse_notifyProcedure_notify(v_reqNotify)); //Message exchange for notification - v_reqNotify.from_ := f_getOriginator(v_aeIndex); - - f_send(e_mcaPort, m_request(valueof(v_reqNotify))); - - //the IUT receives a valid NOTIFY RESPONSE from the AE - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responseNotify(int2000))) -> value v_response { - tc_ac.stop; - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(inconc, __SCOPE__&":INFO: Error while performing notification"); - } - [] mcaPort.receive { - tc_ac.stop; - setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No answer while performing notification"); - } - } + vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler());//Message exchange for notification - //the IUT also sends NOTIFY RESPONSE to the CSE - v_req2 := valueof(m_responseNotification(int2000, omit)); - v_req2.requestIdentifier := v_response.primitive.responsePrimitive.primitiveContent.requestPrimitive.requestIdentifier; - v_req3 := valueof(m_notifyResponsePrimitive(f_getResourceAddress(vc_aeIndex), v_req2)); - v_req3.from_ := f_getOriginator(v_aeIndex); - f_send(e_mcaPort, m_request(v_req3)); - + f_send(e_mcaPort, m_request(v_reqNotify)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responseNotify(int2000))) -> value v_resp2 { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Polling response received"); + + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + + //Send response in any case + v_responsePrimitive := valueof(m_responseNotification(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + v_responsePrimitive.to_ := f_getLocalPoA(vc_aeSimuDesc.mcaPortIn); + f_send(e_mcaPortIn, m_response(v_responsePrimitive)); + tc_ac.start; + repeat; } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(?))) -> value vc_request { tc_ac.stop; - setverdict(fail, __SCOPE__&":INFO: Error while performing notification"); - } - [] mcaPort.receive { + 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{ tc_ac.stop; - setverdict(fail, __SCOPE__&":INFO: Unexpected message received"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__&":INFO: No answer while performing notification"); + setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received"); + tc_ac.start; } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retargeting request"); + } } - - f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); - - //Postamble - f_cse_postamble_deleteResources(); + + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + + // Postamble + f_cse_postamble_deleteResourcesCSE(); // Tear down - f_cf02Down(); + f_cf02DownCseSimuMaster(); } // end f_CSE_SUB_NTF_008