Commit 42b7920e 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 7a88d124
...@@ -1010,12 +1010,11 @@ module OneM2M_Testcases_CSE_Release_1 { ...@@ -1010,12 +1010,11 @@ module OneM2M_Testcases_CSE_Release_1 {
testcase TC_CSE_REG_CRE_010() runs on Tester system CseSystem { testcase TC_CSE_REG_CRE_010() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive; var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1)); v_ae1.start(f_setProtocolBinding(PX_PROTOCOL_BINDING_AE1));
v_ae1.done; v_ae1.done;
v_ae1.start(f_CSE_REG_CRE_010()); v_ae1.start(f_CSE_REG_CRE_010());
v_ae1.done;
v_ae1.done;
} }
...@@ -1024,6 +1023,7 @@ module OneM2M_Testcases_CSE_Release_1 { ...@@ -1024,6 +1023,7 @@ module OneM2M_Testcases_CSE_Release_1 {
var MsgIn v_response; var MsgIn v_response;
var RequestPrimitive v_request; var RequestPrimitive v_request;
var integer v_aeIndex := -1; var integer v_aeIndex := -1;
var template RequestPrimitive v_updateAeAnnc := mw_updateAEAnnc;
//Test control //Test control
if(not(PICS_MN_CSE)) { if(not(PICS_MN_CSE)) {
...@@ -1038,46 +1038,52 @@ module OneM2M_Testcases_CSE_Release_1 { ...@@ -1038,46 +1038,52 @@ module OneM2M_Testcases_CSE_Release_1 {
vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE)); vc_cse1.start(f_cse_registrationRemoteCse(mw_createRemoteCSE));
vc_cse1.done; 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])); 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()); f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
vc_cse1.done;
//TODO Deregister //AE Deregistration
//f_cse_deleteResource(v_aeIndex); vc_cse1.start(f_cse_announcementProcedure_updateHandler());
v_request := valueof(m_delete(f_getResourceAddress(v_aeIndex), f_getOriginator(v_aeIndex))); f_cse_deleteResource(v_aeIndex);
mcaPort.send(f_getMsgOutPrimitive(m_request(v_request)));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
//Test Body //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; tc_ac.start;
alt { alt {
[] mcaPortIn.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop; tc_ac.stop;
//continue to test the content //continue to test the content
if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)){ 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."); setverdict(pass, __SCOPE__ & ": AE creation success.");
}else{ }else{
setverdict(fail, __SCOPE__ & ": Error in AE content."); setverdict(fail, __SCOPE__ & ": Wrong AE-ID assigned during re registration");
} }
}else{ }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; tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating AE"); setverdict(fail, __SCOPE__ & ": Error while AE re registration ");
} }
[] tc_ac.timeout { [] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating AE"); setverdict(fail, __SCOPE__ & ": No answer while creating AE");
} }
} }
f_aeSimu_checkComponentDoneAndGetVerdict(vc_cse1);
// Postamble // Postamble
f_cse_postamble_deleteResources(); 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