Commit 7efb8faf authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

New TPs mapped to IN and MN profiles


Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent cbffaa85
......@@ -2355,7 +2355,80 @@ module OneM2M_PermutationFunctions {
f_cf01Down();
}//end f_CSE_DMR_CRE_012
function f_CSE_DMR_CRE_014(ResourceType p_parentResourceType, template RequestPrimitive p_parentResourceRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on AeSimu {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(p_parentResourceType, p_parentResourceRequestPrimitive, v_aeIndex);
// Test Body
v_request := f_getCreateRequestPrimitive(p_childResourceType, p_childRequestPrimitive, v_resourceIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource created");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error when creating resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource");
}
}
//Check currentByteSize
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
if(v_response.primitive.responsePrimitive.primitiveContent.container.currentByteSize == 8) { //Default content: "AnyValue" (8 bytes length)
setverdict(pass, __SCOPE__ & ": CurrentByteSize attribute in content resource is incremented successfully");
}
else{
setverdict(fail, __SCOPE__ & ": CurrentByteSize attribute in content resource not incremented successfully");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_014
function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu {
// Local variables
......
......@@ -116,8 +116,12 @@ module OneM2M_TestControl_IN_profile {
if(true) {execute (TC_CSE_DMR_CRE_003_CNT());}
if(true) {execute (TC_CSE_DMR_CRE_007 ());}
if(true) {execute (TC_CSE_DMR_CRE_008 ());}
if(true) {execute (TC_CSE_DMR_CRE_009 ());}
if(true) {execute (TC_CSE_DMR_CRE_010 ());}
if(true) {execute (TC_CSE_DMR_CRE_011 ());}
if(true) {execute (TC_CSE_DMR_RET_001_CNT());}
if(true) {execute (TC_CSE_DMR_RET_013_CNT());}
if(true) {execute (TC_CSE_DMR_CRE_014_CNT_CIN ());}
if(true) {execute (TC_CSE_DMR_UPD_001_CNT_LBL());}
if(PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_002_CNT_LBL());}
if(PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_003_CNT_LBL());}
......@@ -126,8 +130,10 @@ module OneM2M_TestControl_IN_profile {
if(true) {execute (TC_CSE_DMR_UPD_007_CNT_CT());}
if(true) {execute (TC_CSE_DMR_UPD_008_CNT_ET());}
if(true) {execute (TC_CSE_DMR_UPD_009_CNT_ET());}
if(true) {execute (TC_CSE_DMR_UPD_010 ());}
if(true) {execute (TC_CSE_DMR_UPD_016_CNT_ET());}
if(true) {execute (TC_CSE_DMR_DEL_001_CNT());}
if(true) {execute (TC_CSE_DMR_DEL_005 ());}
if(true) {execute (TC_CSE_DMR_DEL_006());}
if(PICS_ACP_SUPPORT) {execute (TC_CSE_DMR_CRE_012_CNT_LBL());}
if(true) {execute (TC_CSE_DMR_UPD_014_CNT_LBL());}
......
......@@ -140,8 +140,12 @@ module OneM2M_TestControl_MN_profile {
if(true) {execute (TC_CSE_DMR_CRE_003_CNT());}
if(true) {execute (TC_CSE_DMR_CRE_007 ());}
if(true) {execute (TC_CSE_DMR_CRE_008 ());}
if(true) {execute (TC_CSE_DMR_CRE_009 ());}
if(true) {execute (TC_CSE_DMR_CRE_010 ());}
if(true) {execute (TC_CSE_DMR_CRE_011 ());}
if(true) {execute (TC_CSE_DMR_RET_001_CNT());}
if(true) {execute (TC_CSE_DMR_RET_013_CNT());}
if(true) {execute (TC_CSE_DMR_CRE_014_CNT_CIN ());}
if(true) {execute (TC_CSE_DMR_UPD_001_CNT_LBL());}
if(PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_002_CNT_LBL());}
if(PICS_CNT_LBL) {execute (TC_CSE_DMR_UPD_003_CNT_LBL());}
......@@ -150,8 +154,10 @@ module OneM2M_TestControl_MN_profile {
if(true) {execute (TC_CSE_DMR_UPD_007_CNT_CT());}
if(true) {execute (TC_CSE_DMR_UPD_008_CNT_ET());}
if(true) {execute (TC_CSE_DMR_UPD_009_CNT_ET());}
if(true) {execute (TC_CSE_DMR_UPD_010());}
if(true) {execute (TC_CSE_DMR_UPD_016_CNT_ET());}
if(true) {execute (TC_CSE_DMR_DEL_001_CNT());}
if(true) {execute (TC_CSE_DMR_DEL_005 ());}
if(true) {execute (TC_CSE_DMR_DEL_006());}
if(PICS_ACP_SUPPORT) {execute (TC_CSE_DMR_CRE_012_CNT_LBL());}
if(true) {execute (TC_CSE_DMR_UPD_014_CNT_LBL());}
......
......@@ -3475,7 +3475,222 @@ module OneM2M_Testcases_CSE_Release_1 {
}// end group g_CSE_DMR_CRE_008
group g_CSE_DMR_CRE_009 {
/**
* @desc Check that the IUT increaments and then copies the field value of attribute stateTag in parent container resource when contentInstance resource is created as the direct child of the parent container
*
*/
testcase TC_CSE_DMR_CRE_009() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var MsgIn v_response;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var integer v_contentInstanceIndex := -1;
var template PrimitiveContent v_contentResponse;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);
// Test Body
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
v_contentResponse.container := mw_contentContainerBase;
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == vc_resourcesList[v_containerIndex].resource.container.stateTag + 1) {
setverdict(pass, __SCOPE__ & ": stateTag attribute increased after creation of contentInstance resource");
} else {
setverdict(fail, __SCOPE__ & ": stateTag attribute not incremented correctly after creation of contentInstance resource");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_DMR_CRE_009
}// end group g_CSE_DMR_CRE_009
group g_CSE_DMR_CRE_010 {
/**
* @desc Check that the IUT rejects the CREATE Request of a container resource named “la” as a direct child of a container resource
*
*/
testcase TC_CSE_DMR_CRE_010() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
// Test Body
v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameLatest;
v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'la'");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'la' with wrong ResponseStatusCode");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'la'");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
}
}
f_checkAeSimuStatus();
//Check to see if the resource is NOT present
if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_DMR_CRE_010
}// end group g_CSE_DMR_CRE_010
group g_CSE_DMR_CRE_011 {
/**
* @desc Check that the IUT rejects the CREATE Request of a container resource named “ol” as a direct child of a container resource
*
*/
testcase TC_CSE_DMR_CRE_011() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
// Test Body
v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameOldest;
v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'ol'");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'ol' with wrong ResponseStatusCode");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'ol'");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4");
}
}
f_checkAeSimuStatus();
//Check to see if the resource is NOT present
if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){
setverdict(pass, __SCOPE__ & ":INFO: Resource not created");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource created");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_DMR_CRE_011
}// end group g_CSE_DMR_CRE_011
group g_CSE_DMR_CRE_012 {
/**
......@@ -3713,6 +3928,28 @@ module OneM2M_Testcases_CSE_Release_1 {
}// end group g_CSE_DMR_CRE_013
group g_CSE_DMR_CRE_014 {
/**
* @desc Check that the IUT updates the currentByteSize attribute in a <container> parent resource when a new <contentInstance> resource is created.
*
*/
testcase TC_CSE_DMR_CRE_014_CNT_CIN() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_parentResourceRequest := m_createContainerBase;
var template RequestPrimitive v_childResourceRequest := m_createContentInstanceBase;//Default content: "AnyValue" (8 bytes length)
var ResponsePrimitive v_responsePrimitive;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
const integer c_maxByteSize := 512;
v_parentResourceRequest.primitiveContent.container.maxByteSize := c_maxByteSize;
v_ae1.start(f_CSE_DMR_CRE_014(int3, v_parentResourceRequest, int4, v_childResourceRequest));
v_ae1.done;
}
}
}//end group Create
......@@ -5361,7 +5598,76 @@ module OneM2M_Testcases_CSE_Release_1 {
}
} // end g_CSE_DMR_UPD_009
group g_CSE_DMR_UPD_010{
/**
* @desc Check that the stateTag attribute of a container resource is increased when an update operation has been performed on its child resource
*
*/
testcase TC_CSE_DMR_UPD_010() runs on AeSimu system CseSystem {
var MsgIn v_response;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase);
var Labels v_labels_1:= {"VALUE_1"};
v_updateRequest.primitiveContent.container.labels := v_labels_1;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);
// Test Body
if(ispresent(vc_resourcesList[v_containerIndex].resource.container.stateTag)) {
v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequest);
f_cse_updateResource(v_updateRequest);
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 1) { //(Create and Delete)
setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");
}
else{
setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
}
}
}//end if
else{
setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end TC_CSE_DMR_UPD_010
} // end group g_CSE_DMR_UPD_010
group g_CSE_DMR_UPD_011{
/**
......@@ -7061,6 +7367,97 @@ module OneM2M_Testcases_CSE_Release_1 {
};//end of group g_CSE_DMR_DEL_002
group g_CSE_DMR_DEL_005{
/**
* @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted
*
*/
testcase TC_CSE_DMR_DEL_005() runs on AeSimu system CseSystem {
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var integer v_childResourceIndex := -1;
const ResourceType c_containerResourceType := int3;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex);
if(ispresent(vc_resourcesList[v_resourceIndex].resource.container.stateTag)) {
v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex);
// Test Body
mcaPort.send(m_request(m_delete(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete successfully");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while deleting resource type " & int2str(enum2int(c_containerResourceType)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType)));
}
}
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 2) { //(Create and Delete)
setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");
}
else{
setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented");
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes");
}
}
}//end if
else{
setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty");
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_DEL_005
} // end group g_CSE_DMR_DEL_005
group g_CSE_DMR_DEL_006{
......
......@@ -731,222 +731,6 @@ module OneM2M_Testcases_CSE_Release_2 {
}// end group g_CSE_DMR_CRE_004
group g_CSE_DMR_CRE_009 {
/**
* @desc Check that the IUT increaments and then copies the field value of attribute stateTag in parent container resource when contentInstance resource is created as the direct child of the parent container
*
*/
testcase TC_CSE_DMR_CRE_009() runs on AeSimu system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var MsgIn v_response;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var integer v_contentInstanceIndex := -1;
var template PrimitiveContent v_contentResponse;
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex);
v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);
// Test Body
mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))));
v_contentResponse.container := mw_contentContainerBase;
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Response OK for retrieving");
if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == vc_resourcesList[v_containerIndex].resource.container.stateTag + 1) {
setverdict(pass, __SCOPE__ & ": stateTag attribute increased after creation of contentInstance resource");
} else {
setverdict(fail, __SCOPE__ & ": stateTag attribute not incremented correctly after creation of contentInstance resource");