Skip to content
Snippets Groups Projects

Addition of AE tests

Merged Miguel Angel Reina Ortega requested to merge STF531-AE_UpperTester_for_Rel_1 into Release1
+ 571
18
Compare changes
  • Side-by-side
  • Inline
Files
@@ -1691,13 +1691,19 @@ module OneM2M_Functions {
* @return Internal resource index of AE or -1 in case of failure
* @verdict inconc if no AE registration request is received
*/
function f_ae_preamble_registerAe() runs on CseSimu return integer {
function f_ae_preamble_registerAe(template UtTriggerPrimitive p_utRequest := m_create) runs on CseSimu return integer {
var MsgIn v_request;
var PrimitiveContent v_modifiedResource;
var integer v_resourceIndex, v_parentIndex;
var RequestPrimitive v_rp;
if(not(ispresent(p_utRequest.primitiveContent))) {
p_utRequest.primitiveContent.aE := m_contentCreateAe(omit, omit, omit, omit);
}
f_sendUtPrimitive(p_utRequest);
tc_ac.start;
alt {
[] mcaPort.receive(mw_request(mw_createAe)) -> value v_request {
@@ -1725,7 +1731,55 @@ module OneM2M_Functions {
f_checkCseSimuStatus();
return v_resourceIndex;
}
}//end function f_ae_preamble_register
/**
* @desc Waits for Container create request and process it
* @return Internal resource index of Container or -1 in case of failure
* @verdict inconc if no Container create request is received
*/
function f_ae_preamble_createContainer(template UtTriggerPrimitive p_utRequest := m_create) runs on CseSimu return integer {
var MsgIn v_request;
var PrimitiveContent v_modifiedResource;
var integer v_resourceIndex, v_parentIndex;
var RequestPrimitive v_rp;
if(not(ispresent(p_utRequest.primitiveContent))) {
p_utRequest.primitiveContent.container := m_contentCreateContainer;
}
f_sendUtPrimitive(p_utRequest);
tc_ac.start;
alt {
[] mcaPort.receive(mw_request(mw_createContainer(?,?))) -> value v_request {
tc_ac.stop;
v_rp := v_request.primitive.requestPrimitive;
v_parentIndex := f_getResourceIndex(v_rp.to_);
v_resourceIndex := f_ae_createResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType, v_modifiedResource);
if(v_resourceIndex != -1) {
mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource)));
setverdict(pass, __SCOPE__&":INFO: Container created successfuly");
}
else {
mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier)));
setverdict(inconc, __SCOPE__&":INFO: Container creation failed");
}
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: Container create request not received");
stop;
}
}
f_checkCseSimuStatus();
return v_resourceIndex;
} //end function f_ae_preamble_createContainer
} // end preambleFunctions
@@ -2556,6 +2610,31 @@ module OneM2M_Functions {
}
function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest) runs on Tester {
p_utRequest.from_ := "UNINITIALIZED";
p_utRequest.requestIdentifier := "m_uttriggerPrimitive" & f_rnd(1, 1000000);
utPort.send(valueof(p_utRequest));
tc_wait.start;
alt{
[] utPort.receive(mw_utResponseOK) {
tc_wait.stop;
setverdict(pass, __SCOPE__, " : Triggering message is successfully received!");
}
[] utPort.receive(mw_utResponseKO) {
tc_wait.stop;
setverdict(inconc, __SCOPE__, " : Error while receiving Triggering message!");
}
[] tc_wait.timeout{
setverdict(inconc, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
}
group AltstepFunctions {
/**
Loading