Corrections for TC_CSE_REG_CRE_005

Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 4c41009d
......@@ -750,6 +750,18 @@ module OneM2M_Functions {
p_ae.done;
}
/**
* @desc Calls to postamble for AeSimu component (i.e. AE1) on CseSimu
* @verdict
*/
function f_cse_postamble_ae1() runs on CseSimu {
if(vc_ae1.running) {
vc_ae1.stop;
}
vc_ae1.start(f_cse_postamble_deleteResources());
vc_ae1.done;
}
/**
* @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution
* @verdict
......@@ -760,10 +772,14 @@ module OneM2M_Functions {
var RequestPrimitive v_request;
if (PX_RUN_POSTAMBLE) {
if(vc_config == e_cf02CseSimuMaster) {
f_cse_postamble_ae1();
};
for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) {
v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]);
v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i], e_nonHierarchical);
v_request := valueof(m_delete(v_resourceAddress, f_getOriginator(vc_resourcesIndexToBeDeleted[i],false)));
......@@ -1003,6 +1019,11 @@ module OneM2M_Functions {
setverdict(pass, testcasename() & ": Resource present: " & f_getResourceAddress(p_resourceIndex));
return true;
}
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource: " & f_getResourceAddress(p_resourceIndex) & " not found");
return false;
}
[] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) {
tc_ac.stop;
setverdict(inconc, testcasename() & ": Wrong response status code in the response");
......@@ -1624,6 +1645,11 @@ module OneM2M_Functions {
setverdict(pass, testcasename() & ": Resource present: " & f_getResourceAddress(p_resourceIndex));
return true;
}
[] mccPort.receive(mw_response(mw_responsePrimitive(int4004))) {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource: " & f_getResourceAddress(p_resourceIndex) & " not found");
return false;
}
[] mccPort.receive(mw_response(mw_responsePrimitive(?, -))) {
tc_ac.stop;
setverdict(inconc, testcasename() & ": Wrong response status code in the response");
......@@ -1636,6 +1662,38 @@ module OneM2M_Functions {
}
return false;
}
/**
* @desc Check that a resource is not present in the IUT (resourceId is NOT known)
* @param p_parentIndex Index of the parent resource of the resource to be checked
* @param p_resourceName Resource name (Hierarchical method is used) of the resource to be checked
* @return boolean
*/
function f_cse_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on CseSimu return boolean {
log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource");
//Check to see if the resource has NOT been created
mccPort.send(m_request(m_retrieve(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex))));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int4004))) {
tc_ac.stop;
setverdict(pass, testcasename() & ": Resource not present");
return true;
}
[] mccPort.receive(mw_response(mw_responsePrimitive(?))) {
tc_ac.stop;
setverdict(inconc, testcasename() & ": Wrong response status code in the response");
return false;
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
return false;
}
}
return false;
}
/**
* @desc Registration of Test System (simulating a CSE) to the CSE IUT (creation of remoteCSE)
......@@ -1712,7 +1770,7 @@ module OneM2M_Functions {
v_response.primitiveContent.remoteCSE := vc_localResourcesList[vc_localRemoteCseIndex].resource.remoteCSE;
mccPortIn.send(m_response(v_response));
v_resourceIndex := f_setResource(v_request.primitive.requestPrimitive.primitiveContent, int16, -1);
v_resourceIndex := f_setResource(m_primitiveContentRemoteCSE(m_contentMyRemoteCSEResource), int16, -1);
}
[] mccPortIn.receive {
tc_ac.stop;
......@@ -2953,10 +3011,13 @@ module OneM2M_Functions {
if(vc_config == e_cf03) {
f_cf03Down();
stop;
} else if (vc_config ==e_cf04) {
} else if (vc_config ==e_cf04) {
f_cf04Down();
stop;
}
} else if (vc_config == e_cf02CseSimuMaster) {
f_cf02DownCseSimuMaster();
stop;
}
}
}
......
......@@ -87,7 +87,7 @@ module OneM2M_Pixits {
modulepar charstring PX_AE2_ADDRESS := "127.0.0.1:3142";
modulepar charstring PX_CSE1_ADDRESS := "127.0.0.1:3141";
modulepar charstring PX_CSE1_ADDRESS := "127.0.0.1:4141";
/**
......
......@@ -2867,6 +2867,15 @@ module OneM2M_Templates {
choice := omit//O
};
template RemoteCSE_optional m_contentMyRemoteCSEResource modifies m_contentRemoteCSE_allOmit := {
resourceName := PX_CSE1_NAME,//M
resourceType := int16,//M
pointOfAccess := {PX_CSE1_ADDRESS},//O
cSEBase := PX_CSE1_NAME,//M
cSE_ID := PX_CSE1_ID,//M
requestReachability := true//M
};
template RemoteCSE_optional mw_contentRemoteCSEBase := {
resourceName := ?,//M
resourceType := ?,//M
......
......@@ -566,15 +566,11 @@ module OneM2M_Testcases_CSE_Release_1 {
f_cf02UpCseSimuMaster();
//Preambule
//v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi);
vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSE);
//Test Body
vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, omit, omit)));
vc_ae1.start(f_cse_createResource(int2, m_createAe(PX_APP_ID, -, "S", omit)));
//v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex);
//mcaPort.send(m_request(v_request));
tc_ac.start;
alt{
[]mccPortIn.receive(mw_request(mw_createAEAnnc(f_getResourceAddress(-1,e_hierarchical, e_spRelative) & "/S", "CSE_ID", -))){
......
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