Commit e39c441d authored by Naum Spaseski's avatar Naum Spaseski
Browse files

STF531 - correction of CSE/REG/CRE/022 and 023 & added a simpl postambleDelete function for CSE


Signed-off-by: default avatarNaum Spaseski <naum.spaseski@gmail.com>
parent f0116f7f
......@@ -376,6 +376,48 @@ module OneM2M_Functions {
f_cse_postamble_default();
}
/**
* @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution
* @verdict
*/
function f_cse_postamble_deleteResourcesCSE() runs on CseTester {
var integer i;
var XSD.ID v_resourceAddress;
var RequestPrimitive v_request;
if (PX_RUN_POSTAMBLE) {
for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) {
v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]);
v_request := valueof(m_delete(v_resourceAddress, f_getOriginator(vc_resourcesIndexToBeDeleted[i],false)));
v_request.from_ := PX_SUPER_CSE_ID;
mccPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
log(__SCOPE__&" INFO: Resource " & v_request.to_ & " deleted");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
log(__SCOPE__&" INFO: Error while deleting resource " & v_request.to_);
}
[] tc_ac.timeout {
log(__SCOPE__&" INFO: No answer while deleting resource " & v_request.to_);
}
}
}
}
f_cse_postamble_default();
}
/**
* @desc Default postamble
* @verdict
......@@ -1669,6 +1711,9 @@ module OneM2M_Functions {
if(ischosen(p_contentResource.serviceSubscribedAppRule)) {
return p_contentResource.serviceSubscribedAppRule.resourceName;
}
if(ischosen(p_contentResource.remoteCSE)) {
return p_contentResource.remoteCSE.resourceName;
}
log(__SCOPE__&":WARNING: Primitive Content Kind not implemented");
return "resourceNameNotFound";
......
......@@ -43,7 +43,7 @@ module OneM2M_TestControl {
execute(TC_CSE_REG_CRE_018());
execute(TC_CSE_REG_CRE_022());
execute(TC_CSE_REG_CRE_023());
execute(TC_CSE_REG_CRE_024());
execute(TC_CSE_REG_CRE_025());
execute(TC_CSE_REG_CRE_026());
execute(TC_CSE_REG_RET_001());
execute(TC_CSE_REG_RET_005());
......
......@@ -1293,6 +1293,8 @@ module OneM2M_Testcases {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive);
vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
......@@ -1308,7 +1310,7 @@ module OneM2M_Testcases {
}
// Postamble
f_cse_postamble_deleteResources();
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
......@@ -1345,6 +1347,8 @@ module OneM2M_Testcases {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully");
f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive);
vc_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
......@@ -1356,7 +1360,7 @@ module OneM2M_Testcases {
}
// Postamble
f_cse_postamble_deleteResources();
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
......
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