diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index b61d428e893fe798df25af06fb468ea42ae1fde9..350ce7a0561f57c459d890d8ae05567c4f11834c 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -376,6 +376,48 @@ module OneM2M_Functions { f_cse_postamble_default(); } + /** + * @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution + * @verdict + */ + function f_cse_postamble_deleteResourcesCSE() runs on CseTester { + var integer i; + var XSD.ID v_resourceAddress; + var RequestPrimitive v_request; + + if (PX_RUN_POSTAMBLE) { + + for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) { + + v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]); + + v_request := valueof(m_delete(v_resourceAddress, f_getOriginator(vc_resourcesIndexToBeDeleted[i],false))); + + v_request.from_ := PX_SUPER_CSE_ID; + + mccPort.send(m_request(v_request)); + + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + log(__SCOPE__&" INFO: Resource " & v_request.to_ & " deleted"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + log(__SCOPE__&" INFO: Error while deleting resource " & v_request.to_); + } + [] tc_ac.timeout { + log(__SCOPE__&" INFO: No answer while deleting resource " & v_request.to_); + } + } + + } + } + + f_cse_postamble_default(); + } + /** * @desc Default postamble * @verdict @@ -1669,6 +1711,9 @@ module OneM2M_Functions { if(ischosen(p_contentResource.serviceSubscribedAppRule)) { return p_contentResource.serviceSubscribedAppRule.resourceName; } + if(ischosen(p_contentResource.remoteCSE)) { + return p_contentResource.remoteCSE.resourceName; + } log(__SCOPE__&":WARNING: Primitive Content Kind not implemented"); return "resourceNameNotFound"; diff --git a/OneM2M_TestControl.ttcn b/OneM2M_TestControl.ttcn index 6c0860ad9f3cf4c0bc9466f4d3c00a967b6a6b6c..18722af085bbfcb7c25733aad900cdf65676385d 100644 --- a/OneM2M_TestControl.ttcn +++ b/OneM2M_TestControl.ttcn @@ -43,7 +43,7 @@ module OneM2M_TestControl { execute(TC_CSE_REG_CRE_018()); execute(TC_CSE_REG_CRE_022()); execute(TC_CSE_REG_CRE_023()); - execute(TC_CSE_REG_CRE_024()); + execute(TC_CSE_REG_CRE_025()); execute(TC_CSE_REG_CRE_026()); execute(TC_CSE_REG_RET_001()); execute(TC_CSE_REG_RET_005()); diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index 0ad02eb8a0258ec6ccf5b9695a8fb275bf887b3a..2731e5744a7e8a7243585e3f82c0ceeab4b893d0 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -1293,6 +1293,8 @@ module OneM2M_Testcases { [] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully"); + f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive); + vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; @@ -1308,7 +1310,7 @@ module OneM2M_Testcases { } // Postamble - f_cse_postamble_deleteResources(); + f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down(); @@ -1345,6 +1347,8 @@ module OneM2M_Testcases { [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully"); + f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive); + vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -1356,7 +1360,7 @@ module OneM2M_Testcases { } // Postamble - f_cse_postamble_deleteResources(); + f_cse_postamble_deleteResourcesCSE(); // Tear down f_cf04Down();