diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index c93b8cc9920065bf438e0ab3adcae0b2e9c3f130..7b59f79499f42bb4687b3948e9a7cc7918180c84 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -1518,7 +1518,48 @@ module OneM2M_Functions { return v_matchResult; - } //end f_check_notificationContent + } //end f_check_notificationContent + + /** + * @desc Handling message exchange for the AE Annc update + * @param p_responseStatusCode Response Status Code to be used for the response to the AE Annc request + * @verdict + */ + function f_cse_notifyProcedure_updateHandler() runs on CseSimu { + // Local variables + var ResponsePrimitive v_responsePrimitive; + var template Notification v_notificationRequest := mw_contentNotification_any; + + + //Preparation of Notification response to be sent + v_responsePrimitive := valueof(m_responseNotification(int2004, omit)); + + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(mw_notify(v_notificationRequest))) -> value vc_request { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + } + [] mccPortIn.receive{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No notification received"); + stop; + } + } + + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + if(getverdict == pass) { + mccPortIn.send(m_httpResponse(v_responsePrimitive)); + } else { + v_responsePrimitive.responseStatusCode := int4000; + mccPortIn.send(m_httpResponse(v_responsePrimitive)); + } + + } //end f_cse_notifyProcedure_updateHandler }// end of group NotificationFunctions diff --git a/OneM2M_Testcases_CSE.ttcn b/OneM2M_Testcases_CSE.ttcn index b4c598a41348037ab5fa53d0622e74fac5fad47e..4d470542f5e709c2e1dfc2358c627a11c543fed6 100644 --- a/OneM2M_Testcases_CSE.ttcn +++ b/OneM2M_Testcases_CSE.ttcn @@ -1258,6 +1258,71 @@ module OneM2M_Testcases_CSE { }; //end TC_CSE_REG_CRE_010 + /** + * @desc Check that the IUT accepts a create request of <AE> resource with attributes multiplicity equals to 1 and asking an CSE relative AE_ID by indicating AE_ID_Stem with character ‘C’. + * + */ + testcase TC_CSE_REG_CRE_011() runs on AeSimu system CseSystem { + + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_cseBaseIndex := -1; + var ResourceType v_resourceType := int2; + + + // Test component configuration + f_cf01Up(); + + //Preamble + + //Test Body + v_request := valueof(m_createAe(PX_APP_ID, omit, "C")); + + v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1); + + mcaPort.send(m_request(v_request)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive); + vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); + setverdict(pass, __SCOPE__ & ": AE successfully created."); + + if(v_response.primitive.responsePrimitive.primitiveContent.aE.resourceID[0] == "C"){ + setverdict(pass, __SCOPE__ & "Resource ID set correctly."); + } else { + setverdict(fail, __SCOPE__ & "Resource ID not set correctly."); + } + + if(f_isScopeSpRelative(v_response.primitive.responsePrimitive.primitiveContent.aE.aE_ID)){ + setverdict(pass, __SCOPE__ & "AE ID set correctly."); + } else { + setverdict(fail, __SCOPE__ & "AE ID not set correctly."); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } + + /** + * @desc Check that the IUT accepts an AE registration with the optional attribute OPTIONAL_ATTRIBUTE provided + * + */ group g_CSE_REG_CRE_012 { testcase TC_CSE_REG_CRE_012_AE_LBL() runs on Tester system CseSystem { @@ -1690,6 +1755,90 @@ module OneM2M_Testcases_CSE { }//end TC_CSE_REG_CRE_019 + /** + * @desc Check that the IUT accepts a response from IN_CSE on the success update of AEAnnc during AE registration with preprovisioned SP_relative_AE_ID + * + */ + testcase TC_CSE_REG_CRE_020() runs on AeSimu system CseSystem { + + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var ResourceType v_resourceType := int2; + + //Test control + if(not(PICS_MN_CSE)) { + setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case"); + stop; + } + + // Test component configuration + f_cf02Up(); + + //Preambule + vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE)); + vc_cse1.done; + + v_request := valueof(m_createAe(PX_APP_ID, omit, omit)); + + v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, -1); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response{ + tc_ac.stop; + + f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive); + vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); + setverdict(pass, __SCOPE__ & ": AE successfully created."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); + } + } + + vc_cse1.start(f_cse_notifyProcedure_updateHandler()); + vc_cse1.done; + + //Test body + tc_ac.start; + + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + //continue to test the content + if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)){ + if (v_response.primitive.responsePrimitive.primitiveContent.aE.app_ID == PX_APP_ID){ + setverdict(pass, __SCOPE__ & ": AE creation success."); + }else{ + setverdict(fail, __SCOPE__ & ": Error in AE content."); + } + }else{ + setverdict(fail, __SCOPE__ & ": primitiveContent doesn't exist"); + } + } + [] mcaPort.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating AE"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + }; //end TC_CSE_REG_CRE_020 + /** * @desc Check that the IUT rejects the create request of <CSEBase> resource. *