From e4718e92e1cbdb03b5f6d72a6b02487aed46f810 Mon Sep 17 00:00:00 2001 From: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org> Date: Fri, 28 Jul 2017 10:18:15 +0200 Subject: [PATCH] Correction of TC_CSE_DMR_DEL_002 and TC_CSE_DMR_DEL_004 Signed-off-by: Miguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org> --- LibOneM2M/OneM2M_Functions.ttcn | 8 +++++- OneM2M_Testcases.ttcn | 50 +++++++++------------------------ 2 files changed, 21 insertions(+), 37 deletions(-) diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 4d90261..9170320 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -7,7 +7,7 @@ * * @author oneM2M * @version $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $ - * $Id: OneM2M_Functions.ttcn 330 2017-07-26 10:02:53Z reinaortega $ + * $Id: OneM2M_Functions.ttcn 333 2017-07-28 08:17:47Z reinaortega $ * @desc Module containing functions for oneM2M * */ @@ -975,6 +975,12 @@ module OneM2M_Functions { unmap(self:acPort, system:acPort); } //end f_cse_notifyProcedure_subscriptionDeletion + + function f_isResourceNotDeleted(in integer p_resourceIndex) runs on Tester return boolean { + + //TODO Call f_isResourcePresent + return false; + } /** diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index 7dd0eca..b96a709 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -7,7 +7,7 @@ * * @author oneM2M * @version $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $ - * $Id: OneM2M_Testcases.ttcn 332 2017-07-28 07:24:06Z reinaortega $ + * $Id: OneM2M_Testcases.ttcn 333 2017-07-28 08:17:47Z reinaortega $ * @desc Module containing test cases for oneM2M * */ @@ -9006,23 +9006,8 @@ module OneM2M_Testcases { v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2}; v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); v_updateRequest := f_getUpdateRequestPrimitive(int1, vc_acpAuxIndex, v_updateRequest); + f_cse_updateResource(v_updateRequest); - mcaPort.send(m_request(v_updateRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Attribute of resource type int1 (Acp) updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating resource type int1 (Acp)"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type int1 (Acp)"); - } - } - //Adjustments for ACP resource type if(p_resourceType == int1) { p_createRequestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_2};//{v_accessControlRule_1,v_accessControlRule_2}; @@ -9060,6 +9045,15 @@ module OneM2M_Testcases { setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); } } + + f_checkCseTesterStatus(); + + //Check if the resource has been deleted or not + if(f_isResourceNotDeleted(v_resourceIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource not deleted"); + } else { + setverdict(fail, __SCOPE__ & ":INFO: Resource deleted"); + } // Postamble // We are forced to delete the Ae because the delete request in the postamble_deleteResources is sent by Ae itself, witch doesn't have privileges @@ -9201,25 +9195,9 @@ module OneM2M_Testcases { v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); - // Test Body - v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ":Resource type " & int2str(enum2int(p_resourceType)) & " delete successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); - } - } + f_cse_deleteResource(valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex)))); + //Test Body mcaPort.send(m_request(m_deleteRequest(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); tc_ac.start; @@ -14258,7 +14236,7 @@ module OneM2M_Testcases { }; // Test Body - v_notifyHandler.start(f_CSE_SUB_UPD_018(v_contentResponse, 2)); // check that no notification is received + v_notifyHandler.start(f_CSE_SUB_UPD_007(v_contentResponse, 2)); // check that no notification is received v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 -- GitLab