Commit db28da83 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Review of f_CSE_ANNC_CRE_002


Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 98427bf0
......@@ -1453,12 +1453,11 @@ module OneM2M_Functions {
* @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_parentIndex := -1) runs on AeSimu {
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;
var integer v_resourceIndex := -1;
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_requestUpdatePrimitive);
v_request := f_getUpdateRequestPrimitive(p_resourceType, p_targetIndex, p_requestUpdatePrimitive);
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
......
......@@ -7182,20 +7182,18 @@ module OneM2M_PermutationFunctions {
f_cf02Down();
} //end f_CSE_ANNC_CRE_001
function f_CSE_ANNC_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestUpdatePrimitive := omit) runs on CseSimu {
function f_CSE_ANNC_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_createRequest, in template RequestPrimitive p_updateRequest := omit) runs on CseSimu {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_parentIndex := -1;
var MsgIn v_request;
var PrimitiveContent v_remoteCSEAnncResource;
var integer v_aeIndex := -1;
var integer v_resourceIndex;
var integer v_remoteCSEAnncIndex := -1;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1);
//TODO var template RequestPrimitive v_remoteCSEAnnc := mw_createAccessControlPolicyAnnc;
// Test control
// Test component configuration
......@@ -7204,15 +7202,39 @@ module OneM2M_PermutationFunctions {
// Test adapter configuration
//Preamble
v_ae1.start(f_cse_createResource(int2,v_create));
v_ae1.start(f_cse_preamble_registerAe());
v_ae1.done;
v_aeIndex := f_getLatestResourceIndex(v_ae1);
v_ae1.start(f_cse_createResource(p_resourceType, p_createRequest, v_aeIndex));
v_ae1.done;
v_resourceIndex := f_getLatestResourceIndex(v_ae1);
// Test Body
v_ae1.start(f_cse_sendUpdateRequestPrimitive(p_resourceType, p_requestUpdatePrimitive));
v_ae1.start(f_cse_sendUpdateRequestPrimitive(p_resourceType, p_updateRequest, v_resourceIndex));
v_ae1.done;
f_cse_announcementProcedure_createHandler(p_createRequestAnnc);
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(mw_createRemoteCSEAnnc)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ":INFO: RemoteCSEAnnc CREATE received");
//Save resource and generate required attributes
v_remoteCSEAnncResource:= f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, vc_cSEBaseIndex,v_request.primitive.requestPrimitive.resourceType);
v_remoteCSEAnncIndex := f_setLocalResource(v_remoteCSEAnncResource, v_request.primitive.requestPrimitive.resourceType, vc_cSEBaseIndex);
setverdict(pass, __SCOPE__ & ":INFO: Announcement Parent Resource Address matched");
v_responsePrimitive := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier));
v_responsePrimitive.primitiveContent := vc_localResourcesList[v_remoteCSEAnncIndex].resource;
v_responsePrimitive.from_ := PX_CSE1_ID;
v_responsePrimitive.to_ := v_request.primitive.requestPrimitive.from_;
mccPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
}
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
......
......@@ -9814,12 +9814,12 @@ module OneM2M_Testcases_CSE_Release_2 {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
var template RequestPrimitive v_createRequestAnnc := mw_createAccessControlPolicyAnnc;
var template RequestPrimitive v_createRequest := m_createAcpBase;
f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1);
v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};
v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_002(int1, v_createRequestAnnc, v_updateRequest));//AccessControlPolicy
v_cse1.start(f_CSE_ANNC_CRE_002(int1, v_createRequest, v_updateRequest));//AccessControlPolicy
v_cse1.done;
}
 
......@@ -9827,12 +9827,12 @@ module OneM2M_Testcases_CSE_Release_2 {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var template RequestPrimitive v_createRequestAnnc := mw_createContainerAnncBase;
var template RequestPrimitive v_createRequest := m_createContainerBase;
f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1);
v_updateRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()};
v_updateRequest.primitiveContent.container.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_002(int3, v_createRequestAnnc, v_updateRequest));//Container
v_cse1.start(f_CSE_ANNC_CRE_002(int3, v_createRequest, v_updateRequest));//Container
v_cse1.done;
}
 
......@@ -9840,12 +9840,12 @@ module OneM2M_Testcases_CSE_Release_2 {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var template RequestPrimitive v_createRequestAnnc := mw_createGroupAnncBase;
var template RequestPrimitive v_createRequest := m_createGroupBase;
f_setProtocolBinding(PX_PROTOCOL_BINDING_CSE1);
v_updateRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()};
v_updateRequest.primitiveContent.group_.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_002(int9, v_createRequestAnnc, v_updateRequest));//Group
v_cse1.start(f_CSE_ANNC_CRE_002(int9, v_createRequest, v_updateRequest));//Group
v_cse1.done;
}
......@@ -9853,11 +9853,11 @@ module OneM2M_Testcases_CSE_Release_2 {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_updateRequest := m_updateTimeSeriesBase;
var template RequestPrimitive v_createRequestAnnc := mw_createTimeSeriesAnncBase;
var template RequestPrimitive v_createRequest := m_createTimeSeriesBase;
v_updateRequest.primitiveContent.timeSeries.announceTo := {f_getAnnouncementTargetPoA()};
v_updateRequest.primitiveContent.timeSeries.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_002(int29, v_createRequestAnnc, v_updateRequest));//TimeSeries
v_cse1.start(f_CSE_ANNC_CRE_002(int29, v_createRequest, v_updateRequest));//TimeSeries
v_cse1.done;
}
} //end group g_CSE_ANNC_CRE_002
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment