diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index f48f7c3246e800cd11bdbb651cb156d6e7c905e9..16bba959789a136d27d27c884598f5478abf1e4c 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -326,311 +326,314 @@ module OneM2M_Functions { // Disconnect disconnect(self:infoPort, p_tester:infoPort); } - - /** - * @desc Getting last responsePrimitive saved in a component - * @param p_tester Given component - */ - function f_getResponsePrimitive(in Tester p_component) runs on Tester return ResponsePrimitive { - var ResponsePrimitive v_response; + + group getFunctions { + /** + * @desc Getting last responsePrimitive saved in a component + * @param p_tester Given component + */ + function f_getResponsePrimitive(in Tester p_component) runs on Tester return ResponsePrimitive { + var ResponsePrimitive v_response; + + f_connectInfoPort(p_component); + + p_component.start(f_sendResponsePrimitive()); + alt { + []infoPort.receive(mw_responsePrimitiveforInfoPort) -> value v_response { + } + } + + p_component.done; + f_disconnectInfoPort(p_component); + + return v_response; + + } - f_connectInfoPort(p_component); + /** + * @desc Getting last requestPrimitive saved in an AeSimu component + * @param p_tester Given component + */ + function f_getRequestPrimitive(in Tester p_component) runs on Tester return RequestPrimitive { + var RequestPrimitive v_request; + + f_connectInfoPort(p_component); - p_component.start(f_sendResponsePrimitive()); - alt { - []infoPort.receive(mw_responsePrimitiveforInfoPort) -> value v_response { + p_component.start(f_sendRequestPrimitive()); + alt { + []infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request { + } } + + p_component.done; + f_disconnectInfoPort(p_component); + + return v_request; + } - - p_component.done; - f_disconnectInfoPort(p_component); + + /** + * @desc Getting primitiveContent retrieved in an AeSimu component + * @param p_tester AeSimu component + */ + function f_getPrimitiveContentRetrievedResource(in AeSimu p_ae) runs on Tester return PrimitiveContent { + var PrimitiveContent v_primitiveContent; - return v_response; + f_connectInfoPort(p_ae); + + p_ae.start(f_sendPrimitiveContentRetrievedResource()); + alt { + []infoPort.receive(mw_primitiveContent) -> value v_primitiveContent { + } + } + + p_ae.done; + f_disconnectInfoPort(p_ae); + + return v_primitiveContent; + + } + + /** + * @desc Getting remoteCSE resource from a CseSimu component + * @param p_tester CseSimu component + */ + function f_getRemoteCseResource(in CseSimu p_cse) runs on Tester return integer { + var MyResource v_resource; + var integer v_resourceIndex := -1; - } + f_connectInfoPort(p_cse); - /** - * @desc Getting last requestPrimitive saved in an AeSimu component - * @param p_tester Given component - */ - function f_getRequestPrimitive(in Tester p_component) runs on Tester return RequestPrimitive { - var RequestPrimitive v_request; - - f_connectInfoPort(p_component); - - p_component.start(f_sendRequestPrimitive()); - alt { - []infoPort.receive(mw_requestPrimitiveforInfoPort) -> value v_request { + p_cse.start(f_sendRemoteCseResource()); + alt { + []infoPort.receive(mw_resource) -> value v_resource { + v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false); + } } + + p_cse.done; + f_disconnectInfoPort(p_cse); + + return v_resourceIndex; + } - - p_component.done; - f_disconnectInfoPort(p_component); + + /** + * @desc Getting a specific resource from an AeSimu component + * @param p_tester AeSimu component + * @param p_resourceIndex Index of resource to be retrieved + */ + function f_getResource(in Tester p_component, in integer p_resourceIndex := -1) runs on Tester return integer { + var MyResource v_resource; + var integer v_resourceIndex := -1; + + f_connectInfoPort(p_component); - return v_request; + p_component.start(f_sendResource(p_resourceIndex)); + alt { + []infoPort.receive(mw_resource) -> value v_resource { + v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false); + } + } - } - - /** - * @desc Getting last resourceIndex saved in the vc_resourcesList - * @param p_tester Given component - */ - function f_getLatestResourceIndex(in Tester p_component) runs on Tester return integer { - var integer v_resourceIndex; + p_component.done; + f_disconnectInfoPort(p_component); + + return v_resourceIndex; + + } - f_connectInfoPort(p_component); + /** + * @desc Getting the latest resource from an AeSimu component + * @param p_tester AeSimu component + * @param p_resourceIndex Index of resource to be retrieved + */ + function f_getLatestResource(in Tester p_component) runs on Tester return integer { + var MyResource v_resource; + var integer v_resourceIndex := -1; + + f_connectInfoPort(p_component); - p_component.start(f_sendLatestResourceIndex()); - alt { - []infoPort.receive(mw_resourceIndex) -> value v_resourceIndex{ + p_component.start(f_sendLatestResource()); + alt { + []infoPort.receive(mw_resource) -> value v_resource { + v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false); + } } + + p_component.done; + f_disconnectInfoPort(p_component); + + return v_resourceIndex; + } + + /** + * @desc Getting last resourceIndex saved in the vc_resourcesList + * @param p_tester Given component + */ + function f_getLatestResourceIndex(in Tester p_component) runs on Tester return integer { + var integer v_resourceIndex; - p_component.done; - f_disconnectInfoPort(p_component); + f_connectInfoPort(p_component); - return v_resourceIndex; + p_component.start(f_sendLatestResourceIndex()); + alt { + []infoPort.receive(mw_resourceIndex) -> value v_resourceIndex{ + } + } - } - - /** - * @desc Getting last local resourceIndex saved in the vc_localResourcesList - * @param p_tester Given component - */ - function f_getLatestLocalResourceIndex(in CseSimu p_component) runs on Tester return integer { - var integer v_resourceIndex; + p_component.done; + f_disconnectInfoPort(p_component); - f_connectInfoPort(p_component); + return v_resourceIndex; - p_component.start(f_sendLatestLocalResourceIndex()); - alt { - []infoPort.receive(mw_resourceIndex) -> value v_resourceIndex{ - } } + + /** + * @desc Getting last local resourceIndex saved in the vc_localResourcesList + * @param p_tester Given component + */ + function f_getLatestLocalResourceIndex(in CseSimu p_component) runs on Tester return integer { + var integer v_resourceIndex; - p_component.done; - f_disconnectInfoPort(p_component); + f_connectInfoPort(p_component); - return v_resourceIndex; + p_component.start(f_sendLatestLocalResourceIndex()); + alt { + []infoPort.receive(mw_resourceIndex) -> value v_resourceIndex{ + } + } - } + p_component.done; + f_disconnectInfoPort(p_component); + + return v_resourceIndex; + + } - /** - * @desc Getting the address of the last local resource saved in the vc_localResourcesList - * @param p_tester Given component - */ - function f_getLatestLocalResourceAddress(in CseSimu p_component, AddressingMethod p_addressingMethod := PX_ADDRESSING_METHOD, PrimitiveScope p_primitiveScope := PX_PRIMITIVE_SCOPE) runs on Tester return XSD.ID { - var XSD.ID v_localResourceAddress; + /** + * @desc Getting the address of the last local resource saved in the vc_localResourcesList + * @param p_tester Given component + */ + function f_getLatestLocalResourceAddress(in CseSimu p_component, AddressingMethod p_addressingMethod := PX_ADDRESSING_METHOD, PrimitiveScope p_primitiveScope := PX_PRIMITIVE_SCOPE) runs on Tester return XSD.ID { + var XSD.ID v_localResourceAddress; - f_connectInfoPort(p_component); + f_connectInfoPort(p_component); - p_component.start(f_sendLatestLocalResourceAddress(p_addressingMethod, p_primitiveScope)); - alt { - []infoPort.receive(mw_resourceAddress) -> value v_localResourceAddress{ + p_component.start(f_sendLatestLocalResourceAddress(p_addressingMethod, p_primitiveScope)); + alt { + []infoPort.receive(mw_resourceAddress) -> value v_localResourceAddress{ + } } - } - p_component.done; - f_disconnectInfoPort(p_component); + p_component.done; + f_disconnectInfoPort(p_component); - return v_localResourceAddress; + return v_localResourceAddress; - } - - /** - * @desc Getting primitiveContent retrieved in an AeSimu component - * @param p_tester AeSimu component - */ - function f_getPrimitiveContentRetrievedResource(in AeSimu p_ae) runs on Tester return PrimitiveContent { - var PrimitiveContent v_primitiveContent; - - f_connectInfoPort(p_ae); - - p_ae.start(f_sendPrimitiveContentRetrievedResource()); - alt { - []infoPort.receive(mw_primitiveContent) -> value v_primitiveContent { - } } - - p_ae.done; - f_disconnectInfoPort(p_ae); - - return v_primitiveContent; - - } + }//end of group getFunctions - /** - * @desc Getting remoteCSE resource from a CseSimu component - * @param p_tester CseSimu component - */ - function f_getRemoteCseResource(in CseSimu p_cse) runs on Tester return integer { - var MyResource v_resource; - var integer v_resourceIndex := -1; - - f_connectInfoPort(p_cse); + group sendFunctions { - p_cse.start(f_sendRemoteCseResource()); - alt { - []infoPort.receive(mw_resource) -> value v_resource { - v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false); - } - } + /** + * @desc Sending of last responsePrimitive (vc_response) through InfoPort + */ + function f_sendResponsePrimitive() runs on Tester { + + infoPort.send(vc_response.primitive.responsePrimitive); + + } - p_cse.done; - f_disconnectInfoPort(p_cse); - - return v_resourceIndex; - - } + /** + * @desc Sending of last requestPrimitive (vc_request) through InfoPort + */ + function f_sendRequestPrimitive() runs on Tester { - /** - * @desc Getting the latest resource from an AeSimu component - * @param p_tester AeSimu component - * @param p_resourceIndex Index of resource to be retrieved - */ - function f_getLatestResource(in Tester p_component) runs on Tester return integer { - var MyResource v_resource; - var integer v_resourceIndex := -1; + infoPort.send(vc_request.primitive.requestPrimitive); - f_connectInfoPort(p_component); - - p_component.start(f_sendLatestResource()); - alt { - []infoPort.receive(mw_resource) -> value v_resource { - v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false); - } - } - - p_component.done; - f_disconnectInfoPort(p_component); + } - return v_resourceIndex; + /** + * @desc Sending of last primitiveContent retrieved (vc_primitiveContentRetrievedResource) through InfoPort + */ + function f_sendPrimitiveContentRetrievedResource() runs on AeSimu { + + infoPort.send(vc_primitiveContentRetrievedResource); + + } - } + /** + * @desc Sending of remoteCSE resource through InfoPort + */ + function f_sendRemoteCseResource() runs on CseSimu { - /** - * @desc Getting a specific resource from an AeSimu component - * @param p_tester AeSimu component - * @param p_resourceIndex Index of resource to be retrieved - */ - function f_getResource(in Tester p_component, in integer p_resourceIndex := -1) runs on Tester return integer { - var MyResource v_resource; - var integer v_resourceIndex := -1; + infoPort.send(vc_resourcesList[vc_remoteCseIndex]); + + } + + /** + * @desc Sending of Ae resource through InfoPort + */ + function f_sendAeResource() runs on AeSimu { - f_connectInfoPort(p_component); - - p_component.start(f_sendResource(p_resourceIndex)); - alt { - []infoPort.receive(mw_resource) -> value v_resource { - v_resourceIndex := f_setResource(v_resource.resource, v_resource.resourceType, v_resource.parentIndex, false); - } - } - - p_component.done; - f_disconnectInfoPort(p_component); + infoPort.send(vc_resourcesList[vc_aeAuxIndex]); + + } - return v_resourceIndex; + /** + * @desc Sending of a specific resource through InfoPort + * @param p_resourceIndex Index of resource to be sent + */ + function f_sendResource(in integer p_resourceIndex) runs on Tester { + + if(p_resourceIndex == -1) { + infoPort.send(vc_resourcesList[vc_aeAuxIndex]); //TODO To send Ae or RemoteCSE depending on the component type + } else { + infoPort.send(vc_resourcesList[p_resourceIndex]); + } + + } - } + /** + * @desc Sending of the latest resource through InfoPort + */ + function f_sendLatestResource() runs on Tester { - /** - * @desc Sending of last responsePrimitive (vc_response) through InfoPort - */ - function f_sendResponsePrimitive() runs on Tester { - - infoPort.send(vc_response.primitive.responsePrimitive); + infoPort.send(vc_resourcesList[lengthof(vc_resourcesList)-1]); - } - - /** - * @desc Sending of last requestPrimitive (vc_request) through InfoPort - */ - function f_sendRequestPrimitive() runs on Tester { - - infoPort.send(vc_request.primitive.requestPrimitive); - - } - - /** - * @desc Sending of last resourceIndex saved in the vc_resourcesList - */ - function f_sendLatestResourceIndex() runs on Tester { + } + + /** + * @desc Sending of last resourceIndex saved in the vc_resourcesList + */ + function f_sendLatestResourceIndex() runs on Tester { - infoPort.send(lengthof(vc_resourcesList)-1); + infoPort.send(lengthof(vc_resourcesList)-1); - } + } - /** - * @desc Sending the address of the last resource saved in the vc_resourcesList - */ - function f_sendLatestLocalResourceAddress(AddressingMethod p_addressingMethod := PX_ADDRESSING_METHOD, PrimitiveScope p_primitiveScope := PX_PRIMITIVE_SCOPE) runs on CseSimu { + /** + * @desc Sending the address of the last resource saved in the vc_resourcesList + */ + function f_sendLatestLocalResourceAddress(AddressingMethod p_addressingMethod := PX_ADDRESSING_METHOD, PrimitiveScope p_primitiveScope := PX_PRIMITIVE_SCOPE) runs on CseSimu { - infoPort.send(f_getLocalResourceAddress(lengthof(vc_localResourcesList)-1, p_addressingMethod, p_primitiveScope)); + infoPort.send(f_getLocalResourceAddress(lengthof(vc_localResourcesList)-1, p_addressingMethod, p_primitiveScope)); - } + } - /** - * @desc Sending of last local resourceIndex saved in the vc_localResourcesList - */ - function f_sendLatestLocalResourceIndex() runs on CseSimu { + /** + * @desc Sending of last local resourceIndex saved in the vc_localResourcesList + */ + function f_sendLatestLocalResourceIndex() runs on CseSimu { - infoPort.send(lengthof(vc_localResourcesList)-1); - - } - - /** - * @desc Sending of last primitiveContent retrieved (vc_primitiveContentRetrievedResource) through InfoPort - */ - function f_sendPrimitiveContentRetrievedResource() runs on AeSimu { - - infoPort.send(vc_primitiveContentRetrievedResource); - - } - - /** - * @desc Sending of remoteCSE resource through InfoPort - */ - function f_sendRemoteCseResource() runs on CseSimu { - - infoPort.send(vc_resourcesList[vc_remoteCseIndex]); - - } - - /** - * @desc Sending of Ae resource through InfoPort - */ - function f_sendAeResource() runs on AeSimu { - - infoPort.send(vc_resourcesList[vc_aeAuxIndex]); - - } + infoPort.send(lengthof(vc_localResourcesList)-1); - /** - * @desc Sending of a specific resource through InfoPort - * @param p_resourceIndex Index of resource to be sent - */ - function f_sendResource(in integer p_resourceIndex) runs on Tester { - - if(p_resourceIndex == -1) { - if(vc_testSystemRole == e_ae) { - infoPort.send(vc_resourcesList[vc_aeAuxIndex]); - }else if(vc_testSystemRole == e_cse) { - infoPort.send(vc_resourcesList[vc_remoteCseIndex]); - } - } else { - infoPort.send(vc_resourcesList[p_resourceIndex]); - } - } + } + + }//end of group sendFunctions - /** - * @desc Sending of the latest resource through InfoPort - */ - function f_sendLatestResource() runs on Tester { - - infoPort.send(vc_resourcesList[lengthof(vc_resourcesList)-1]); - - } - }// end of group InfoPortCommunication group CseFunctions { @@ -828,7 +831,7 @@ module OneM2M_Functions { vc_ae2.start(f_cse_createAccessControlPolicyAux("SubscriptionVerificationAcp",{"all"}, int63)); f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); - vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred + vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getCompletePoA("HTTP", PX_AE2_ADDRESS, "")}), -1)); // AE2 is registred f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); p_ae2Index := f_getResource(vc_ae2); @@ -990,7 +993,7 @@ module OneM2M_Functions { if(not(v_deregistrationPerformed)) { if(vc_localRemoteCseIndex != -1) { //1) Deregistration by Registrar (Test System) - v_childResourceRefs := f_cse_retrieveChildResourceRefs({int16}, -, f_getOriginator(vc_remoteCseIndex)); + v_childResourceRefs := f_cse_retrieveChildResourceRefs_cseSimu({int16}, -, f_getOriginator(vc_remoteCseIndex)); if(v_childResourceRefs != {}) { //v_request := valueof(m_delete(v_childResourceRefs[0], f_getOriginator(vc_remoteCseIndex))); @@ -1091,108 +1094,22 @@ module OneM2M_Functions { return v_resourceIndex; } - - /** - * @desc Message exchange for the creation of a resource - * @param p_resourceType Resource type of the resource to be created - * @param p_requestPrimitive UPDATE request primitive to be used - * @param p_resourceIndex Internal resource index which indicates the resource to be updated - * @verdict - */ - function f_cse_createResourceHandler(template RequestPrimitive p_request := mw_create) runs on CseSimu return integer{ - var integer v_localResourceIndex; - - //Activate defaults when running on a PTC - f_cse_activateDefaults_cse1(); - - tc_ac.start; - alt { - [] mccPortIn.receive(mw_request(p_request)) -> value vc_request { - tc_ac.stop; - v_localResourceIndex := f_processCreateRequestPrimitive(vc_request.primitive.requestPrimitive); - mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No creation for resource received"); - } - } - - f_checkCseSimuStatus(); - - return v_localResourceIndex; - - }// end f_cse_createResourceHandler - /** - * @desc Creation of a local resource + * @desc Creation of a resource * @param p_resourceType Resource type of the resource to be created * @param p_requestPrimitive CREATE request primitive for the resource to be created * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created * @return Internal resource index of the created resource * @verdict */ - function f_cse_createLocalResource(template UtTriggerPrimitive p_utRequest := m_utCreate, charstring p_action) runs on CseSimu return integer { + function f_cse_createResource_withAcpAux(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu return integer { - var ResponsePrimitive v_response; - var integer v_parentResourceIndex := -1; - var integer v_localResourceIndex := -1; - var PrimitiveContent v_localResource; + var RequestPrimitive v_request; + var integer v_resourceIndex := -1; //Activate defaults when running on a PTC - f_cse_activateDefaults_cse1(); - - f_sendUtPrimitive(p_utRequest, p_action); - - tc_ac.start; - alt { - [] mccPortIn.receive(mw_request(mw_create(?,?))) -> value vc_request { - tc_ac.stop; - - v_parentResourceIndex := f_getResourceIndex(vc_request.primitive.requestPrimitive.to_); - if(v_parentResourceIndex == -1) { - log(__SCOPE__&": ERROR: Target resource not found"); - v_response := valueof(m_responsePrimitive(int4004,vc_request.primitive.requestPrimitive.requestIdentifier)); - - } else { - v_localResource := f_generateLocalResource(vc_request.primitive.requestPrimitive.primitiveContent, v_parentResourceIndex, vc_request.primitive.requestPrimitive.resourceType); - v_localResourceIndex := f_setLocalResource(v_localResource, vc_request.primitive.requestPrimitive.resourceType, v_parentResourceIndex); - - v_response := valueof(m_responsePrimitive(int2001,vc_request.primitive.requestPrimitive.requestIdentifier)); - v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource; - } - v_response.from_ := PX_CSE1_ID; - v_response.to_ := vc_request.primitive.requestPrimitive.from_; - mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response))); - } - - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: Container create request not received"); - stop; - } - } - - f_checkCseSimuStatus(); - - return v_localResourceIndex; - - } - - /** - * @desc Creation of a resource - * @param p_resourceType Resource type of the resource to be created - * @param p_requestPrimitive CREATE request primitive for the resource to be created - * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created - * @return Internal resource index of the created resource - * @verdict - */ - function f_cse_createResource_withAcpAux(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu return integer { - - var RequestPrimitive v_request; - var integer v_resourceIndex := -1; - - //Activate defaults when running on a PTC - f_cse_activateDefaults_ae(); + f_cse_activateDefaults_ae(); if(vc_acpAuxIndex != -1) { p_requestPrimitive := f_setAcpId(p_requestPrimitive, {vc_resourcesList[vc_acpAuxIndex].resource.accessControlPolicy.resourceID}); @@ -1203,37 +1120,6 @@ module OneM2M_Functions { return v_resourceIndex; } - - /** - * @desc Message exchange for the update of an announced resource - * @param p_requestPrimitive UPDATE request primitive to be used - * @verdict - */ - function f_cse_updateAnnouncedResource(in RequestPrimitive p_requestPrimitive) runs on CseSimu { - - mccPort.send(f_getMsgOutPrimitive(m_request(p_requestPrimitive))); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__&":INFO: Attribute of announced resource updated successfuly"); - } - [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(inconc, __SCOPE__&":INFO: Error while updating announced resource"); - } - [] mccPort.receive{ - tc_ac.stop; - setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No answer while updating announced resource"); - } - } - - f_checkCseSimuStatus(); - - }// end f_cse_updateAnnouncedResource /** * @desc Creation of the auxiliar ACP resource @@ -1316,42 +1202,7 @@ module OneM2M_Functions { f_checkAeSimuStatus(); - }// end f_cse_updateResource - - /** - * @desc Message exchange for the update of a resource - * @param p_resourceIndex Internal resource index which indicates the resource to be updated - * @param p_requestPrimitive UPDATE request primitive to be used - * @verdict - */ - function f_cse_updateResourceHandler(integer p_resourceIndex, template RequestPrimitive p_request := mw_update) runs on CseSimu { - - var integer v_targetResourceIndex := -1; - - //Activate defaults when running on a PTC - f_cse_activateDefaults_cse1(); - - tc_ac.start; - alt { - [] mccPortIn.receive(mw_request(p_request)) -> value vc_request { - tc_ac.stop; - - v_targetResourceIndex := f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive); - if(v_targetResourceIndex == p_resourceIndex) { - setverdict(pass, __SCOPE__&":INFO: Resource updated successfuly"); - } else { - setverdict(inconc, __SCOPE__&":INFO: Unexpected resource update"); - } - mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No answer while updating resource"); - } - } - - f_checkCseSimuStatus(); - - }// end f_cse_updateResourceHandler + }// end f_cse_updateResource /** * @desc Message exchange for the retrieval of a resource @@ -1381,41 +1232,7 @@ module OneM2M_Functions { return vc_response.primitive.responsePrimitive.primitiveContent; - }// end f_cse_retrieveResource - - /** - * @desc Message exchange for the retrieve of a resource - * @param p_resourceIndex Internal resource index which indicates the expected resource to be retrieved - * @param p_requestPrimitive RETRIEVE request primitive to be used - * @verdict - */ - function f_cse_retrieveResourceHandler(integer p_resourceIndex, template RequestPrimitive p_request := mw_retrieve(?)) runs on CseSimu { - - var integer v_targetResourceIndex := -1; - - //Activate defaults when running on a PTC - f_cse_activateDefaults_cse1(); - - tc_ac.start; - alt { - [] mccPortIn.receive(mw_request(p_request)) -> value vc_request { - tc_ac.stop; - v_targetResourceIndex := f_processRetrieveRequestPrimitive(vc_request.primitive.requestPrimitive); - if(v_targetResourceIndex == p_resourceIndex) { - setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly"); - } else { - setverdict(inconc, __SCOPE__&":INFO: Unexpected resource retrieval"); - } - mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource"); - } - } - - f_checkCseSimuStatus(); - - }// end f_cse_retrieveResourceHandler + }// end f_cse_retrieveResource /** * @desc Message exchange for the deletion of a resource @@ -1454,40 +1271,6 @@ module OneM2M_Functions { f_checkAeSimuStatus(); }// end f_cse_deleteResource - - /** - * @desc Message exchange for the delete of a resource - * @param p_resourceIndex Internal resource index which indicates the expected resource to be deleted - * @param p_requestPrimitive DELETE request primitive to be used - * @verdict - */ - function f_cse_deleteResourceHandler(integer p_resourceIndex, template RequestPrimitive p_request := mw_delete) runs on CseSimu { - - var integer v_targetResourceIndex := -1; - - //Activate defaults when running on a PTC - f_cse_activateDefaults_cse1(); - - tc_ac.start; - alt { - [] mccPortIn.receive(mw_request(p_request)) -> value vc_request { - tc_ac.stop; - v_targetResourceIndex := f_processDeleteRequestPrimitive(vc_request.primitive.requestPrimitive); - if(v_targetResourceIndex == p_resourceIndex) { - setverdict(pass, __SCOPE__&":INFO: Resource deleted successfuly"); - } else { - setverdict(inconc, __SCOPE__&":INFO: Unexpected resource retrieval"); - } - mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource"); - } - } - - f_checkCseSimuStatus(); - - }// end f_cse_deleteResourceHandler /** * @desc Message exchange for any operation on a resource @@ -1524,7 +1307,7 @@ module OneM2M_Functions { * @param p_resourceIndex Resource index of the resource to be checked * @return boolean */ - function f_isResourcePresent (integer p_resourceIndex) runs on AeSimu return boolean { + function f_cse_isResourcePresent (integer p_resourceIndex) runs on AeSimu return boolean { //Check to see if the resource is present or not mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))))); @@ -1559,7 +1342,7 @@ module OneM2M_Functions { * @param p_resourceName Resource name (Hierarchical method is used) of the resource to be checked * @return boolean */ - function f_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on AeSimu return boolean { + function f_cse_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on AeSimu return boolean { log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource"); @@ -1620,170 +1403,73 @@ module OneM2M_Functions { f_checkAeSimuStatus(); } + + /** + * @desc Sending of a request primitive over mca port + * @param p_resourceType Resource type of the resource to be created + * @param p_requestPrimitive CREATE request primitive for the resource to be created + * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created + * @return Internal resource index of the created resource + * @verdict + */ + function f_cse_sendCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu { + + var RequestPrimitive v_request; + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex); - + mcaPort.send(f_getMsgOutPrimitive(m_request(v_request))); + + } + /** - * @desc Checking of returned important attributed (in response) in order to save properly internally - * @param p_resourceType ResourceType of the resource to be checked - * @param p_request Request primitive used for the CRU operation - * @param p_response Response primitive received + * @desc Sending of a request primitive over mca port + * @param p_resourceType Resource type of the resource to be created + * @param p_requestPrimitive UPDATE request primitive for the resource to be created + * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created + * @return Internal resource index of the created resource * @verdict */ - //Note: This function will be continously extended with necessary attributes/resources - function f_checkAttributesToBeSaved (ResourceType p_resourceType, RequestPrimitive p_request, inout ResponsePrimitive p_response) { - select (p_resourceType) { - case (int1) { - if(isvalue(p_response.primitiveContent.accessControlPolicy) and - not(ispresent(p_response.primitiveContent.accessControlPolicy.resourceName))) { - p_response.primitiveContent.accessControlPolicy.resourceName := p_request.primitiveContent.accessControlPolicy.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.accessControlPolicy.resourceName) - } + function f_cse_sendUpdateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestUpdatePrimitive := m_update, integer p_targetIndex := -1) runs on AeSimu { + + var RequestPrimitive v_request; + + v_request := f_getUpdateRequestPrimitive(p_resourceType, p_targetIndex, p_requestUpdatePrimitive); + + mcaPort.send(f_getMsgOutPrimitive(m_request(v_request))); + + } + + /** + * @desc Receive response from the IUT + * @param p_requestPrimtive Received request primitive + */ + function f_cse_receiveResponse(in RequestPrimitive p_request) runs on AeSimu { + + var integer v_resourceIndex := -1; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_ae(); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Response received with positive response status code"); + f_checkAttributesToBeSaved(p_request.resourceType, p_request, vc_response.primitive.responsePrimitive); + v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_request.resourceType); } - case (int2) { - if(isvalue(p_response.primitiveContent.aE) and - not(ispresent(p_response.primitiveContent.aE.resourceName))) { - p_response.primitiveContent.aE.resourceName := p_request.primitiveContent.aE.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.aE.resourceName) - } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Response received with negative response status code"); } - case (int3) { - if(isvalue(p_response.primitiveContent.container) and - not(ispresent(p_response.primitiveContent.container.resourceName))) { - p_response.primitiveContent.container.resourceName := p_request.primitiveContent.container.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.container.resourceName) - } - } - case (int4) { - if(isvalue(p_response.primitiveContent.contentInstance) and - not(ispresent(p_response.primitiveContent.contentInstance.resourceName))) { - p_response.primitiveContent.contentInstance.resourceName := p_request.primitiveContent.contentInstance.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.contentInstance.resourceName) - } - } - case (int15) { - if (isvalue(p_response.primitiveContent.pollingChannel) and - not(ispresent(p_response.primitiveContent.pollingChannel.resourceName))) { - p_response.primitiveContent.pollingChannel.resourceName := p_request.primitiveContent.pollingChannel.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.pollingChannel.resourceName) - } - } - case (int16) { - if (isvalue(p_response.primitiveContent.remoteCSE) and - not(ispresent(p_response.primitiveContent.remoteCSE.resourceName))) { - p_response.primitiveContent.remoteCSE.resourceName := p_request.primitiveContent.remoteCSE.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.remoteCSE.resourceName) - } - } - case (int18) { - if (isvalue(p_response.primitiveContent.schedule) and - not(ispresent(p_response.primitiveContent.schedule.resourceName))) { - p_response.primitiveContent.schedule.resourceName := p_request.primitiveContent.schedule.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.schedule.resourceName) - } - } - case (int23) { - if (isvalue(p_response.primitiveContent.subscription) and - not(ispresent(p_response.primitiveContent.subscription.resourceName))) { - p_response.primitiveContent.subscription.resourceName := p_request.primitiveContent.subscription.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.subscription.resourceName) - } - } - case (int9) { - if (isvalue(p_response.primitiveContent.group_) and - not(ispresent(p_response.primitiveContent.group_.resourceName))) { - p_response.primitiveContent.group_.resourceName := p_request.primitiveContent.group_.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.group_.resourceName) - } - } - case (int29) { - if (isvalue(p_response.primitiveContent.timeSeries) and - not(ispresent(p_response.primitiveContent.timeSeries.resourceName))) { - p_response.primitiveContent.timeSeries.resourceName := p_request.primitiveContent.timeSeries.resourceName; - log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.timeSeries.resourceName) - } - } - case else { - log(__SCOPE__&":WARNING: Resource Type "&int2str(enum2int(p_resourceType))&" not implemented"); + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No response received"); } - } - - // TODO test that if the resource name is returned is the same resource name as used in the create message - } - - /** - * @desc Comparison of two URIs - * @param p_expectedURIIndex Resource index of the resource for which its URI is to be compared - * @param p_receivedURI URI to be compared - * @param p_response Response primitive received - * @verdict - */ - function f_compareURIs(in integer p_expectedURIIndex, in XSD.ID p_receivedURI) runs on Tester return boolean{ - // Local variables - var boolean v_matchResult := false; - var AddressingMethod v_addressingMethod; - var PrimitiveScope v_primitiveScope; - - if (f_isNonHierarchical(p_receivedURI)) { - v_addressingMethod := e_nonHierarchical; - } else if (f_isHierarchical(p_receivedURI)) { - v_addressingMethod := e_hierarchical; - } - if (f_isScopeCseRelative(p_receivedURI)) { - v_primitiveScope := e_cseRelative; - } - if (f_isScopeSpRelative(p_receivedURI)) { - v_primitiveScope := e_spRelative; - } - if (f_isScopeAbsolute(p_receivedURI)) { - v_primitiveScope := e_absolute; - } - - if(match(f_getResourceAddress(p_expectedURIIndex, v_addressingMethod, v_primitiveScope), p_receivedURI)) { - v_matchResult := true; - } else { - v_matchResult := false; - } - - return v_matchResult; - - } //end f_compareURIs - - /** - * @desc Sending of a request primitive over mca port - * @param p_resourceType Resource type of the resource to be created - * @param p_requestPrimitive CREATE request primitive for the resource to be created - * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created - * @return Internal resource index of the created resource - * @verdict - */ - function f_cse_sendCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu { - - var RequestPrimitive v_request; - - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex); - - mcaPort.send(f_getMsgOutPrimitive(m_request(v_request))); - - } - - /** - * @desc Sending of a request primitive over mca port - * @param p_resourceType Resource type of the resource to be created - * @param p_requestPrimitive UPDATE request primitive for the resource to be created - * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created - * @return Internal resource index of the created resource - * @verdict - */ - function f_cse_sendUpdateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_requestUpdatePrimitive := m_update, integer p_targetIndex := -1) runs on AeSimu { - - var RequestPrimitive v_request; + } - v_request := f_getUpdateRequestPrimitive(p_resourceType, p_targetIndex, p_requestUpdatePrimitive); - - mcaPort.send(f_getMsgOutPrimitive(m_request(v_request))); - } + function f_cse_generateMissingDataPoint(in integer p_timeSeriesResourceIndex) runs on AeSimu{ @@ -2136,66 +1822,6 @@ module OneM2M_Functions { } //end f_cse_notifyProcedure_notify - /** - * @desc Checking of notification primitiveContent - * @param p_requestPrimitive Received Notification request - * @param p_primitiveContent Expected primitiveContent in the notification - * @verdict - */ - function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on Tester return boolean{ - // Local variables - var boolean v_matchResult := false; - var integer i; - var integer v_numberOfAggregatedNotification; - - if (ischosen(p_primitiveContent.aE)){ - log("Representation contains AE resource representation"); - if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE)) { - v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE, p_primitiveContent.aE); - log("Expected primitiveContent"); - } - else if(isvalue(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.aE)) { - v_matchResult :=match(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE); - } - else if (isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list)) { - v_matchResult := true; - v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list); - for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){ - if(isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE)) { - if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE, p_primitiveContent.aE))){ - v_matchResult := false; - } - } - } - if (i == 0){ - v_matchResult := false; - } - } - - } - - if (ischosen(p_primitiveContent.container)){ - if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container)) { - v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container, p_primitiveContent.container) - } - else if(isvalue(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.container)) { - v_matchResult := match(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.container, p_primitiveContent.container) - } - } - - if (ischosen(p_primitiveContent.timeSeries)){ - if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.timeSeries)) { - v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.timeSeries, p_primitiveContent.timeSeries) - } - else if(isvalue(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.timeSeries)) { - v_matchResult := match(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.timeSeries, p_primitiveContent.timeSeries) - } - } - - return v_matchResult; - - } //end f_check_notificationContent - }// end of group NotificationFunctions group AnnouncementFunctions { @@ -2407,96 +2033,316 @@ module OneM2M_Functions { }//end of group AnnouncementFunctions /** - * @desc Message exchange for the retrieval of a child resource refs - * @param p_resourceType ResourceType of children of the resource to be retrieved - * @param p_resourceIndex Resource index of the resource to be retrieved - * @return PrimitiveContent parameter of the RETRIEVE response + * @desc Message exchange for the creation of a resource + * @param p_resourceType Resource type of the resource to be created + * @param p_requestPrimitive UPDATE request primitive to be used + * @param p_resourceIndex Internal resource index which indicates the resource to be updated * @verdict */ - function f_cse_retrieveChildResourceRefs(template(omit) ResourceTypeList p_resourceTypeList := omit, integer p_targetResourceIndex := -1, XSD.ID p_originator := PX_SUPER_CSE_ID) runs on CseSimu return URIList { - var RequestPrimitive v_requestPrimitive; - var URIList v_uriList := {}; - v_requestPrimitive := valueof(m_retrieveChildResourceRefs(f_getResourceAddress(p_targetResourceIndex), p_originator)); - mccPort.send(f_getMsgOutPrimitive(m_request(v_requestPrimitive))); - tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly"); - v_uriList := vc_response.primitive.responsePrimitive.primitiveContent.uRIList; - } - [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(inconc, __SCOPE__&":INFO: Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource"); - } - } + function f_cse_createResourceHandler(template RequestPrimitive p_request := mw_create) runs on CseSimu return integer{ - return v_uriList; + var integer v_localResourceIndex; - }// end f_cse_retrieveResourceChildren + //Activate defaults when running on a PTC + f_cse_activateDefaults_cse1(); - /** - * @desc Check that a resource is present in the IUT (resourceId is known) - * @param p_resourceIndex Resource index - * @return boolean - */ - function f_cse_isResourcePresent (integer p_resourceIndex) runs on CseSimu return boolean { - - //Check to see if the resource is present or not - mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))))); tc_ac.start; alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource present: " & f_getResourceAddress(p_resourceIndex)); - return true; - } - [] mccPort.receive(mw_response(mw_responsePrimitive(int4004))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource: " & f_getResourceAddress(p_resourceIndex) & " not found"); - return false; - } - [] mccPort.receive(mw_response(mw_responsePrimitive(?, -))) { + [] mccPortIn.receive(mw_request(p_request)) -> value vc_request { tc_ac.stop; - setverdict(inconc, testcasename() & ": Wrong response status code in the response"); - return false; + v_localResourceIndex := f_processCreateRequestPrimitive(vc_request.primitive.requestPrimitive); + mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - return false; + setverdict(inconc, __SCOPE__&":INFO: No creation for resource received"); } } - return false; - } - + + f_checkCseSimuStatus(); + + return v_localResourceIndex; + + }// end f_cse_createResourceHandler + /** - * @desc Check that a resource is not present in the IUT (resourceId is NOT known) - * @param p_parentIndex Index of the parent resource of the resource to be checked - * @param p_resourceName Resource name (Hierarchical method is used) of the resource to be checked - * @return boolean + * @desc Creation of a local resource + * @param p_resourceType Resource type of the resource to be created + * @param p_requestPrimitive CREATE request primitive for the resource to be created + * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created + * @return Internal resource index of the created resource + * @verdict */ - function f_cse_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on CseSimu return boolean { + function f_cse_createLocalResource(template UtTriggerPrimitive p_utRequest := m_utCreate, charstring p_action) runs on CseSimu return integer { - log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource"); + var ResponsePrimitive v_response; + var integer v_parentResourceIndex := -1; + var integer v_localResourceIndex := -1; + var PrimitiveContent v_localResource; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_cse1(); + + f_sendUtPrimitive(p_utRequest, p_action); - //Check to see if the resource has NOT been created - mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex))))); tc_ac.start; - alt { - [] mccPort.receive(mw_response(mw_responsePrimitive(int4004))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource not present"); - return true; - } - [] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource " & p_resourceName & " present"); - return false; - } - [] mccPort.receive(mw_response(mw_responsePrimitive(?))) { + alt { + [] mccPortIn.receive(mw_request(mw_create(?,?))) -> value vc_request { + tc_ac.stop; + + v_parentResourceIndex := f_getResourceIndex(vc_request.primitive.requestPrimitive.to_); + if(v_parentResourceIndex == -1) { + log(__SCOPE__&": ERROR: Target resource not found"); + v_response := valueof(m_responsePrimitive(int4004,vc_request.primitive.requestPrimitive.requestIdentifier)); + + } else { + v_localResource := f_generateLocalResource(vc_request.primitive.requestPrimitive.primitiveContent, v_parentResourceIndex, vc_request.primitive.requestPrimitive.resourceType); + v_localResourceIndex := f_setLocalResource(v_localResource, vc_request.primitive.requestPrimitive.resourceType, v_parentResourceIndex); + + v_response := valueof(m_responsePrimitive(int2001,vc_request.primitive.requestPrimitive.requestIdentifier)); + v_response.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource; + } + v_response.from_ := PX_CSE1_ID; + v_response.to_ := vc_request.primitive.requestPrimitive.from_; + mccPortIn.send(f_getMsgOutPrimitive(m_response(v_response))); + } + + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: Container create request not received"); + stop; + } + } + + f_checkCseSimuStatus(); + + return v_localResourceIndex; + + } + + /** + * @desc Message exchange for the update of an announced resource + * @param p_requestPrimitive UPDATE request primitive to be used + * @verdict + */ + function f_cse_updateAnnouncedResource(in RequestPrimitive p_requestPrimitive) runs on CseSimu { + + mccPort.send(f_getMsgOutPrimitive(m_request(p_requestPrimitive))); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Attribute of announced resource updated successfuly"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Error while updating announced resource"); + } + [] mccPort.receive{ + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while updating announced resource"); + } + } + + f_checkCseSimuStatus(); + + }// end f_cse_updateAnnouncedResource + + /** + * @desc Message exchange for the update of a resource + * @param p_resourceIndex Internal resource index which indicates the resource to be updated + * @param p_requestPrimitive UPDATE request primitive to be used + * @verdict + */ + function f_cse_updateResourceHandler(integer p_resourceIndex, template RequestPrimitive p_request := mw_update) runs on CseSimu { + + var integer v_targetResourceIndex := -1; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_cse1(); + + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(p_request)) -> value vc_request { + tc_ac.stop; + + v_targetResourceIndex := f_processUpdateRequestPrimitive(vc_request.primitive.requestPrimitive); + if(v_targetResourceIndex == p_resourceIndex) { + setverdict(pass, __SCOPE__&":INFO: Resource updated successfuly"); + } else { + setverdict(inconc, __SCOPE__&":INFO: Unexpected resource update"); + } + mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while updating resource"); + } + } + + f_checkCseSimuStatus(); + + }// end f_cse_updateResourceHandler + + /** + * @desc Message exchange for the retrieve of a resource + * @param p_resourceIndex Internal resource index which indicates the expected resource to be retrieved + * @param p_requestPrimitive RETRIEVE request primitive to be used + * @verdict + */ + function f_cse_retrieveResourceHandler(integer p_resourceIndex, template RequestPrimitive p_request := mw_retrieve(?)) runs on CseSimu { + + var integer v_targetResourceIndex := -1; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_cse1(); + + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(p_request)) -> value vc_request { + tc_ac.stop; + v_targetResourceIndex := f_processRetrieveRequestPrimitive(vc_request.primitive.requestPrimitive); + if(v_targetResourceIndex == p_resourceIndex) { + setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly"); + } else { + setverdict(inconc, __SCOPE__&":INFO: Unexpected resource retrieval"); + } + mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource"); + } + } + + f_checkCseSimuStatus(); + + }// end f_cse_retrieveResourceHandler + + /** + * @desc Message exchange for the retrieval of a child resource refs + * @param p_resourceType ResourceType of children of the resource to be retrieved + * @param p_resourceIndex Resource index of the resource to be retrieved + * @return PrimitiveContent parameter of the RETRIEVE response + * @verdict + */ + function f_cse_retrieveChildResourceRefs_cseSimu(template(omit) ResourceTypeList p_resourceTypeList := omit, integer p_targetResourceIndex := -1, XSD.ID p_originator := PX_SUPER_CSE_ID) runs on CseSimu return URIList { + var RequestPrimitive v_requestPrimitive; + var URIList v_uriList := {}; + v_requestPrimitive := valueof(m_retrieveChildResourceRefs(f_getResourceAddress(p_targetResourceIndex), p_originator)); + mccPort.send(f_getMsgOutPrimitive(m_request(v_requestPrimitive))); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly"); + v_uriList := vc_response.primitive.responsePrimitive.primitiveContent.uRIList; + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource"); + } + } + + return v_uriList; + + }// end f_cse_retrieveResourceChildren + + /** + * @desc Message exchange for the delete of a resource + * @param p_resourceIndex Internal resource index which indicates the expected resource to be deleted + * @param p_requestPrimitive DELETE request primitive to be used + * @verdict + */ + function f_cse_deleteResourceHandler(integer p_resourceIndex, template RequestPrimitive p_request := mw_delete) runs on CseSimu { + + var integer v_targetResourceIndex := -1; + + //Activate defaults when running on a PTC + f_cse_activateDefaults_cse1(); + + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(p_request)) -> value vc_request { + tc_ac.stop; + v_targetResourceIndex := f_processDeleteRequestPrimitive(vc_request.primitive.requestPrimitive); + if(v_targetResourceIndex == p_resourceIndex) { + setverdict(pass, __SCOPE__&":INFO: Resource deleted successfuly"); + } else { + setverdict(inconc, __SCOPE__&":INFO: Unexpected resource retrieval"); + } + mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource"); + } + } + + f_checkCseSimuStatus(); + + }// end f_cse_deleteResourceHandler + + /** + * @desc Check that a resource is present in the IUT (resourceId is known) + * @param p_resourceIndex Resource index + * @return boolean + */ + function f_cse_isResourcePresent_cseSimu (integer p_resourceIndex) runs on CseSimu return boolean { + + //Check to see if the resource is present or not + mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex))))); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource present: " & f_getResourceAddress(p_resourceIndex)); + return true; + } + [] mccPort.receive(mw_response(mw_responsePrimitive(int4004))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource: " & f_getResourceAddress(p_resourceIndex) & " not found"); + return false; + } + [] mccPort.receive(mw_response(mw_responsePrimitive(?, -))) { + tc_ac.stop; + setverdict(inconc, testcasename() & ": Wrong response status code in the response"); + return false; + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + return false; + } + } + return false; + } + + /** + * @desc Check that a resource is not present in the IUT (resourceId is NOT known) + * @param p_parentIndex Index of the parent resource of the resource to be checked + * @param p_resourceName Resource name (Hierarchical method is used) of the resource to be checked + * @return boolean + */ + function f_cse_isResourceNotPresent_cseSimu (integer p_parentIndex, XSD.String p_resourceName) runs on CseSimu return boolean { + + log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource"); + + //Check to see if the resource has NOT been created + mccPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex))))); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitive(int4004))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource not present"); + return true; + } + [] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource " & p_resourceName & " present"); + return false; + } + [] mccPort.receive(mw_response(mw_responsePrimitive(?))) { tc_ac.stop; setverdict(inconc, testcasename() & ": Wrong response status code in the response"); return false; @@ -2615,7 +2461,7 @@ module OneM2M_Functions { * @desc Receive a request from the CSE IUT to the Test System (simulating a CSE) * @param p_requestPrimitive Expected CREATE request primitive */ - function f_cse_receiveCreateRequest(in template RequestPrimitive p_requestPrimitive := ?) runs on CseSimu { + function f_cse_receiveCreateRequest_cseSimu(in template RequestPrimitive p_requestPrimitive := ?) runs on CseSimu { var ResponsePrimitive v_responsePrimitive; //Activate defaults when running on a PTC @@ -2690,7 +2536,7 @@ module OneM2M_Functions { v_myResource.cSEBase.lastModifiedTime := v_myResource.cSEBase.creationTime; v_myResource.cSEBase.cSE_ID := PX_CSE1_ID; v_myResource.cSEBase.supportedResourceType := PX_CSE1_SRT; - v_myResource.cSEBase.pointOfAccess := {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING_CSE1, PX_CSE1_ADDRESS, "")}; + v_myResource.cSEBase.pointOfAccess := {f_getCompletePoA(PX_PROTOCOL_BINDING_CSE1, PX_CSE1_ADDRESS, "")}; v_myResource.cSEBase.cseType := vc_cseType; }else if(p_resourceType == int16 and ispresent(p_resource)) { //RemoteCSE @@ -2798,8 +2644,8 @@ module OneM2M_Functions { v_myResource.accessControlPolicy.lastModifiedTime := v_myResource.accessControlPolicy.creationTime; v_myResource.accessControlPolicy.announceTo := omit; v_myResource.accessControlPolicy.announcedAttribute := omit; - v_myResource.accessControlPolicy.privileges := p_resource.accessControlPolicy.privileges; - v_myResource.accessControlPolicy.selfPrivileges := p_resource.accessControlPolicy.selfPrivileges; + v_myResource.accessControlPolicy.privileges := valueof(p_resource.accessControlPolicy.privileges); + v_myResource.accessControlPolicy.selfPrivileges := valueof(p_resource.accessControlPolicy.selfPrivileges); } } else if(p_resourceType == int2 and ispresent(p_resource)) {//AE if(ischosen(p_resource.aE)){ @@ -2817,8 +2663,8 @@ module OneM2M_Functions { if(not(ispresent(p_resource.aE.resourceName))) { v_myResource.aE.resourceName := "ae" & int2str(v_resourceIndex); } - v_myResource.aE.app_ID := p_resource.aE.app_ID; - v_myResource.aE.requestReachability := p_resource.aE.requestReachability; + v_myResource.aE.app_ID := valueof(p_resource.aE.app_ID); + v_myResource.aE.requestReachability := valueof(p_resource.aE.requestReachability); } } else if(p_resourceType == int3 and ispresent(p_resource)) { //Container if(ischosen(p_resource.container)){ @@ -3110,7 +2956,7 @@ module OneM2M_Functions { * @desc Send response to the IUT (Test System simulating a CSE) * @param p_requestPrimtive Received request primitive */ - function f_cse_sendResponse(in MsgIn p_requestPrimitive) runs on CseSimu { + function f_cse_sendResponse_cseSimu(in MsgIn p_requestPrimitive) runs on CseSimu { f_processCreateRequestPrimitive(p_requestPrimitive.primitive.requestPrimitive); @@ -3118,41 +2964,11 @@ module OneM2M_Functions { mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); } - - /** - * @desc Receive response from the IUT - * @param p_requestPrimtive Received request primitive - */ - function f_cse_receiveResponse(in RequestPrimitive p_request) runs on AeSimu { - - var integer v_resourceIndex := -1; - - //Activate defaults when running on a PTC - f_cse_activateDefaults_ae(); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__&":INFO: Response received with positive response status code"); - f_checkAttributesToBeSaved(p_request.resourceType, p_request, vc_response.primitive.responsePrimitive); - v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_request.resourceType); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response { - tc_ac.stop; - setverdict(pass, __SCOPE__&":INFO: Response received with negative response status code"); - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__&":INFO: No response received"); - } - } - - } - - }//end group CseSimuFunctions - - group CseAltstepFunctions { - + + }//end group CseSimuFunctions + + group CseAltstepFunctions { + /** * @desc Cse altstep for config 01 */ @@ -3309,69 +3125,46 @@ module OneM2M_Functions { log(__SCOPE__&": WARNING: Unexpected message received"); repeat; } - } - + } + /** - * @desc Altstep for AeSimu + * @desc Activation of the corresponding default altstep depending on config for CseSimu */ - altstep a_ae_cseSimu() runs on CseSimu { - var MsgIn v_request; - var ResponsePrimitive v_response; - - [] mcaPortIn.receive(mw_request(mw_notify)) -> value v_request { - tc_ac.stop; - log(__SCOPE__&": WARNING: Unexpected NOTIFY message received"); - - //Send response in any case - v_response := valueof(m_responseNotification(int2000, omit)); - v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; - mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_response))); - tc_ac.start(10.0); - repeat; - } - [] mcaPortIn.receive { - log(__SCOPE__&": WARNING: Unexpected message received"); - repeat; - } - [] mcaPort.receive { - log(__SCOPE__&": WARNING: Unexpected message received"); - repeat; - } - } - - }//end group altstepFunctions - - function f_cse_activateDefaults_cse1() runs on CseSimu { - if(not(self == mtc)) { - activate(a_default()); - if(vc_config == e_cf02) { - activate(a_cse_cf02_cse1()); - log(__SCOPE__&": INFO: Default cf02_cse1 activated"); - } else if(vc_config == e_cf04) { - activate(a_cse_cf04()); - log(__SCOPE__&": INFO: Default cf04 activated"); - } - } - } - - function f_cse_activateDefaults_ae() runs on AeSimu { - if(not(self == mtc)) { - activate(a_default()); - if(vc_config == e_cf01) { - activate(a_cse_cf01()); - log(__SCOPE__&": INFO: Default cf01 and cf01_ae2 activated"); - } else if(vc_config == e_cf02CseSimuMaster) { - activate(a_cse_cf02_ae1()); - log(__SCOPE__&": INFO: Default cf02_ae1 activated"); - } - } - } + function f_cse_activateDefaults_cse1() runs on CseSimu { + if(not(self == mtc)) { + activate(a_default()); + if(vc_config == e_cf02) { + activate(a_cse_cf02_cse1()); + log(__SCOPE__&": INFO: Default cf02_cse1 activated"); + } else if(vc_config == e_cf04) { + activate(a_cse_cf04()); + log(__SCOPE__&": INFO: Default cf04 activated"); + } + } + } + + /** + * @desc Activation of the corresponding default altstep depending on config for AeSimu + */ + function f_cse_activateDefaults_ae() runs on AeSimu { + if(not(self == mtc)) { + activate(a_default()); + if(vc_config == e_cf01) { + activate(a_cse_cf01()); + log(__SCOPE__&": INFO: Default cf01 and cf01_ae2 activated"); + } else if(vc_config == e_cf02CseSimuMaster) { + activate(a_cse_cf02_ae1()); + log(__SCOPE__&": INFO: Default cf02_ae1 activated"); + } + } + } + }//end group CseAltstepFunctions }//end cseFunctions group AeFunctions { - group preambleFunctions { + group PreambleFunctions { /** * @desc Waits for AE registration request and process it @@ -3465,9 +3258,9 @@ module OneM2M_Functions { return v_resourceIndex; } //end function f_ae_preamble_createContainer - } // end preambleFunctions + } // end PreambleFunctions - group helpingFunctions { + group CseSimuFunctions { function f_ae_createPollingChannel(template UtTriggerPrimitive p_utRequest := m_utCreateAe) runs on CseSimu return integer { var MsgIn v_request; @@ -3512,29 +3305,10 @@ module OneM2M_Functions { return v_resourceIndex; } //end function f_ae_createPollingChannel - } // end helpingFunctions - - group altstepFunctions { - - /** - * @desc Ae altstep - */ - altstep a_ae_default() runs on CseSimu { + } // end CseSimuFunctions - var MsgIn v_request; - - [] mcaPort.receive(mw_request(?)) -> value v_request { - log(__SCOPE__ & ":WARNING: Unexpected request received"); - mcaPort.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier)))); - repeat; - } - - [] mcaPort.receive { - log(__SCOPE__ & ":WARNING: Unexpected message received"); - repeat; - } - } - + group AeAltstepFunctions { + /** * @desc Waits for CREATE request, stores resource and replies to request * @remark This altstep includes a_ae_default @@ -3542,39 +3316,59 @@ module OneM2M_Functions { */ altstep a_ae_cf03() runs on CseSimu { + [] a_ae_cseSimu(); + } + + /** + * @desc Altstep for AeSimu + */ + altstep a_ae_cseSimu() runs on CseSimu { + var ResponsePrimitive v_response; var MsgIn v_request; - var PrimitiveContent v_modifiedResource; - var integer v_resourceIndex, v_parentIndex; - var RequestPrimitive v_rp; - + var integer v_localResourceIndex := -1; + + [] mcaPortIn.receive(mw_request(mw_notify)) -> value v_request { + tc_ac.stop; + log(__SCOPE__&": WARNING: Unexpected NOTIFY message received"); + + //Send response in any case + v_response := valueof(m_responseNotification(int2000, omit)); + v_response.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_response))); + tc_ac.start(10.0); + repeat; + } [] mcaPortIn.receive(mw_request(mw_create)) -> value v_request { - v_rp := v_request.primitive.requestPrimitive; - v_parentIndex := f_getResourceIndex(v_rp.to_); - v_modifiedResource := f_generateLocalResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType); - v_resourceIndex := f_setLocalResource(v_modifiedResource, v_rp.resourceType, v_parentIndex); - if(v_resourceIndex != -1) { - mcaPortIn.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource)))); - } - else { - mcaPortIn.send(f_getMsgOutPrimitive(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier)))); - } - repeat; + + v_localResourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive); + + mccPortIn.send(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))); + tc_ac.start(10.0); + repeat; } - - [] a_ae_default(); - } - - }//end group altstepFunctions - - function f_ae_activateDefaults() runs on CseSimu { - if(not(self == mtc)) { - activate(a_default()); - if(vc_config == e_cf03) { - activate(a_ae_cf03()); - log(__SCOPE__&": INFO: Default cf03 activated"); + [] mcaPortIn.receive { + log(__SCOPE__&": WARNING: Unexpected message received"); + repeat; } - } - } + [] mcaPort.receive { + log(__SCOPE__&": WARNING: Unexpected message received"); + repeat; + } + } + + /** + * @desc Activation of the corresponding default altstep depending on config for CseSimu + */ + function f_ae_activateDefaults_cse1() runs on CseSimu { + if(not(self == mtc)) { + activate(a_default()); + if(vc_config == e_cf03) { + activate(a_ae_cf03()); + log(__SCOPE__&": INFO: Default cf03 activated"); + } + } + } + }//end group AeAltstepFunctions }//end of aeFunctions @@ -3582,149 +3376,417 @@ module OneM2M_Functions { group GetSetFunctions { /** - * @desc Creation of a CREATE request primitive from a template request primitive - * @param p_resourceType Type of resource to be created - * @param p_request Template request primitive - * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created - * @return Created CREATE request primitive - * @verdict + * @desc Get MsgOut primitive + * @param MsgOut MsgOut primitive */ - function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on Tester return RequestPrimitive { - var template ListOfURIs v_defaultListOfURIs := {"NotInitialized"}; - var template AcpType v_defaultAcpIDs := {"NotInitialized"}; - p_request.requestIdentifier := valueof(p_request.requestIdentifier) & f_rnd(1, 1000000); + function f_getMsgOutPrimitive(template MsgOut p_msgOut) runs on Tester return MsgOut { + p_msgOut.protocolBinding := vc_protocolBinding; + return valueof(p_msgOut); + } + + /** + * @desc Build a reception template from the primitiveContent sent in previous request primitive + * @param p_primitiveContent PrimitiveContent from previous request primitive + * @return Built reception template + * @verdict + */ + function f_getTemplateFromPrimitiveContent (in template PrimitiveContent p_primitiveContent) return template PrimitiveContent{ + var template PrimitiveContent v_primitiveContent := omit; - if((p_resourceType != int2) and (p_resourceType != int10002)) { - if(p_resourceType == int16) { - p_request.from_ := PX_CSE1_ID; - } else { - p_request.from_ := f_getOriginator(p_parentIndex, vc_testSystemRole); - } - } - //Only set To parameter if it has not been set yet - if(valueof(p_request.to_) == "NotInitialized") { - p_request.to_ := f_getResourceAddress(p_parentIndex); - } - - if (p_resourceType == int1) {//AccessControlPolicy + if(ischosen(p_primitiveContent.container)){ // Container + v_primitiveContent := {container := mw_contentContainerBase}; - } else if (p_resourceType == int2) {//AE - if(ispresent(p_request.primitiveContent.aE.pointOfAccess)) { - p_request.primitiveContent.aE.requestReachability := true; + if(ispresent(p_primitiveContent.container.labels)){ + v_primitiveContent.container.labels := ?; } - } else if (p_resourceType == int16) {//remoteCSE - if(ispresent(p_request.primitiveContent.remoteCSE.pointOfAccess)) { - p_request.primitiveContent.remoteCSE.requestReachability := true; + if(ispresent(p_primitiveContent.container.accessControlPolicyIDs)){ + v_primitiveContent.container.accessControlPolicyIDs := ?; } - } else if (p_resourceType == int9) {//group - if(match(valueof(p_request.primitiveContent.group_.memberIDs), v_defaultListOfURIs )){ - if ((p_parentIndex == -1) and (isbound(vc_aeAuxIndex))){ - p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[vc_aeAuxIndex].resource)}; - }else{ - p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[p_parentIndex].resource)}; - } + if(ispresent(p_primitiveContent.container.announceTo)){ + v_primitiveContent.container.announceTo := ?; } - } else if(p_resourceType == int3){//container - //when a container is created by hosting cse for storing location information, the container is seen as a location container - if(PX_IS_LOC_CONTAINER){ - p_request.primitiveContent.container.locationID := f_getResourceId(vc_resourcesList[p_parentIndex].resource);//resourceID of the locationPolicy - } - if(ispresent(p_request.primitiveContent.container.accessControlPolicyIDs)) { - if((match(valueof(p_request.primitiveContent.container.accessControlPolicyIDs), v_defaultAcpIDs )) and (isbound(vc_acpAuxIndex))){ - p_request.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}; - } - } - } else if (p_resourceType == int15) {//pollingChannel - if(ischosen(vc_resourcesList[p_parentIndex].resource.aE)) { - p_request.from_ := vc_resourcesList[p_parentIndex].resource.aE.aE_ID; + if(ispresent(p_primitiveContent.container.announcedAttribute)){ + v_primitiveContent.container.announcedAttribute := ?; } - } else if (p_resourceType == int18) {//schedule - } else if (p_resourceType == int23) {//subscription - //notificationURI - if(match(valueof(p_request.primitiveContent.subscription.notificationURI), v_defaultListOfURIs )){ - p_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_parentIndex)}; + if(ispresent(p_primitiveContent.container.creator)){ + v_primitiveContent.container.creator := ?; } - //subscriberURI - if(ispresent(p_request.primitiveContent.subscription.subscriberURI)) { - if(match(valueof(p_request.primitiveContent.subscription.subscriberURI), "NotInitialized" )){ - p_request.primitiveContent.subscription.subscriberURI := f_getResourceAddress(vc_aeAuxIndex); - } + if(ispresent(p_primitiveContent.container.maxNrOfInstances)){ + v_primitiveContent.container.maxNrOfInstances := ?; } - //accessControlPolicyIds - if(ispresent(p_request.primitiveContent.subscription.accessControlPolicyIDs)) { - if(match(valueof(p_request.primitiveContent.subscription.accessControlPolicyIDs), v_defaultAcpIDs )){ - p_request.primitiveContent.subscription.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}; - } - } - } else if (p_resourceType == int4) {//contentInstance - //creator attribute - if(ispresent(p_request.primitiveContent.contentInstance.creator)) { - p_request.primitiveContent.contentInstance.creator := f_getCreator(p_parentIndex); + if(ispresent(p_primitiveContent.container.maxByteSize)){ + v_primitiveContent.container.maxByteSize := ?; + } + if(ispresent(p_primitiveContent.container.maxInstanceAge)){ + v_primitiveContent.container.maxInstanceAge := ?; + } + if(ispresent(p_primitiveContent.container.locationID)){ + v_primitiveContent.container.locationID := ?; + } + if(ispresent(p_primitiveContent.container.ontologyRef)){ + v_primitiveContent.container.ontologyRef := ?; } } - - return valueof(p_request); - } - - /** - * @desc Creation of a CREATE response primitive from a template request primitive - * @param p_resourceType Type of resource to be created - * @param p_request Template request primitive - * @return Created CREATE response primitive - * @verdict - */ - //TODO To be completed - function f_getCreateResponsePrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create) runs on Tester return ResponsePrimitive { - var template ResponsePrimitive v_responsePrimitive; - - if(p_resourceType != int2) { - v_responsePrimitive.from_ := p_request.to_; - } - p_request.to_ := p_request.from_; - - if (p_resourceType == int1) {//AccessControlPolicy - - } - if (p_resourceType == int9) {//group + else if(ischosen(p_primitiveContent.aE)){ // AE + v_primitiveContent := {aE := mw_contentAeBase}; + if(ispresent(p_primitiveContent.aE.labels)){ + v_primitiveContent.aE.labels := ?; + } + if(ispresent(p_primitiveContent.aE.accessControlPolicyIDs)){ + v_primitiveContent.aE.accessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.aE.announceTo)){ + v_primitiveContent.aE.announceTo := ?; + } + if(ispresent(p_primitiveContent.aE.announcedAttribute)){ + v_primitiveContent.aE.announcedAttribute := ?; + } + if(ispresent(p_primitiveContent.aE.appName)){ + v_primitiveContent.aE.appName := ?; + } + if(ispresent(p_primitiveContent.aE.pointOfAccess)){ + v_primitiveContent.aE.pointOfAccess := ?; + } + if(ispresent(p_primitiveContent.aE.ontologyRef)){ + v_primitiveContent.aE.ontologyRef := ?; + } + if(ispresent(p_primitiveContent.aE.nodeLink)){ + v_primitiveContent.aE.nodeLink := ?; + } + if(ispresent(p_primitiveContent.aE.contentSerialization)){ + v_primitiveContent.aE.contentSerialization := ?; + } } - if(p_resourceType == int3){//container - + else if(ischosen(p_primitiveContent.accessControlPolicy)){ // ACP + v_primitiveContent := {accessControlPolicy := mw_contentAcpBase}; + + if(ispresent(p_primitiveContent.accessControlPolicy.labels)){ + v_primitiveContent.accessControlPolicy.labels := ?; + } + if(ispresent(p_primitiveContent.accessControlPolicy.announceTo)){ + v_primitiveContent.accessControlPolicy.announceTo := ?; + } } - if (p_resourceType == int15) {//pollingChannel - - } + else if(ischosen(p_primitiveContent.contentInstance)){ // ContentInstance + v_primitiveContent := {contentInstance := mw_contentContentInstanceBase}; + + if(ispresent(p_primitiveContent.contentInstance.labels)){ + v_primitiveContent.contentInstance.labels := ?; + } + if(ispresent(p_primitiveContent.contentInstance.announceTo)){ + v_primitiveContent.contentInstance.announceTo := ?; + } + if(ispresent(p_primitiveContent.contentInstance.announcedAttribute)){ + v_primitiveContent.contentInstance.announcedAttribute := ?; + } + if(ispresent(p_primitiveContent.contentInstance.creator)){ + v_primitiveContent.contentInstance.creator := ?; + } + if(ispresent(p_primitiveContent.contentInstance.contentInfo)){ + v_primitiveContent.contentInstance.contentInfo := ?; + } + if(ispresent(p_primitiveContent.contentInstance.ontologyRef)){ + v_primitiveContent.contentInstance.ontologyRef := ?; + } + } - if (p_resourceType == int18) {//schedule - } + else if(ischosen(p_primitiveContent.group_)){ // Group + v_primitiveContent := {group_ := mw_contentGroupBase}; - if (p_resourceType == int23) {//subscription - - + if(ispresent(p_primitiveContent.group_.labels)){ + v_primitiveContent.group_.labels := ?; + } + if(ispresent(p_primitiveContent.group_.accessControlPolicyIDs)){ + v_primitiveContent.group_.accessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.group_.announceTo)){ + v_primitiveContent.group_.announceTo := ?; + } + if(ispresent(p_primitiveContent.group_.announcedAttribute)){ + v_primitiveContent.group_.announcedAttribute := ?; + } + if(ispresent(p_primitiveContent.group_.creator)){ + v_primitiveContent.group_.creator := ?; + } + if(ispresent(p_primitiveContent.group_.membersAccessControlPolicyIDs)){ + v_primitiveContent.group_.membersAccessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.group_.memberTypeValidated)){ + v_primitiveContent.group_.memberTypeValidated := ?; + } + if(ispresent(p_primitiveContent.group_.consistencyStrategy)){ + v_primitiveContent.group_.consistencyStrategy := ?; + } + if(ispresent(p_primitiveContent.group_.groupName)){ + v_primitiveContent.group_.groupName := ?; + } } + + else if(ischosen(p_primitiveContent.pollingChannel)){ // PollingChannel + v_primitiveContent := {pollingChannel := mw_contentPollingChannelBase}; - return valueof(v_responsePrimitive); + if(ispresent(p_primitiveContent.pollingChannel.labels)){ + v_primitiveContent.pollingChannel.labels := ?; + } + } + + else if(ischosen(p_primitiveContent.schedule)){ // Schedule + v_primitiveContent := {schedule := mw_contentScheduleBase}; + + if(ispresent(p_primitiveContent.schedule.labels)){ + v_primitiveContent.schedule.labels := ?; + } + if(ispresent(p_primitiveContent.schedule.announceTo)){ + v_primitiveContent.schedule.announceTo := ?; + } + if(ispresent(p_primitiveContent.schedule.announcedAttribute)){ + v_primitiveContent.schedule.announcedAttribute := ?; + } + } + + else if(ischosen(p_primitiveContent.subscription)){ // Subscription + v_primitiveContent := {subscription := mw_contentSubscriptionBase}; + + if(ispresent(p_primitiveContent.subscription.labels)){ + v_primitiveContent.subscription.labels := ?; + } + if(ispresent(p_primitiveContent.subscription.accessControlPolicyIDs)){ + v_primitiveContent.subscription.accessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.subscription.creator)){ + v_primitiveContent.subscription.creator := ?; + } + if(ispresent(p_primitiveContent.subscription.eventNotificationCriteria)){ + v_primitiveContent.subscription.eventNotificationCriteria := ?; + } + if(ispresent(p_primitiveContent.subscription.expirationCounter)){ + v_primitiveContent.subscription.expirationCounter := ?; + } + if(ispresent(p_primitiveContent.subscription.groupID)){ + v_primitiveContent.subscription.groupID := ?; + } + if(ispresent(p_primitiveContent.subscription.notificationForwardingURI)){ + v_primitiveContent.subscription.notificationForwardingURI := ?; + } + if(ispresent(p_primitiveContent.subscription.batchNotify)){ + v_primitiveContent.subscription.batchNotify := ?; + } + if(ispresent(p_primitiveContent.subscription.rateLimit)){ + v_primitiveContent.subscription.rateLimit := ?; + } + if(ispresent(p_primitiveContent.subscription.preSubscriptionNotify)){ + v_primitiveContent.subscription.preSubscriptionNotify := ?; + } + if(ispresent(p_primitiveContent.subscription.pendingNotification)){ + v_primitiveContent.subscription.pendingNotification := ?; + } + if(ispresent(p_primitiveContent.subscription.notificationStoragePriority)){ + v_primitiveContent.subscription.notificationStoragePriority := ?; + } + if(ispresent(p_primitiveContent.subscription.latestNotify)){ + v_primitiveContent.subscription.latestNotify := ?; + } + if(ispresent(p_primitiveContent.subscription.notificationContentType)){ + v_primitiveContent.subscription.notificationContentType := ?; + } + if(ispresent(p_primitiveContent.subscription.notificationEventCat)){ + v_primitiveContent.subscription.notificationEventCat := ?; + } + if(ispresent(p_primitiveContent.subscription.subscriberURI)){ + v_primitiveContent.subscription.subscriberURI := ?; + } + } + else if(ischosen(p_primitiveContent.remoteCSE)){ //remoteCSE + v_primitiveContent := {remoteCSE := mw_contentRemoteCSEBase}; + + if(ispresent(p_primitiveContent.remoteCSE.labels)){ + v_primitiveContent.remoteCSE.labels := ?; + } + + if(ispresent(p_primitiveContent.remoteCSE.accessControlPolicyIDs)){ + v_primitiveContent.remoteCSE.accessControlPolicyIDs := ?; + } + + if(ispresent(p_primitiveContent.remoteCSE.announceTo)){ + v_primitiveContent.remoteCSE.announceTo := ?; + } + + if(ispresent(p_primitiveContent.remoteCSE.announcedAttribute)){ + v_primitiveContent.remoteCSE.announcedAttribute := ?; + } + + if(ispresent(p_primitiveContent.remoteCSE.cseType)){ + v_primitiveContent.remoteCSE.cseType := ?; + } + + if(ispresent(p_primitiveContent.remoteCSE.pointOfAccess)){ + v_primitiveContent.remoteCSE.pointOfAccess := ?; + } + + if(ispresent(p_primitiveContent.remoteCSE.m2M_Ext_ID)){ + v_primitiveContent.remoteCSE.m2M_Ext_ID := ?; + } + + if(ispresent(p_primitiveContent.remoteCSE.trigger_Recipient_ID)){ + v_primitiveContent.remoteCSE.trigger_Recipient_ID := ?; + } + + if(ispresent(p_primitiveContent.remoteCSE.nodeLink)){ + v_primitiveContent.remoteCSE.nodeLink := ?; + } + } + return v_primitiveContent; } /** - * @desc Creation of an UPDATE request primitive from a template request primitive + * @desc Creation of a CREATE request primitive from a template request primitive * @param p_resourceType Type of resource to be created - * @param p_resourceIndex Internal resource index which indicates the resource to be updated - * @param p_request Template request primitive - * @return Created UPDATE request primitive + * @param p_request Template request primitive + * @param p_parentIndex Internal resource index which indicates the parent of the resource to be created + * @return Created CREATE request primitive * @verdict */ - function f_getUpdateRequestPrimitive(in ResourceType p_resourceType, integer p_resourceIndex, template RequestPrimitive p_request) runs on Tester return RequestPrimitive { - + function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on Tester return RequestPrimitive { + var template ListOfURIs v_defaultListOfURIs := {"NotInitialized"}; + var template AcpType v_defaultAcpIDs := {"NotInitialized"}; + p_request.requestIdentifier := valueof(p_request.requestIdentifier) & f_rnd(1, 1000000); - if(p_resourceType != int10002) { - p_request.from_ := f_getOriginator(p_resourceIndex); - + if((p_resourceType != int2) and (p_resourceType != int10002)) { + if(p_resourceType == int16) { + p_request.from_ := PX_CSE1_ID; + } else { + p_request.from_ := f_getOriginator(p_parentIndex, vc_testSystemRole); + } + } + //Only set To parameter if it has not been set yet + if(valueof(p_request.to_) == "NotInitialized") { + p_request.to_ := f_getResourceAddress(p_parentIndex); + } + + if (p_resourceType == int1) {//AccessControlPolicy + + } else if (p_resourceType == int2) {//AE + if(ispresent(p_request.primitiveContent.aE.pointOfAccess)) { + p_request.primitiveContent.aE.requestReachability := true; + } + } else if (p_resourceType == int16) {//remoteCSE + if(ispresent(p_request.primitiveContent.remoteCSE.pointOfAccess)) { + p_request.primitiveContent.remoteCSE.requestReachability := true; + } + } else if (p_resourceType == int9) {//group + if(match(valueof(p_request.primitiveContent.group_.memberIDs), v_defaultListOfURIs )){ + if ((p_parentIndex == -1) and (isbound(vc_aeAuxIndex))){ + p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[vc_aeAuxIndex].resource)}; + }else{ + p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[p_parentIndex].resource)}; + } + } + } else if(p_resourceType == int3){//container + //when a container is created by hosting cse for storing location information, the container is seen as a location container + if(PX_IS_LOC_CONTAINER){ + p_request.primitiveContent.container.locationID := f_getResourceId(vc_resourcesList[p_parentIndex].resource);//resourceID of the locationPolicy + } + if(ispresent(p_request.primitiveContent.container.accessControlPolicyIDs)) { + if((match(valueof(p_request.primitiveContent.container.accessControlPolicyIDs), v_defaultAcpIDs )) and (isbound(vc_acpAuxIndex))){ + p_request.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}; + } + } + } else if (p_resourceType == int15) {//pollingChannel + if(ischosen(vc_resourcesList[p_parentIndex].resource.aE)) { + p_request.from_ := vc_resourcesList[p_parentIndex].resource.aE.aE_ID; + } + } else if (p_resourceType == int18) {//schedule + } else if (p_resourceType == int23) {//subscription + //notificationURI + if(match(valueof(p_request.primitiveContent.subscription.notificationURI), v_defaultListOfURIs )){ + p_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_parentIndex)}; + } + //subscriberURI + if(ispresent(p_request.primitiveContent.subscription.subscriberURI)) { + if(match(valueof(p_request.primitiveContent.subscription.subscriberURI), "NotInitialized" )){ + p_request.primitiveContent.subscription.subscriberURI := f_getResourceAddress(vc_aeAuxIndex); + } + } + //accessControlPolicyIds + if(ispresent(p_request.primitiveContent.subscription.accessControlPolicyIDs)) { + if(match(valueof(p_request.primitiveContent.subscription.accessControlPolicyIDs), v_defaultAcpIDs )){ + p_request.primitiveContent.subscription.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}; + } + } + } else if (p_resourceType == int4) {//contentInstance + //creator attribute + if(ispresent(p_request.primitiveContent.contentInstance.creator)) { + p_request.primitiveContent.contentInstance.creator := f_getCreator(p_parentIndex); + } + } + + return valueof(p_request); + } + + /** + * @desc Creation of a CREATE response primitive from a template request primitive + * @param p_resourceType Type of resource to be created + * @param p_request Template request primitive + * @return Created CREATE response primitive + * @verdict + */ + //TODO To be completed + function f_getCreateResponsePrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create) runs on Tester return ResponsePrimitive { + var template ResponsePrimitive v_responsePrimitive; + + if(p_resourceType != int2) { + v_responsePrimitive.from_ := p_request.to_; + } + p_request.to_ := p_request.from_; + + if (p_resourceType == int1) {//AccessControlPolicy + + } + + if (p_resourceType == int9) {//group + + } + + if(p_resourceType == int3){//container + + } + + if (p_resourceType == int15) {//pollingChannel + + } + + if (p_resourceType == int18) {//schedule + } + + if (p_resourceType == int23) {//subscription + + + } + + return valueof(v_responsePrimitive); + } + + /** + * @desc Creation of an UPDATE request primitive from a template request primitive + * @param p_resourceType Type of resource to be created + * @param p_resourceIndex Internal resource index which indicates the resource to be updated + * @param p_request Template request primitive + * @return Created UPDATE request primitive + * @verdict + */ + function f_getUpdateRequestPrimitive(in ResourceType p_resourceType, integer p_resourceIndex, template RequestPrimitive p_request) runs on Tester return RequestPrimitive { + + p_request.requestIdentifier := valueof(p_request.requestIdentifier) & f_rnd(1, 1000000); + + if(p_resourceType != int10002) { + p_request.from_ := f_getOriginator(p_resourceIndex); + //Only set To parameter if it has not been set yet if(valueof(p_request.to_) == "NotInitialized") { p_request.to_ := f_getResourceAddress(p_resourceIndex); @@ -3972,7 +4034,7 @@ module OneM2M_Functions { * @param p_announcementTargetResource Announcement Target Resource * @return p_annoucementTargetPoA Announcemenet Target PoA */ - function f_getAnnouncementTargetPoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING_CSE1, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "" ) return charstring { + function f_getCompletePoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING_CSE1, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "" ) return charstring { if(p_protocolBinding == "HTTP") { return "http://" & p_announcementTargetAddress & "/" & p_announcementTargetResource; @@ -4161,8 +4223,109 @@ module OneM2M_Functions { } } + + /** + * @desc Retrieve AE_ID for a given AE resource + * @param p_targetResourceIndex Internal resource index of the given resource + * @return AE_ID of the given resource + */ + function f_getAeId(integer p_targetResourceIndex := -1) runs on Tester return XSD.ID { + + if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.aE)) { + return vc_resourcesList[p_targetResourceIndex].resource.aE.aE_ID; + } + + log(__SCOPE__ & ":WARNING: p_targetResourceIndex does not refer to AE resource"); + return ""; + + } // end f_getAeId + + /** + * @desc Retrieve Announced Resource Type from the given resource type + * @param p_targetResourceIndex Internal resource index of the given resource + * @return AE_ID of the given resource + */ + function f_getAnnouncedResourceType(in ResourceType p_resourceType) runs on Tester return ResourceType { + + if(p_resourceType == int2) { + return int10002; + } + + return p_resourceType; + + } // end f_getAnnouncedResourceType + + /** + * @desc Retrieve Time from a given timestamp + * @param p_timestamp Given timestamp + * @return Time + */ + function f_getTime(charstring p_timestamp) runs on Tester return integer { + + var charstring v_time := ""; + var integer i; + + for(i := 9; i <= 14; i := i+1){ + v_time := v_time & p_timestamp[i]; + } + return str2int(v_time); + + } // end f_getTime + + /** + * @desc Retrieve Year from a given timestamp + * @param p_timestamp Given timestamp + * @return Year + */ + function f_getYear(charstring p_timestamp) runs on Tester return charstring { + + var charstring v_year := ""; + var integer i; + + for(i := 0; i <= 3; i := i+1){ + v_year := v_year & p_timestamp[i]; + } + return v_year; + + } // end f_getYear + /** + * @desc Retrieve Month from a given timestamp + * @param p_timestamp Given timestamp + * @return Year + */ + function f_getMonth(charstring p_timestamp) runs on Tester return charstring { + + var charstring v_month := ""; + var integer i; + + for(i := 4; i <= 5; i := i+1){ + if(p_timestamp[i] != "0") { + v_month := v_month & p_timestamp[i]; + } + } + return v_month; + + } // end f_getYear + /** + * @desc Retrieve IP address from a given address which includes port information separated by : + * @param p_addressPort Given address + * @return IPv4 Address + */ + function f_getIpv4Address(charstring p_addressPort) runs on Tester return charstring { + + var charstring v_ipv4Address := ""; + var integer i:= 0; + + while ((i < lengthof(p_addressPort)-1) and (p_addressPort[i] != ":")){ + v_ipv4Address := v_ipv4Address & p_addressPort[i]; + i := i + 1; + } + return v_ipv4Address; + + } // end f_getIpv4Address + /** * @desc Saving of a resource and its parent index in the internal resource list * @param p_resource Resource to be saved @@ -4262,7 +4425,7 @@ module OneM2M_Functions { } return valueof(p_requestPrimitive); } - + /** * @desc Set parentID into the resource * @param p_resource Resource to be modified @@ -4341,136 +4504,133 @@ module OneM2M_Functions { * @param p_targetResourceIndex Internal resource index of the given resource * @return AE_ID of the given resource */ - function f_getAeId(integer p_targetResourceIndex := -1) runs on Tester return XSD.ID { - - if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.aE)) { - return vc_resourcesList[p_targetResourceIndex].resource.aE.aE_ID; + function f_setProtocolBinding(charstring p_protocolBinding) runs on Tester { + vc_protocolBinding := p_protocolBinding; + } + + /** + * @desc Returns the protocol binding used by the component + */ + function f_getProtocolBinding() runs on Tester return charstring { + return vc_protocolBinding; + } + + }//end group getSetFunctions + + group CheckingFunctions { + + group ComponentStatus { + + /** + * @desc Boolean to charstring + * @param p_bool + * @verdict + */ + function f_checkAeSimuStatus() runs on AeSimu { + + if (getverdict != pass) { + f_cse_postamble_deleteResources(); + + // Tear down + if(vc_config == e_cf01) { + f_cf01Down(); + } else if (vc_config ==e_cf02) { + f_cf02Down(); + } + kill; + } else { + log(__SCOPE__, ":INFO: AeSimu status OK"); + } } - log(__SCOPE__ & ":WARNING: p_targetResourceIndex does not refer to AE resource"); - return ""; - } // end f_getAeId + /** + * @desc Sending of an Adapter Control primitive + * @param event Action to be performed by TA + * @param data Corresponding information for the correct execution of the given action + * @verdict + */ + function f_checkCseSimuStatus() runs on CseSimu { - /** - * @desc Retrieve Announced Resource Type from the given resource type - * @param p_targetResourceIndex Internal resource index of the given resource - * @return AE_ID of the given resource - */ - function f_getAnnouncedResourceType(in ResourceType p_resourceType) runs on Tester return ResourceType { - - if(p_resourceType == int2) { - return int10002; + if (getverdict != pass) { + //f_ae_postamble_deleteResources(); + // Tear down + //f_cfAeTesterDown(); + f_cse_postamble_deleteResourcesCSE(); + //Tear down + if(vc_config == e_cf03) { + f_cf03Down(); + } else if (vc_config ==e_cf04) { + f_cf04Down(); + } else if (vc_config == e_cf02CseSimuMaster) { + f_cf02DownCseSimuMaster(); + } + kill; + } else { + log(__SCOPE__, ":INFO: CseSimu status OK"); + } } - return p_resourceType; - - - } // end f_getAnnouncedResourceType - - /** - * @desc Proccessing of the CREATE request primitive - * @param p_request Request primitive to be processed - * @return Local resource index - */ - function f_processCreateRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer { - var integer v_parentIndex := -1; - var integer v_localResourceIndex := -1; - var PrimitiveContent v_localResource; + /** + * @desc Sending of an Adapter Control primitive + * @param event Action to be performed by TA + * @param data Corresponding information for the correct execution of the given action + * @verdict + */ + function f_aeSimu_checkComponentDoneAndGetVerdict(Tester p_component) runs on AeSimu { - v_parentIndex := f_getResourceIndex(p_request.to_); - if(v_parentIndex == -1) { - setverdict(inconc,__SCOPE__&": ERROR: Target resource not found"); - vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier)); - - } else { - setverdict(pass, __SCOPE__&":INFO: Resource created successfuly"); - v_localResource := f_generateLocalResource(p_request.primitiveContent, v_parentIndex, p_request.resourceType); - v_localResourceIndex := f_setLocalResource(v_localResource, p_request.resourceType, v_parentIndex); + var verdicttype v_verdict := none; - vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2001,p_request.requestIdentifier)); - vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource; - } - vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID; - vc_response.primitive.responsePrimitive.to_ := p_request.from_; + tc_ac.start(15.0); + alt { + [] p_component.done -> value v_verdict { + tc_ac.stop; + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__ & "INFO: Component did not finish"); + } + } - return v_localResourceIndex; - } - - /** - * @desc Proccessing of the UPDATE request primitive - * @param p_request Request primitive to be processed - */ - function f_processUpdateRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer { - var integer v_targetLocalResourceIndex := -1; + if(v_verdict == pass) { // Component was successfully completed and got stopped state + setverdict(pass); + } else { + setverdict(inconc); // Component was not completed successfully + } - v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_); - if(v_targetLocalResourceIndex == -1) { - setverdict(inconc,__SCOPE__&": ERROR: Target resource not found"); - vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier)); - - } else { - setverdict(pass, __SCOPE__&":INFO: Resource updated successfuly"); - f_updateLocalResource(v_targetLocalResourceIndex, p_request.primitiveContent); - vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2004,p_request.requestIdentifier)); - vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_targetLocalResourceIndex].resource; - } - vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID; - vc_response.primitive.responsePrimitive.to_ := p_request.from_; - - return v_targetLocalResourceIndex; - - } + f_checkAeSimuStatus(); + } + + /** + * @desc Sending of an Adapter Control primitive + * @param event Action to be performed by TA + * @param data Corresponding information for the correct execution of the given action + * @verdict + */ + function f_cseSimu_checkComponentDoneAndGetVerdict(Tester p_component) runs on CseSimu { + + var verdicttype v_verdict := none; - /** - * @desc Proccessing of the RETRIEVE request primitive - * @param p_request Request primitive to be processed - */ - function f_processRetrieveRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer { - var integer v_targetLocalResourceIndex := -1; + tc_ac.start(15.0); + alt { + [] p_component.done -> value v_verdict { + tc_ac.stop; + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__ & "INFO: Component did not finish"); + } + } - v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_); - if(v_targetLocalResourceIndex == -1) { - setverdict(inconc,__SCOPE__&": ERROR: Target resource not found"); - vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier)); - - } else { - setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly"); - vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2000,p_request.requestIdentifier)); - vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_targetLocalResourceIndex].resource; - } - vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID; - vc_response.primitive.responsePrimitive.to_ := p_request.from_; - - return v_targetLocalResourceIndex; - } - - /** - * @desc Proccessing of the DELETE request primitive - * @param p_request Request primitive to be processed - */ - function f_processDeleteRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer { - var integer v_targetLocalResourceIndex := -1; + if(v_verdict == pass) { // Component was successfully completed and got stopped state + setverdict(pass); + } else { + setverdict(inconc); // Component was not completed successfully + } - v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_); - if(v_targetLocalResourceIndex == -1) { - setverdict(inconc,__SCOPE__&": ERROR: Target resource not found"); - vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier)); - - } else { - setverdict(pass, __SCOPE__&":INFO: Resource deleted successfuly"); - vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2002,p_request.requestIdentifier)); - } - vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID; - vc_response.primitive.responsePrimitive.to_ := p_request.from_; - - return v_targetLocalResourceIndex; - } + f_checkCseSimuStatus(); + } - }//end group getSetFunctions - - group CheckingFunctions { - + }//end of group ComponentStatus + /** * @desc It determines whether the addressing method of the given address is non-hierarchical. Not valid for CSE-Base as target * @param p_resourceAddress @@ -4509,8 +4669,7 @@ module OneM2M_Functions { return false; } } - - + /** * @desc It determines whether the addressing method of the given address is hierarchical. Not valid for CSE-Base as target * @param p_resourceAddress @@ -4563,208 +4722,189 @@ module OneM2M_Functions { } } - - - }//end group CheckingFunctions - - group CommonFunctions { - - - /** - * @desc Boolean to charstring - * @param p_bool - * @verdict - */ - function f_checkAeSimuStatus() runs on AeSimu { - - if (getverdict != pass) { - f_cse_postamble_deleteResources(); - - // Tear down - if(vc_config == e_cf01) { - f_cf01Down(); - } else if (vc_config ==e_cf02) { - f_cf02Down(); - } - kill; - } else { - log(__SCOPE__, ":INFO: AeSimu status OK"); - } - } - - /** - * @desc Sending of an Adapter Control primitive - * @param event Action to be performed by TA - * @param data Corresponding information for the correct execution of the given action - * @verdict - */ - function f_aeSimu_checkComponentDoneAndGetVerdict(Tester p_component) runs on AeSimu { - - var verdicttype v_verdict := none; - - tc_ac.start(15.0); - alt { - [] p_component.done -> value v_verdict { - tc_ac.stop; - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__ & "INFO: Component did not finish"); - } - } - - if(v_verdict == pass) { // Component was successfully completed and got stopped state - setverdict(pass); - } else { - setverdict(inconc); // Component was not completed successfully - } - - f_checkAeSimuStatus(); - } - - /** - * @desc Sets the protocol binding to be used by a component - * @param p_protocolBinding Protocol binding to be used - */ - - function f_setProtocolBinding(charstring p_protocolBinding) runs on Tester { - vc_protocolBinding := p_protocolBinding; - } - + /** - * @desc Returns the protocol binding used by the component - */ - function f_getProtocolBinding() runs on Tester return charstring { - return vc_protocolBinding; - } - - /** - * @desc Sending of an Adapter Control primitive - * @param event Action to be performed by TA - * @param data Corresponding information for the correct execution of the given action - * @verdict - */ - function f_cseSimu_checkComponentDoneAndGetVerdict(Tester p_component) runs on CseSimu { - - var verdicttype v_verdict := none; - - tc_ac.start(15.0); - alt { - [] p_component.done -> value v_verdict { - tc_ac.stop; - } - [] tc_ac.timeout { - setverdict(inconc, __SCOPE__ & "INFO: Component did not finish"); - } - } - - if(v_verdict == pass) { // Component was successfully completed and got stopped state - setverdict(pass); - } else { - setverdict(inconc); // Component was not completed successfully - } - - f_checkCseSimuStatus(); - } - - /** - * @desc Sending of an Adapter Control primitive - * @param event Action to be performed by TA - * @param data Corresponding information for the correct execution of the given action - * @verdict - */ - function f_checkCseSimuStatus() runs on CseSimu { - - if (getverdict != pass) { - //f_ae_postamble_deleteResources(); - // Tear down - //f_cfAeTesterDown(); - f_cse_postamble_deleteResourcesCSE(); - //Tear down - if(vc_config == e_cf03) { - f_cf03Down(); - } else if (vc_config ==e_cf04) { - f_cf04Down(); - } else if (vc_config == e_cf02CseSimuMaster) { - f_cf02DownCseSimuMaster(); - } - kill; - } else { - log(__SCOPE__, ":INFO: CseSimu status OK"); - } - } - - /** - * @desc Sending of an Adapter Control primitive - * @param event Action to be performed by TA - * @param data Corresponding information for the correct execution of the given action - * @verdict - */ - function f_sendAcPrimitive(in charstring p_event, in charstring p_data) runs on Tester { - - - var charstring v_data := "" & p_data; // clear encoding rules (ttwb issue ?) - acPort.send(AcRequestPrimitive:{p_event, {charstring := v_data}}); - - } - - /** - * @desc Get MsgOut primitive - * @param MsgOut MsgOut primitive - */ - - function f_getMsgOutPrimitive(template MsgOut p_msgOut) runs on Tester return MsgOut { - p_msgOut.protocolBinding := vc_protocolBinding; - return valueof(p_msgOut); - } - - function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest, in universal charstring p_action) runs on Tester { - - if (PX_UT_IMPLEMENTED){ - - p_utRequest.requestPrimitive.requestIdentifier := "m_uttriggerPrimitive" & f_rnd(1, 1000000); - - deactivate; - utPort.send(valueof(p_utRequest)); - - tc_wait.start; - alt{ - [] utPort.receive(mw_utResponseOK) { - tc_wait.stop; - setverdict(pass, __SCOPE__ & " : Triggering message is successfully received!"); + * @desc Checking of returned important attributed (in response) in order to save properly internally + * @param p_resourceType ResourceType of the resource to be checked + * @param p_request Request primitive used for the CRU operation + * @param p_response Response primitive received + * @verdict + */ + //Note: This function will be continously extended with necessary attributes/resources + function f_checkAttributesToBeSaved (ResourceType p_resourceType, RequestPrimitive p_request, inout ResponsePrimitive p_response) { + select (p_resourceType) { + case (int1) { + if(isvalue(p_response.primitiveContent.accessControlPolicy) and + not(ispresent(p_response.primitiveContent.accessControlPolicy.resourceName))) { + p_response.primitiveContent.accessControlPolicy.resourceName := p_request.primitiveContent.accessControlPolicy.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.accessControlPolicy.resourceName) + } } - [] utPort.receive(mw_utResponseKO) { - tc_wait.stop; - setverdict(inconc, __SCOPE__ & " : Error while receiving Triggering message!"); + case (int2) { + if(isvalue(p_response.primitiveContent.aE) and + not(ispresent(p_response.primitiveContent.aE.resourceName))) { + p_response.primitiveContent.aE.resourceName := p_request.primitiveContent.aE.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.aE.resourceName) + } } - [] tc_wait.timeout{ - setverdict(inconc, __SCOPE__ & " : Timeout due to no response received from requested SUT!"); + case (int3) { + if(isvalue(p_response.primitiveContent.container) and + not(ispresent(p_response.primitiveContent.container.resourceName))) { + p_response.primitiveContent.container.resourceName := p_request.primitiveContent.container.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.container.resourceName) + } } - } - - activate(a_default()); - if(vc_config == e_cf01) { - vc_aeSimu := activate(a_cse_cf01()); - } else if ((vc_config == e_cf02) or (vc_config == e_cf02CseSimuMaster)) { - if(vc_testSystemRole == e_ae) { - vc_aeSimu := activate(a_cse_cf02_ae1()); - } else if (vc_testSystemRole == e_cse) { - vc_cseSimu := activate(a_cse_cf02_cse1()); + case (int4) { + if(isvalue(p_response.primitiveContent.contentInstance) and + not(ispresent(p_response.primitiveContent.contentInstance.resourceName))) { + p_response.primitiveContent.contentInstance.resourceName := p_request.primitiveContent.contentInstance.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.contentInstance.resourceName) + } + } + case (int15) { + if (isvalue(p_response.primitiveContent.pollingChannel) and + not(ispresent(p_response.primitiveContent.pollingChannel.resourceName))) { + p_response.primitiveContent.pollingChannel.resourceName := p_request.primitiveContent.pollingChannel.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.pollingChannel.resourceName) + } + } + case (int16) { + if (isvalue(p_response.primitiveContent.remoteCSE) and + not(ispresent(p_response.primitiveContent.remoteCSE.resourceName))) { + p_response.primitiveContent.remoteCSE.resourceName := p_request.primitiveContent.remoteCSE.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.remoteCSE.resourceName) + } + } + case (int18) { + if (isvalue(p_response.primitiveContent.schedule) and + not(ispresent(p_response.primitiveContent.schedule.resourceName))) { + p_response.primitiveContent.schedule.resourceName := p_request.primitiveContent.schedule.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.schedule.resourceName) + } + } + case (int23) { + if (isvalue(p_response.primitiveContent.subscription) and + not(ispresent(p_response.primitiveContent.subscription.resourceName))) { + p_response.primitiveContent.subscription.resourceName := p_request.primitiveContent.subscription.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.subscription.resourceName) + } + } + case (int9) { + if (isvalue(p_response.primitiveContent.group_) and + not(ispresent(p_response.primitiveContent.group_.resourceName))) { + p_response.primitiveContent.group_.resourceName := p_request.primitiveContent.group_.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.group_.resourceName) + } + } + case else { + log(__SCOPE__&":WARNING: Resource Type "&int2str(enum2int(p_resourceType))&" not implemented"); } - } else if (vc_config == e_cf03) { - vc_cseSimu := activate(a_ae_cf03()); - } else if (vc_config == e_cf04) { - vc_cseSimu := activate(a_cse_cf04()); } - }else{ - - action(p_action); - + + // TODO test that if the resource name is returned is the same resource name as used in the create message } - - - - } - + + /** + * @desc Comparison of two URIs + * @param p_expectedURIIndex Resource index of the resource for which its URI is to be compared + * @param p_receivedURI URI to be compared + * @param p_response Response primitive received + * @verdict + */ + function f_compareURIs(in integer p_expectedURIIndex, in XSD.ID p_receivedURI) runs on Tester return boolean{ + // Local variables + var boolean v_matchResult := false; + var AddressingMethod v_addressingMethod; + var PrimitiveScope v_primitiveScope; + + if (f_isNonHierarchical(p_receivedURI)) { + v_addressingMethod := e_nonHierarchical; + } else if (f_isHierarchical(p_receivedURI)) { + v_addressingMethod := e_hierarchical; + } + if (f_isScopeCseRelative(p_receivedURI)) { + v_primitiveScope := e_cseRelative; + } + if (f_isScopeSpRelative(p_receivedURI)) { + v_primitiveScope := e_spRelative; + } + if (f_isScopeAbsolute(p_receivedURI)) { + v_primitiveScope := e_absolute; + } + + if(match(f_getResourceAddress(p_expectedURIIndex, v_addressingMethod, v_primitiveScope), p_receivedURI)) { + v_matchResult := true; + } else { + v_matchResult := false; + } + + return v_matchResult; + + } //end f_compareURIs + + /** + * @desc Checking of notification primitiveContent + * @param p_requestPrimitive Received Notification request + * @param p_primitiveContent Expected primitiveContent in the notification + * @verdict + */ + function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on Tester return boolean{ + // Local variables + var boolean v_matchResult := false; + var integer i; + var integer v_numberOfAggregatedNotification; + + if (ischosen(p_primitiveContent.aE)){ + log("Representation contains AE resource representation"); + if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE)) { + v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE, p_primitiveContent.aE); + log("Expected primitiveContent"); + } + else if(isvalue(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.aE)) { + v_matchResult :=match(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE); + } + else if (isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list)) { + v_matchResult := true; + v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list); + for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){ + if(isvalue(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE)) { + if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE, p_primitiveContent.aE))){ + v_matchResult := false; + } + } + } + if (i == 0){ + v_matchResult := false; + } + } + + } + + if (ischosen(p_primitiveContent.container)){ + if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container)) { + v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container, p_primitiveContent.container) + } + else if(isvalue(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.container)) { + v_matchResult := match(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.container, p_primitiveContent.container) + } + } + + if (ischosen(p_primitiveContent.timeSeries)){ + if(isvalue(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.timeSeries)) { + v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.timeSeries, p_primitiveContent.timeSeries) + } + else if(isvalue(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.timeSeries)) { + v_matchResult := match(p_requestPrimitive.primitiveContent.responsePrimitive.primitiveContent.timeSeries, p_primitiveContent.timeSeries) + } + } + + return v_matchResult; + + } //end f_check_notificationContent + + }//end group CheckingFunctions + + group CommonFunctions { group AltstepFunctions { @@ -4783,433 +4923,275 @@ module OneM2M_Functions { }//end group altstepFunctions - /** - * @desc Get the Resource Identifier with Unstructured-CSE-relative -Resource-ID format - * @return Cleaned-up resourceID - */ - function f_resourceIdCleaner(in XSD.ID p_resourceID) return XSD.ID { - var integer v_length := lengthof(p_resourceID); - var integer i; - var XSD.ID result := ""; - - //log("p_resourceID: " & p_resourceID); - for (i := v_length - 1; i>=0; i := i-1){ - if(p_resourceID[i]=="/"){ - //log("result: " & result); - return result; - } - else{ - result := p_resourceID[i] & result; - } - } - //log("result: " & result); - return result; - } + group AcFunctions { - /** - * @desc It removes the poa from a given url - * @param p_url URL - * @return Resource Identifier - * NOT USED FOR THE TIME BEING - */ - function f_removePoa(in XSD.ID p_url) return XSD.ID { - var integer v_length := lengthof(p_url); - var integer i; - var integer v_numberOfColons := 0; - var boolean v_lookForSlash := false; - var boolean v_getURI := false; - var XSD.ID v_uri := ""; - - //TODO Process when FQDN is used in the URL - for (i := 0; i<v_length; i := i + 1){ - if(v_getURI) { - v_uri := v_uri & p_url[i]; - } else { - if(p_url[i]==":"){ - v_numberOfColons := v_numberOfColons + 1; - } - if(v_numberOfColons >= 2) { - v_lookForSlash := true; - } - if(v_lookForSlash) { - if(p_url[i]=="/") { - v_getURI := true; - } - } - } - } - - - if(v_uri == "") { - return p_url; - } else { - return v_uri; + /** + * @desc Sending of an Adapter Control primitive + * @param event Action to be performed by TA + * @param data Corresponding information for the correct execution of the given action + * @verdict + */ + function f_sendAcPrimitive(in charstring p_event, in charstring p_data) runs on Tester { + + + var charstring v_data := "" & p_data; // clear encoding rules (ttwb issue ?) + acPort.send(AcRequestPrimitive:{p_event, {charstring := v_data}}); + } - } + }//end of group AcFunctions - /** - * @desc Removal of an element from a given integer list - * @param p_list Given integer list - * @param p_valueToBeDeleted Element value to be removed - * @verdict - */ - function f_removeElementFromList (inout IntegerList p_list, in integer p_valueToBeDeleted) { - var IntegerList result := {}; - var integer i; - for(i := 0; i < lengthof(p_list); i := i+1){ - if(p_list[i] != p_valueToBeDeleted){ - result := result & {p_list[i]}; - } - } - p_list := result; - } + group UtFunctions { - /** - * @desc Build a reception template from the primitiveContent sent in previous request primitive - * @param p_primitiveContent PrimitiveContent from previous request primitive - * @return Built reception template - * @verdict - */ - function f_getTemplateFromPrimitiveContent (in template PrimitiveContent p_primitiveContent) return template PrimitiveContent{ - var template PrimitiveContent v_primitiveContent := omit; - - if(ischosen(p_primitiveContent.container)){ // Container - v_primitiveContent := {container := mw_contentContainerBase}; - - if(ispresent(p_primitiveContent.container.labels)){ - v_primitiveContent.container.labels := ?; - } - if(ispresent(p_primitiveContent.container.accessControlPolicyIDs)){ - v_primitiveContent.container.accessControlPolicyIDs := ?; - } - if(ispresent(p_primitiveContent.container.announceTo)){ - v_primitiveContent.container.announceTo := ?; - } - if(ispresent(p_primitiveContent.container.announcedAttribute)){ - v_primitiveContent.container.announcedAttribute := ?; - } - if(ispresent(p_primitiveContent.container.creator)){ - v_primitiveContent.container.creator := ?; - } - if(ispresent(p_primitiveContent.container.maxNrOfInstances)){ - v_primitiveContent.container.maxNrOfInstances := ?; - } - if(ispresent(p_primitiveContent.container.maxByteSize)){ - v_primitiveContent.container.maxByteSize := ?; - } - if(ispresent(p_primitiveContent.container.maxInstanceAge)){ - v_primitiveContent.container.maxInstanceAge := ?; - } - if(ispresent(p_primitiveContent.container.locationID)){ - v_primitiveContent.container.locationID := ?; - } - if(ispresent(p_primitiveContent.container.ontologyRef)){ - v_primitiveContent.container.ontologyRef := ?; - } - } - - else if(ischosen(p_primitiveContent.aE)){ // AE - v_primitiveContent := {aE := mw_contentAeBase}; + /** + * @desc Sending of an Upper Tester primitive + * @param p_utRequest Action to be performed by IUT + * @param p_action Description of the given action to be performed by the IUT + * @verdict + */ + function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest, in universal charstring p_action) runs on Tester { - if(ispresent(p_primitiveContent.aE.labels)){ - v_primitiveContent.aE.labels := ?; - } - if(ispresent(p_primitiveContent.aE.accessControlPolicyIDs)){ - v_primitiveContent.aE.accessControlPolicyIDs := ?; - } - if(ispresent(p_primitiveContent.aE.announceTo)){ - v_primitiveContent.aE.announceTo := ?; - } - if(ispresent(p_primitiveContent.aE.announcedAttribute)){ - v_primitiveContent.aE.announcedAttribute := ?; - } - if(ispresent(p_primitiveContent.aE.appName)){ - v_primitiveContent.aE.appName := ?; - } - if(ispresent(p_primitiveContent.aE.pointOfAccess)){ - v_primitiveContent.aE.pointOfAccess := ?; - } - if(ispresent(p_primitiveContent.aE.ontologyRef)){ - v_primitiveContent.aE.ontologyRef := ?; - } - if(ispresent(p_primitiveContent.aE.nodeLink)){ - v_primitiveContent.aE.nodeLink := ?; - } - if(ispresent(p_primitiveContent.aE.contentSerialization)){ - v_primitiveContent.aE.contentSerialization := ?; - } - } - - else if(ischosen(p_primitiveContent.accessControlPolicy)){ // ACP - v_primitiveContent := {accessControlPolicy := mw_contentAcpBase}; + if (PX_UT_IMPLEMENTED){ + + p_utRequest.requestPrimitive.requestIdentifier := "m_uttriggerPrimitive" & f_rnd(1, 1000000); - if(ispresent(p_primitiveContent.accessControlPolicy.labels)){ - v_primitiveContent.accessControlPolicy.labels := ?; - } - if(ispresent(p_primitiveContent.accessControlPolicy.announceTo)){ - v_primitiveContent.accessControlPolicy.announceTo := ?; - } - } - - else if(ischosen(p_primitiveContent.contentInstance)){ // ContentInstance - v_primitiveContent := {contentInstance := mw_contentContentInstanceBase}; - - if(ispresent(p_primitiveContent.contentInstance.labels)){ - v_primitiveContent.contentInstance.labels := ?; - } - if(ispresent(p_primitiveContent.contentInstance.announceTo)){ - v_primitiveContent.contentInstance.announceTo := ?; - } - if(ispresent(p_primitiveContent.contentInstance.announcedAttribute)){ - v_primitiveContent.contentInstance.announcedAttribute := ?; - } - if(ispresent(p_primitiveContent.contentInstance.creator)){ - v_primitiveContent.contentInstance.creator := ?; - } - if(ispresent(p_primitiveContent.contentInstance.contentInfo)){ - v_primitiveContent.contentInstance.contentInfo := ?; - } - if(ispresent(p_primitiveContent.contentInstance.ontologyRef)){ - v_primitiveContent.contentInstance.ontologyRef := ?; - } - } - - else if(ischosen(p_primitiveContent.group_)){ // Group - v_primitiveContent := {group_ := mw_contentGroupBase}; - - if(ispresent(p_primitiveContent.group_.labels)){ - v_primitiveContent.group_.labels := ?; - } - if(ispresent(p_primitiveContent.group_.accessControlPolicyIDs)){ - v_primitiveContent.group_.accessControlPolicyIDs := ?; - } - if(ispresent(p_primitiveContent.group_.announceTo)){ - v_primitiveContent.group_.announceTo := ?; - } - if(ispresent(p_primitiveContent.group_.announcedAttribute)){ - v_primitiveContent.group_.announcedAttribute := ?; - } - if(ispresent(p_primitiveContent.group_.creator)){ - v_primitiveContent.group_.creator := ?; - } - if(ispresent(p_primitiveContent.group_.membersAccessControlPolicyIDs)){ - v_primitiveContent.group_.membersAccessControlPolicyIDs := ?; - } - if(ispresent(p_primitiveContent.group_.memberTypeValidated)){ - v_primitiveContent.group_.memberTypeValidated := ?; - } - if(ispresent(p_primitiveContent.group_.consistencyStrategy)){ - v_primitiveContent.group_.consistencyStrategy := ?; - } - if(ispresent(p_primitiveContent.group_.groupName)){ - v_primitiveContent.group_.groupName := ?; - } - } - - else if(ischosen(p_primitiveContent.pollingChannel)){ // PollingChannel - v_primitiveContent := {pollingChannel := mw_contentPollingChannelBase}; - - if(ispresent(p_primitiveContent.pollingChannel.labels)){ - v_primitiveContent.pollingChannel.labels := ?; - } - } - - else if(ischosen(p_primitiveContent.schedule)){ // Schedule - v_primitiveContent := {schedule := mw_contentScheduleBase}; - - if(ispresent(p_primitiveContent.schedule.labels)){ - v_primitiveContent.schedule.labels := ?; - } - if(ispresent(p_primitiveContent.schedule.announceTo)){ - v_primitiveContent.schedule.announceTo := ?; - } - if(ispresent(p_primitiveContent.schedule.announcedAttribute)){ - v_primitiveContent.schedule.announcedAttribute := ?; - } - } - - else if(ischosen(p_primitiveContent.subscription)){ // Subscription - v_primitiveContent := {subscription := mw_contentSubscriptionBase}; - - if(ispresent(p_primitiveContent.subscription.labels)){ - v_primitiveContent.subscription.labels := ?; - } - if(ispresent(p_primitiveContent.subscription.accessControlPolicyIDs)){ - v_primitiveContent.subscription.accessControlPolicyIDs := ?; - } - if(ispresent(p_primitiveContent.subscription.creator)){ - v_primitiveContent.subscription.creator := ?; - } - if(ispresent(p_primitiveContent.subscription.eventNotificationCriteria)){ - v_primitiveContent.subscription.eventNotificationCriteria := ?; - } - if(ispresent(p_primitiveContent.subscription.expirationCounter)){ - v_primitiveContent.subscription.expirationCounter := ?; - } - if(ispresent(p_primitiveContent.subscription.groupID)){ - v_primitiveContent.subscription.groupID := ?; - } - if(ispresent(p_primitiveContent.subscription.notificationForwardingURI)){ - v_primitiveContent.subscription.notificationForwardingURI := ?; - } - if(ispresent(p_primitiveContent.subscription.batchNotify)){ - v_primitiveContent.subscription.batchNotify := ?; - } - if(ispresent(p_primitiveContent.subscription.rateLimit)){ - v_primitiveContent.subscription.rateLimit := ?; - } - if(ispresent(p_primitiveContent.subscription.preSubscriptionNotify)){ - v_primitiveContent.subscription.preSubscriptionNotify := ?; - } - if(ispresent(p_primitiveContent.subscription.pendingNotification)){ - v_primitiveContent.subscription.pendingNotification := ?; - } - if(ispresent(p_primitiveContent.subscription.notificationStoragePriority)){ - v_primitiveContent.subscription.notificationStoragePriority := ?; - } - if(ispresent(p_primitiveContent.subscription.latestNotify)){ - v_primitiveContent.subscription.latestNotify := ?; - } - if(ispresent(p_primitiveContent.subscription.notificationContentType)){ - v_primitiveContent.subscription.notificationContentType := ?; - } - if(ispresent(p_primitiveContent.subscription.notificationEventCat)){ - v_primitiveContent.subscription.notificationEventCat := ?; - } - if(ispresent(p_primitiveContent.subscription.subscriberURI)){ - v_primitiveContent.subscription.subscriberURI := ?; - } - } - else if(ischosen(p_primitiveContent.remoteCSE)){ //remoteCSE - v_primitiveContent := {remoteCSE := mw_contentRemoteCSEBase}; - - if(ispresent(p_primitiveContent.remoteCSE.labels)){ - v_primitiveContent.remoteCSE.labels := ?; - } - - if(ispresent(p_primitiveContent.remoteCSE.accessControlPolicyIDs)){ - v_primitiveContent.remoteCSE.accessControlPolicyIDs := ?; - } - - if(ispresent(p_primitiveContent.remoteCSE.announceTo)){ - v_primitiveContent.remoteCSE.announceTo := ?; - } - - if(ispresent(p_primitiveContent.remoteCSE.announcedAttribute)){ - v_primitiveContent.remoteCSE.announcedAttribute := ?; - } + deactivate; + utPort.send(valueof(p_utRequest)); + + tc_wait.start; + alt{ + [] utPort.receive(mw_utResponseOK) { + tc_wait.stop; + setverdict(pass, __SCOPE__ & " : Triggering message is successfully received!"); + } + [] utPort.receive(mw_utResponseKO) { + tc_wait.stop; + setverdict(inconc, __SCOPE__ & " : Error while receiving Triggering message!"); + } + [] tc_wait.timeout{ + setverdict(inconc, __SCOPE__ & " : Timeout due to no response received from requested SUT!"); + } + } + + activate(a_default()); + if(vc_config == e_cf01) { + vc_aeSimu := activate(a_cse_cf01()); + } else if ((vc_config == e_cf02) or (vc_config == e_cf02CseSimuMaster)) { + if(vc_testSystemRole == e_ae) { + vc_aeSimu := activate(a_cse_cf02_ae1()); + } else if (vc_testSystemRole == e_cse) { + vc_cseSimu := activate(a_cse_cf02_cse1()); + } + } else if (vc_config == e_cf03) { + vc_cseSimu := activate(a_ae_cf03()); + } else if (vc_config == e_cf04) { + vc_cseSimu := activate(a_cse_cf04()); + } + }else{ + + action(p_action); - if(ispresent(p_primitiveContent.remoteCSE.cseType)){ - v_primitiveContent.remoteCSE.cseType := ?; - } - - if(ispresent(p_primitiveContent.remoteCSE.pointOfAccess)){ - v_primitiveContent.remoteCSE.pointOfAccess := ?; - } - - if(ispresent(p_primitiveContent.remoteCSE.m2M_Ext_ID)){ - v_primitiveContent.remoteCSE.m2M_Ext_ID := ?; - } - - if(ispresent(p_primitiveContent.remoteCSE.trigger_Recipient_ID)){ - v_primitiveContent.remoteCSE.trigger_Recipient_ID := ?; - } - - if(ispresent(p_primitiveContent.remoteCSE.nodeLink)){ - v_primitiveContent.remoteCSE.nodeLink := ?; } - } - return v_primitiveContent; + } + + }//end of group UtFunctions + + + /** + * @desc Proccessing of the CREATE request primitive + * @param p_request Request primitive to be processed + * @return Local resource index + */ + function f_processCreateRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer { + var integer v_parentIndex := -1; + var integer v_localResourceIndex := -1; + var PrimitiveContent v_localResource; + + v_parentIndex := f_getResourceIndex(p_request.to_); + if(v_parentIndex == -1) { + setverdict(inconc,__SCOPE__&": ERROR: Target resource not found"); + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier)); + + } else { + setverdict(pass, __SCOPE__&":INFO: Resource created successfuly"); + v_localResource := f_generateLocalResource(p_request.primitiveContent, v_parentIndex, p_request.resourceType); + v_localResourceIndex := f_setLocalResource(v_localResource, p_request.resourceType, v_parentIndex); + + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2001,p_request.requestIdentifier)); + vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_localResourceIndex].resource; + } + vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID; + vc_response.primitive.responsePrimitive.to_ := p_request.from_; + + return v_localResourceIndex; } /** - * @desc Comparison of two primitiveContent parameters - * @param p_responsePrimitiveContent Received primitiveContent - * @param p_requestPrimitiveContent Sent primitiveContent - * @verdict + * @desc Proccessing of the UPDATE request primitive + * @param p_request Request primitive to be processed */ - function f_match2PrimitiveContent (in PrimitiveContent p_responsePrimitiveContent, in template PrimitiveContent p_requestPrimitiveContent) runs on Tester { - var template PrimitiveContent v_primitiveContent; - var PrimitiveContent v_response; - v_response := p_responsePrimitiveContent; - v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitiveContent); - if(not(match(v_response, v_primitiveContent))){ - setverdict(inconc, __SCOPE__&":INFO: Resource incomplete, some attribute missing "); + function f_processUpdateRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer { + var integer v_targetLocalResourceIndex := -1; + + v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_); + if(v_targetLocalResourceIndex == -1) { + setverdict(inconc,__SCOPE__&": ERROR: Target resource not found"); + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier)); + + } else { + setverdict(pass, __SCOPE__&":INFO: Resource updated successfuly"); + f_updateLocalResource(v_targetLocalResourceIndex, p_request.primitiveContent); + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2004,p_request.requestIdentifier)); + vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_targetLocalResourceIndex].resource; } - - } + vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID; + vc_response.primitive.responsePrimitive.to_ := p_request.from_; + return v_targetLocalResourceIndex; + } + /** - * @desc Retrieve Year from a given timestamp - * @param p_timestamp Given timestamp - * @return Year + * @desc Proccessing of the RETRIEVE request primitive + * @param p_request Request primitive to be processed */ - function f_getYear(charstring p_timestamp) runs on Tester return charstring { - - var charstring v_year := ""; - var integer i; - - for(i := 0; i <= 3; i := i+1){ - v_year := v_year & p_timestamp[i]; + function f_processRetrieveRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer { + var integer v_targetLocalResourceIndex := -1; + + v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_); + if(v_targetLocalResourceIndex == -1) { + setverdict(inconc,__SCOPE__&": ERROR: Target resource not found"); + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier)); + + } else { + setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly"); + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2000,p_request.requestIdentifier)); + vc_response.primitive.responsePrimitive.primitiveContent := vc_localResourcesList[v_targetLocalResourceIndex].resource; } - return v_year; - - } // end f_getYear + vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID; + vc_response.primitive.responsePrimitive.to_ := p_request.from_; + return v_targetLocalResourceIndex; + } + /** - * @desc Retrieve Month from a given timestamp - * @param p_timestamp Given timestamp - * @return Year + * @desc Proccessing of the DELETE request primitive + * @param p_request Request primitive to be processed */ - function f_getMonth(charstring p_timestamp) runs on Tester return charstring { - - var charstring v_month := ""; + function f_processDeleteRequestPrimitive(in RequestPrimitive p_request) runs on CseSimu return integer { + var integer v_targetLocalResourceIndex := -1; + + v_targetLocalResourceIndex := f_getResourceIndex(p_request.to_); + if(v_targetLocalResourceIndex == -1) { + setverdict(inconc,__SCOPE__&": ERROR: Target resource not found"); + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int4004,p_request.requestIdentifier)); + + } else { + setverdict(pass, __SCOPE__&":INFO: Resource deleted successfuly"); + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2002,p_request.requestIdentifier)); + } + vc_response.primitive.responsePrimitive.from_ := PX_CSE1_ID; + vc_response.primitive.responsePrimitive.to_ := p_request.from_; + + return v_targetLocalResourceIndex; + } + + /** + * @desc Get the Resource Identifier with Unstructured-CSE-relative -Resource-ID format + * @return Cleaned-up resourceID + */ + function f_resourceIdCleaner(in XSD.ID p_resourceID) return XSD.ID { + var integer v_length := lengthof(p_resourceID); var integer i; + var XSD.ID result := ""; - for(i := 4; i <= 5; i := i+1){ - if(p_timestamp[i] != "0") { - v_month := v_month & p_timestamp[i]; + //log("p_resourceID: " & p_resourceID); + for (i := v_length - 1; i>=0; i := i-1){ + if(p_resourceID[i]=="/"){ + //log("result: " & result); + return result; } + else{ + result := p_resourceID[i] & result; + } } - return v_month; - - } // end f_getMonth + //log("result: " & result); + return result; + } /** - * @desc Retrieve Time from a given timestamp - * @param p_timestamp Given timestamp - * @return Time + * @desc It removes the poa from a given url + * @param p_url URL + * @return Resource Identifier + * NOT USED FOR THE TIME BEING */ - function f_getTime(charstring p_timestamp) runs on Tester return integer { - - var charstring v_time := ""; + function f_removePoa(in XSD.ID p_url) return XSD.ID { + var integer v_length := lengthof(p_url); var integer i; + var integer v_numberOfColons := 0; + var boolean v_lookForSlash := false; + var boolean v_getURI := false; + var XSD.ID v_uri := ""; - for(i := 9; i <= 14; i := i+1){ - v_time := v_time & p_timestamp[i]; + //TODO Process when FQDN is used in the URL + for (i := 0; i<v_length; i := i + 1){ + if(v_getURI) { + v_uri := v_uri & p_url[i]; + } else { + if(p_url[i]==":"){ + v_numberOfColons := v_numberOfColons + 1; + } + if(v_numberOfColons >= 2) { + v_lookForSlash := true; + } + if(v_lookForSlash) { + if(p_url[i]=="/") { + v_getURI := true; + } + } + } } - return str2int(v_time); - } // end f_getYear + + if(v_uri == "") { + return p_url; + } else { + return v_uri; + } + } /** - * @desc Retrieve IP address from a given address which includes port information separated by : - * @param p_addressPort Given address - * @return IPv4 Address + * @desc Removal of an element from a given integer list + * @param p_list Given integer list + * @param p_valueToBeDeleted Element value to be removed + * @verdict */ - function f_getIpv4Address(charstring p_addressPort) runs on Tester return charstring { - - var charstring v_ipv4Address := ""; - var integer i:= 0; - - while ((i < lengthof(p_addressPort)-1) and (p_addressPort[i] != ":")){ - v_ipv4Address := v_ipv4Address & p_addressPort[i]; - i := i + 1; + function f_removeElementFromList (inout IntegerList p_list, in integer p_valueToBeDeleted) { + var IntegerList result := {}; + var integer i; + for(i := 0; i < lengthof(p_list); i := i+1){ + if(p_list[i] != p_valueToBeDeleted){ + result := result & {p_list[i]}; + } } - return v_ipv4Address; - - } // end f_getIpv4Address - + p_list := result; + } + + /** + * @desc Comparison of two primitiveContent parameters + * @param p_responsePrimitiveContent Received primitiveContent + * @param p_requestPrimitiveContent Sent primitiveContent + * @verdict + */ + function f_match2PrimitiveContent (in PrimitiveContent p_responsePrimitiveContent, in template PrimitiveContent p_requestPrimitiveContent) runs on Tester { + var template PrimitiveContent v_primitiveContent; + var PrimitiveContent v_response; + v_response := p_responsePrimitiveContent; + v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitiveContent); + if(not(match(v_response, v_primitiveContent))){ + setverdict(inconc, __SCOPE__&":INFO: Resource incomplete, some attribute missing "); + } + + } + }//end of commonFunctions group externalFunctions { diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 4e524cfdf5ae5eb5d8b530539a2c73ef538f8d09..decec6f046600eff73b5e7dfaa611adf86b6eb9e 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -1539,7 +1539,7 @@ module OneM2M_Templates { /** * @desc Base NOTIFY request primitive */ - template RequestPrimitive m_notifyNotification(XSD.ID p_resourceAddress, Notification p_notification) modifies m_notify := { + template RequestPrimitive m_notifyNotification(XSD.ID p_resourceAddress, template (value) Notification p_notification) modifies m_notify := { primitiveContent := {notification := p_notification}, requestExpirationTimestamp := {alt_1 := 10000}//Needed for polling }; diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index c6144cca5fd2e02477a0507f182200e98b1b2621..0fcf98729f5f534eb293b071edc49c9f5cbbdba6 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -1450,7 +1450,7 @@ module OneM2M_PermutationFunctions { vc_remoteCseIndex := f_cse_registerRemoteCse(p_request, p_contentResponse); //Check if the resource has been deleted or not - if(f_cse_isResourcePresent(vc_remoteCseIndex)) { + if(f_cse_isResourcePresent_cseSimu(vc_remoteCseIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); @@ -1739,7 +1739,7 @@ module OneM2M_PermutationFunctions { // Preamble - v_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()})); + v_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()})); vc_ae1.start(f_cse_preamble_registerAe()); vc_ae1.done; @@ -1829,7 +1829,7 @@ module OneM2M_PermutationFunctions { v_cseBaseIndex := f_getLatestLocalResourceIndex(vc_cse1); - vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()}))); + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()}))); f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); v_aeIndex := f_cse_preamble_registerAe(); @@ -1989,7 +1989,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if (f_isResourcePresent(v_resourceIndex)){ + if (f_cse_isResourcePresent(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -2071,7 +2071,7 @@ module OneM2M_PermutationFunctions { f_checkCseSimuStatus(); //Check to see if the resource is present or not - if (f_cse_isResourcePresent(v_resourceIndex)){ + if (f_cse_isResourcePresent_cseSimu(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -2134,7 +2134,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_resourceIndex)){ + if(f_cse_isResourcePresent(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -2263,7 +2263,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -2320,7 +2320,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -2381,7 +2381,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_resourceIndex)){ + if(f_cse_isResourcePresent(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -2445,7 +2445,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_parentIndex, p_resourceName)){ + if(f_cse_isResourceNotPresent(v_parentIndex, p_resourceName)){ setverdict(pass, __SCOPE__ & ":INFO: Oldest resource " & int2str(enum2int(p_resourceTypeChild)) & " has been removed to allow the creation of the new instance"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Oldest resource " & int2str(enum2int(p_resourceTypeChild)) & " has not been removed to allow the creation of the new instance"); @@ -2507,7 +2507,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_parentIndex, p_resourceName)){ + if(f_cse_isResourceNotPresent(v_parentIndex, p_resourceName)){ setverdict(pass, __SCOPE__ & ":INFO: Oldest resource " & int2str(enum2int(p_resourceTypeChild)) & " has been removed to allow the creation of the new instance"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Oldest resource " & int2str(enum2int(p_resourceTypeChild)) & " has not been removed to allow the creation of the new instance"); @@ -2598,7 +2598,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_resourceIndex)) { + if(f_cse_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -2962,7 +2962,7 @@ module OneM2M_PermutationFunctions { f_checkCseSimuStatus(); //Check to see if the resource is present or not - if (f_cse_isResourcePresent(v_resourceIndex)){ + if (f_cse_isResourcePresent_cseSimu(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -3004,7 +3004,7 @@ module OneM2M_PermutationFunctions { mcaPort.send(f_getMsgOutPrimitive(m_request(v_request))); - vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc)); + vc_cse1.start(f_cse_receiveCreateRequest_cseSimu(p_requestAnnc)); vc_cse1.done; // Postamble @@ -3054,7 +3054,7 @@ module OneM2M_PermutationFunctions { // Test Body v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); - vc_cse1.start(f_cse_receiveCreateRequest(p_requestAnnc)); + vc_cse1.start(f_cse_receiveCreateRequest_cseSimu(p_requestAnnc)); mcaPort.send(f_getMsgOutPrimitive(m_request(v_request))); vc_cse1.done; @@ -5194,7 +5194,7 @@ module OneM2M_PermutationFunctions { // Preamble if(p_resourceType != int2) { - v_aeIndex := f_cse_preamble_registerAe(-, {f_getAnnouncementTargetPoA("HTTP", PX_AE1_ADDRESS, "")});//c_CRUDNDi); + v_aeIndex := f_cse_preamble_registerAe(-, {f_getCompletePoA("HTTP", PX_AE1_ADDRESS, "")});//c_CRUDNDi); } if(p_resourceType != int1) { @@ -5465,7 +5465,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if (f_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){ + if (f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){ setverdict(pass, __SCOPE__ & ":INFO: Resource deleted"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not deleted"); @@ -5553,7 +5553,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check if the resource has been deleted or not - if(f_isResourcePresent(v_resourceIndex)) { + if(f_cse_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource not deleted"); } else { setverdict(fail, __SCOPE__ & ":INFO: Resource deleted"); @@ -6363,7 +6363,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_childResourceIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_childResourceIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Subscription resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Subscription resource created"); @@ -6942,7 +6942,7 @@ module OneM2M_PermutationFunctions { v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getCompletePoA(-, PX_AE1_ADDRESS, -)}); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); @@ -7003,7 +7003,7 @@ module OneM2M_PermutationFunctions { v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; vc_acpAuxIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}, {f_getCompletePoA(-, PX_AE1_ADDRESS, -)}); // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); @@ -7190,7 +7190,7 @@ module OneM2M_PermutationFunctions { // Test adapter configuration //Register the CSE - vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()}))); + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()}))); vc_cse1.done; f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); @@ -7260,7 +7260,7 @@ module OneM2M_PermutationFunctions { f_cf02Up(); //Register the CSE - vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()}))); + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()}))); f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); @@ -7393,7 +7393,7 @@ module OneM2M_PermutationFunctions { // Test adapter configuration //Register the CSE - vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()}))); + vc_cse1.start(f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()}))); f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1); @@ -7458,7 +7458,7 @@ module OneM2M_PermutationFunctions { // Test adapter configuration // Register the CSE - f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()})); + f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()})); //Preamble vc_ae1.start(f_cse_createResource(int2,v_create)); @@ -7592,7 +7592,7 @@ module OneM2M_PermutationFunctions { // Test adapter configuration // Register the CSE - vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()})); + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()})); //Preamble vc_ae1.start(f_cse_createResource(int2,v_create)); @@ -7723,7 +7723,7 @@ module OneM2M_PermutationFunctions { //Test adapter configuration // Register the CSE - vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()})); + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()})); f_checkCseSimuStatus(); @@ -7764,7 +7764,7 @@ module OneM2M_PermutationFunctions { //Test adapter configuration // Register the CSE - vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getAnnouncementTargetPoA()})); + vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(-, -, -, -, {f_getCompletePoA()})); f_checkCseSimuStatus(); vc_ae1.start(f_cse_createResource(int2,v_create)); @@ -8845,7 +8845,7 @@ module OneM2M_PermutationFunctions { vc_cse1.done; //Check to see if the resource is present or not - if (f_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){ + if (f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(vc_resourcesList[v_resourceIndex].resource))){ setverdict(pass, __SCOPE__ & ":INFO: Resource deleted"); }else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not deleted"); @@ -9357,7 +9357,7 @@ module OneM2M_PermutationFunctions { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if (f_isResourcePresent(v_resourceIndex)){ + if (f_cse_isResourcePresent(v_resourceIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -9491,7 +9491,7 @@ module OneM2M_PermutationFunctions { v_contentResponse.uRI := ?; - v_aeIndex := f_cse_preamble_registerAe(-, {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING_AE1, PX_AE1_ADDRESS, "")});//c_CRUDNDi); + v_aeIndex := f_cse_preamble_registerAe(-, {f_getCompletePoA(PX_PROTOCOL_BINDING_AE1, PX_AE1_ADDRESS, "")});//c_CRUDNDi); if(ispresent(p_parentRequestPrimitive)) { v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); p_requestPrimitive.to_ := f_getResourceAddress(v_resourceIndex); @@ -9565,7 +9565,7 @@ module OneM2M_PermutationFunctions { v_contentResponse.uRI := ?; - v_aeIndex := f_cse_preamble_registerAe(-, {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING_AE1, PX_AE1_ADDRESS, "")});//c_CRUDNDi); + v_aeIndex := f_cse_preamble_registerAe(-, {f_getCompletePoA(PX_PROTOCOL_BINDING_AE1, PX_AE1_ADDRESS, "")});//c_CRUDNDi); if(ispresent(p_parentRequestPrimitive)) { v_resourceIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_aeIndex); @@ -9642,11 +9642,11 @@ module OneM2M_PermutationFunctions { v_contentResponse.uRI := ?; - v_aeIndex := f_cse_preamble_registerAe(-, {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING_AE1, PX_AE1_ADDRESS, "")});//c_CRUDNDi); + v_aeIndex := f_cse_preamble_registerAe(-, {f_getCompletePoA(PX_PROTOCOL_BINDING_AE1, PX_AE1_ADDRESS, "")});//c_CRUDNDi); f_checkAeSimuStatus(); - vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING_AE2, PX_AE2_ADDRESS, "")}))); // AE2 is registred + vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, c_defaultAE2Name, {f_getCompletePoA(PX_PROTOCOL_BINDING_AE2, PX_AE2_ADDRESS, "")}))); // AE2 is registred f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index 8078cf0b9d478d55b50d4620e128443f0aba50e1..8de0e84ee963005e98348ac81dfe74c6aabc6d60 100644 --- a/OneM2M_Testcases_CSE_Release_1.ttcn +++ b/OneM2M_Testcases_CSE_Release_1.ttcn @@ -710,17 +710,17 @@ module OneM2M_Testcases_CSE_Release_1 { [] mccPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation redirected."); - f_cse_sendResponse(v_request); + f_cse_sendResponse_cseSimu(v_request); } [] mccPortIn.receive(mw_request(mw_createAEAnnc())) -> value v_request { tc_ac.stop; setverdict(fail, __SCOPE__ & ": AE creation redirected but wrong parameters"); - f_cse_sendResponse(v_request); + f_cse_sendResponse_cseSimu(v_request); } [] mccPortIn.receive(mw_request(?))-> value v_request { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Unexpected message received"); - f_cse_sendResponse(v_request); + f_cse_sendResponse_cseSimu(v_request); } [] tc_ac.timeout { setverdict(fail, __SCOPE__ & ": No answer while creating AE"); @@ -1722,7 +1722,7 @@ module OneM2M_Testcases_CSE_Release_1 { } //Check to see if the resource is present or not - if (f_isResourcePresent(vc_aeAuxIndex)){ + if (f_cse_isResourcePresent(vc_aeAuxIndex)){ setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -2072,7 +2072,7 @@ module OneM2M_Testcases_CSE_Release_1 { vc_remoteCseIndex := f_cse_registerRemoteCse(v_request, v_contentResponse); //Check if the resource has been deleted or not - if(f_cse_isResourcePresent(vc_remoteCseIndex)) { + if(f_cse_isResourcePresent_cseSimu(vc_remoteCseIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); @@ -3174,7 +3174,7 @@ module OneM2M_Testcases_CSE_Release_1 { } // Check if the resource has been deleted or not - if(f_cse_isResourcePresent(vc_remoteCseIndex)) { + if(f_cse_isResourcePresent_cseSimu(vc_remoteCseIndex)) { setverdict(fail, __SCOPE__ & ":INFO: Resource not deleted"); } else { setverdict(pass, __SCOPE__ & ":INFO: Resource deleted"); @@ -4035,7 +4035,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){ + if(f_cse_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){ setverdict(pass, __SCOPE__ & ":INFO: Oldest contentInstance has been removed to allow the creation of the new contentInstance"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Oldest contentInstance has not been removed to allow the creation of the new contentInstance"); @@ -4122,7 +4122,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){ + if(f_cse_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){ setverdict(pass, __SCOPE__ & ":INFO: Oldest contentInstance has been removed to allow the creation of the new contentInstance"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Oldest contentInstance has not been removed to allow the creation of the new contentInstance"); @@ -4282,7 +4282,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -4362,7 +4362,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -5849,7 +5849,7 @@ module OneM2M_Testcases_CSE_Release_1 { v_ae1.done; v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;//Attribute 3 v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_2; //Attribute 1 - v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2 + v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getCompletePoA()};//Attribute 2 v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;//Attribute 3 v_nullFields := {{"labels", omit}}; @@ -8699,7 +8699,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_resourceIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_resourceIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -8774,7 +8774,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_contentInstanceResourceIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_contentInstanceResourceIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -8854,7 +8854,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -8928,7 +8928,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -9353,7 +9353,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_acpIndex)) { + if(f_cse_isResourcePresent(v_acpIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -9438,7 +9438,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_acpIndex)) { + if(f_cse_isResourcePresent(v_acpIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -9523,7 +9523,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_acpIndex)) { + if(f_cse_isResourcePresent(v_acpIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -9598,7 +9598,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourceNotPresent(-1, v_createRequest.primitiveContent.accessControlPolicy.resourceName)) { + if(f_cse_isResourceNotPresent(-1, v_createRequest.primitiveContent.accessControlPolicy.resourceName)) { setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -11109,7 +11109,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -11197,7 +11197,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); diff --git a/OneM2M_Testcases_CSE_Release_2.ttcn b/OneM2M_Testcases_CSE_Release_2.ttcn index ce79c10547e581a3233b6cadb45305d4dfa9dcff..42b1fc6eab743885a556a3a8eef2ee203148ebaf 100644 --- a/OneM2M_Testcases_CSE_Release_2.ttcn +++ b/OneM2M_Testcases_CSE_Release_2.ttcn @@ -2335,7 +2335,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); v_ae1.done; - v_createRequest.primitiveContent.timeSeries.announceTo := {f_getAnnouncementTargetPoA()}; + v_createRequest.primitiveContent.timeSeries.announceTo := {f_getCompletePoA()}; v_ae1.start(f_CSE_DMR_CRE_020(int29, v_createRequest, mw_createTimeSeriesAnncBase));//TimeSeries v_ae1.done; @@ -2348,7 +2348,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); v_ae1.done; - v_createRequest.primitiveContent.timeSeriesInstance.announceTo := {f_getAnnouncementTargetPoA()}; + v_createRequest.primitiveContent.timeSeriesInstance.announceTo := {f_getCompletePoA()}; v_ae1.start(f_CSE_DMR_CRE_020(int30, v_createRequest, mw_createTimeSeriesInstanceAnncBase));//TimeSeriesInstance v_ae1.done; @@ -5029,7 +5029,7 @@ module OneM2M_Testcases_CSE_Release_2 { v_ae1.done; v_createRequest.primitiveContent.schedule.scheduleElement := {{"0 0 0,1,2 1 1 * *"}};//Attribute 1 v_updateRequest.primitiveContent.schedule.scheduleElement := {{"1 1 1,2 1 1 * *"}}; //Attribute 1 - v_updateRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2 + v_updateRequest.primitiveContent.schedule.announceTo := {f_getCompletePoA()};//Attribute 2 v_updateRequest.primitiveContent.schedule.labels := v_labels_1;//Attribute 3 v_nullFields := {{"labels", omit}}; @@ -8032,7 +8032,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -8107,7 +8107,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_resourceIndex)) { + if(f_cse_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -8190,7 +8190,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -8263,7 +8263,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_checkAeSimuStatus(); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -8495,7 +8495,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_resourceIndex)) { + if(f_cse_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -8574,7 +8574,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_checkAeSimuStatus(); //Check to see if the resource is present or not - if(f_isResourcePresent(v_resourceIndex)) { + if(f_cse_isResourcePresent(v_resourceIndex)) { setverdict(pass, __SCOPE__ & ":INFO: Resource created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); @@ -9101,7 +9101,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -9178,7 +9178,7 @@ module OneM2M_Testcases_CSE_Release_2 { f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); //Check to see if the resource is NOT present - if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + if(f_cse_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); } else { setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); @@ -13743,7 +13743,7 @@ module OneM2M_Testcases_CSE_Release_2 { var XSD.NonNegativeInteger v_missingDataPointNumber := 1; var template PrimitiveContent v_contentNotification := {timeSeries := mw_contentTimeSeries(?,v_missingDataPointNumber)}; - v_eventNotificationCriteria.missingData := valueof(m_missingData(v_missingDataPointNumber, "P60")); + v_eventNotificationCriteria.missingData := valueof(m_missingData(v_missingDataPointNumber, "PT0H")); // Test control @@ -13811,7 +13811,7 @@ module OneM2M_Testcases_CSE_Release_2 { var XSD.NonNegativeInteger v_missingDataPointNumber := 100; var template PrimitiveContent v_contentResponse; - v_eventNotificationCriteria.missingData := valueof(m_missingData(v_missingDataPointNumber, "1000")); + v_eventNotificationCriteria.missingData := valueof(m_missingData(v_missingDataPointNumber, "PT0H")); // Test control