Resolving following issues:

- f_generateLocalResource - error for contentInstance resource generation
- f_getResourceIndex - error when CSEBase is the target resource and unstructured format address is used
- implementation of several functions to process CREATE, UPDATE, RETRIEVE and DELETE requests
- modification of AE_GEN and AE_DMR test cases groups to use the above-mentioned functions
Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 305c85a0
This diff is collapsed.
This diff is collapsed.
......@@ -812,11 +812,8 @@ module OneM2M_Testcases_AE_Release_1 {
//variables
var template UtTriggerPrimitive v_utRequest := m_utCreateContainer;
var MsgIn v_request;
var integer v_parentIndex := -1;
var integer v_resourceIndex := -1;
var PrimitiveContent v_resource;
var template RequestPrimitive v_requestPrimitive := mw_createContainer;
var ResponsePrimitive v_responsePrimitive;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for container to ";
f_cf03Up();
......@@ -832,15 +829,11 @@ module OneM2M_Testcases_AE_Release_1 {
[] mcaPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : Container creation request is accepted!");
v_parentIndex := f_getResourceIndex(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));
v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);
//send back responsePrimitive
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
}
[] mcaPortIn.receive(mw_request(mw_create)) {
[] mcaPortIn.receive(mw_request(mw_create)) -> value v_request{
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Unexpected CREATE request ");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
......@@ -872,13 +865,10 @@ module OneM2M_Testcases_AE_Release_1 {
var template UtTriggerPrimitive v_utRequest := m_utCreateContentInstance;
var MsgIn v_request;
var integer v_parentIndex := -1;
var integer v_resourceIndex := -1;
var PrimitiveContent v_resource;
var PrimitiveContent v_localResource;
var integer v_containerIndex := -1;
var template RequestPrimitive v_requestPrimitive := mw_createContentInstance;
var ResponsePrimitive v_responsePrimitive;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for ContentInstance to ";
//Test component configuration
......@@ -899,15 +889,11 @@ module OneM2M_Testcases_AE_Release_1 {
[] mcaPortIn.receive(mw_request(v_requestPrimitive)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & " : ContentInstance creation request is accepted!!");
v_parentIndex := f_getResourceIndex(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));
v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive);
//send back responsePrimitive
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
mcaPortIn.send(f_getMsgOutPrimitive(f_getMsgOutPrimitive(m_response(vc_response.primitive.responsePrimitive))));
}
[] mcaPortIn.receive(mw_request(mw_create)) {
[] mcaPortIn.receive(mw_request(mw_create)) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Unexpected CREATE request ");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
......@@ -1470,7 +1456,7 @@ module OneM2M_Testcases_AE_Release_1 {
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(mw_retrieve(?))) {
[] mcaPortIn.receive(mw_request(mw_retrieve(?))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Retrieve Request for unexpected target");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
......@@ -1532,7 +1518,7 @@ module OneM2M_Testcases_AE_Release_1 {
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(mw_retrieve(?))) {
[] mcaPortIn.receive(mw_request(mw_retrieve(?))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Retrieve Request for unexpected target");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
......@@ -1590,7 +1576,7 @@ module OneM2M_Testcases_AE_Release_1 {
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(mw_retrieve(?))) {
[] mcaPortIn.receive(mw_request(mw_retrieve(?))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Retrieve Request for unexpected target");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
......@@ -1650,7 +1636,7 @@ module OneM2M_Testcases_AE_Release_1 {
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, vc_localResourcesList[v_resourceIndex].resource));
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
}
[] mcaPortIn.receive(mw_request(mw_retrieve(?))) {
[] mcaPortIn.receive(mw_request(mw_retrieve(?))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Retrieve Request for unexpected target");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
......@@ -1717,9 +1703,10 @@ module OneM2M_Testcases_AE_Release_1 {
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
tc_ac.stop;
}
[] mcaPortIn.receive (mw_request(mw_delete(?))) {
[] mcaPortIn.receive (mw_request(mw_delete(?))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Delete request for unexpected target");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
......@@ -1779,9 +1766,10 @@ module OneM2M_Testcases_AE_Release_1 {
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
tc_ac.stop;
}
[] mcaPortIn.receive (mw_request(mw_delete(?))) {
[] mcaPortIn.receive (mw_request(mw_delete(?))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Delete request for unexpected target");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
......@@ -1841,9 +1829,10 @@ module OneM2M_Testcases_AE_Release_1 {
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
tc_ac.stop;
}
[] mcaPortIn.receive (mw_request(mw_delete(?))) {
[] mcaPortIn.receive (mw_request(mw_delete(?))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Delete request for unexpected target");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!");
......@@ -1905,9 +1894,10 @@ module OneM2M_Testcases_AE_Release_1 {
mcaPortIn.send(f_getMsgOutPrimitive(m_response(v_responsePrimitive)));
tc_ac.stop;
}
[] mcaPortIn.receive (mw_request(mw_delete(?))) {
[] mcaPortIn.receive (mw_request(mw_delete(?))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__ & " : Delete request for unexpected target");
mcaPortIn.send(f_getMsgOutPrimitive(m_response(valueof(m_responsePrimitive(int4004, v_request.primitive.requestPrimitive.requestIdentifier, omit)))));
}
[] 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