Commit 4882a091 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega

Merge branch 'STF531-AE_UpperTester_for_Rel_1' into 'Release1'

Addition of AE tests



See merge request !23
parents ac99d137 04d4946b
......@@ -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,13 +11,14 @@
* @desc Module containing test cases for oneM2M
*
*/
module OneM2M_Testcases {
module OneM2M_Testcases_CSE {
import from OneM2M_TestSystem all;
import from OneM2M_Templates all;
import from OneM2M_Types all;//{type XSD.ID};
import from OneM2M_TypesAndValues all;
import from OneM2M_Pixits all;
import from LibCommon_Time all;
import from OneM2M_Pics all;
import from OneM2M_Functions all;
import from XSD all;
......@@ -18111,7 +18112,9 @@ module OneM2M_Testcases {
*/
testcase TC_CSE_SUB_NTF_003() runs on AeSimu system CseSystem {
// Local variables
const integer numberOfAggregatedNotification := 2;
timer t_batchNotificationTimer := PX_TAC * 2.0;
var float v_elapsedTime;
const integer c_numberOfAggregatedNotification := 2;
var Labels v_labels_1:= {"VALUE_1"};
var Labels v_labels_2:= {"VALUE_2"};
var integer v_aeIndex := -1;
......@@ -18136,7 +18139,7 @@ module OneM2M_Testcases {
f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23);
v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(numberOfAggregatedNotification), omit, omit, -, int2);
v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotify(c_numberOfAggregatedNotification + 1, "PT10S" ), omit, omit, -, int2);//batchNotify/number greater than number of notifications to be sent so that batchNotify/duration expires before
v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription
......@@ -18145,18 +18148,26 @@ module OneM2M_Testcases {
};
// Test Body
vc_ae2.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, 2)); // check that no notification is received
vc_ae2.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, c_numberOfAggregatedNotification));
v_updateRequest.primitiveContent.aE.labels := v_labels_1;
v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1
f_cse_updateResource(v_request);
t_batchNotificationTimer.start;
v_updateRequest := m_updateAeBase;
v_updateRequest.requestIdentifier := "m_updateAe" & f_rnd(1, 1000000);
v_updateRequest.primitiveContent.aE.appName := "MyAppName2";
v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2
f_cse_updateResource(v_request);
vc_ae2.done;
v_elapsedTime := t_batchNotificationTimer.read;
t_batchNotificationTimer.stop;
if(v_elapsedTime < 10.0) {
setverdict(fail, __SCOPE__ & ": Notifications sent before bathNotify/duration expired");
}
f_checkComponentDoneAndGetVerdict(vc_ae2);
//Postamble
......
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