Commit 8650b38a authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Review of TC_AE_SUB_NTF_001 and TC_AE_SUB_NTF_002


Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 6a4adf24
......@@ -1961,79 +1961,23 @@ module OneM2M_Testcases_AE_Release_1 {
function f_AE_SUB_NTF_001() runs on CseSimu system AeSystem {
//variables
var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
var MsgIn v_request;
var integer v_parentIndex := -1;
var integer v_resourceIndex := -1;
var PrimitiveContent v_resource;
var ResponsePrimitive v_responsePrimitive;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid AE Registration CREATE Request";
var RequestPrimitive v_req;
var integer v_aeLocalIndex := -1;
// Test control
// Test component configuration
f_cf03Up();
//create Ae
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress();
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt{
[] mcaPortIn.receive(mw_request(mw_createAe)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : AE registration request is accepted!!");
v_parentIndex := f_getLocalResourceIndex(v_request.primitive.requestPrimitive.to_);
v_resource := f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
v_resourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
//send back responsePrimitive
f_send(e_mca_in_port, m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(mw_createAe(*,?,m_contentCreateAe_Invalid))) -> value v_request {
tc_ac.stop;
setverdict(inconc, __SCOPE__ & " : AE registration request is rejected due to not including mandatory attributes!!");
f_send(e_mca_in_port, m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
}
[] tc_ac.timeout{
setverdict(inconc, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
}
}
f_checkCseSimuStatus();
//create Subscription
v_utRequest := m_utCreateSubscription;
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
v_action := "Please, send a valid CREATE request for Subscription";
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt{
[] mcaPortIn.receive(mw_request(mw_createSubscription)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : Subscription creation request is accepted!");
v_parentIndex := f_getLocalResourceIndex(v_request.primitive.requestPrimitive.to_);
v_resource := f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
v_resourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
//send back responsePrimitive
f_send(e_mca_in_port, m_response(v_responsePrimitive));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(inconc, __SCOPE__ & " : Subscription creation request is rejected due to not including mandatory attributes!!");
f_send(e_mca_in_port, m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
}
[] tc_ac.timeout{
setverdict(inconc, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
}
}
f_checkCseSimuStatus();
// Preamble
// create Ae
v_aeLocalIndex := f_ae_preamble_registerAe();
//Test behavior
f_send(e_mca_port, m_request(m_notify(f_getLocalResourceAddress(v_resourceIndex))));
v_req := valueof(m_notifyNotification("", m_contentNotification_subscriptionVerification(PX_TS_CSE1.cseId)));
v_req.from_ := PX_TS_CSE1.cseId;
f_send(e_mca_port, m_request(v_req));
tc_ac.start;
alt{
......@@ -2041,9 +1985,13 @@ module OneM2M_Testcases_AE_Release_1 {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : Notification response is accepted!");
}
[] mcaPort.receive {
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Notification response is rejected due to not including mandatory attributes!");
setverdict(fail, __SCOPE__ & " : Notification response with wrong response status code");
}
[] mcaPort.receive(mw_response(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Unexpected Notification response");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
......@@ -2070,89 +2018,35 @@ module OneM2M_Testcases_AE_Release_1 {
function f_AE_SUB_NTF_002() runs on CseSimu system AeSystem {
//variables
var template UtTriggerPrimitive v_utRequest := m_utCreateAe;
var MsgIn v_request;
var ResponsePrimitive v_responsePrimitive;
var PrimitiveContent v_localResource;
var integer v_parentIndex := -1;
var integer v_resourceIndex := -1;
var PrimitiveContent v_resource;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid AE Registration CREATE Request";
var integer v_aeLocalIndex := -1;
var RequestPrimitive v_req;
// Test component configuration
f_cf03Up();
//create Ae
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress();
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt{
[] mcaPortIn.receive(mw_request(mw_createAe)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : AE registration request is accepted!!");
v_parentIndex := f_getLocalResourceIndex(v_request.primitive.requestPrimitive.to_);
v_resource := f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
v_resourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
//send back responsePrimitive
f_send(e_mca_in_port, m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(mw_createAe(*,?,m_contentCreateAe_Invalid))) -> value v_request {
tc_ac.stop;
setverdict(inconc, __SCOPE__ & " : AE registration request is rejected due to not including mandatory attributes!!");
f_send(e_mca_in_port, m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
}
[] tc_ac.timeout{
setverdict(inconc, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
}
}
f_checkCseSimuStatus();
// Preamble
// create Ae
v_aeLocalIndex := f_ae_preamble_registerAe();
//create Subscription
v_utRequest := m_utCreateSubscription;
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_resourceIndex);
v_action := "Please, send a valid CREATE request for Subscription";
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt{
[] mcaPortIn.receive(mw_request(mw_createSubscription)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : Subscription creation request is accepted!");
v_parentIndex := f_getLocalResourceIndex(v_request.primitive.requestPrimitive.to_);
v_resource := f_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
v_resourceIndex := f_setLocalResource(v_resource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
//send back responsePrimitive
f_send(e_mca_in_port, m_response(v_responsePrimitive));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(inconc, __SCOPE__ & " : Subscription creation request is rejected due to not including mandatory attributes!!");
f_send(e_mca_in_port, m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit))));
}
[] tc_ac.timeout{
setverdict(inconc, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
}
}
f_checkCseSimuStatus();
//Test behavior
f_send(e_mca_port, m_request(m_notifyAggregatedNotification));
v_req := valueof(m_notifyAggregatedNotification);
v_req.from_ := PX_TS_CSE1.cseId;
f_send(e_mca_port, m_request(v_req));
tc_ac.start;
alt{
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : Notification response is accepted!");
}
[] mcaPort.receive {
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Notification response with wrong response status code");
}
[] mcaPort.receive(mw_response(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Notification response is rejected due to not including mandatory attributes!");
setverdict(fail, __SCOPE__ & " : Unexpected Notification response");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
......
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