Newer
Older

Miguel Angel Reina Ortega
committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* Copyright Notification
* No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission.
* The copyright and the foregoing restriction extend to reproduction in all media.
* © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC).
* All rights reserved.
*
* @author ETSI
* @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_Testcases.ttcn $
* $Id: OneM2M_Testcases.ttcn 347 2017-08-11 08:48:20Z reinaortega $
* @desc Module containing test cases for oneM2M
*
*/
module OneM2M_PermutationFunctions {
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;
group AE {
group General {
group Create {
function f_AE_GEN_CRE_001(PrimitiveScope p_primitiveScope) runs on CseSimu {
var ResponsePrimitive v_responsePrimitive;
var template UtTriggerPrimitive v_utRequest := m_utCreateContainer;
var UtTriggerAckPrimitive v_trigger_response;
var integer v_parentIndex := -1;
var integer v_resourceIndex := -1;
var MsgIn v_request;
var PrimitiveContent v_modifiedResource;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for container containing To set to " & f_getLocalResourceAddress(0, e_nonHierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
f_cf03Up();
//Send Trigger Message
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(v_utRequest, v_action);
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.requestPrimitive.to_))) -> value v_request {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container creation request received successfuly");
v_parentIndex := f_getResourceIndex(v_request.primitive.requestPrimitive.to_);
v_modifiedResource := f_ae_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, v_parentIndex, v_request.primitive.requestPrimitive.resourceType);
v_resourceIndex := f_setLocalResource(v_modifiedResource, v_request.primitive.requestPrimitive.resourceType, v_parentIndex);
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, v_modifiedResource));
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while creating container");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, " : No answer while creating resource");
stop;
}
}
// Postamble
f_cf03Down();
}
function f_AE_GEN_CRE_002(PrimitiveScope p_primitiveScope) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
var template UtTriggerPrimitive v_utRequest := m_utCreateContainer;
var UtTriggerAckPrimitive v_trigger_response;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for container containing To set to " & f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
//Test Control
if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
f_cf03Up();
//Send Trigger Message
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_createContainer(-,v_utRequest.requestPrimitive.to_))) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container creation request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while creating container");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, " : No answer while creating resource");
stop;
}
}
// Postamble
f_cf03Down();
}
} //end group Create
group Update {
function f_AE_GEN_UPD_001(PrimitiveScope p_primitiveScope) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer;
var UtTriggerAckPrimitive v_trigger_response;
var integer v_auxInteger;
var PrimitiveContent v_localResource;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request for container containing To set to " & f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
f_cf03Up();
//Send Trigger Message

Miguel Angel Reina Ortega
committed
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.requestPrimitive.to_))) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container update request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while updating container");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, " : No answer while updating resource");
stop;
}
}
// Postamble
f_cf03Down();
}
function f_AE_GEN_UPD_002(PrimitiveScope p_primitiveScope) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
var template UtTriggerPrimitive v_utRequest := m_utUpdateContainer;
var UtTriggerAckPrimitive v_trigger_response;
var integer v_auxInteger;
var PrimitiveContent v_localResource;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid UPDATE Request for container containing To set to " & f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
f_cf03Up();
//Send Trigger Message
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_updateContainer(-,v_utRequest.requestPrimitive.to_))) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container update request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while updating container");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, " : No answer while updating resource");
stop;
}
}
// Postamble
f_cf03Down();
}
} //end group Update
group Retrieve {
function f_AE_GEN_RET_001(PrimitiveScope p_primitiveScope) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
var template UtTriggerPrimitive v_utRequestTemplate;
var UtTriggerPrimitive v_utRequest;
var UtTriggerAckPrimitive v_trigger_response;
var integer v_auxInteger;
var PrimitiveContent v_localResource;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid RETRIEVE Request for container containing To set to " & f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
f_cf03Up();
//Send Trigger Message
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
v_utRequestTemplate := m_utRetrieve(f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope));

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(v_utRequestTemplate,v_action);
v_utRequest := valueof(v_utRequestTemplate);
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.requestPrimitive.to_))) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while retrieving container");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, " : No answer while retrieving resource");
stop;
}
}
// Postamble
f_cf03Down();
}
function f_AE_GEN_RET_002(PrimitiveScope p_primitiveScope) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
var template UtTriggerPrimitive v_utRequestTemplate;
var UtTriggerPrimitive v_utRequest;
var UtTriggerAckPrimitive v_trigger_response;
var integer v_auxInteger;
var PrimitiveContent v_localResource;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid RETRIEVE Request for container containing To set to " & f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
f_cf03Up();
//Send Trigger Message
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
v_utRequestTemplate := m_utRetrieve(f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope));

Miguel Angel Reina Ortega
committed
v_utRequest := valueof(v_utRequestTemplate);
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.requestPrimitive.to_))) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while retrieving container");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, " : No answer while retrieving resource");
stop;
}
}
// Postamble
f_cf03Down();
}
} //end group Retrieve
group Delete {
function f_AE_GEN_DEL_001(PrimitiveScope p_primitiveScope) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
var template UtTriggerPrimitive v_utRequest := m_utDelete;

Miguel Angel Reina Ortega
committed
var UtTriggerAckPrimitive v_trigger_response;
var integer v_auxInteger;
var PrimitiveContent v_localResource;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-, e_nonHierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__, ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
f_cf03Up();
//Send Trigger Message
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_nonHierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container update request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while updating container");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, " : No answer while updating resource");
stop;
}
}
// Postamble
f_cf03Down();
}
function f_AE_GEN_DEL_002(PrimitiveScope p_primitiveScope) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
var template UtTriggerPrimitive v_utRequest := m_utDelete;

Miguel Angel Reina Ortega
committed
var UtTriggerAckPrimitive v_trigger_response;
var integer v_auxInteger;
var PrimitiveContent v_localResource;
var universal charstring v_action := __SCOPE__ & ": Please, send a valid DELETE Request for container containing To set to " & f_getLocalResourceAddress(-, e_hierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__, ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
f_cf03Up();
//Send Trigger Message
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger, e_hierarchical, p_primitiveScope);

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(v_utRequest,v_action);
tc_ac.start;
alt {
[] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.requestPrimitive.to_))) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container update request received successfuly");
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(?)) {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Error while updating container");
stop;
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__, " : No answer while updating resource");
stop;
}
}
// Postamble
f_cf03Down();
}
} //end group Delete
}//end group General
group Registration {
group Create {
function f_AE_REG_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {

Miguel Angel Reina Ortega
committed
//primitives for mcaPortIn

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
f_cf03Up();
//Send Trigger Message
p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
p_request.to_ := p_utRequest.requestPrimitive.to_;

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(p_utRequest,p_action);
//Test behavior
tc_ac.start;
alt{
[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : AE registration request is accepted!!");
//v_responsePrimitive := valueof(m_responsePrimitiveTemp(int2000, omit));
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive(mw_request(mw_createAe(*,?,m_contentCreateAe_Invalid))) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : AE registration request is rejected due to not including the optional attribute!");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
// Postamble
f_cf03Down();
}
} // End of subgroup Create
group Delete {
}// End Delete subgroup
}//end Registration subgroup
group Data_Management_and_Repository {
group Create {
function f_AE_DMR_CRE_003(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
var PrimitiveContent v_localResource;
var integer v_containerIndex := -1;

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
//Test component configuration
f_cf03Up();
//send triggering primitive to SUT
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);

Miguel Angel Reina Ortega
committed
v_containerIndex := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);
p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_containerIndex, -, -);
p_request.to_ := p_utRequest.requestPrimitive.to_;

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(p_utRequest,p_action);
//Test behavior
tc_ac.start;
alt{
//receive MsgIn requestPrimitive
[] mcaPortIn.receive(mw_request(p_request)) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : ContentInstance creation request is accepted!!");
//set responseStatusCode back to SUT
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : ContentInstance creation request is rejected due to not including the attribute!");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
// Postamble
f_cf03Down();
}
function f_AE_DMR_CRE_004(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;
//Test component configuration
f_cf03Up();
//send triggering primitive to SUT
p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -);
p_request.to_ := p_utRequest.requestPrimitive.to_;

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(p_utRequest,p_action);
//Test behavior
tc_ac.start;
alt{
//receive MsgIn requestPrimitive
[] mcaPortIn.receive(mw_request(p_request)) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container creation request is accepted!!");
//set responseStatusCode back to SUT
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Container creation request is rejected due to not including the attribute!");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
// Postamble
f_cf03Down();
}
}//End of subgroup Create
group Update {
function f_AE_DMR_UPD_001(template UtTriggerPrimitive p_utRequest, in universal charstring p_action, template RequestPrimitive p_expectedUpdateRequest) runs on CseSimu {

Miguel Angel Reina Ortega
committed
//primitives for mcaPortIn
var MsgIn v_request;

Miguel Angel Reina Ortega
committed
var integer v_auxInteger := -1;
var PrimitiveContent v_modifiedResource;
var PrimitiveContent v_localResource;

Miguel Angel Reina Ortega
committed
f_cf03Up();
//Preamble

Miguel Angel Reina Ortega
committed

Miguel Angel Reina Ortega
committed
//Send Trigger Message

Miguel Angel Reina Ortega
committed
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentAe(m_contentCreateAe(omit, omit, omit, omit))), vc_cSEBaseIndex, int2);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, int2, vc_cSEBaseIndex);

Miguel Angel Reina Ortega
committed
p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger);
f_sendUtPrimitive(p_utRequest,p_action);

Miguel Angel Reina Ortega
committed
//Test behavior
tc_ac.start;
alt{
[] mcaPortIn.receive(mw_request(p_expectedUpdateRequest)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__, " : AE update request is accepted!");

Miguel Angel Reina Ortega
committed
vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit));
mcaPortIn.send(m_response(vc_response.primitive.responsePrimitive));

Miguel Angel Reina Ortega
committed
}
[] mcaPortIn.receive(mw_request(?)) -> value v_request {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : AE update request is rejected due to not including the optional attribute!");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
// Postamble
f_cf03Down();
}
function f_AE_DMR_UPD_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {

Miguel Angel Reina Ortega
committed
var ResponsePrimitive v_responsePrimitive;

Miguel Angel Reina Ortega
committed
var PrimitiveContent v_localResource;
var integer v_auxInteger := -1;

Miguel Angel Reina Ortega
committed
//Test component configuration
f_cf03Up();
//send triggering primitive to SUT

Miguel Angel Reina Ortega
committed
v_localResource := f_ae_generateLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, int3, vc_cSEBaseIndex);

Miguel Angel Reina Ortega
committed
p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(v_auxInteger);

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(p_utRequest,p_action);
//Test behavior
tc_ac.start;
alt{
//receive MsgIn requestPrimitive
[] mcaPortIn.receive(mw_request(p_request)) -> value (v_request) {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Container update request is accepted!!");
//set responseStatusCode back to SUT
v_responsePrimitive := valueof(m_responsePrimitive(int2004, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Container update request is rejected due to not including the attribute!");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
// Postamble
f_cf03Down();
}
}//End of subgroup Update
group Retrieve {

Miguel Angel Reina Ortega
committed
function f_AE_DMR_RET_001(ResourceType p_resourceType, template PrimitiveContent p_primitiveContent, in universal charstring p_action) runs on CseSimu {

Miguel Angel Reina Ortega
committed
//variables

Miguel Angel Reina Ortega
committed
var template UtTriggerPrimitive v_utRequest;

Miguel Angel Reina Ortega
committed
var MsgIn v_request;
var ResponsePrimitive v_responsePrimitive;

Miguel Angel Reina Ortega
committed
var PrimitiveContent v_localResource;
var integer v_auxInteger := -1;

Miguel Angel Reina Ortega
committed
//Test component configuration
f_cf03Up();
//send triggering primitive to SUT

Miguel Angel Reina Ortega
committed
v_localResource := f_ae_generateLocalResource(valueof(p_primitiveContent), vc_cSEBaseIndex, p_resourceType);

Miguel Angel Reina Ortega
committed
v_auxInteger := f_setLocalResource(v_localResource, p_resourceType, vc_cSEBaseIndex);

Miguel Angel Reina Ortega
committed
v_utRequest := m_utRetrieve(f_getLocalResourceAddress(v_auxInteger));

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(v_utRequest,p_action);
//Test behavior
tc_ac.start;
alt{

Miguel Angel Reina Ortega
committed
[] mcaPortIn.receive(mw_request(mw_retrieve(f_getLocalResourceAddress(v_auxInteger)))) -> value v_request {

Miguel Angel Reina Ortega
committed
tc_ac.stop;
setverdict(pass, __SCOPE__, " : retrieve resource type request is accepted!!");
//set responseStatusCode back to SUT
v_responsePrimitive := valueof(m_responsePrimitive(int2000, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
tc_ac.stop;
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : error while retrieving resource !");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
// Postamble
f_cf03Down();
}
}//End of subgroup Retrieve
group Delete {
}
}//end DMR subgroup
group Subscription_and_Notification {
group Create {
function f_AE_SUB_CRE_002(template UtTriggerPrimitive p_utRequest, template RequestPrimitive p_request, in universal charstring p_action) runs on CseSimu {
var MsgIn v_request;
var ResponsePrimitive v_responsePrimitive;
f_cf03Up();
//send triggering primitive to SUT

Miguel Angel Reina Ortega
committed
p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress();

Miguel Angel Reina Ortega
committed
f_sendUtPrimitive(p_utRequest,p_action);
//Test behavior
tc_ac.start;
alt{
[] mcaPortIn.receive(mw_request(p_request)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__, " : Subscription creation request is accepted!");
//set responseStatusCode back to SUT
v_responsePrimitive := valueof(m_responsePrimitive(int2001, v_request.primitive.requestPrimitive.requestIdentifier, omit));

Miguel Angel Reina Ortega
committed
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//send back responsePrimitive
mcaPortIn.send(m_response(v_responsePrimitive));
}
[] mcaPortIn.receive {
tc_ac.stop;
setverdict(fail, __SCOPE__, " : Subscription creation request is rejected due to not including the optional attribute!");
}
[] tc_ac.timeout{
setverdict(fail, __SCOPE__, " : Timeout due to no response received from requested SUT!");
}
}
// Postamble
f_cf03Down();
}
}//End Create Group
group Notify {
}//End of Notify group
}//end SUB subgroup
}//end group AE
group CSE {
group Generic {
group Create {
function f_CSE_GEN_CRE_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
// Local variables
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var AddressingMethod v_addressingMethod;
var PrimitiveScope v_primitiveScope;
// Test control
if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
// Test Body
//Force usage of Non-Hierarchical addressing method
v_addressingMethod := e_nonHierarchical;
v_primitiveScope := p_primitiveScope;
v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Container resource created using non-hierarchical addressing method");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating container resource using non-hierarchical addressing method");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_GEN_CRE_001
function f_CSE_GEN_CRE_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
// Local variables
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var AddressingMethod v_addressingMethod;
var PrimitiveScope v_primitiveScope;
// Test control
if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
// Test Body
//Force usage of Non-Hierarchical addressing method
v_addressingMethod := e_hierarchical;
v_primitiveScope := p_primitiveScope;
v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex);
v_request.to_ := f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Container resource created using hierarchical addressing method");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating container resource using hierarchical addressing method");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_GEN_CRE_002
} // end of group Create
group Retrieve {
function f_CSE_GEN_RET_001(in PrimitiveScope p_primitiveScope) runs on AeSimu {
// Local variables
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var AddressingMethod v_addressingMethod;
var PrimitiveScope v_primitiveScope;
// Test control
if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
// Test Body
//Force usage of Non-Hierarchical addressing method
v_addressingMethod := e_nonHierarchical;
v_primitiveScope := p_primitiveScope;
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Container resource retrieved using non-hierarchical addressing method");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using non-hierarchical addressing method");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_GEN_RET_001
function f_CSE_GEN_RET_002(in PrimitiveScope p_primitiveScope) runs on AeSimu {
// Local variables
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var AddressingMethod v_addressingMethod;
var PrimitiveScope v_primitiveScope;
// Test control
if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) {
setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case");
stop;
}
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
// Test Body
//Force usage of Non-Hierarchical addressing method
v_addressingMethod := e_hierarchical;
v_primitiveScope := p_primitiveScope;
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Container resource retrieved using hierarchical addressing method");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hierarchical addressing method");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}