From aef723d293a115d9fab0557aeec0185610b11889 Mon Sep 17 00:00:00 2001 From: reinaortega <miguelangel.reinaortega@etsi.org> Date: Thu, 14 Dec 2017 14:53:41 +0100 Subject: [PATCH] Addition of a new file OneM2M_PermutationFunctions to accommodate the permutation functions Signed-off-by: reinaortega <miguelangel.reinaortega@etsi.org> --- OneM2M_PermutationFunctions.ttcn | 6183 ++++++++++++++++++++++++++++++ OneM2M_Testcases_AE.ttcn | 666 +--- OneM2M_Testcases_CSE.ttcn | 5499 +------------------------- 3 files changed, 6349 insertions(+), 5999 deletions(-) create mode 100644 OneM2M_PermutationFunctions.ttcn diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn new file mode 100644 index 0000000..dbcae45 --- /dev/null +++ b/OneM2M_PermutationFunctions.ttcn @@ -0,0 +1,6183 @@ +/** + * Copyright Notification + * No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC). + * All rights reserved. + * + * @author ETSI + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_Testcases.ttcn $ + * $Id: OneM2M_Testcases.ttcn 347 2017-08-11 08:48:20Z reinaortega $ + * @desc Module containing test cases for oneM2M + * + */ +module OneM2M_PermutationFunctions { + + import from OneM2M_TestSystem all; + import from OneM2M_Templates all; + import from OneM2M_Types all;//{type XSD.ID}; + import from OneM2M_TypesAndValues all; + import from OneM2M_Pixits all; + import from LibCommon_Time all; + import from OneM2M_Pics all; + import from OneM2M_Functions all; + import from XSD all; + + group AE { + + group General { + + group Create { + + function f_AE_GEN_CRE_001(PrimitiveScope p_primitiveScope) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + var template UtTriggerPrimitive v_utRequest := m_utCreateContainer; + var UtTriggerAckPrimitive v_trigger_response; + var integer v_parentIndex := -1; + var integer v_resourceIndex := -1; + var MsgIn v_request; + var PrimitiveContent v_modifiedResource; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); + + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + f_cf03Up(); + + //Send Trigger Message + v_utRequest.to_ := f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); + v_utRequest.from_ := "UNINITIALIZED"; + f_sendUtPrimitive(v_utRequest, v_action); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.to_))) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container creation request received successfuly"); + v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_); + v_modifiedResource := f_ae_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType); + v_resourceIndex := f_setLocalResource(v_modifiedResource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex); + v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, v_modifiedResource)); + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Error while creating container"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, " : No answer while creating resource"); + stop; + } + } + + // Postamble + f_cf03Down(); + } + function f_AE_GEN_CRE_002(PrimitiveScope p_primitiveScope) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + var template UtTriggerPrimitive v_utRequest := m_utCreateContainer; + var UtTriggerAckPrimitive v_trigger_response; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); + + + //Test Control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + f_cf03Up(); + + //Send Trigger Message + v_utRequest.to_ := f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); + v_utRequest.from_ := "UNINITIALIZED"; + f_sendUtPrimitive(v_utRequest,v_action); + + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.to_))) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container creation request received successfuly"); + + v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Error while creating container"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, " : No answer while creating resource"); + stop; + } + } + + // Postamble + f_cf03Down(); + } + + } //end group Create + + group Update { + + function f_AE_GEN_UPD_001(PrimitiveScope p_primitiveScope) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer; + var UtTriggerAckPrimitive v_trigger_response; + var integer v_auxInteger; + var PrimitiveContent v_localResource; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); + + + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + f_cf03Up(); + + //Send Trigger Message + v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); + v_auxInteger := f_setLocalResource(v_localResource, int3); + v_utRequest.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope); + v_utRequest.from_ := "UNINITIALIZED"; + f_sendUtPrimitive(v_utRequest,v_action); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.to_))) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container update request received successfuly"); + + v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Error while updating container"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, " : No answer while updating resource"); + stop; + } + } + + // Postamble + f_cf03Down(); + } + function f_AE_GEN_UPD_002(PrimitiveScope p_primitiveScope) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer; + var UtTriggerAckPrimitive v_trigger_response; + var integer v_auxInteger; + var PrimitiveContent v_localResource; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); + + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + f_cf03Up(); + + //Send Trigger Message + v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); + v_auxInteger := f_setLocalResource(v_localResource, int3); + v_utRequest.from_ := "UNINITIALIZED"; + f_sendUtPrimitive(v_utRequest,v_action); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.to_))) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container update request received successfuly"); + + v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Error while updating container"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, " : No answer while updating resource"); + stop; + } + } + + // Postamble + f_cf03Down(); + } + + } //end group Update + + group Retrieve { + + function f_AE_GEN_RET_001(PrimitiveScope p_primitiveScope) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + var template UtTriggerPrimitive v_utRequestTemplate; + var UtTriggerPrimitive v_utRequest; + var UtTriggerAckPrimitive v_trigger_response; + var integer v_auxInteger; + var PrimitiveContent v_localResource; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid RETRIEVE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); + + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + f_cf03Up(); + + //Send Trigger Message + v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); + v_auxInteger := f_setLocalResource(v_localResource, int3); + v_utRequestTemplate := m_utRetrieveResource(f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope),"UNINITIALIZED"); + f_sendUtPrimitive(v_utRequestTemplate,v_action); + v_utRequest := valueof(v_utRequestTemplate); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.to_))) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly"); + + v_responsePrimitive := valueof(m_responsePrimitive(int2000, "To_be_defined", omit)); + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Error while retrieving container"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, " : No answer while retrieving resource"); + stop; + } + } + + // Postamble + f_cf03Down(); + } + function f_AE_GEN_RET_002(PrimitiveScope p_primitiveScope) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + var template UtTriggerPrimitive v_utRequestTemplate; + var UtTriggerPrimitive v_utRequest; + var UtTriggerAckPrimitive v_trigger_response; + var integer v_auxInteger; + var PrimitiveContent v_localResource; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid RETRIEVE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); + + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + f_cf03Up(); + + //Send Trigger Message + v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); + v_auxInteger := f_setLocalResource(v_localResource, int3); + v_utRequestTemplate := m_utRetrieveResource(f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope),"UNINITIALIZED"); + v_utRequest := valueof(v_utRequestTemplate); + f_sendUtPrimitive(v_utRequest,v_action); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.to_))) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly"); + + v_responsePrimitive := valueof(m_responsePrimitive(int2000, "To_be_defined", omit)); + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Error while retrieving container"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, " : No answer while retrieving resource"); + stop; + } + } + + // Postamble + f_cf03Down(); + } + + } //end group Retrieve + + group Delete { + + function f_AE_GEN_DEL_001(PrimitiveScope p_primitiveScope) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest; + var UtTriggerAckPrimitive v_trigger_response; + var integer v_auxInteger; + var PrimitiveContent v_localResource; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); + + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + f_cf03Up(); + + //Send Trigger Message + v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); + v_auxInteger := f_setLocalResource(v_localResource, int3); + v_utRequest.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope); + v_utRequest.from_ := "UNINITIALIZED"; + f_sendUtPrimitive(v_utRequest,v_action); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.to_))) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container update request received successfuly"); + + v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Error while updating container"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, " : No answer while updating resource"); + stop; + } + } + + // Postamble + f_cf03Down(); + } + function f_AE_GEN_DEL_002(PrimitiveScope p_primitiveScope) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest; + var UtTriggerAckPrimitive v_trigger_response; + var integer v_auxInteger; + var PrimitiveContent v_localResource; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); + + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + f_cf03Up(); + + //Send Trigger Message + v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); + v_auxInteger := f_setLocalResource(v_localResource, int3); + v_utRequest.to_ := f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope); + v_utRequest.from_ := "UNINITIALIZED"; + f_sendUtPrimitive(v_utRequest,v_action); + + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.to_))) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container update request received successfuly"); + + v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Error while updating container"); + stop; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, " : No answer while updating resource"); + stop; + } + } + + // Postamble + f_cf03Down(); + } + + } //end group Delete + + }//end group General + + group Registration { + + group Create { + + function f_AE_REG_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_response, in universal charstring p_action) runs on CseSimu { + + //primitives for mcaPortIn + var MsgIn v_request; + var ResponsePrimitive v_responsePrimitive; + + f_cf03Up(); + + //Send Trigger Message + f_sendUtPrimitive(p_utRequest,p_action); + + //Test behavior + tc_ac.start; + alt{ + [] mcaPortIn.receive(mw_request(p_response)) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : AE registration request is accepted!!"); + //v_responsePrimitive := valueof(m_responsePrimitiveTemp(int2000, omit)); + v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); + + //send back responsePrimitive + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(mw_createAe(*,?,m_contentCreateAe_Invalid))) -> value v_request { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : AE registration request is rejected due to not including the optional attribute!"); + } + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + } + + } + + // Postamble + f_cf03Down(); + } + + } // End of subgroup Create + + group Delete { + + }// End Delete subgroup + + }//end Registration subgroup + + group Data_Management_and_Repository { + + group Create { + + function f_AE_DMR_CRE_003(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + + //Test component configuration + f_cf03Up(); + + //send triggering primitive to SUT + f_sendUtPrimitive(p_utRequest,p_action); + + //Test behavior + tc_ac.start; + alt{ + + //receive MsgIn requestPrimitive + [] mcaPortIn.receive(mw_request(p_request)) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : ContentInstance creation request is accepted!!"); + + //set responseStatusCode back to SUT + v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); + + //send back responsePrimitive + mcaPortIn.send(m_response(v_responsePrimitive)); + } + + [] mcaPortIn.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : ContentInstance creation request is rejected due to not including the attribute!"); + } + + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + } + } + + // Postamble + f_cf03Down(); + } + function f_AE_DMR_CRE_004(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + + //Test component configuration + f_cf03Up(); + + //send triggering primitive to SUT + f_sendUtPrimitive(p_utRequest,p_action); + + //Test behavior + tc_ac.start; + alt{ + + //receive MsgIn requestPrimitive + [] mcaPortIn.receive(mw_request(p_request)) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container creation request is accepted!!"); + + //set responseStatusCode back to SUT + v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); + + //send back responsePrimitive + mcaPortIn.send(m_response(v_responsePrimitive)); + } + + [] mcaPortIn.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Container creation request is rejected due to not including the attribute!"); + } + + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + } + } + + // Postamble + f_cf03Down(); + } + + }//End of subgroup Create + + group Update { + + function f_AE_DMR_UPD_001(template UtTriggerPrimitive p_utRequestTestBody, in universal charstring p_action, template RequestPrimitive p_expectedUpdateRequest) runs on CseSimu { + + //primitives for mcaPortIn + var MsgIn v_request; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_parentIndex := -1; + var PrimitiveContent v_modifiedResource; + + f_cf03Up(); + + //Preamble + v_aeIndex := f_ae_preamble_registerAe(); + + //Send Trigger Message + p_utRequestTestBody.to_ := f_getLocalResourceAddress(v_aeIndex); + f_sendUtPrimitive(p_utRequestTestBody,p_action); + + //Test behavior + + tc_ac.start; + alt{ + [] mcaPortIn.receive(mw_request(p_expectedUpdateRequest)) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : AE update request is accepted!"); + v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_); + v_modifiedResource := f_ae_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType); + v_resourceIndex := f_setLocalResource(v_modifiedResource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex); + if(v_resourceIndex != -1) { + mcaPortIn.send(m_response(m_responsePrimitive_content(int2004, v_request.primitive.requestPrimitive.requestIdentifier, v_modifiedResource))); + } + //send back responsePrimitive + //mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive(mw_request(?)) -> value v_request { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : AE update request is rejected due to not including the optional attribute!"); + } + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + } + + } + + // Postamble + f_cf03Down(); + } + + function f_AE_DMR_UPD_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + + //Test component configuration + f_cf03Up(); + + //send triggering primitive to SUT + f_sendUtPrimitive(p_utRequest,p_action); + + //Test behavior + tc_ac.start; + alt{ + + //receive MsgIn requestPrimitive + [] mcaPortIn.receive(mw_request(p_request)) { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Container update request is accepted!!"); + + //set responseStatusCode back to SUT + v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); + + //send back responsePrimitive + mcaPortIn.send(m_response(v_responsePrimitive)); + } + + [] mcaPortIn.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Container update request is rejected due to not including the attribute!"); + } + + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + } + } + + // Postamble + f_cf03Down(); + } + + }//End of subgroup Update + + group Retrieve { + + function f_AE_DMR_RET_001(ResourceType p_resourceType, XSD.AnyURI p_address, in universal charstring p_action) runs on CseSimu { + + //variables + var template UtTriggerPrimitive v_utRequest := m_utRetrieveResource (p_address, "UNINITIALIZED"); + var MsgIn v_request; + var ResponsePrimitive v_responsePrimitive; + + //Test component configuration + f_cf03Up(); + + //send triggering primitive to SUT + v_utRequest.resourceType := p_resourceType; + f_sendUtPrimitive(v_utRequest,p_action); + + //Test behavior + tc_ac.start; + alt{ + [] mcaPortIn.receive(mw_request(mw_retrieve(p_address))) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : retrieve resource type request is accepted!!"); + + //set responseStatusCode back to SUT + v_responsePrimitive := valueof(m_responsePrimitive(int2000, "To_be_defined", omit)); + + //send back responsePrimitive + mcaPortIn.send(m_response(v_responsePrimitive)); + tc_ac.stop; + } + [] mcaPortIn.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : error while retrieving resource !"); + } + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + } + } + + // Postamble + f_cf03Down(); + } + + + }//End of subgroup Retrieve + + group Delete { + + } + + }//end DMR subgroup + + group Subscription_and_Notification { + + group Create { + + function f_AE_SUB_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { + + var MsgIn v_request; + var ResponsePrimitive v_responsePrimitive; + + f_cf03Up(); + + //send triggering primitive to SUT + f_sendUtPrimitive(p_utRequest,p_action); + + //Test behavior + tc_ac.start; + alt{ + [] mcaPortIn.receive(mw_request(p_request)) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__, " : Subscription creation request is accepted!"); + + //set responseStatusCode back to SUT + v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); + + //send back responsePrimitive + mcaPortIn.send(m_response(v_responsePrimitive)); + } + [] mcaPortIn.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__, " : Subscription creation request is rejected due to not including the optional attribute!"); + } + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + } + } + + // Postamble + f_cf03Down(); + + } + + }//End Create Group + + group Notify { + + }//End of Notify group + + + }//end SUB subgroup + + + }//end group AE + + + + group CSE { + + group Generic { + + group Create { + + function f_CSE_GEN_CRE_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + // Test control + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + v_addressingMethod := e_nonHierarchical; + v_primitiveScope := p_primitiveScope; + v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); + v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource created using non-hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating container resource using non-hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_CRE_001 + + function f_CSE_GEN_CRE_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + // Test control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + v_addressingMethod := e_hierarchical; + v_primitiveScope := p_primitiveScope; + v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); + v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource created using hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating container resource using hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_CRE_002 + + } // end of group Create + + group Retrieve { + + function f_CSE_GEN_RET_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { + + // Local variables + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + // Test control + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + v_addressingMethod := e_nonHierarchical; + v_primitiveScope := p_primitiveScope; + + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource retrieved using non-hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using non-hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_RET_001 + + function f_CSE_GEN_RET_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { + + // Local variables + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + // Test control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + v_addressingMethod := e_hierarchical; + v_primitiveScope := p_primitiveScope; + + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource retrieved using hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_RET_002 + + } // end of group Retrieve + + group Update { + + function f_CSE_GEN_UPD_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { + + // Local variables + var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + // Test control + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + v_addressingMethod := e_nonHierarchical; + v_primitiveScope := p_primitiveScope; + + v_updateRequest.primitiveContent.container.labels := {"MyLabel"}; + + v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest); + v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); + + mcaPort.send(m_request(v_updateRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource updated using non-hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating container resource using non-hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_UPD_001 + + function f_CSE_GEN_UPD_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { + + // Local variables + var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + // Test control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + v_addressingMethod := e_hierarchical; + v_primitiveScope := p_primitiveScope; + + v_updateRequest.primitiveContent.container.labels := {"MyLabel"}; + + v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest); + v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); + + mcaPort.send(m_request(v_updateRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource updated using hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating container resource using hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_UPD_002 + + } // end of group Update + + group Delete { + + function f_CSE_GEN_DEL_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + // Test control + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + v_addressingMethod := e_nonHierarchical; + v_primitiveScope := p_primitiveScope; + + v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource deleted using non-hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting container resource using non-hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_DEL_001 + + function f_CSE_GEN_DEL_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + // Test control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + v_addressingMethod := e_hierarchical; + v_primitiveScope := p_primitiveScope; + + v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource deleted using hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting container resource using hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_DEL_002 + + } // end of group Delete + + } // end of group Generic + + group Registration { + + group Create{ + + function f_CSE_REG_CRE_012(in template RequestPrimitive p_createAe) runs on AeSimu { + + //Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var ResourceType v_resourceType := int2; //AE + + // Test control + + // Test component configuration + f_cf01Up(); + + //Test Body + + v_request := valueof(p_createAe); + 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 creation successfull."); + } + [] 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(); + } + + function f_CSE_REG_CRE_013(template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var ResourceType v_resourceType := int16; //remoteCSE + + // Test control + + // Test component configuration + f_cf04Up(); + + // Test adapter configuration + + // Preamble + + // Test Body + v_request := f_getCreateRequestPrimitive(v_resourceType, p_requestPrimitive, -1); + + mccPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Accepted creation for resource type remoteCSE containing attribute " & p_optionalAttribute.name); + f_setResource(v_request.primitiveContent,int16); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + f_setResource(v_request.primitiveContent,int16); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted creation for resource type remoteCSE without containing attribute " & p_optionalAttribute.name); + f_setResource(v_request.primitiveContent,int16); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Rejected creation of resource type remoteCSE containing attribute " & p_optionalAttribute.name); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); + } + } + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + + }//end f_CSE_REG_CRE_BV_013 + + + function f_CSE_REG_CRE_017(template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { + + //Local variables + var ResourceType v_resourceType := int2; + var RequestPrimitive v_request; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + // Test Body + v_request := f_getCreateRequestPrimitive(int2, p_createRequestPrimitive, -1); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Request successfully rejected"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, AE has been registered"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } + + function f_CSE_REG_CRE_026(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in charstring p_action) runs on CseSimu { + + var ResponsePrimitive v_responsePrimitive; + + //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_cf04Up(); + + //send triggering primitive to SUT + f_sendUtPrimitive(p_utRequest,p_action); + + //Test behavior + tc_ac.start; + alt{ + + //receive MsgIn requestPrimitive + [] mccPortIn.receive(mw_request(p_request)) { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Resource type remoteCSE created successfuly"); + + //set responseStatusCode back to SUT + v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); + + //send back responsePrimitive + mccPortIn.send(m_response(v_responsePrimitive)); + } + [] mccPortIn.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__&":INFO: Unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__&":INFO: No request received for creating resource type remoteCSE"); + } + } + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + + } + + function f_CSE_REG_CRE_028(RequestPrimitive p_request, template PrimitiveContent p_contentResponse) runs on CseSimu{ //system CseSystem { + //Local variables + var ResourceType v_resourceType := int16; //remoteCSE + // Test control + + // Test component configuration + f_cf04Up(); + + // Test adapter configuration + + // Preamble + + + //Test Body + vc_remoteCseIndex := f_cse_registerRemoteCse(p_request, p_contentResponse); + + //Check if the resource has been deleted or not + if(f_cse_isResourcePresent(vc_remoteCseIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + + }//end TC_CSE_REG_CRE_028 + + } //end group Create + + group Retrieve{ + + function f_CSE_REG_RET_002(template PrimitiveContent p_contentResponse) runs on AeSimu { + //Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex)))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } //end f_CSE_REG_RET_002 + + function f_CSE_REG_RET_004(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + //Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_createResource(int2, p_createRequestPrimitive, -1); + + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } //end f_CSE_REG_RET_004 + + function f_CSE_REG_RET_007(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on CseSimu { + var MsgIn v_response; + var RequestPrimitive v_request; + var ResourceType v_resourceType := int16; //remoteCSE + var template PrimitiveContent v_contentResponse; + + // Test control + + // Test component configuration + f_cf04Up(); + + // Test adapter configuration + + // Preamble + if(PICS_IN_CSE){ + vc_remoteCseIndex := f_cse_registerRemoteCse(p_createRequestPrimitive); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(vc_remoteCseIndex), f_getOriginator(vc_remoteCseIndex)))); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + } else if (PICS_MN_CSE){ + vc_remoteCseIndex := f_cse_registrationRemoteCse(p_createRequestPrimitive); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(vc_remoteCseIndex), f_getOriginator(vc_remoteCseIndex)))); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + } + + //Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + } // f_CSE_REG_RET_007 + + }//end group Retrieve + + group Update{ + + function f_CSE_REG_UPD_002(template RequestPrimitive p_requestPrimitive) runs on CseSimu { + //Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var ResourceType v_resourceType := int16; //remoteCSE + // Test control + + // Test component configuration + f_cf04Up(); + + // Test adapter configuration + + // Preamble + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); + + // Test Body + v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive); + + mccPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute "); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute "); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Rejected updation of resource type remoteCSE containing attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE"); + } + } + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + + }//end f_CSE_REG_UPD_002 + + function f_CSE_REG_UPD_003(template RequestPrimitive p_requestPrimitive, in AttributeList p_attribute) runs on CseSimu { + // Local variables + //Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var ResourceType v_resourceType := int16; //remoteCSE + var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; + var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request containing To set to " & PX_CSE1_ADDRESS & " and Content containing remoteCSE resource containing a valid attribute " & p_attribute[0]; // 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_cf04Up(); + + // Test adapter configuration + + // Preamble + vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase); + + //Send Trigger Message + v_utRequest.to_ := f_getResourceAddress(); + v_utRequest.from_ := "UNINITIALIZED"; + f_sendUtPrimitive(v_utRequest, v_action); + + // Test Body + v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive); + + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(v_request)) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Received request for updation for resource type remoteCSE containing attribute " & p_attribute[0]); + f_setResource(v_request.primitiveContent,int16); + } + [] mccPortIn.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error: Did not receive update request for resource type remoteCSE"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE"); + } + } + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + + }//end f_CSE_REG_UPD_003 + + }// end group Update + + group Delete{ + + + }// end group Delete + + }//end Registration + + group Data_Management_and_Repository { + + group Create { + + function f_CSE_DMR_CRE_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on AeSimu return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_parentIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpAuxIndex := -1; + var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"}; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + + if(ispresent(p_parentRequestPrimitive)) { + if(match(int23, p_parentRequestPrimitive.resourceType)){ + vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred + vc_ae2.done; + v_ae2Index := f_getResource(vc_ae2); + p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; + vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); + } + if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)){ + + f_cse_preamble_registerAe(); + + } + v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex); + + + + } else {//Resource under CSEBase + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + + if(ischosen(p_requestPrimitive.primitiveContent.group_)){ + + f_cse_preamble_registerAe(); + + } + + } + + // Test Body + + if(match(int23, p_requestPrimitive.resourceType)){ + vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred + vc_ae2.done; + v_ae2Index := f_getResource(vc_ae2); + p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; + vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); + } + + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); + f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); + v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if (f_isResourcePresent(v_resourceIndex)){ + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return vc_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_CRE_001 + + function f_CSE_DMR_CRE_001_cseSimu(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseSimu return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_parentIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae1Index := -1; + var integer v_acpAuxIndex := -1; + var PoaList v_poaList := {"http://" & PX_AE1_ADDRESS & "/"}; + + // Test control + + // Test component configuration + f_cf02UpCseSimuMaster(); + + // Test adapter configuration + + // Preamble + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); + + if(match(int23, p_resourceType)){ + vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered + vc_ae1.done; + v_ae1Index := f_getResource(vc_ae1); + p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)}; + vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); + } + + // Test Body + + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, vc_remoteCseIndex); + + mccPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); + f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); + v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, vc_remoteCseIndex); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkCseSimuStatus(); + + //Check to see if the resource is present or not + if (f_isResourcePresentCseSimu(v_resourceIndex)){ + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf02DownCseSimuMaster(); + + return vc_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_CRE_001_cseSimu + + function f_CSE_DMR_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive{//system CseSystem { MRO system keyword not supported on functions in Titan + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); + f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); + v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)){ + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return vc_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_CRE_002 + + function f_CSE_DMR_CRE_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {//system CseSystem { MRO system keyword not supported on functions in Titan + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType == int23){ + //vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); + } + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + v_request.requestIdentifier := "Existing resource"; + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4105))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource already exists"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating an already existing resource"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Creating a resource that already exists"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_CRE_003 + + function f_CSE_DMR_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {//system CseSystem { MRO system keyword not supported on functions in Titan + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_acpAuxIndex := -1; + var integer v_aeIndex := -1; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + if (p_resourceType != int23) { + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) + } else { + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int60);//c_UDNDi); + } + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -); + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to create a resource"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating a resource without privileges"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Resource created without creation privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_CRE_004 + + function f_CSE_DMR_CRE_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_invalidAttribute) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + mcaPort.send(m_request(v_request, {p_invalidAttribute})); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Creation rejected for resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute " & p_invalidAttribute.name); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted creation of resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute" & p_invalidAttribute.name); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_CRE_005 + + function f_CSE_DMR_CRE_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType))); + f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); + v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Creation rejected of resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)){ + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return vc_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_CRE_006 + + function f_CSE_DMR_CRE_012(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeList p_optionalAttribute) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_containerIndex := -1; + var integer v_parentIndex := -1; + var integer v_acpAuxIndex := -1; + var integer v_ae2Index := -1; + const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs"; + var integer v_resourceIndex := -1; + var XSD.NCName v_myOptionalAttribute := p_optionalAttribute[0]; + + // Test control + if(v_myOptionalAttribute == c_accessControlPolicyIDs) { + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + } + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + if (v_myOptionalAttribute == c_accessControlPolicyIDs) { + v_acpAuxIndex := f_cse_preamble_createAcpAux();//c_CRUDNDi) + } + + v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + + if(p_resourceType == int4) { + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); + v_parentIndex := v_containerIndex; + } + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); + + if(v_myOptionalAttribute == "creator") { + mcaPort.send(m_request(v_request, {{v_myOptionalAttribute, omit}})); + } else { + mcaPort.send(m_request(v_request)); + } + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & v_myOptionalAttribute); + f_checkAttributesToBeSaved(p_resourceType, v_request, v_response.primitive.responsePrimitive); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " with incorrect attributes"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Rejected creation of resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_CRE_012 + + function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + v_request.resultContent := int0;//Attributes + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, omit))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No content provided with RC set to 0"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Content provided with RC set to 0"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_CRE_015 + + function f_CSE_DMR_CRE_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + v_request.resultContent := int2;//Attributes + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response { + tc_ac.stop; + if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRI)) { + setverdict(pass, __SCOPE__ & ": Response returning correctly only the hierarchical address of the created resource"); + } else { + setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 2"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + + }//end f_CSE_DMR_CRE_016 + + function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + v_request.resultContent := int3;//Attributes + Hierarchichal Address + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response { + tc_ac.stop; + if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.resource.uRI)) { + setverdict(pass, __SCOPE__ & ": Response returning correctly the hierarchical address of the created resource and resource representation"); + } else { + setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 3"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_CRE_017 + + function f_CSE_DMR_CRE_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_parentIndex := -1; + var integer v_containerIndex := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(p_resourceType == int4) { + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); + v_parentIndex := v_containerIndex; + } + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); + + mcaPort.send(m_request(v_request)); + + vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc)); + vc_cse1.done; + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + }//end f_CSE_DMR_CRE_020 + + function f_CSE_DMR_CRE_021(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu{ + + // Local variables + var MsgIn v_anncRequest; + var RequestPrimitive v_request; + var integer v_parentIndex := -1; + var integer v_containerIndex := -1; + var integer v_remoteCseIndex; + var integer v_aeAnncIndex; + var integer v_resourceIndex; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + + if (PX_IUT_IS_MN_CSE == true) { + vc_cse1.start(f_cse_registrationRemoteCse(m_createRemoteCSEBase)); + }else if (PX_IUT_IS_IN_CSE == true) { + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase)); + } + vc_cse1.done; + + vc_cse1.start(f_cse_resourceAnnouncementHandler()); + v_resourceIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit)); + vc_cse1.done; + + if(p_resourceType == int4) { + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); + v_parentIndex := v_containerIndex; + } + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); + + vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc)); + mcaPort.send(m_request(v_request)); + vc_cse1.done; + + vc_request.primitive.requestPrimitive := f_getRequestPrimitive(vc_cse1); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + //return v_anncRequest.primitive.requestPrimitive; + + }//end f_CSE_DMR_CRE_021 + + }//end group Create + + group Retrieve { + + function f_CSE_DMR_RET_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_parentIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + if(p_resourceType == int4) { //ContentInstance + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + v_parentIndex := v_containerIndex; + }else{ + v_parentIndex := v_aeIndex; + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); + + // Test Body + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_RET_001 + function f_CSE_DMR_RET_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpAuxIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); + stop; + } + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, -);//c_CRUDNDi) + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//c_CRUDNDi; + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + f_cse_updateAcpAuxResource(int61); //c_CUDNDi + + // Test Body + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_003 + + function f_CSE_DMR_RET_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_004 + + function f_CSE_DMR_RET_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_005 + + function f_CSE_DMR_RET_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , + {"pi", "ct"}, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, not only requested attributes retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_006 + + function f_CSE_DMR_RET_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), + {"lbl"}, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_007 + + function f_CSE_DMR_RET_008(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), + {"lbl", "at"}, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_008 + + function f_CSE_DMR_RET_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpIndex := -1; + + // Test control + + // Test component configuration + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Up(true); + } else { + f_cf02Up(); + } + + // Test adapter configuration + + // Preamble + + if(p_resourceType != int2) { //ResourceType != AE + + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + } + + if(p_resourceType != int1) { + + v_acpIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID}); + } + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + } else { //ResourceType = RemoteCSE + + vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + + } + + // Test Body + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Down(); + } else { + f_cf02Down(); + } + + }//end f_CSE_DMR_RET_013 + + function f_CSE_DMR_RET_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpAuxIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); + stop; + } + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + + if (p_resourceType!=int2){ + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi; + } + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, int61); + + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + if (p_resourceType==int2){ + v_aeIndex := v_resourceIndex; + } + + + } else { //ResourceType = RemoteCSE + + vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + + } + + // Test Body + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_014 + + function f_CSE_DMR_RET_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpAuxIndex := -1; + + // Test control + + // Test component configuration + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Up(true); + } else { + f_cf02Up(); + } + + // Test adapter configuration + + // Preamble + if(p_resourceType != int2) { //ResourceType != AE + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + } + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + } else { + vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + } + + // Test Body + mcaPort.send(m_request(m_retrieveAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Down(); + } else { + f_cf02Down(); + } + + }//end f_CSE_DMR_RET_015 + + function f_CSE_DMR_RET_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpAuxIndex := -1; + + // Test control + + // Test component configuration + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Up(true); + } else { + f_cf02Up(); + } + + // Test adapter configuration + + // Preamble + if(p_resourceType != int2) { //ResourceType != AE + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + } + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + }else{ + vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + } + + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Down(); + } else { + f_cf02Down(); + } + + }//end f_CSE_DMR_RET_016 + + function f_CSE_DMR_RET_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpAuxIndex := -1; + + // Test control + + // Test component configuration + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Up(true); + } else { + f_cf02Up(); + } + + // Test adapter configuration + + // Preamble + if(p_resourceType != int2) { //ResourceType != AE + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + } + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + }else{ + vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + } + + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , + {"pi", "ct"}, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, not only requested attributes retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Down(); + } else { + f_cf02Down(); + } + + }//end f_CSE_DMR_RET_017 + + function f_CSE_DMR_RET_018(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpAuxIndex := -1; + + // Test control + + // Test component configuration + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Up(true); + } else { + f_cf02Up(); + }; + + // Test adapter configuration + + // Preamble + if(p_resourceType != int2) { //ResourceType != AE + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + } + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + }else{ + vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + } + + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), + {"lbl"}, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Down(); + } else { + f_cf02Down(); + } + + }//end f_CSE_DMR_RET_018 + + function f_CSE_DMR_RET_019(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpAuxIndex := -1; + + // Test control + + // Test component configuration + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Up(true); + } else { + f_cf02Up(); + } + + // Test adapter configuration + + // Preamble + if(p_resourceType != int2) { //ResourceType != AE + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + } + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + }else{ + vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + } + + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), + {"lbl", "at"}, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Down(); + } else { + f_cf02Down(); + } + + }//end f_CSE_DMR_RET_019 + + function f_CSE_DMR_RET_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, ResultContent p_resultContent) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := p_resultContent; + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Request successfully rejected"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, Result content set to " & int2str(enum2int(p_resultContent)) & " is impossible for a retrieve request "); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_020 + + function f_CSE_DMR_RET_021(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int1;//Attributes + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_021 + + function f_CSE_DMR_RET_022(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int4;//Attributes and child resources + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_022 + + function f_CSE_DMR_RET_023(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int5;//attributes and child resource references + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_023 + + function f_CSE_DMR_RET_024(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int6;//Child resource references + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_024 + + function f_CSE_DMR_RET_025(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int6;//Child resource references + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_025 + + }//end group Retrieve + + group Update { + function f_CSE_DMR_UPD_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu return ResponsePrimitive{ + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkAeSimuStatus(); + + //Used to check that the resource has been updated + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return vc_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_001 + + function f_CSE_DMR_UPD_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + //Used to check that the resource has been updated + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return vc_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_002 + + function f_CSE_DMR_UPD_003(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu return ResponsePrimitive { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + //f_match2PrimitiveContent(vc_resourcesList[v_resourceIndex].resource, p_createRequestPrimitive.primitiveContent); TODO fix the match problem + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request, p_nullFields)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return vc_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_003 + + function f_CSE_DMR_UPD_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request, p_nullFields)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return vc_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_004 + + function f_CSE_DMR_UPD_005(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive , v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_005 + + function f_CSE_DMR_UPD_006(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_acpAuxIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int59);//c_CRDNDi) + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to update attributes from resource type " & int2str(enum2int(p_resourceType))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Updating attributes from resource without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_006 + + function f_CSE_DMR_UPD_007(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation not allowed. RO attribute from resource type " & int2str(enum2int(p_resourceType)) ); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Updating RO attribute from resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_007 + + function f_CSE_DMR_UPD_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request,p_nullFields)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation not allowed. Mandatory RW attribute from resource type " & int2str(enum2int(p_resourceType)) ); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Deleting a mandatory RW attribute from resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_008 + + function f_CSE_DMR_UPD_014(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_014 + + function f_CSE_DMR_UPD_015(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, boolean p_secondAcp := false) runs on AeSimu { + //Local variables + var MsgIn v_response; + var AcpType v_acpi; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpAuxIndex := -1; + var integer v_acpIndex := -1; + + // Test control + + // Test component configuration + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Up(true); + } else { + f_cf02Up(); + } + + // Test adapter configuration + + // Preamble + if(p_resourceType != int2) { + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + } + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + + if(p_secondAcp) {//A second ACP is required + v_acpIndex := f_cse_createResource(int1, m_createAcpBase); + + v_acpi := {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID}; + + p_updateRequestPrimitive := f_setAcpId(p_updateRequestPrimitive, v_acpi); + + } + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource + } else { //ResourceType = RemoteCSE + vc_cse1.start(f_cse_registerRemoteCse(p_createRequestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + } + + //Test Body + vc_request.primitive.requestPrimitive := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(vc_request.primitive.requestPrimitive)); //CSEBase + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__, ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__, ": Error while updating optional attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Down(); + } else { + f_cf02Down(); + } + + } // end function f_CSE_DMR_UPD_015 + + function f_CSE_DMR_UPD_016(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { + //Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var integer v_acpAuxIndex := -1; + + // Test control + + // Test component configuration + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Up(true); + } else { + f_cf02Up(); + } + + // Test adapter configuration + + // Preamble + if(p_resourceType != int2) { + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + } + + if(p_resourceType != int1) { + + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); + + p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); + } + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource + } else { //ResourceType = RemoteCSE + vc_cse1.start(f_cse_registerRemoteCse(p_createRequestPrimitive)); + vc_cse1.done; + + v_resourceIndex := f_getRemoteCseResource(vc_cse1); + } + + //Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); //CSEBase + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__, ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(fail, __SCOPE__, ": Error while updating mandatory attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + f_cf01Down(); + } else { + f_cf02Down(); + } + + } //end function f_CSE_DMR_UPD_016 + + }//end group Update + + group Delete { + + function f_CSE_DMR_DEL_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_parentIndex := -1; + var integer v_containerIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + if(p_resourceType == int4) { + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + v_parentIndex := v_containerIndex; + }else{ + v_parentIndex := v_aeIndex; + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_parentIndex); + + // Test Body + v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource" & int2str(enum2int(p_resourceType)) & " deleted successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] 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_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if (f_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource deleted"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not deleted"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + };//end f_CSE_DMR_DEL_001 + + function f_CSE_DMR_DEL_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var RequestPrimitive v_updateRequest; + var integer v_acpAuxIndex := -1; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_ae2Index := -1; + var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63)); + var AccessControlRule v_accessControlRule_2; + var SetOfAcrs v_setOfArcs; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-,-);//c_CRDNDi); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRUNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + //Update ACP Aux to remove DELETE operation rights to AE, keeping rights of SUPER USER to run postamble + v_accessControlRule_2 := valueof(m_createAcr({f_getResourceId(vc_resourcesList[v_aeIndex].resource)}, int55)); + + 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); + + //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}; + } else { + p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}); + } + + //Creation of resource + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.from_ := f_getOriginator(v_aeIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to delete the resource " & int2str(enum2int(p_resourceType))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error resource deleted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkAeSimuStatus(); + + //Check if the resource has been deleted or not + if(f_isResourcePresent(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 + f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + };//end f_CSE_DMR_DEL_002 + + function f_CSE_DMR_DEL_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_createRequestPrimitiveChildResource) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); + + f_cse_deleteResource(v_resourceIndex); + + // Test Body + mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Error while deleting non existing resource"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + };//end f_CSE_DMR_DEL_004 + + }//end group Delete + + }//end group Data_Management_and_Repository + + group Location { + + + + }//end group Location + + group Group_Managment { + + group Create { + + + } // end group Create + + group Retrieve { + + } // end group Retrieve + + group Update { + + } // end group Update + + group Basic_Operations { + + function f_CSE_GMG_001(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var integer i; + var ListOfURIs v_memberIDs; + var AcpType v_acpIDs; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else { + for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ + setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); + } + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_001 + + function f_CSE_GMG_002(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var ListOfURIs v_memberIDs; + var ListOfURIs v_membersAcpIds; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation successful while doesn't have privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_002 + + function f_CSE_GMG_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var integer i; + var ListOfURIs v_memberIDs; + var ListOfURIs v_membersAcpIds; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else { + for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ + setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); + } + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_003 + + function f_CSE_GMG_004(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var ListOfURIs v_memberIDs; + var AcpType v_acpIDs; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation successful while doesn't have privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_004 + + function f_CSE_GMG_005(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { + //Local constants + const integer c_numberOfResponsePrimitive := 2; + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var ListOfURIs v_memberIDs; + var integer i; + var template RequestPrimitive v_createContainerRequest_1 := m_createContainer_noResourceName; + var template RequestPrimitive v_createContainerRequest_2 := m_createContainer_noResourceName; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_containerIndex_1 := f_cse_createResource(int3, v_createContainerRequest_1, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, v_createContainerRequest_2, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, -), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else{ + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ + setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); + } + else{ + for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); + } + } + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_005 + + function f_CSE_GMG_006(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { + //Local constants + const integer c_numberOfResponsePrimitive := 2; + + // Local variables + var MsgIn v_response; + var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex := -1; + var integer i; + var ListOfURIs v_memberIDs; + var ListOfURIs v_membersAcpIds; + var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1")); + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); + var template PrimitiveContent v_contentResponse; + + v_contentResponse.contentInstance := mw_contentContentInstanceBase; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, omit), -1); // AE2 is registred + v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)}; + v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds, -), -); + + v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName; + v_createRequest.from_ := f_getOriginator(v_groupIndex); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN + v_createRequest.requestIdentifier := v_createRequest.requestIdentifier & f_rnd(1, 1000000); + + // Test Body + + mcaPort.send(m_request(v_createRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else{ + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ + setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); + } + else{ + for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); + } + } + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_006 + + }// End of Basic_Operations + + } // end group Group_Managment + + group Discovery { + + } //end group Group Discovery + + group Subscription_And_Notification { + + group Create { + + + }//end group Create + + group Notify{ + + + }//end group Notify + + group Update { + + + + }//end group Update + + group Delete { + + + }//end group Delete + + }//end group Subscription_And_Notification + + group Security { + + group Access_Control_Policy { + + group Create { + + + }// end of group Create + + group Update { + + + }// end of group Update + + group Basic_Operations { + + function f_CSE_SEC_ACP_001(template RequestPrimitive p_requestPrimitive) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest := valueof(m_createAcpBase); + var RequestPrimitive v_updateRequest; + var AccessControlRule v_accessControlRule_1; + var SetOfAcrs v_setOfArcs; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + v_accessControlRule_1 := valueof(m_createAcr({ f_getOriginator(v_aeIndex), PX_SUPER_AE_ID}, int63)); + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := "UnknowOriginator"; + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); + } + } + + //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 + if(testcasename() == "TC_CSE_SEC_ACP_001_DEL") { + f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE + } + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } //end f_CSE_SEC_ACP_001 + + function f_CSE_SEC_ACP_002(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex1 := -1; + var integer v_acpIndex2 := -1; + var RequestPrimitive v_createRequest := valueof(m_createAcp(f_getResourceAddress(-1), omit)); + var RequestPrimitive v_updateRequest; + var AccessControlRule v_accessControlRule_1; + var SetOfAcrs v_setOfArcs; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource + v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource), f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}, -); + + v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int3)); // c_CR + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int60)); // c_UDNDi + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex2, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } //end f_CSE_SEC_ACP_002 + + function f_CSE_SEC_ACP_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule_1; + var RequestPrimitive v_updateRequest; + var SetOfAcrs v_setOfArcs; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := valueof(m_createAcp(f_getResourceAddress(), -, {"testDomain"})); + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := "testDomain"; + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + //Postamble + v_accessControlRule_1 := valueof(m_createAcr({"all"}, int63)); + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); + v_updateRequest.from_ := "testDomain"; + mcaPort.send(m_request(v_updateRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + log(__SCOPE__ & ":INFO: Attribute of resource type ACP updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + log(__SCOPE__ & ":INFO: Error while updating resource type ACP"); + } + [] tc_ac.timeout { + log(__SCOPE__ & ":INFO: No answer while updating resource type ACP"); + } + } + + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_003 + + function f_CSE_SEC_ACP_004(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := "UnknowOriginator"; + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_004 + + function f_CSE_SEC_ACP_005(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var charstring v_currentTime; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_currentTime := fx_generateTimestamp(); + v_accessControlRule.accessControlContexts_list := {{{"* * * * * " & f_getYear(v_currentTime)}, omit, omit}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_005 + + function f_CSE_SEC_ACP_006(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{{"* * * * * 3000"}, omit, omit}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_006 + + function f_CSE_SEC_ACP_007(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{{}, omit, { choice := { countryCode := {"ES"}}}}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + //TODO How to indicate the location of the Originator (AE1)? + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_007 + + function f_CSE_SEC_ACP_008(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{{}, omit, { choice := { countryCode := {"ES"}}}}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + //TODO How to indicate the location of the Originator (AE1)? + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_008 + + function f_CSE_SEC_ACP_009(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{{}, {{f_getIpv4Address(PX_AE1_ADDRESS)}, omit}, omit}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_009 + + function f_CSE_SEC_ACP_010(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{{}, {{f_getIpv4Address(PX_AE2_ADDRESS)}, omit}, omit}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_010 + + function f_CSE_SEC_ACP_011(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int3 (Container)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } //end f_CSE_SEC_ACP_011 + + function f_CSE_SEC_ACP_012(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_acor) runs on AeSimu { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_request; + var RequestPrimitive v_createRequest := valueof(m_createAcpBase); + var RequestPrimitive v_updateRequest; + var AccessControlRule v_accessControlRule_1, v_accessControlRule_2; + var SetOfAcrs v_setOfArcs; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63)); + v_accessControlRule_2 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, p_acor)); + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + // Test Body + v_request := f_getCreateRequestPrimitive(int3, p_requestPrimitive, v_containerIndex); + + mcaPort.send(m_request(valueof(v_request))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); + } + } + + //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 + if(testcasename() == "TC_CSE_SEC_ACP_012_DEL") { + f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE + } + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } //end f_CSE_SEC_ACP_012 + + }// end of Basic_Operations + + }//end group AccessControlPolicy + + }//end group Security + + }//end group CSE + + +} diff --git a/OneM2M_Testcases_AE.ttcn b/OneM2M_Testcases_AE.ttcn index 1a9944c..8be5d97 100644 --- a/OneM2M_Testcases_AE.ttcn +++ b/OneM2M_Testcases_AE.ttcn @@ -21,6 +21,7 @@ module OneM2M_Testcases_AE { import from LibCommon_Time all; import from OneM2M_Pics all; import from OneM2M_Functions all; + import from OneM2M_PermutationFunctions all; import from XSD all; group AE { @@ -68,55 +69,7 @@ module OneM2M_Testcases_AE { f_AE_GEN_CRE_001(e_absolute); } - function f_AE_GEN_CRE_001(PrimitiveScope p_primitiveScope) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - var template UtTriggerPrimitive v_utRequest := m_utCreateContainer; - var UtTriggerAckPrimitive v_trigger_response; - var integer v_parentIndex := -1; - var integer v_resourceIndex := -1; - var MsgIn v_request; - var PrimitiveContent v_modifiedResource; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); - - if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - f_cf03Up(); - - //Send Trigger Message - v_utRequest.to_ := f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); - v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest, v_action); - - tc_ac.start; - alt { - [] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.to_))) -> value v_request { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container creation request received successfuly"); - v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_); - v_modifiedResource := f_ae_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType); - v_resourceIndex := f_setLocalResource(v_modifiedResource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex); - v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, v_modifiedResource)); - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Error while creating container"); - stop; - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, " : No answer while creating resource"); - stop; - } - } - - // Postamble - f_cf03Down(); - } - }//end group g_AE_GEN_CRE_002//end group g_AE_GEN_CRE_002 + }//end group g_AE_GEN_CRE_002 group g_AE_GEN_CRE_002 { @@ -154,52 +107,6 @@ module OneM2M_Testcases_AE { f_AE_GEN_CRE_002(e_absolute); } - function f_AE_GEN_CRE_002(PrimitiveScope p_primitiveScope) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - var template UtTriggerPrimitive v_utRequest := m_utCreateContainer; - var UtTriggerAckPrimitive v_trigger_response; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); - - - //Test Control - if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - f_cf03Up(); - - //Send Trigger Message - v_utRequest.to_ := f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); - v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest,v_action); - - - tc_ac.start; - alt { - [] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.to_))) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container creation request received successfuly"); - - v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Error while creating container"); - stop; - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, " : No answer while creating resource"); - stop; - } - } - - // Postamble - f_cf03Down(); - } - } //end group g_AE_GEN_CRE_002 } //end group Create @@ -245,53 +152,6 @@ module OneM2M_Testcases_AE { f_AE_GEN_UPD_001(e_absolute); } - function f_AE_GEN_UPD_001(PrimitiveScope p_primitiveScope) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer; - var UtTriggerAckPrimitive v_trigger_response; - var integer v_auxInteger; - var PrimitiveContent v_localResource; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); - - - if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - f_cf03Up(); - - //Send Trigger Message - v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); - v_auxInteger := f_setLocalResource(v_localResource, int3); - v_utRequest.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope); - v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest,v_action); - - tc_ac.start; - alt { - [] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.to_))) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container update request received successfuly"); - - v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Error while updating container"); - stop; - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, " : No answer while updating resource"); - stop; - } - } - - // Postamble - f_cf03Down(); - } }//end group g_AE_GEN_UPD_001 group g_AE_GEN_UPD_002 { @@ -333,52 +193,6 @@ module OneM2M_Testcases_AE { f_AE_GEN_UPD_002(e_absolute); } - function f_AE_GEN_UPD_002(PrimitiveScope p_primitiveScope) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer; - var UtTriggerAckPrimitive v_trigger_response; - var integer v_auxInteger; - var PrimitiveContent v_localResource; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); - - if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - f_cf03Up(); - - //Send Trigger Message - v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); - v_auxInteger := f_setLocalResource(v_localResource, int3); - v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest,v_action); - - tc_ac.start; - alt { - [] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.to_))) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container update request received successfuly"); - - v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Error while updating container"); - stop; - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, " : No answer while updating resource"); - stop; - } - } - - // Postamble - f_cf03Down(); - } - } //end group g_AE_GEN_UPD_002 } //end group Update @@ -424,53 +238,6 @@ module OneM2M_Testcases_AE { f_AE_GEN_RET_001(e_absolute); } - function f_AE_GEN_RET_001(PrimitiveScope p_primitiveScope) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - var template UtTriggerPrimitive v_utRequestTemplate; - var UtTriggerPrimitive v_utRequest; - var UtTriggerAckPrimitive v_trigger_response; - var integer v_auxInteger; - var PrimitiveContent v_localResource; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid RETRIEVE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); - - if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - f_cf03Up(); - - //Send Trigger Message - v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); - v_auxInteger := f_setLocalResource(v_localResource, int3); - v_utRequestTemplate := m_utRetrieveResource(f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope),"UNINITIALIZED"); - f_sendUtPrimitive(v_utRequestTemplate,v_action); - v_utRequest := valueof(v_utRequestTemplate); - - tc_ac.start; - alt { - [] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.to_))) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly"); - - v_responsePrimitive := valueof(m_responsePrimitive(int2000, "To_be_defined", omit)); - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Error while retrieving container"); - stop; - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, " : No answer while retrieving resource"); - stop; - } - } - - // Postamble - f_cf03Down(); - } }//end group g_AE_GEN_RET_001 group g_AE_GEN_RET_002 { @@ -512,54 +279,6 @@ module OneM2M_Testcases_AE { f_AE_GEN_RET_002(e_absolute); } - function f_AE_GEN_RET_002(PrimitiveScope p_primitiveScope) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - var template UtTriggerPrimitive v_utRequestTemplate; - var UtTriggerPrimitive v_utRequest; - var UtTriggerAckPrimitive v_trigger_response; - var integer v_auxInteger; - var PrimitiveContent v_localResource; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid RETRIEVE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); - - if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - f_cf03Up(); - - //Send Trigger Message - v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); - v_auxInteger := f_setLocalResource(v_localResource, int3); - v_utRequestTemplate := m_utRetrieveResource(f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope),"UNINITIALIZED"); - v_utRequest := valueof(v_utRequestTemplate); - f_sendUtPrimitive(v_utRequest,v_action); - - tc_ac.start; - alt { - [] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.to_))) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly"); - - v_responsePrimitive := valueof(m_responsePrimitive(int2000, "To_be_defined", omit)); - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Error while retrieving container"); - stop; - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, " : No answer while retrieving resource"); - stop; - } - } - - // Postamble - f_cf03Down(); - } - } //end group g_AE_GEN_RET_002 } //end group Retrieve @@ -605,52 +324,6 @@ module OneM2M_Testcases_AE { f_AE_GEN_DEL_001(e_absolute); } - function f_AE_GEN_DEL_001(PrimitiveScope p_primitiveScope) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest; - var UtTriggerAckPrimitive v_trigger_response; - var integer v_auxInteger; - var PrimitiveContent v_localResource; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_nonHierarchical, p_primitiveScope); - - if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - f_cf03Up(); - - //Send Trigger Message - v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); - v_auxInteger := f_setLocalResource(v_localResource, int3); - v_utRequest.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope); - v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest,v_action); - - tc_ac.start; - alt { - [] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.to_))) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container update request received successfuly"); - - v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Error while updating container"); - stop; - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, " : No answer while updating resource"); - stop; - } - } - - // Postamble - f_cf03Down(); - } }//end group g_AE_GEN_DEL_001 group g_AE_GEN_DEL_002 { @@ -692,54 +365,6 @@ module OneM2M_Testcases_AE { f_AE_GEN_DEL_002(e_absolute); } - function f_AE_GEN_DEL_002(PrimitiveScope p_primitiveScope) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest; - var UtTriggerAckPrimitive v_trigger_response; - var integer v_auxInteger; - var PrimitiveContent v_localResource; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-1, e_hierarchical, p_primitiveScope); - - if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - f_cf03Up(); - - //Send Trigger Message - v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), -1, int3); - v_auxInteger := f_setLocalResource(v_localResource, int3); - v_utRequest.to_ := f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope); - v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest,v_action); - - - tc_ac.start; - alt { - [] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.to_))) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container update request received successfuly"); - - v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Error while updating container"); - stop; - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, " : No answer while updating resource"); - stop; - } - } - - // Postamble - f_cf03Down(); - } - } //end group g_AE_GEN_DEL_002 } //end group Delete @@ -901,45 +526,7 @@ module OneM2M_Testcases_AE { f_AE_REG_CRE_002(v_utRequest,v_createAe,v_action); } - function f_AE_REG_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_response, in universal charstring p_action) runs on CseSimu { - - //primitives for mcaPortIn - var MsgIn v_request; - var ResponsePrimitive v_responsePrimitive; - - f_cf03Up(); - - //Send Trigger Message - f_sendUtPrimitive(p_utRequest,p_action); - - //Test behavior - tc_ac.start; - alt{ - [] mcaPortIn.receive(mw_request(p_response)) -> value v_request { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : AE registration request is accepted!!"); - //v_responsePrimitive := valueof(m_responsePrimitiveTemp(int2000, omit)); - v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); - - //send back responsePrimitive - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(mw_createAe(*,?,m_contentCreateAe_Invalid))) -> value v_request { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : AE registration request is rejected due to not including the optional attribute!"); - } - [] tc_ac.timeout{ - setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); - } - - } - - // Postamble - f_cf03Down(); - } - }//End of subgroup AE_REG_CRE_002 - } // End of subgroup Create @@ -1138,46 +725,6 @@ module OneM2M_Testcases_AE { f_AE_DMR_CRE_003(v_utRequest,v_request,v_action); } - function f_AE_DMR_CRE_003(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - - //Test component configuration - f_cf03Up(); - - //send triggering primitive to SUT - f_sendUtPrimitive(p_utRequest,p_action); - - //Test behavior - tc_ac.start; - alt{ - - //receive MsgIn requestPrimitive - [] mcaPortIn.receive(mw_request(p_request)) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : ContentInstance creation request is accepted!!"); - - //set responseStatusCode back to SUT - v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); - - //send back responsePrimitive - mcaPortIn.send(m_response(v_responsePrimitive)); - } - - [] mcaPortIn.receive { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : ContentInstance creation request is rejected due to not including the attribute!"); - } - - [] tc_ac.timeout{ - setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); - } - } - - // Postamble - f_cf03Down(); - } - }//End of subgroup AE_DMR_CRE_003 @@ -1269,46 +816,6 @@ module OneM2M_Testcases_AE { f_AE_DMR_CRE_004(v_utRequest,v_request,v_action); } - function f_AE_DMR_CRE_004(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - - //Test component configuration - f_cf03Up(); - - //send triggering primitive to SUT - f_sendUtPrimitive(p_utRequest,p_action); - - //Test behavior - tc_ac.start; - alt{ - - //receive MsgIn requestPrimitive - [] mcaPortIn.receive(mw_request(p_request)) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container creation request is accepted!!"); - - //set responseStatusCode back to SUT - v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); - - //send back responsePrimitive - mcaPortIn.send(m_response(v_responsePrimitive)); - } - - [] mcaPortIn.receive { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Container creation request is rejected due to not including the attribute!"); - } - - [] tc_ac.timeout{ - setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); - } - } - - // Postamble - f_cf03Down(); - } - }//End of subgroup AE_DMR_CRE_004 }//End of subgroup Create @@ -1431,55 +938,6 @@ module OneM2M_Testcases_AE { f_AE_DMR_UPD_001(v_utRequestTestBody,v_action, v_expectedUpdateRequestAe); } - function f_AE_DMR_UPD_001(template UtTriggerPrimitive p_utRequestTestBody, in universal charstring p_action, template RequestPrimitive p_expectedUpdateRequest) runs on CseSimu { - - //primitives for mcaPortIn - var MsgIn v_request; - var ResponsePrimitive v_responsePrimitive; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_parentIndex := -1; - var PrimitiveContent v_modifiedResource; - - f_cf03Up(); - - //Preamble - v_aeIndex := f_ae_preamble_registerAe(); - - //Send Trigger Message - p_utRequestTestBody.to_ := f_getLocalResourceAddress(v_aeIndex); - f_sendUtPrimitive(p_utRequestTestBody,p_action); - - //Test behavior - - tc_ac.start; - alt{ - [] mcaPortIn.receive(mw_request(p_expectedUpdateRequest)) -> value v_request { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : AE update request is accepted!"); - v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_); - v_modifiedResource := f_ae_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType); - v_resourceIndex := f_setLocalResource(v_modifiedResource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex); - if(v_resourceIndex != -1) { - mcaPortIn.send(m_response(m_responsePrimitive_content(int2004, v_request.primitive.requestPrimitive.requestIdentifier, v_modifiedResource))); - } - //send back responsePrimitive - //mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive(mw_request(?)) -> value v_request { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : AE update request is rejected due to not including the optional attribute!"); - } - [] tc_ac.timeout{ - setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); - } - - } - - // Postamble - f_cf03Down(); - } - }//End of subgroup AE_DMR_UPD_001 group g_AE_DMR_UPD_002 { @@ -1548,47 +1006,7 @@ module OneM2M_Testcases_AE { f_AE_DMR_UPD_002(v_utRequest,v_request,v_action); } - function f_AE_DMR_UPD_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - - //Test component configuration - f_cf03Up(); - - //send triggering primitive to SUT - f_sendUtPrimitive(p_utRequest,p_action); - - //Test behavior - tc_ac.start; - alt{ - - //receive MsgIn requestPrimitive - [] mcaPortIn.receive(mw_request(p_request)) { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Container update request is accepted!!"); - - //set responseStatusCode back to SUT - v_responsePrimitive := valueof(m_responsePrimitive(int2004, "To_be_defined", omit)); - - //send back responsePrimitive - mcaPortIn.send(m_response(v_responsePrimitive)); - } - - [] mcaPortIn.receive { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Container update request is rejected due to not including the attribute!"); - } - - [] tc_ac.timeout{ - setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); - } - } - - // Postamble - f_cf03Down(); - } - - }//End of subgroup AE_DMR_UPD_002 + }//End of subgroup AE_DMR_UPD_002 }//End of subgroup Update @@ -1618,47 +1036,6 @@ module OneM2M_Testcases_AE { f_AE_DMR_RET_001(int3, f_getLocalResourceAddress(v_auxInteger),v_action); } - function f_AE_DMR_RET_001(ResourceType p_resourceType, XSD.AnyURI p_address, in universal charstring p_action) runs on CseSimu { - - //variables - var template UtTriggerPrimitive v_utRequest := m_utRetrieveResource (p_address, "UNINITIALIZED"); - var MsgIn v_request; - var ResponsePrimitive v_responsePrimitive; - - //Test component configuration - f_cf03Up(); - - //send triggering primitive to SUT - v_utRequest.resourceType := p_resourceType; - f_sendUtPrimitive(v_utRequest,p_action); - - //Test behavior - tc_ac.start; - alt{ - [] mcaPortIn.receive(mw_request(mw_retrieve(p_address))) -> value v_request { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : retrieve resource type request is accepted!!"); - - //set responseStatusCode back to SUT - v_responsePrimitive := valueof(m_responsePrimitive(int2000, "To_be_defined", omit)); - - //send back responsePrimitive - mcaPortIn.send(m_response(v_responsePrimitive)); - tc_ac.stop; - } - [] mcaPortIn.receive { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : error while retrieving resource !"); - } - [] tc_ac.timeout{ - setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); - } - } - - // Postamble - f_cf03Down(); - } - }//End of TC_AE_DMR_RET_001 /** @@ -2233,43 +1610,6 @@ module OneM2M_Testcases_AE { f_AE_SUB_CRE_002(v_utRequest, v_requestT, v_action); } - function f_AE_SUB_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu { - - var MsgIn v_request; - var ResponsePrimitive v_responsePrimitive; - - f_cf03Up(); - - //send triggering primitive to SUT - f_sendUtPrimitive(p_utRequest,p_action); - - //Test behavior - tc_ac.start; - alt{ - [] mcaPortIn.receive(mw_request(p_request)) -> value v_request { - tc_ac.stop; - setverdict(pass, __SCOPE__, " : Subscription creation request is accepted!"); - - //set responseStatusCode back to SUT - v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); - - //send back responsePrimitive - mcaPortIn.send(m_response(v_responsePrimitive)); - } - [] mcaPortIn.receive { - tc_ac.stop; - setverdict(fail, __SCOPE__, " : Subscription creation request is rejected due to not including the optional attribute!"); - } - [] tc_ac.timeout{ - setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!"); - } - } - - // Postamble - f_cf03Down(); - - } - }//End AE_SUB_CRE_002 }//End Create Group diff --git a/OneM2M_Testcases_CSE.ttcn b/OneM2M_Testcases_CSE.ttcn index 700294d..274f623 100644 --- a/OneM2M_Testcases_CSE.ttcn +++ b/OneM2M_Testcases_CSE.ttcn @@ -21,6 +21,7 @@ module OneM2M_Testcases_CSE { import from LibCommon_Time all; import from OneM2M_Pics all; import from OneM2M_Functions all; + import from OneM2M_PermutationFunctions all; import from XSD all; @@ -112,68 +113,7 @@ module OneM2M_Testcases_CSE { v_ae1.start(f_CSE_GEN_CRE_001(e_absolute)); v_ae1.done; - } - - function f_CSE_GEN_CRE_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { - - // Local variables - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - // Test control - if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - //Force usage of Non-Hierarchical addressing method - v_addressingMethod := e_nonHierarchical; - v_primitiveScope := p_primitiveScope; - v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); - v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Container resource created using non-hierarchical addressing method"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating container resource using non-hierarchical addressing method"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_GEN_CRE_001 - + } } // end of group g_CSE_GEN_CRE_001 @@ -209,67 +149,6 @@ module OneM2M_Testcases_CSE { v_ae1.start(f_CSE_GEN_CRE_002(e_absolute)); v_ae1.done; } - - function f_CSE_GEN_CRE_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { - - // Local variables - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - // Test control - if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - //Force usage of Non-Hierarchical addressing method - v_addressingMethod := e_hierarchical; - v_primitiveScope := p_primitiveScope; - v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); - v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Container resource created using hierarchical addressing method"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating container resource using hierarchical addressing method"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_GEN_CRE_002 - } // end of group g_CSE_GEN_CRE_002 @@ -308,63 +187,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_GEN_RET_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { - - // Local variables - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - // Test control - if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - //Force usage of Non-Hierarchical addressing method - v_addressingMethod := e_nonHierarchical; - v_primitiveScope := p_primitiveScope; - - mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Container resource retrieved using non-hierarchical addressing method"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using non-hierarchical addressing method"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_GEN_RET_001 - } // end of group g_CSE_GEN_RET_001 @@ -400,62 +222,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_GEN_RET_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { - - // Local variables - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - // Test control - if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - //Force usage of Non-Hierarchical addressing method - v_addressingMethod := e_hierarchical; - v_primitiveScope := p_primitiveScope; - - mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Container resource retrieved using hierarchical addressing method"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hierarchical addressing method"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_GEN_RET_002 - } // end of group g_CSE_GEN_RET_002 } // end of group Retrieve @@ -492,69 +258,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_GEN_UPD_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { - - // Local variables - var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - // Test control - if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - //Force usage of Non-Hierarchical addressing method - v_addressingMethod := e_nonHierarchical; - v_primitiveScope := p_primitiveScope; - - v_updateRequest.primitiveContent.container.labels := {"MyLabel"}; - - v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest); - v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); - - mcaPort.send(m_request(v_updateRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Container resource updated using non-hierarchical addressing method"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating container resource using non-hierarchical addressing method"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_GEN_UPD_001 - } // end of group g_CSE_GEN_UPD_001 group g_CSE_GEN_UPD_002 { @@ -590,70 +293,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_GEN_UPD_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { - - // Local variables - var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - // Test control - if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - //Force usage of Non-Hierarchical addressing method - v_addressingMethod := e_hierarchical; - v_primitiveScope := p_primitiveScope; - - v_updateRequest.primitiveContent.container.labels := {"MyLabel"}; - - v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest); - v_updateRequest.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope); - - mcaPort.send(m_request(v_updateRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Container resource updated using hierarchical addressing method"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating container resource using hierarchical addressing method"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_GEN_UPD_002 - - } // end of group g_CSE_GEN_UPD_002 } // end of group Update @@ -692,67 +331,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_GEN_DEL_001(in PrimitiveScope p_primitiveScope) runs on AeSimu { - - // Local variables - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - // Test control - if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - //Force usage of Non-Hierarchical addressing method - v_addressingMethod := e_nonHierarchical; - v_primitiveScope := p_primitiveScope; - - v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Container resource deleted using non-hierarchical addressing method"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while deleting container resource using non-hierarchical addressing method"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_GEN_DEL_001 - - } // end of group g_CSE_GEN_DEL_001 group g_CSE_GEN_DEL_002 { @@ -788,67 +366,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_GEN_DEL_002(in PrimitiveScope p_primitiveScope) runs on AeSimu { - - // Local variables - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - // Test control - if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { - setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - //Force usage of Non-Hierarchical addressing method - v_addressingMethod := e_hierarchical; - v_primitiveScope := p_primitiveScope; - - v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Container resource deleted using hierarchical addressing method"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while deleting container resource using hierarchical addressing method"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_GEN_DEL_002 - - } // end of group g_CSE_GEN_DEL_002 } // end of group Delete @@ -1356,7 +873,7 @@ module OneM2M_Testcases_CSE { var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.labels := {"labels"}; - v_ae1.start(TC_CSE_REG_CRE_012(v_create)); + v_ae1.start(f_CSE_REG_CRE_012(v_create)); v_ae1.done; } @@ -1365,7 +882,7 @@ module OneM2M_Testcases_CSE { var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.appName := "AeAppName"; - v_ae1.start(TC_CSE_REG_CRE_012(v_create)); + v_ae1.start(f_CSE_REG_CRE_012(v_create)); v_ae1.done; } @@ -1374,7 +891,7 @@ module OneM2M_Testcases_CSE { var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.pointOfAccess := {PX_AE1_ADDRESS}; - v_ae1.start(TC_CSE_REG_CRE_012(v_create)); + v_ae1.start(f_CSE_REG_CRE_012(v_create)); v_ae1.done; } @@ -1383,61 +900,17 @@ module OneM2M_Testcases_CSE { var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); v_create.primitiveContent.aE.nodeLink := "http://127.0.0.1/"; - v_ae1.start(TC_CSE_REG_CRE_012(v_create)); + v_ae1.start(f_CSE_REG_CRE_012(v_create)); v_ae1.done; } - testcase TC_CSE_REG_CRE_012_AE_OR() runs on Tester system CseSystem { - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); - - v_create.primitiveContent.aE.ontologyRef := "MyOntologyRef"; - v_ae1.start(TC_CSE_REG_CRE_012(v_create)); - v_ae1.done; - } - - function TC_CSE_REG_CRE_012(in template RequestPrimitive p_createAe) runs on AeSimu { - - //Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var ResourceType v_resourceType := int2; //AE - - // Test control - - // Test component configuration - f_cf01Up(); - - //Test Body - - v_request := valueof(p_createAe); - 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 creation successfull."); - } - [] 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(); + testcase TC_CSE_REG_CRE_012_AE_OR() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit); - // Tear down - f_cf01Down(); + v_create.primitiveContent.aE.ontologyRef := "MyOntologyRef"; + v_ae1.start(f_CSE_REG_CRE_012(v_create)); + v_ae1.done; } } @@ -1500,60 +973,6 @@ module OneM2M_Testcases_CSE { } - function f_CSE_REG_CRE_013(template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var ResourceType v_resourceType := int16; //remoteCSE - - // Test control - - // Test component configuration - f_cf04Up(); - - // Test adapter configuration - - // Preamble - - // Test Body - v_request := f_getCreateRequestPrimitive(v_resourceType, p_requestPrimitive, -1); - - mccPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Accepted creation for resource type remoteCSE containing attribute " & p_optionalAttribute.name); - f_setResource(v_request.primitiveContent,int16); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - f_setResource(v_request.primitiveContent,int16); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Accepted creation for resource type remoteCSE without containing attribute " & p_optionalAttribute.name); - f_setResource(v_request.primitiveContent,int16); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Rejected creation of resource type remoteCSE containing attribute " & p_optionalAttribute.name); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); - } - } - - // Postamble - f_cse_postamble_deleteResourcesCSE(); - - // Tear down - f_cf04Down(); - - }//end f_CSE_REG_CRE_BV_013 - }// end group g_CSE_REG_CRE_BV_013 /** @@ -1634,51 +1053,6 @@ module OneM2M_Testcases_CSE { }//end TC_CSE_REG_CRE_017_RR - function f_CSE_REG_CRE_017(template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { - - //Local variables - var ResourceType v_resourceType := int2; - var RequestPrimitive v_request; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - - // Test Body - v_request := f_getCreateRequestPrimitive(int2, p_createRequestPrimitive, -1); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Request successfully rejected"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){ - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, AE has been registered"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } }//end g_CSE_REG_CRE_017 /** @@ -2242,53 +1616,6 @@ module OneM2M_Testcases_CSE { f_CSE_REG_CRE_026(v_utRequest,v_request,v_action); } - function f_CSE_REG_CRE_026(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in charstring p_action) runs on CseSimu { - - var ResponsePrimitive v_responsePrimitive; - - //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_cf04Up(); - - //send triggering primitive to SUT - f_sendUtPrimitive(p_utRequest,p_action); - - //Test behavior - tc_ac.start; - alt{ - - //receive MsgIn requestPrimitive - [] mccPortIn.receive(mw_request(p_request)) { - tc_ac.stop; - setverdict(pass, __SCOPE__&":INFO: Resource type remoteCSE created successfuly"); - - //set responseStatusCode back to SUT - v_responsePrimitive := valueof(m_responsePrimitive(int2001, "To_be_defined", omit)); - - //send back responsePrimitive - mccPortIn.send(m_response(v_responsePrimitive)); - } - [] mccPortIn.receive { - tc_ac.stop; - setverdict(fail, __SCOPE__&":INFO: Unexpected message received"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__&":INFO: No request received for creating resource type remoteCSE"); - } - } - - // Postamble - f_cse_postamble_deleteResourcesCSE(); - - // Tear down - f_cf04Down(); - - } } /*testcase TC_CSE_REG_CRE_029() runs on CseSimu system CseSystem { @@ -2476,36 +1803,6 @@ module OneM2M_Testcases_CSE { } - function f_CSE_REG_CRE_028(RequestPrimitive p_request, template PrimitiveContent p_contentResponse) runs on CseSimu{ //system CseSystem { - //Local variables - var ResourceType v_resourceType := int16; //remoteCSE - // Test control - - // Test component configuration - f_cf04Up(); - - // Test adapter configuration - - // Preamble - - - //Test Body - vc_remoteCseIndex := f_cse_registerRemoteCse(p_request, p_contentResponse); - - //Check if the resource has been deleted or not - if(f_cse_isResourcePresent(vc_remoteCseIndex)) { - setverdict(pass, __SCOPE__ & ":INFO: Resource created"); - } else { - setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); - } - - // Postamble - f_cse_postamble_deleteResourcesCSE(); - - // Tear down - f_cf04Down(); - - }//end TC_CSE_REG_CRE_028 }//end g_CSE_REG_CRE_028 } //end group Create @@ -2599,52 +1896,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_REG_RET_002(template PrimitiveContent p_contentResponse) runs on AeSimu { - //Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - mcaPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex)))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - } //end f_CSE_REG_RET_002 - } //end g_CSE_REG_RET_002 /** @@ -2787,52 +2038,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_REG_RET_004(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - //Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_createResource(int2, p_createRequestPrimitive, -1); - - mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - } //end f_CSE_REG_RET_004 - } //end g_CSE_REG_RET_004 /** @@ -3051,79 +2256,6 @@ module OneM2M_Testcases_CSE { v_cse1.done; } - function f_CSE_REG_RET_007(template RequestPrimitive p_createRequestPrimitive, template PrimitiveContent p_contentResponse) runs on CseSimu { - var MsgIn v_response; - var RequestPrimitive v_request; - var ResourceType v_resourceType := int16; //remoteCSE - var template PrimitiveContent v_contentResponse; - - // Test control - - // Test component configuration - f_cf04Up(); - - // Test adapter configuration - - // Preamble - if(PICS_IN_CSE){ - vc_remoteCseIndex := f_cse_registerRemoteCse(p_createRequestPrimitive); - mccPort.send(m_request(m_retrieve(f_getResourceAddress(vc_remoteCseIndex), f_getOriginator(vc_remoteCseIndex)))); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - } else if (PICS_MN_CSE){ - vc_remoteCseIndex := f_cse_registrationRemoteCse(p_createRequestPrimitive); - mccPort.send(m_request(m_retrieve(f_getResourceAddress(vc_remoteCseIndex), f_getOriginator(vc_remoteCseIndex)))); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Response OK for retrieving for attribute"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - } - - //Postamble - f_cse_postamble_deleteResourcesCSE(); - - // Tear down - f_cf04Down(); - } // f_CSE_REG_RET_007 - } //end g_CSE_REG_RET_007 /** @@ -3410,71 +2542,22 @@ module OneM2M_Testcases_CSE { v_updateRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest)); - v_cse1.done; - - } - - testcase TC_CSE_REG_UPD_002_RR() runs on Tester system CseSystem { - // Local variables - var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; - var CseSimu v_cse1 := CseSimu.create("CSE1") alive; - - v_updateRequest.primitiveContent.remoteCSE.requestReachability := true; - - v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest)); - v_cse1.done; - - } - - function f_CSE_REG_UPD_002(template RequestPrimitive p_requestPrimitive) runs on CseSimu { - //Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var ResourceType v_resourceType := int16; //remoteCSE - // Test control - - // Test component configuration - f_cf04Up(); - - // Test adapter configuration - - // Preamble - vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); - - // Test Body - v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive); - - mccPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int2004, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Accepted updation for resource type remoteCSE containing attribute "); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Accepted updation for resource type remoteCSE without containing attribute "); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Rejected updation of resource type remoteCSE containing attribute"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE"); - } - } + v_cse1.done; - // Postamble - f_cse_postamble_deleteResourcesCSE(); + } + + testcase TC_CSE_REG_UPD_002_RR() runs on Tester system CseSystem { + // Local variables + var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; - // Tear down - f_cf04Down(); + v_updateRequest.primitiveContent.remoteCSE.requestReachability := true; + + v_cse1.start(f_CSE_REG_UPD_002(v_updateRequest)); + v_cse1.done; - }//end f_CSE_REG_UPD_002 + } + } //end g_CSE_REG_UPD_002 /** @@ -3553,58 +2636,6 @@ module OneM2M_Testcases_CSE { } - function f_CSE_REG_UPD_003(template RequestPrimitive p_requestPrimitive, in AttributeList p_attribute) runs on CseSimu { - // Local variables - //Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var ResourceType v_resourceType := int16; //remoteCSE - var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; - var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request containing To set to " & PX_CSE1_ADDRESS & " and Content containing remoteCSE resource containing a valid attribute " & p_attribute[0]; // 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_cf04Up(); - - // Test adapter configuration - - // Preamble - vc_remoteCseIndex := f_cse_registrationRemoteCse(m_createRemoteCSEBase); - - //Send Trigger Message - v_utRequest.to_ := f_getResourceAddress(); - v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest, v_action); - - // Test Body - v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive); - - tc_ac.start; - alt { - [] mccPortIn.receive(mw_request(v_request)) { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Received request for updation for resource type remoteCSE containing attribute " & p_attribute[0]); - f_setResource(v_request.primitiveContent,int16); - } - [] mccPortIn.receive { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error: Did not receive update request for resource type remoteCSE"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type remoteCSE"); - } - } - - // Postamble - f_cse_postamble_deleteResourcesCSE(); - - // Tear down - f_cf04Down(); - - }//end f_CSE_REG_UPD_003 } //end g_CSE_REG_UPD_003 }// end group Update @@ -4352,188 +3383,7 @@ module OneM2M_Testcases_CSE { } } - - function f_CSE_DMR_CRE_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on AeSimu return ResponsePrimitive { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_parentIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpAuxIndex := -1; - var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"}; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - - if(ispresent(p_parentRequestPrimitive)) { - if(match(int23, p_parentRequestPrimitive.resourceType)){ - vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred - vc_ae2.done; - v_ae2Index := f_getResource(vc_ae2); - p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; - vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); - } - if(ischosen(p_parentRequestPrimitive.primitiveContent.group_)){ - - f_cse_preamble_registerAe(); - - } - v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex); - - - - } else {//Resource under CSEBase - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - - if(ischosen(p_requestPrimitive.primitiveContent.group_)){ - - f_cse_preamble_registerAe(); - - } - - } - - // Test Body - - if(match(int23, p_requestPrimitive.resourceType)){ - vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, v_poaList), -1)); // AE2 is registred - vc_ae2.done; - v_ae2Index := f_getResource(vc_ae2); - p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; - vc_ae2.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); - } - - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); - f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); - v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); - } - } - - f_checkAeSimuStatus(); - - //Check to see if the resource is present or not - if (f_isResourcePresent(v_resourceIndex)){ - setverdict(pass, __SCOPE__ & ":INFO: Resource created"); - } else { - setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - return vc_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_CRE_001 - - function f_CSE_DMR_CRE_001_cseSimu(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseSimu return ResponsePrimitive { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_parentIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae1Index := -1; - var integer v_acpAuxIndex := -1; - var PoaList v_poaList := {"http://" & PX_AE1_ADDRESS & "/"}; - - // Test control - - // Test component configuration - f_cf02UpCseSimuMaster(); - - // Test adapter configuration - - // Preamble - vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase); - - if(match(int23, p_resourceType)){ - vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered - vc_ae1.done; - v_ae1Index := f_getResource(vc_ae1); - p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)}; - vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler()); - } - - // Test Body - - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, vc_remoteCseIndex); - - mccPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); - f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); - v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, vc_remoteCseIndex); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); - } - } - - f_checkCseSimuStatus(); - - //Check to see if the resource is present or not - if (f_isResourcePresentCseSimu(v_resourceIndex)){ - setverdict(pass, __SCOPE__ & ":INFO: Resource created"); - } else { - setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); - } - - // Postamble - f_cse_postamble_deleteResourcesCSE(); - - // Tear down - f_cf02DownCseSimuMaster(); - - return vc_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_CRE_001_cseSimu - + } // end g_CSE_DMR_CRE_001 @@ -4914,75 +3764,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - - function f_CSE_DMR_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {//system CseSystem { MRO system keyword not supported on functions in Titan - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_acpAuxIndex := -1; - var integer v_aeIndex := -1; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - if (p_resourceType != int23) { - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) - } else { - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int60);//c_UDNDi); - } - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -); - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Access denied to create a resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating a resource without privileges"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Resource created without creation privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - f_checkAeSimuStatus(); - - //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ - setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); - } else { - setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_CRE_004 - }// end group g_CSE_DMR_CRE_004 group g_CSE_DMR_CRE_005 { @@ -5007,89 +3788,31 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_DMR_CRE_005_MBS() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_createRequest := m_createContainerBase; - var AttributeAux v_invalidAttribute; - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_createRequest.primitiveContent.container.maxByteSize := 0; - v_invalidAttribute := {name := "maxByteSize", value_ := "-1"}; - - v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); - v_ae1.done; - - } - - testcase TC_CSE_DMR_CRE_005_MIA() runs on Tester system CseSystem { - // Local variables - var template RequestPrimitive v_createRequest := m_createContainerBase; - var AttributeAux v_invalidAttribute; - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_createRequest.primitiveContent.container.maxInstanceAge := 0; - v_invalidAttribute := {name := "maxInstanceAge", value_ := "-1"}; - - v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); - v_ae1.done; - - } - - function f_CSE_DMR_CRE_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_invalidAttribute) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); - - mcaPort.send(m_request(v_request, {p_invalidAttribute})); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Creation rejected for resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute " & p_invalidAttribute.name); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Accepted creation of resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute" & p_invalidAttribute.name); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); - } - } - - f_checkAeSimuStatus(); - - //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ - setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); - } else { - setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); - } + var AttributeAux v_invalidAttribute; + var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_CRE_005 + v_createRequest.primitiveContent.container.maxByteSize := 0; + v_invalidAttribute := {name := "maxByteSize", value_ := "-1"}; + + v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); + v_ae1.done; + + } + + testcase TC_CSE_DMR_CRE_005_MIA() runs on Tester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createContainerBase; + var AttributeAux v_invalidAttribute; + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + v_createRequest.primitiveContent.container.maxInstanceAge := 0; + v_invalidAttribute := {name := "maxInstanceAge", value_ := "-1"}; + + v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); + v_ae1.done; + + } + }// end group g_CSE_DMR_CRE_005 group g_CSE_DMR_CRE_006 { @@ -5153,68 +3876,6 @@ module OneM2M_Testcases_CSE { } } - function f_CSE_DMR_CRE_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType))); - f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive); - v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Creation rejected of resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); - } - } - - f_checkAeSimuStatus(); - - //Check to see if the resource is present or not - if(f_isResourcePresent(v_resourceIndex)){ - setverdict(pass, __SCOPE__ & ":INFO: Resource created"); - } else { - setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - return vc_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_CRE_006 - }// end group g_CSE_DMR_CRE_006 group g_CSE_DMR_CRE_007 { @@ -5980,97 +4641,6 @@ module OneM2M_Testcases_CSE { } - function f_CSE_DMR_CRE_012(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeList p_optionalAttribute) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_containerIndex := -1; - var integer v_parentIndex := -1; - var integer v_acpAuxIndex := -1; - var integer v_ae2Index := -1; - const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs"; - var integer v_resourceIndex := -1; - var XSD.NCName v_myOptionalAttribute := p_optionalAttribute[0]; - - // Test control - if(v_myOptionalAttribute == c_accessControlPolicyIDs) { - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - } - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - if (v_myOptionalAttribute == c_accessControlPolicyIDs) { - v_acpAuxIndex := f_cse_preamble_createAcpAux();//c_CRUDNDi) - } - - v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - - if(p_resourceType == int4) { - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); - v_parentIndex := v_containerIndex; - } - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); - - if(v_myOptionalAttribute == "creator") { - mcaPort.send(m_request(v_request, {{v_myOptionalAttribute, omit}})); - } else { - mcaPort.send(m_request(v_request)); - } - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & v_myOptionalAttribute); - f_checkAttributesToBeSaved(p_resourceType, v_request, v_response.primitive.responsePrimitive); - v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " with incorrect attributes"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Rejected creation of resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); - } - } - - f_checkAeSimuStatus(); - - //Check to see if the resource is present or not - if(f_isResourcePresent(v_resourceIndex)) { - setverdict(pass, __SCOPE__ & ":INFO: Resource created"); - } else { - setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_CRE_012 - }// end group g_CSE_DMR_CRE_012 group g_CSE_DMR_CRE_013{ @@ -6284,62 +4854,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); - v_request.resultContent := int0;//Attributes - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, omit))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": No content provided with RC set to 0"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Content provided with RC set to 0"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_CRE_015 - } // end g_CSE_DMR_CRE_015 group g_CSE_DMR_CRE_016 { @@ -6414,67 +4928,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_CRE_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); - v_request.resultContent := int2;//Attributes - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response { - tc_ac.stop; - if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRI)) { - setverdict(pass, __SCOPE__ & ": Response returning correctly only the hierarchical address of the created resource"); - } else { - setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format"); - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 2"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - - }//end f_CSE_DMR_CRE_016 - } // end g_CSE_DMR_CRE_016 group g_CSE_DMR_CRE_017 { @@ -6528,87 +4981,27 @@ module OneM2M_Testcases_CSE { } testcase TC_CSE_DMR_CRE_017_PCH() runs on Tester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_contentResponse.resource := mw_contentPollingChannel_rc3; - - v_ae1.start(f_CSE_DMR_CRE_017(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel - v_ae1.done; - } - - testcase TC_CSE_DMR_CRE_017_SUB() runs on Tester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_contentResponse.resource := mw_contentSubscription_rc3; - - v_ae1.start(f_CSE_DMR_CRE_017(int23, m_createSubscriptionBase, v_contentResponse));//Subscription - v_ae1.done; - } - - function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); - v_request.resultContent := int3;//Attributes + Hierarchichal Address - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response { - tc_ac.stop; - if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.resource.uRI)) { - setverdict(pass, __SCOPE__ & ": Response returning correctly the hierarchical address of the created resource and resource representation"); - } else { - setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format"); - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 3"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); + // Local variables + var template PrimitiveContent v_contentResponse; + var AeSimu v_ae1 := AeSimu.create("AE1") alive; - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_CRE_017 - + v_contentResponse.resource := mw_contentPollingChannel_rc3; + + v_ae1.start(f_CSE_DMR_CRE_017(int15, m_createPollingChannelBase, v_contentResponse));//PollingChannel + v_ae1.done; + } + + testcase TC_CSE_DMR_CRE_017_SUB() runs on Tester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_contentResponse.resource := mw_contentSubscription_rc3; + + v_ae1.start(f_CSE_DMR_CRE_017(int23, m_createSubscriptionBase, v_contentResponse));//Subscription + v_ae1.done; + } + } // end g_CSE_DMR_CRE_017 @@ -6706,45 +5099,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_CRE_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_parentIndex := -1; - var integer v_containerIndex := -1; - - // Test control - - // Test component configuration - f_cf02Up(); - - // Test adapter configuration - - // Preamble - v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(p_resourceType == int4) { - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); - v_parentIndex := v_containerIndex; - } - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); - - mcaPort.send(m_request(v_request)); - - vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc)); - vc_cse1.done; - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf02Down(); - - }//end f_CSE_DMR_CRE_020 - } // end g_CSE_DMR_CRE_020 group g_CSE_DMR_CRE_021 { @@ -6943,64 +5297,8 @@ module OneM2M_Testcases_CSE { } } - function f_CSE_DMR_CRE_021(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu{ - - // Local variables - var MsgIn v_anncRequest; - var RequestPrimitive v_request; - var integer v_parentIndex := -1; - var integer v_containerIndex := -1; - var integer v_remoteCseIndex; - var integer v_aeAnncIndex; - var integer v_resourceIndex; - - // Test control - - // Test component configuration - f_cf02Up(); - - // Test adapter configuration - - // Preamble - - if (PX_IUT_IS_MN_CSE == true) { - vc_cse1.start(f_cse_registrationRemoteCse(m_createRemoteCSEBase)); - }else if (PX_IUT_IS_IN_CSE == true) { - vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSEBase)); - } - vc_cse1.done; - - vc_cse1.start(f_cse_resourceAnnouncementHandler()); - v_resourceIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit)); - vc_cse1.done; - - if(p_resourceType == int4) { - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); - v_parentIndex := v_containerIndex; - } - - // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); - - vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc)); - mcaPort.send(m_request(v_request)); - vc_cse1.done; - - vc_request.primitive.requestPrimitive := f_getRequestPrimitive(vc_cse1); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf02Down(); - - //return v_anncRequest.primitive.requestPrimitive; - - }//end f_CSE_DMR_CRE_021 - } // end g_CSE_DMR_CRE_021 - }//end group Create group Retrieve { @@ -7102,73 +5400,6 @@ module OneM2M_Testcases_CSE { } - function f_CSE_DMR_RET_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu return ResponsePrimitive { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var integer v_parentIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - if(p_resourceType == int4) { //ContentInstance - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - v_parentIndex := v_containerIndex; - }else{ - v_parentIndex := v_aeIndex; - } - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); - - // Test Body - mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - return v_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_RET_001 - } // end g_CSE_DMR_RET_001 group g_CSE_DMR_RET_002 { @@ -7294,67 +5525,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpAuxIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); - stop; - } - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, -);//c_CRUDNDi) - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//c_CRUDNDi; - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - f_cse_updateAcpAuxResource(int61); //c_CUDNDi - - // Test Body - mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_003 - } // end g_CSE_DMR_RET_003 group g_CSE_DMR_RET_004 { @@ -7435,63 +5605,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - mcaPort.send(m_request(m_retrieveAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_004 - } // end g_CSE_DMR_RET_004 group g_CSE_DMR_RET_005 { @@ -7565,70 +5678,14 @@ module OneM2M_Testcases_CSE { var AeSimu v_ae1 := AeSimu.create("AE1") alive; var template PrimitiveContent v_contentResponse; - v_contentResponse.subscription := m_contentSubscription_allOmit; - v_contentResponse.subscription.parentID := ?; - - v_ae1.start(f_CSE_DMR_RET_005(int23, m_createSubscriptionBase, v_contentResponse));//Subscription - v_ae1.done; - } - - - function f_CSE_DMR_RET_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_resourceIndex)))); + v_contentResponse.subscription := m_contentSubscription_allOmit; + v_contentResponse.subscription.parentID := ?; + + v_ae1.start(f_CSE_DMR_RET_005(int23, m_createSubscriptionBase, v_contentResponse));//Subscription + v_ae1.done; + } - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_005 - + } // end g_CSE_DMR_RET_005 group g_CSE_DMR_RET_006 { @@ -7716,63 +5773,6 @@ module OneM2M_Testcases_CSE { } - function f_CSE_DMR_RET_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , - {"pi", "ct"}, f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, not only requested attributes retrieved"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_006 - } // end g_CSE_DMR_RET_006 group g_CSE_DMR_RET_007 { @@ -7829,59 +5829,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - - function f_CSE_DMR_RET_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), - {"lbl"}, f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { - tc_ac.stop; - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_007 - } // end g_CSE_DMR_RET_007 group g_CSE_DMR_RET_008 { @@ -7938,59 +5885,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - - function f_CSE_DMR_RET_008(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), - {"lbl", "at"}, f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { - tc_ac.stop; - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_008 - } // end f_CSE_DMR_RET_008 group g_CSE_DMR_RET_009{ @@ -8303,123 +6197,36 @@ module OneM2M_Testcases_CSE { var template PrimitiveContent v_contentResponse; v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; - - v_ae1.start(f_CSE_DMR_RET_013(int16, m_createRemoteCSEBase, v_contentResponse));//RemoteCSE - v_ae1.done; - - } - - testcase TC_CSE_DMR_RET_013_SCH() runs on Tester system CseSystem { - // Local variables - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template PrimitiveContent v_contentResponse; - - v_contentResponse.schedule := mw_contentSchedule_rc1; - - v_ae1.start(f_CSE_DMR_RET_013(int18, m_createScheduleBase, v_contentResponse));//Schedule - v_ae1.done; - - } - - testcase TC_CSE_DMR_RET_013_SUB() runs on Tester system CseSystem { - // Local variables - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template PrimitiveContent v_contentResponse; - - v_contentResponse.subscription := mw_contentSubscription_rc1; - - v_ae1.start(f_CSE_DMR_RET_013(int23, m_createSubscriptionBase, v_contentResponse));//Subscription - v_ae1.done; - - } - - function f_CSE_DMR_RET_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpIndex := -1; - - // Test control - - // Test component configuration - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Up(true); - } else { - f_cf02Up(); - } - - // Test adapter configuration - - // Preamble - - if(p_resourceType != int2) { //ResourceType != AE - - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - } - - if(p_resourceType != int1) { - - v_acpIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID}); - } - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - - } else { //ResourceType = RemoteCSE - - vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - - } - - // Test Body - mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); + + v_ae1.start(f_CSE_DMR_RET_013(int16, m_createRemoteCSEBase, v_contentResponse));//RemoteCSE + v_ae1.done; - // Tear down - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Down(); - } else { - f_cf02Down(); - } + } + + testcase TC_CSE_DMR_RET_013_SCH() runs on Tester system CseSystem { + // Local variables + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := mw_contentSchedule_rc1; - }//end f_CSE_DMR_RET_013 - + v_ae1.start(f_CSE_DMR_RET_013(int18, m_createScheduleBase, v_contentResponse));//Schedule + v_ae1.done; + + } + + testcase TC_CSE_DMR_RET_013_SUB() runs on Tester system CseSystem { + // Local variables + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := mw_contentSubscription_rc1; + + v_ae1.start(f_CSE_DMR_RET_013(int23, m_createSubscriptionBase, v_contentResponse));//Subscription + v_ae1.done; + + } + } // end g_CSE_DMR_RET_013 group g_CSE_DMR_RET_014 { @@ -8479,90 +6286,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpAuxIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); - stop; - } - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - - if (p_resourceType!=int2){ - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi; - } - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, int61); - - p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - - - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - - if (p_resourceType==int2){ - v_aeIndex := v_resourceIndex; - } - - - } else { //ResourceType = RemoteCSE - - vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - - } - - // Test Body - mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_014 - } // end g_CSE_DMR_RET_014 group g_CSE_DMR_RET_015 { @@ -8655,89 +6378,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpAuxIndex := -1; - - // Test control - - // Test component configuration - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Up(true); - } else { - f_cf02Up(); - } - - // Test adapter configuration - - // Preamble - if(p_resourceType != int2) { //ResourceType != AE - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - - } else { - vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - } - - // Test Body - mcaPort.send(m_request(m_retrieveAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_aeIndex))));//from AE ID - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Down(); - } else { - f_cf02Down(); - } - - }//end f_CSE_DMR_RET_015 - } // end g_CSE_DMR_RET_015 group g_CSE_DMR_RET_016 { @@ -8830,88 +6470,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - - function f_CSE_DMR_RET_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpAuxIndex := -1; - - // Test control - - // Test component configuration - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Up(true); - } else { - f_cf02Up(); - } - - // Test adapter configuration - - // Preamble - if(p_resourceType != int2) { //ResourceType != AE - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - - }else{ - vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - } - - mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_aeIndex))));//from AE ID - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, not only requested attribute retrieved"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Down(); - } else { - f_cf02Down(); - } - - }//end f_CSE_DMR_RET_016 - } // end g_CSE_DMR_RET_016 group g_CSE_DMR_RET_017 { @@ -9087,91 +6645,8 @@ module OneM2M_Testcases_CSE { v_ae1.start(f_CSE_DMR_RET_017(int23, m_createSubscriptionBase, v_contentResponse));//Subscription v_ae1.done; - } - - - function f_CSE_DMR_RET_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpAuxIndex := -1; - - // Test control - - // Test component configuration - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Up(true); - } else { - f_cf02Up(); - } - - // Test adapter configuration - - // Preamble - if(p_resourceType != int2) { //ResourceType != AE - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - - }else{ - vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - } - - mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , - {"pi", "ct"}, f_getOriginator(v_aeIndex))));//from AE ID - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, not only requested attributes retrieved"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Down(); - } else { - f_cf02Down(); - } - - }//end f_CSE_DMR_RET_017 - + } + } // end g_CSE_DMR_RET_017 group g_CSE_DMR_RET_018 { @@ -9236,85 +6711,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - - function f_CSE_DMR_RET_018(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpAuxIndex := -1; - - // Test control - - // Test component configuration - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Up(true); - } else { - f_cf02Up(); - }; - - // Test adapter configuration - - // Preamble - if(p_resourceType != int2) { //ResourceType != AE - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - - }else{ - vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - } - - mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), - {"lbl"}, f_getOriginator(v_aeIndex))));//from AE ID - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Down(); - } else { - f_cf02Down(); - } - - }//end f_CSE_DMR_RET_018 - } // end g_CSE_DMR_RET_018 group g_CSE_DMR_RET_019 { @@ -9379,85 +6775,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - - function f_CSE_DMR_RET_019(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpAuxIndex := -1; - - // Test control - - // Test component configuration - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Up(true); - } else { - f_cf02Up(); - } - - // Test adapter configuration - - // Preamble - if(p_resourceType != int2) { //ResourceType != AE - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource - - }else{ - vc_cse1.start(f_cse_registerRemoteCse(p_requestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - } - - mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), - {"lbl", "at"}, f_getOriginator(v_aeIndex))));//from AE ID - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error : attribute was retrieved while it doesn't exist"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Down(); - } else { - f_cf02Down(); - } - - }//end f_CSE_DMR_RET_019 - } // end f_CSE_DMR_RET_019 group g_CSE_DMR_RET_020 { @@ -9487,57 +6804,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, ResultContent p_resultContent) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := p_resultContent; - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Request successfully rejected"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error, Result content set to " & int2str(enum2int(p_resultContent)) & " is impossible for a retrieve request "); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_020 - } // end g_CSE_DMR_RET_020 group g_CSE_DMR_RET_021 { @@ -9612,78 +6878,8 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_021(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - var integer v_resourceIndex := -1; - var integer v_childResourceIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(isvalue(p_childResourceType)) { - if(valueof(p_childResourceType) == int23) { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); - } else { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); - } - } - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - if(p_resourceType != int15) { - v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); - } - - // Test Body - v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int1;//Attributes - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_021 - } // end g_CSE_DMR_RET_021 - group g_CSE_DMR_RET_022 { /** @@ -9753,78 +6949,9 @@ module OneM2M_Testcases_CSE { v_contentResponse.subscription := mw_contentSubscription_rc4; v_ae1.start(f_CSE_DMR_RET_022(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase));//Subscription - v_ae1.done; - } - - function f_CSE_DMR_RET_022(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - var integer v_resourceIndex := -1; - var integer v_childResourceIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(isvalue(p_childResourceType)) { - if(valueof(p_childResourceType) == int23) { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); - } else { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); - } - } - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - if(p_resourceType != int15) { - v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); - } - - // Test Body - v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int4;//Attributes and child resources - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_022 - + v_ae1.done; + } + } // end g_CSE_DMR_RET_022 group g_CSE_DMR_RET_023 { @@ -9899,76 +7026,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_023(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - var integer v_resourceIndex := -1; - var integer v_childResourceIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(isvalue(p_childResourceType)) { - if(valueof(p_childResourceType) == int23) { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); - } else { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); - } - } - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - - if(p_resourceType != int15) { - v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); - } - - // Test Body - v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int5;//attributes and child resource references - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_023 - } // end g_CSE_DMR_RET_023 group g_CSE_DMR_RET_024 { @@ -10043,75 +7100,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_024(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - var integer v_resourceIndex := -1; - var integer v_childResourceIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(isvalue(p_childResourceType)) { - if(valueof(p_childResourceType) == int23) { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); - } else { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); - } - } - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - if(p_resourceType != int15) { - v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); - } - - // Test Body - v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int6;//Child resource references - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_024 - } // end g_CSE_DMR_RET_024 group g_CSE_DMR_RET_025 { @@ -10186,75 +7174,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_RET_025(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - var integer v_resourceIndex := -1; - var integer v_childResourceIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - if(isvalue(p_childResourceType)) { - if(valueof(p_childResourceType) == int23) { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); - } else { - f_cse_preamble_subscriptionVerification(v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); - } - } - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - if(p_resourceType != int15) { - v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); - } - - // Test Body - v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int6;//Child resource references - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_025 - } // end g_CSE_DMR_RET_025 }//end group Retrieve @@ -10502,67 +7421,6 @@ module OneM2M_Testcases_CSE { } - function f_CSE_DMR_UPD_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu return ResponsePrimitive{ - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - f_checkAeSimuStatus(); - - //Used to check that the resource has been updated - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - return vc_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_UPD_001 - } // end g_CSE_DMR_UPD_001 group g_CSE_DMR_UPD_002 { @@ -10776,76 +7634,17 @@ module OneM2M_Testcases_CSE { } } - v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); - - //Check that the resource has been udpated correctly - if(ischosen(v_primitiveContentRetrieveResource.subscription)) { - if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_1){ - setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") - } - } - } - } - - function f_CSE_DMR_UPD_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu return ResponsePrimitive { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } } - } - - //Used to check that the resource has been updated - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - return vc_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_UPD_002 - + } + } + } // end g_CSE_DMR_UPD_002 group g_CSE_DMR_UPD_003 { @@ -11120,65 +7919,6 @@ module OneM2M_Testcases_CSE { } } - function f_CSE_DMR_UPD_003(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu return ResponsePrimitive { - - // Local variables - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - //f_match2PrimitiveContent(vc_resourcesList[v_resourceIndex].resource, p_createRequestPrimitive.primitiveContent); TODO fix the match problem - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request, p_nullFields)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - return vc_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_UPD_003 - } // end g_CSE_DMR_UPD_003 group g_CSE_DMR_UPD_004 { @@ -11543,64 +8283,6 @@ module OneM2M_Testcases_CSE { } } - function f_CSE_DMR_UPD_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu return ResponsePrimitive { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request, p_nullFields)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - return vc_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_UPD_004 - } // end g_CSE_DMR_UPD_004 group g_CSE_DMR_UPD_005{ @@ -11699,60 +8381,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; } - function f_CSE_DMR_UPD_005(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_ae2Index := -1; - var integer v_resourceIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive , v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_UPD_005 - } // end g_CSE_DMR_UPD_005 group g_CSE_DMR_UPD_006{ @@ -11903,69 +8531,6 @@ module OneM2M_Testcases_CSE { } } - function f_CSE_DMR_UPD_006(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_acpAuxIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int59);//c_CRDNDi) - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Access denied to update attributes from resource type " & int2str(enum2int(p_resourceType))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Updating attributes from resource without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_UPD_006 - } // end g_CSE_DMR_UPD_006 @@ -12109,72 +8674,16 @@ module OneM2M_Testcases_CSE { v_ae1.done; if(getverdict == pass){ - v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); - //Check that the resource has NOT been udpated - if(ischosen(v_primitiveContentRetrieveResource.subscription_update_invalid)) { - if(v_primitiveContentRetrieveResource.subscription_update_invalid.creationTime == v_creationTime){ - setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") - } - } - } - } - - function f_CSE_DMR_UPD_007(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Operation not allowed. RO attribute from resource type " & int2str(enum2int(p_resourceType)) ); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Updating RO attribute from resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_UPD_007 - + v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1); + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.subscription_update_invalid)) { + if(v_primitiveContentRetrieveResource.subscription_update_invalid.creationTime == v_creationTime){ + setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") + } + } + } + } + } // end g_CSE_DMR_UPD_007 group g_CSE_DMR_UPD_008{ @@ -12339,62 +8848,6 @@ module OneM2M_Testcases_CSE { } } - function f_CSE_DMR_UPD_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request,p_nullFields)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Operation not allowed. Mandatory RW attribute from resource type " & int2str(enum2int(p_resourceType)) ); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Deleting a mandatory RW attribute from resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_UPD_008 - } // end g_CSE_DMR_UPD_008 group g_CSE_DMR_UPD_010{ @@ -13459,56 +9912,6 @@ module OneM2M_Testcases_CSE { } - function f_CSE_DMR_UPD_014(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_UPD_014 - } // end g_CSE_DMR_UPD_014 group g_CSE_DMR_UPD_015{ @@ -14662,97 +11065,6 @@ module OneM2M_Testcases_CSE { } } - function f_CSE_DMR_UPD_015(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, boolean p_secondAcp := false) runs on AeSimu { - //Local variables - var MsgIn v_response; - var AcpType v_acpi; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpAuxIndex := -1; - var integer v_acpIndex := -1; - - // Test control - - // Test component configuration - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Up(true); - } else { - f_cf02Up(); - } - - // Test adapter configuration - - // Preamble - if(p_resourceType != int2) { - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - - if(p_secondAcp) {//A second ACP is required - v_acpIndex := f_cse_createResource(int1, m_createAcpBase); - - v_acpi := {vc_resourcesList[v_acpIndex].resource.accessControlPolicy.resourceID}; - - p_updateRequestPrimitive := f_setAcpId(p_updateRequestPrimitive, v_acpi); - - } - - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource - } else { //ResourceType = RemoteCSE - vc_cse1.start(f_cse_registerRemoteCse(p_createRequestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - } - - //Test Body - vc_request.primitive.requestPrimitive := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(vc_request.primitive.requestPrimitive)); //CSEBase - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__, ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__, ": Error while updating optional attribute"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - //Postamble - f_cse_postamble_deleteResources(); - - // Tear down - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Down(); - } else { - f_cf02Down(); - } - - } // end function f_CSE_DMR_UPD_015 - } // end group g_CSE_DMR_UPD_017 group g_CSE_DMR_UPD_016 { @@ -15301,87 +11613,6 @@ module OneM2M_Testcases_CSE { } } - function f_CSE_DMR_UPD_016(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on AeSimu { - //Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var integer v_acpAuxIndex := -1; - - // Test control - - // Test component configuration - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Up(true); - } else { - f_cf02Up(); - } - - // Test adapter configuration - - // Preamble - if(p_resourceType != int2) { - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - if(p_resourceType != int1) { - - v_acpAuxIndex := f_cse_createAccessControlPolicyAux(-, -, -); - - p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {vc_resourcesList[v_acpAuxIndex].resource.accessControlPolicy.resourceID}); - } - - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource - } else { //ResourceType = RemoteCSE - vc_cse1.start(f_cse_registerRemoteCse(p_createRequestPrimitive)); - vc_cse1.done; - - v_resourceIndex := f_getRemoteCseResource(vc_cse1); - } - - //Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request)); //CSEBase - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__, ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(fail, __SCOPE__, ": Error while updating mandatory attribute"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); - - //Postamble - f_cse_postamble_deleteResources(); - - // Tear down - if (p_resourceType!=int16){ //ResourceType != RemoteCSE - f_cf01Down(); - } else { - f_cf02Down(); - } - - } //end function f_CSE_DMR_UPD_016 - } // end group g_CSE_DMR_UPD_016 }//end group Update @@ -15439,91 +11670,20 @@ module OneM2M_Testcases_CSE { }; testcase TC_CSE_DMR_DEL_001_SUB() runs on Tester system CseSystem { - // Local variables - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_ae1.start(f_CSE_DMR_DEL_001(int23, m_createSubscriptionBase));//Subscription - v_ae1.done; - }; - - testcase TC_CSE_DMR_DEL_001_CIN() runs on AeSimu system CseSystem { - // Local variables - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_ae1.start(f_CSE_DMR_DEL_001(int4, m_createContentInstanceBase));//ContentInstance - v_ae1.done; - }; - - function f_CSE_DMR_DEL_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_parentIndex := -1; - var integer v_containerIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - if(p_resourceType == int4) { - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - v_parentIndex := v_containerIndex; - }else{ - v_parentIndex := v_aeIndex; - } - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_parentIndex); - - // Test Body - v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Resource" & int2str(enum2int(p_resourceType)) & " deleted successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] 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_checkAeSimuStatus(); - - //Check to see if the resource is present or not - if (f_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){ - setverdict(pass, __SCOPE__ & ":INFO: Resource deleted"); - } else { - setverdict(fail, __SCOPE__ & ":ERROR: Resource not deleted"); - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - };//end f_CSE_DMR_DEL_001 + // Local variables + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_DMR_DEL_001(int23, m_createSubscriptionBase));//Subscription + v_ae1.done; + }; + + testcase TC_CSE_DMR_DEL_001_CIN() runs on AeSimu system CseSystem { + // Local variables + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_DMR_DEL_001(int4, m_createContentInstanceBase));//ContentInstance + v_ae1.done; + }; };//end of group g_CSE_DMR_DEL_001 @@ -15582,97 +11742,6 @@ module OneM2M_Testcases_CSE { }; - function f_CSE_DMR_DEL_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on AeSimu { - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var RequestPrimitive v_updateRequest; - var integer v_acpAuxIndex := -1; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63)); - var AccessControlRule v_accessControlRule_2; - var SetOfAcrs v_setOfArcs; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-,-);//c_CRDNDi); - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRUNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - //Update ACP Aux to remove DELETE operation rights to AE, keeping rights of SUPER USER to run postamble - v_accessControlRule_2 := valueof(m_createAcr({f_getResourceId(vc_resourcesList[v_aeIndex].resource)}, int55)); - - 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); - - //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}; - } else { - p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}); - } - - //Creation of resource - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_delete(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.from_ := f_getOriginator(v_aeIndex); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Access denied to delete the resource " & int2str(enum2int(p_resourceType))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error resource deleted without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); - } - } - - f_checkAeSimuStatus(); - - //Check if the resource has been deleted or not - if(f_isResourcePresent(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 - f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - };//end f_CSE_DMR_DEL_002 - };//end of group g_CSE_DMR_DEL_002 group g_CSE_DMR_DEL_003{ @@ -15788,62 +11857,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }; - - function f_CSE_DMR_DEL_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_createRequestPrimitiveChildResource) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_childResourceIndex := -1; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(true); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); - - f_cse_deleteResource(v_resourceIndex); - - // Test Body - mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Error while deleting non existing resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - };//end f_CSE_DMR_DEL_004 };//end of group g_CSE_DMR_DEL_004 group g_CSE_DMR_DEL_005{ @@ -18560,84 +14573,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_GMG_001_DEL - function f_CSE_GMG_001(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex_1 := -1; - var integer v_containerIndex_2 := -1; - var integer v_groupIndex := -1; - var integer i; - var ListOfURIs v_memberIDs; - var AcpType v_acpIDs; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; - v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); - } - else { - for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ - setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_001 - } // end group g_CSE_GMG_001 group g_CSE_GMG_002 { @@ -18677,72 +14612,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_GMG_002_DEL - function f_CSE_GMG_002(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex_1 := -1; - var integer v_containerIndex_2 := -1; - var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - var ListOfURIs v_membersAcpIds; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; - v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error operation successful while doesn't have privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_002 - } // end group g_CSE_GMG_002 group g_CSE_GMG_003 { @@ -18764,101 +14633,23 @@ module OneM2M_Testcases_CSE { var Labels v_labels_1:= {"VALUE_1"}; v_updateRequest.primitiveContent.container.labels := v_labels_1; - v_ae1.start(f_CSE_GMG_003(v_updateRequest, int2004)); - v_ae1.done; - }//end TC_CSE_GMG_003_UPD - - testcase TC_CSE_GMG_003_RET() runs on Tester system CseSystem { //Retrieve - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_ae1.start(f_CSE_GMG_003(m_retrieve("Temporary", "Temporary"), int2000)); - v_ae1.done; - }//end TC_CSE_GMG_003_RET - - testcase TC_CSE_GMG_003_DEL() runs on Tester system CseSystem { //Delete - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_ae1.start(f_CSE_GMG_003(m_delete("Temporary", "Temporary"), int2002)); - v_ae1.done; - }//end TC_CSE_GMG_003_DEL - - function f_CSE_GMG_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex_1 := -1; - var integer v_containerIndex_2 := -1; - var integer v_groupIndex := -1; - var integer i; - var ListOfURIs v_memberIDs; - var ListOfURIs v_membersAcpIds; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; - v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); - } - else { - for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ - setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); + v_ae1.start(f_CSE_GMG_003(v_updateRequest, int2004)); + v_ae1.done; + }//end TC_CSE_GMG_003_UPD - // Tear down - f_cf01Down(); + testcase TC_CSE_GMG_003_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_GMG_003(m_retrieve("Temporary", "Temporary"), int2000)); + v_ae1.done; + }//end TC_CSE_GMG_003_RET - } // end f_CSE_GMG_003 + testcase TC_CSE_GMG_003_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_GMG_003(m_delete("Temporary", "Temporary"), int2002)); + v_ae1.done; + }//end TC_CSE_GMG_003_DEL } // end group g_CSE_GMG_003 @@ -18899,72 +14690,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_GMG_004_DEL - function f_CSE_GMG_004(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex_1 := -1; - var integer v_containerIndex_2 := -1; - var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - var AcpType v_acpIDs; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; - v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error operation successful while doesn't have privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_004 - } // end group g_CSE_GMG_004 group g_CSE_GMG_005 { @@ -19013,85 +14738,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_GMG_005_DEL - function f_CSE_GMG_005(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { - //Local constants - const integer c_numberOfResponsePrimitive := 2; - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex_1 := -1; - var integer v_containerIndex_2 := -1; - var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - var integer i; - var template RequestPrimitive v_createContainerRequest_1 := m_createContainer_noResourceName; - var template RequestPrimitive v_createContainerRequest_2 := m_createContainer_noResourceName; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_containerIndex_1 := f_cse_createResource(int3, v_createContainerRequest_1, v_aeIndex); // AE child resource - v_containerIndex_2 := f_cse_createResource(int3, v_createContainerRequest_2, v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, -), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); - } - else{ - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ - setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); - } - else{ - for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); - } - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_005 - } // end group g_CSE_GMG_005 group g_CSE_GMG_006 { @@ -19140,96 +14786,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_GMG_006_DEL - /** - * @desc Check that IUT generates a request primitive for each resource in memberIDs with a relative address appended to it. - * - */ - function f_CSE_GMG_006(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { - //Local constants - const integer c_numberOfResponsePrimitive := 2; - - // Local variables - var MsgIn v_response; - var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex := -1; - var integer i; - var ListOfURIs v_memberIDs; - var ListOfURIs v_membersAcpIds; - var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1")); - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); - var template PrimitiveContent v_contentResponse; - - v_contentResponse.contentInstance := mw_contentContentInstanceBase; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, omit), -1); // AE2 is registred - v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource - v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)}; - v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds, -), -); - - v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName; - v_createRequest.from_ := f_getOriginator(v_groupIndex); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN - v_createRequest.requestIdentifier := v_createRequest.requestIdentifier & f_rnd(1, 1000000); - - // Test Body - - mcaPort.send(m_request(v_createRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); - } - else{ - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ - setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); - } - else{ - for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); - } - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_006 }//end group g_CSE_GMG_006 }// End of Basic_Operations @@ -21580,70 +17136,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_001_DEL - function f_CSE_SEC_ACP_001(template RequestPrimitive p_requestPrimitive) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest := valueof(m_createAcpBase); - var RequestPrimitive v_updateRequest; - var AccessControlRule v_accessControlRule_1; - var SetOfAcrs v_setOfArcs; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - v_accessControlRule_1 := valueof(m_createAcr({ f_getOriginator(v_aeIndex), PX_SUPER_AE_ID}, int63)); - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); - f_cse_updateResource(v_updateRequest); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := "UnknowOriginator"; - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); - } - } - - //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 - if(testcasename() == "TC_CSE_SEC_ACP_001_DEL") { - f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE - } - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } //end f_CSE_SEC_ACP_001 - } //end g_CSE_SEC_ACP_001 group g_CSE_SEC_ACP_002{ @@ -21683,79 +17175,8 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_002_DEL - function f_CSE_SEC_ACP_002(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex1 := -1; - var integer v_acpIndex2 := -1; - var RequestPrimitive v_createRequest := valueof(m_createAcp(f_getResourceAddress(-1), omit)); - var RequestPrimitive v_updateRequest; - var AccessControlRule v_accessControlRule_1; - var SetOfAcrs v_setOfArcs; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource), f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}, -); - - v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int3)); // c_CR - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest); - f_cse_updateResource(v_updateRequest); - - v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int60)); // c_UDNDi - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex2, v_updateRequest); - f_cse_updateResource(v_updateRequest); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); - } - } - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } //end f_CSE_SEC_ACP_002 - } //end g_CSE_SEC_ACP_002 - - group g_CSE_SEC_ACP_003 { /** @@ -21788,88 +17209,11 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_SEC_ACP_003_DEL() runs on Tester system CseSystem { //Delete var AeSimu v_ae1 := AeSimu.create("AE1") alive; - - v_ae1.start(f_CSE_SEC_ACP_003(m_delete("Temporary", "Temporary"), int2002)); - v_ae1.done; - }//end TC_CSE_SEC_ACP_003_04 - - function f_CSE_SEC_ACP_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - var AccessControlRule v_accessControlRule_1; - var RequestPrimitive v_updateRequest; - var SetOfAcrs v_setOfArcs; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_createRequest := valueof(m_createAcp(f_getResourceAddress(), -, {"testDomain"})); - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := "testDomain"; - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); - } - } - - //Postamble - v_accessControlRule_1 := valueof(m_createAcr({"all"}, int63)); - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); - v_updateRequest.from_ := "testDomain"; - mcaPort.send(m_request(v_updateRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - log(__SCOPE__ & ":INFO: Attribute of resource type ACP updated successfully"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - log(__SCOPE__ & ":INFO: Error while updating resource type ACP"); - } - [] tc_ac.timeout { - log(__SCOPE__ & ":INFO: No answer while updating resource type ACP"); - } - } - - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end f_CSE_SEC_ACP_003 - + + v_ae1.start(f_CSE_SEC_ACP_003(m_delete("Temporary", "Temporary"), int2002)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_003_04 + }//end g_CSE_SEC_ACP_003 group g_CSE_SEC_ACP_004 { @@ -21909,60 +17253,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_004_DEL - function f_CSE_SEC_ACP_004(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := "UnknowOriginator"; - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); - } - } - - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end f_CSE_SEC_ACP_004 - }//end g_CSE_SEC_ACP_004 group g_CSE_SEC_ACP_005 { @@ -22002,65 +17292,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_005_DEL - function f_CSE_SEC_ACP_005(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var charstring v_currentTime; - var RequestPrimitive v_createRequest; - var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_currentTime := fx_generateTimestamp(); - v_accessControlRule.accessControlContexts_list := {{{"* * * * * " & f_getYear(v_currentTime)}, omit, omit}}; - v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); - } - } - - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end f_CSE_SEC_ACP_005 - }//end g_CSE_SEC_ACP_005 group g_CSE_SEC_ACP_006 { @@ -22100,63 +17331,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_006_DEL - function f_CSE_SEC_ACP_006(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{"* * * * * 3000"}, omit, omit}}; - v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation"); - } - } - - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end f_CSE_SEC_ACP_006 - }//end g_CSE_SEC_ACP_006 group g_CSE_SEC_ACP_007 { @@ -22196,64 +17370,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_007_DEL - function f_CSE_SEC_ACP_007(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, omit, { choice := { countryCode := {"ES"}}}}}; - v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - //TODO How to indicate the location of the Originator (AE1)? - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); - } - } - - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end f_CSE_SEC_ACP_007 - }//end g_CSE_SEC_ACP_007 group g_CSE_SEC_ACP_008 { @@ -22293,64 +17409,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_008_DEL - function f_CSE_SEC_ACP_008(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, omit, { choice := { countryCode := {"ES"}}}}}; - v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - //TODO How to indicate the location of the Originator (AE1)? - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation"); - } - } - - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end f_CSE_SEC_ACP_008 - }//end g_CSE_SEC_ACP_008 group g_CSE_SEC_ACP_009 { @@ -22390,63 +17448,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_009_DEL - function f_CSE_SEC_ACP_009(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, {{f_getIpv4Address(PX_AE1_ADDRESS)}, omit}, omit}}; - v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); - } - } - - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end f_CSE_SEC_ACP_009 - }//end g_CSE_SEC_ACP_009 group g_CSE_SEC_ACP_010 { @@ -22486,66 +17487,8 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_010_DEL - function f_CSE_SEC_ACP_010(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_accessControlRule.accessControlContexts_list := {{{}, {{f_getIpv4Address(PX_AE2_ADDRESS)}, omit}, omit}}; - v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation"); - } - } - - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end f_CSE_SEC_ACP_010 - }//end g_CSE_SEC_ACP_010 - group g_CSE_SEC_ACP_011 { /** @@ -22583,56 +17526,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_011_DEL - function f_CSE_SEC_ACP_011(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Successful operation on resource type int3 (Container)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while operation on resource type int3 (Container)"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); - } - } - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } //end f_CSE_SEC_ACP_011 - } //end g_CSE_SEC_ACP_011 group g_CSE_SEC_ACP_012 { @@ -22672,72 +17565,6 @@ module OneM2M_Testcases_CSE { v_ae1.done; }//end TC_CSE_SEC_ACP_012_DEL - function f_CSE_SEC_ACP_012(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_acor) runs on AeSimu { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_request; - var RequestPrimitive v_createRequest := valueof(m_createAcpBase); - var RequestPrimitive v_updateRequest; - var AccessControlRule v_accessControlRule_1, v_accessControlRule_2; - var SetOfAcrs v_setOfArcs; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_AE_ID}, int63)); - v_accessControlRule_2 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, p_acor)); - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); - f_cse_updateResource(v_updateRequest); - - // Test Body - v_request := f_getCreateRequestPrimitive(int3, p_requestPrimitive, v_containerIndex); - - mcaPort.send(m_request(valueof(v_request))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); - } - } - - //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 - if(testcasename() == "TC_CSE_SEC_ACP_012_DEL") { - f_cse_deleteResource(v_aeIndex, m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator()));//Use of PX_SUPER_AE_ID to remove AE - } - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } //end f_CSE_SEC_ACP_012 - } //end g_CSE_SEC_ACP_012 }// end of Basic_Operations -- GitLab