Updated TC_CSE_DMR_DEL_005 to be run on Tester

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 06c12969
......@@ -8307,97 +8307,106 @@ module OneM2M_Testcases_CSE_Release_1 {
};//end of group g_CSE_DMR_DEL_002
group g_CSE_DMR_DEL_005{
/**
* @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted
*
*/
testcase TC_CSE_DMR_DEL_005() 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_CSE_DMR_DEL_005());
v_ae1.done;
}
/**
* @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted
*
*/
testcase TC_CSE_DMR_DEL_005() runs on AeSimu system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
if(ispresent(vc_resourcesList[v_resourceIndex].resource.container.stateTag)) {
v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
// Test Body
mcaPort.send(f_getMsgOutPrimitive(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete successfully");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
}
function f_CSE_DMR_DEL_005() runs on AeSimu system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
if(ispresent(vc_resourcesList[v_resourceIndex].resource.container.stateTag)) {
v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
// Test Body
mcaPort.send(f_getMsgOutPrimitive(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete successfully");
}
mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 2) { //(Create and Delete)
setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");
}
else{
setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
}
}
mcaPort.send(f_getMsgOutPrimitive(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 2) { //(Create and Delete)
setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
else{
setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
}
}
}//end if
else{
setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_DEL_005
} // end group g_CSE_DMR_DEL_005
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
}
}
}//end if
else{
setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_DEL_005
/**
* @desc Check that the IUT decreases the field value of attribute currentNrOfInstances and currentByteSize of parent container when a latest contentInstance resource is deleted successfully
*
......
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