AE test cases from STF531-AE_UpperTester for Release 1

Signed-off-by: Miguel Angel Reina Ortega's avatarMiguel Angel Reina Ortega <miguelangel.reinaortega@etsi.org>
parent 5c9f35be
......@@ -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 {
/**
......
......@@ -22,5 +22,9 @@ module OneM2M_Pics {
modulepar boolean PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true;
modulepar boolean PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true;
modulepar boolean PICS_PRIMITIVE_SCOPE_CSE_RELATIVE := true;
modulepar boolean PICS_PRIMITIVE_SCOPE_SP_RELATIVE := true;
modulepar boolean PICS_PRIMITIVE_SCOPE_ABSOLUTE := true;
} // end of module
......@@ -52,4 +52,15 @@ module OneM2M_Ports {
RequestPrimitive, ResponsePrimitive, PrimitiveContent, MyResource;
}
/**
* @desc Port to transport control commands to Upper Tester Application
*/
type port UpperTesterPort message {
in
UtTriggerAckPrimitive;
out
UtTriggerPrimitive;
}
}//end module
This diff is collapsed.
......@@ -25,6 +25,7 @@ module OneM2M_TestSystem {
type component Tester {
port AdapterControlPort acPort;
port InfoPort infoPort;
port UpperTesterPort utPort;
//timers
timer tc_ac := PX_TAC;
timer tc_wait;
......
......@@ -4130,6 +4130,10 @@ module OneM2M_Types {
with {
encode "adapter";
}
type RequestPrimitive UtTriggerPrimitive;
type ResponsePrimitive UtTriggerAckPrimitive;
type record AttributeAux {
XSD.NCName name,
......
This diff is collapsed.
......@@ -11,7 +11,7 @@
* @desc Module containing test cases for oneM2M
*
*/
module OneM2M_Testcases {
module OneM2M_Testcases_CSE {
import from OneM2M_TestSystem all;
import from OneM2M_Templates all;
......
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