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

Review and clean up of TC_CSE_REG_CRE_010


Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 61b4643e
......@@ -1010,12 +1010,11 @@ module OneM2M_Testcases_CSE_Release_1 {
testcase TC_CSE_REG_CRE_010() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
v_ae1.done;
v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
v_ae1.done;
v_ae1.start(f_CSE_REG_CRE_010());
v_ae1.done;
v_ae1.done;
}
......@@ -1024,6 +1023,7 @@ module OneM2M_Testcases_CSE_Release_1 {
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var template RequestPrimitive v_updateAeAnnc := mw_updateAEAnnc;
//Test control
if(not(PICS_MN_CSE)) {
......@@ -1038,46 +1038,52 @@ module OneM2M_Testcases_CSE_Release_1 {
vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
vc_cse1.done;
vc_cse1.start(f_cse_announcementProcedure_createHandler());
v_aeIndex := f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, PX_ALLOWED_S_AE_IDS[0]));
vc_cse1.start(f_cse_announcementProcedure_createHandler());
vc_cse1.done;
f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
//TODO Deregister
//f_cse_deleteResource(v_aeIndex);
v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
//AE Deregistration
vc_cse1.start(f_cse_announcementProcedure_updateHandler());
f_cse_deleteResource(v_aeIndex);
f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
//Test Body
f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, f_getResourceId(vc_resourcesList[v_aeIndex].resource)));
v_updateAeAnnc.primitiveContent.aEAnnc.link := PX_CSE_ID & "/" & f_getResourceId(vc_resourcesList[v_aeIndex].resource);
v_updateAeAnnc.primitiveContent.aEAnnc.labels := {"Credential-ID:None"};
vc_cse1.start(f_cse_announcementProcedure_updateHandler(v_updateAeAnnc));
v_request := valueof(m_createAe(PX_APP_ID, omit, f_getResourceId(vc_resourcesList[v_aeIndex].resource)));
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
vc_cse1.start(f_cse_announcementProcedure_createHandler(mw_createAEAnnc_s_ae_id(PX_CSE_ID, -, -, -)));
vc_cse1.done;
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
//continue to test the content
if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)){
if (v_response.primitive.responsePrimitive.primitiveContent.aE.app_ID == PX_APP_ID){
if (v_response.primitive.responsePrimitive.primitiveContent.aE.aE_ID == f_getResourceId(vc_resourcesList[v_aeIndex].resource)){
setverdict(pass, __SCOPE__ & ": AE creation success.");
}else{
setverdict(fail, __SCOPE__ & ": Error in AE content.");
setverdict(fail, __SCOPE__ & ": Wrong AE-ID assigned during re registration");
}
}else{
setverdict(fail, __SCOPE__ & ": primitiveContent doesn't exist");
setverdict(fail, __SCOPE__ & ": Ae representation not present");
}
}
[] mcaPortIn.receive {
[] mcaPort.receive (mw_response(mw_responsePrimitive(?))) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating AE");
setverdict(fail, __SCOPE__ & ": Error while AE re registration ");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating AE");
}
}
f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
// Postamble
f_cse_postamble_deleteResources();
......
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