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

Test cases from Release 1 become permutation test cases -...


Test cases from Release 1 become permutation test cases - TC_CSE_DMR_CRE_008_CNT_CIN, TC_CSE_DMR_DEL_005_CNT, TC_CSE_DMR_DEL_006_CNT_CIN, TC_CSE_SUB_CRE_001_CIN
Missing permutation for TC_CSE_DMR_CRE_012_SUB_SU for subscriberUri
Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 8b86cdbb
......@@ -4193,10 +4193,10 @@ module OneM2M_Testcases_CSE_Release_1 {
group g_CSE_DMR_CRE_007 {
/**
/**
* @desc Checks that the IUT accepts a newly created RESOURCE_TYPE when the currentNrOfInstances exceeds the field value set in maxNrOfInstances in the PARENT_RESOURCE_TYPE resource by removing enough of the oldest RESOURCE_TYPE resources to allow the creation of the new RESOURCE_TYPE resource
*
*/
*
*/
testcase TC_CSE_DMR_CRE_007_CNT_CIN() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
......@@ -4213,92 +4213,34 @@ module OneM2M_Testcases_CSE_Release_1 {
}
}// end group g_CSE_DMR_CRE_007
/**
* @desc Checks that the IUT accepts a newly created contentInstance when the currentByteSize exceeds the field value set in maxByteSize in the parent container resource by removing enough of the oldest <contentInstance> resources to allow the creation of the new <contentInstance> resource.
*
*/
testcase TC_CSE_DMR_CRE_008() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_CRE_008());
v_ae1.done;
}
function f_CSE_DMR_CRE_008() runs on AeSimu system CseSystem {
//Local variables
var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
var template RequestPrimitive v_createRequestContentInstance := m_createContentInstanceBase;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var integer v_contentInstanceIndex := -1;
const integer c_maxByteSize := 10;
const XSD.String c_primitiveContent1 := "Content1";
const XSD.String c_primitiveContent2 := "Content2";
// Test control
// Test component configuration
f_cf01Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
v_createRequestContainer.primitiveContent.container.maxByteSize := c_maxByteSize;
v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex); //Container
v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_containerIndex), c_primitiveContent1), v_containerIndex);//ContentInstance
// Test Body
v_createRequestContentInstance.primitiveContent.contentInstance.content := c_primitiveContent2; //ContentInstance 2
v_createRequestContentInstance.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2";
v_request := f_getCreateRequestPrimitive(int4, v_createRequestContentInstance, v_containerIndex);
f_send(e_mca_port, m_request(v_request));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": ContentInstance created");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code in the response");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type contentInstance");
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type contentInstance");
}
}
group g_CSE_DMR_CRE_008 {
/**
* @desc Checks that the IUT accepts a newly created RESOURCE_TYPE when the currentNrOfInstances exceeds the field value set in maxNrOfInstances in the PARENT_RESOURCE_TYPE resource by removing enough of the oldest RESOURCE_TYPE resources to allow the creation of the new RESOURCE_TYPE resource
*
*/
testcase TC_CSE_DMR_CRE_008_CNT_CIN() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
var template RequestPrimitive v_createRequestContentInstance1 := m_createContentInstanceBase;
var template RequestPrimitive v_createRequestContentInstance2 := m_createContentInstanceBase;
const integer c_maxByteSize := 10;
const XSD.String c_primitiveContent1 := "Content1";
const XSD.String c_primitiveContent2 := "Content2";
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
f_checkAeSimuStatus();
v_createRequestContainer.primitiveContent.container.maxByteSize := c_maxByteSize;
v_createRequestContentInstance1.primitiveContent.contentInstance.content := c_primitiveContent1; //ContentInstance 1
v_createRequestContentInstance2.primitiveContent.contentInstance.content := c_primitiveContent2; //ContentInstance 2
v_createRequestContentInstance2.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2"; //ContentInstance 2
//Check to see if the resource is NOT present
if(f_cse_isResourceNotPresent(v_containerIndex, c_defaultContentInstanceResourceName)){
setverdict(pass, __SCOPE__ & ":INFO: Oldest contentInstance has been removed to allow the creation of the new contentInstance");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Oldest contentInstance has not been removed to allow the creation of the new contentInstance");
v_ae1.start(f_CSE_DMR_CRE_007(int3, v_createRequestContainer, int4, v_createRequestContentInstance1, v_createRequestContentInstance2, c_defaultContentInstanceResourceName));//ContentInstance under Container
v_ae1.done;
}
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_CRE_008
}// end group g_CSE_DMR_CRE_008
/**
* @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
*
......@@ -4693,6 +4635,18 @@ module OneM2M_Testcases_CSE_Release_1 {
}
testcase TC_CSE_DMR_CRE_012_SUB_SU() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var AttributeList v_optionalAttribute := {"subscriberURI"};
v_createRequest.primitiveContent.subscription.subscriberURI := "NotInitialized";
v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, v_optionalAttribute));
v_ae1.done;
}
}// end group g_CSE_DMR_CRE_012
group g_CSE_DMR_CRE_013 {
......@@ -7983,170 +7937,53 @@ module OneM2M_Testcases_CSE_Release_1 {
};//end of group g_CSE_DMR_DEL_002
/**
* @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 Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_DEL_005());
v_ae1.done;
}
function f_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
f_send(e_mca_port, 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)));
}
}
f_send(e_mca_port, 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)
group g_CSE_DMR_DEL_005{
/**
* @desc Check that the stateTag attribute of a RESOURCE_TYPE resource is increased when a child resource is deleted
*
*/
testcase TC_CSE_DMR_DEL_005_CNT() runs on Tester system CseSystem {
// Local variables
var PrimitiveContent v_primitiveContentRetrieveResource;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_DEL_005(int3, m_createContainerBase, int3, m_createContainerBase));//Container
v_ae1.done;
if(getverdict == pass){
v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1);
//Check that stateTag has been incremented
if(ischosen(v_primitiveContentRetrieveResource.container)) {
if(v_primitiveContentRetrieveResource.container.stateTag == 2){ //(Create and Delete)
setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented");
}
else{
}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
/**
* @desc Check that the IUT decreases the field value of attribute currentNrOfInstances and currentByteSize of parent container when a latest contentInstance resource is deleted successfully
*
*/
testcase TC_CSE_DMR_DEL_006() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_DMR_DEL_006());
v_ae1.done;
}
function f_CSE_DMR_DEL_006() runs on AeSimu system CseSystem {
// Local variables
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var integer v_contentInstanceIndex := -1;
var PrimitiveContent v_attributesContainer, v_attributesContainer_afterDeletion;
// 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);
v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex);
v_attributesContainer := f_cse_retrieveResource(v_containerIndex);
if(not(ispresent(v_attributesContainer.container.currentNrOfInstances))) {
setverdict(fail, __SCOPE__ & ": Error the currentNrOfInstances attribute is empty");
f_checkAeSimuStatus();
}
// Test Body
f_cse_deleteResource(v_contentInstanceIndex);
}
};
};//end of group g_CSE_DMR_DEL_005
v_attributesContainer_afterDeletion := f_cse_retrieveResource(v_containerIndex);
if(not(ispresent(v_attributesContainer.container.currentNrOfInstances))) {
setverdict(fail, __SCOPE__ & ": Error the currentNrOfInstances attribute is empty");
f_checkAeSimuStatus();
}
if((v_attributesContainer.container.currentNrOfInstances > v_attributesContainer_afterDeletion.container.currentNrOfInstances) and
(v_attributesContainer.container.currentByteSize > v_attributesContainer_afterDeletion.container.currentByteSize)) {
setverdict(pass, __SCOPE__ & ": The currentNrOfInstances and currentByteSize attributes are decreased");
} else {
setverdict(fail, __SCOPE__ & ": currentNrOfInstances and/or currentByteSize attributes are not decreased");
}
group g_CSE_DMR_DEL_006{
/**
* @desc Check that the IUT decreases the field value of attribute currentNrOfInstances and currentByteSize of parent RESOURCE_TYPE when a latest RESOURCE_TYPE resource is deleted successfully
*
*/
testcase TC_CSE_DMR_DEL_006_CNT_CIN() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}//end f_CSE_DMR_DEL_006
v_ae1.start(f_CSE_DMR_DEL_006(int3, m_createContainerBase, int4, m_createContentInstanceBase));//ContentInstance under Container
v_ae1.done;
};
};//end of group g_CSE_DMR_DEL_006
/**
* @desc Check that the IUT accepts the DELETE Request of the latest contentInstance resource target to a container resource
......@@ -8340,6 +8177,37 @@ module OneM2M_Testcases_CSE_Release_1 {
group Create {
group g_CSE_SUB_CRE_001 {
/**
* @desc Check that the IUT rejects the creation of the <subscription> resource when the target subscribed-to RESOURCE_TYPE resource is not subscribable.
*
*/
testcase TC_CSE_SUB_CRE_001_CIN() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_parentResourceRequest := m_createContainerBase;
var template RequestPrimitive v_childResourceRequest := m_createContentInstanceBase;
var ResponsePrimitive v_responsePrimitive;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
const XSD.String c_content := "Random Value";
v_childResourceRequest.primitiveContent.contentInstance.content := "Random Value";
v_ae1.start(f_CSE_SUB_CRE_001(int3, v_parentResourceRequest, int4, v_childResourceRequest));
v_ae1.done;
}
testcase TC_CSE_SUB_CRE_001_SUB() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_parentResourceRequest := m_createSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SUB_CRE_001(int23, v_parentResourceRequest, int23, v_parentResourceRequest));
v_ae1.done;
}
}// end group g_CSE_SUB_CRE_001
/**
* @desc Check that the IUT rejects the creation of the <subscription> resource when the originator does not have privileges for retrieving the subscribed-to resource.
*
......
......@@ -753,34 +753,7 @@ module OneM2M_Testcases_CSE_Release_2 {
}
}// end group g_CSE_DMR_CRE_006
group g_CSE_DMR_CRE_008 {
/**
* @desc Checks that the IUT accepts a newly created RESOURCE_TYPE when the currentNrOfInstances exceeds the field value set in maxNrOfInstances in the PARENT_RESOURCE_TYPE resource by removing enough of the oldest RESOURCE_TYPE resources to allow the creation of the new RESOURCE_TYPE resource
*
*/
testcase TC_CSE_DMR_CRE_008_CNT_CIN() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequestContainer := m_createContainerBase;
var template RequestPrimitive v_createRequestContentInstance1 := m_createContentInstanceBase;
var template RequestPrimitive v_createRequestContentInstance2 := m_createContentInstanceBase;
const integer c_maxByteSize := 10;
const XSD.String c_primitiveContent1 := "Content1";
const XSD.String c_primitiveContent2 := "Content2";
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_createRequestContainer.primitiveContent.container.maxByteSize := c_maxByteSize;
v_createRequestContentInstance1.primitiveContent.contentInstance.content := c_primitiveContent1; //ContentInstance 1
v_createRequestContentInstance2.primitiveContent.contentInstance.content := c_primitiveContent2; //ContentInstance 2
v_createRequestContentInstance2.primitiveContent.contentInstance.resourceName := c_defaultContentInstanceResourceName & "2"; //ContentInstance 2
v_ae1.start(f_CSE_DMR_CRE_007(int3, v_createRequestContainer, int4, v_createRequestContentInstance1, v_createRequestContentInstance2, c_defaultContentInstanceResourceName));//ContentInstance under Container
v_ae1.done;
}
}// end group g_CSE_DMR_CRE_008
group g_CSE_DMR_CRE_015 {
/**
......@@ -1398,39 +1371,6 @@ module OneM2M_Testcases_CSE_Release_2 {
} // end g_CSE_DMR_UPD_007
group g_CSE_DMR_UPD_008{
/**
* @desc Check that the IUT responds with an error when the AE tries to delete a mandatory RW attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource
*
*/
testcase TC_CSE_DMR_UPD_008_PCH_ET() runs on Tester system CseSystem {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var Timestamp v_expirationTime := "21001231T012345";
var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase;
var AttributeAux_list v_nullFields;
var PrimitiveContent v_primitiveContentRetrieveResource;
v_nullFields := {{"expirationTime", omit}};
v_updateRequest.primitiveContent.pollingChannel.expirationTime := v_expirationTime;
v_ae1.start(f_CSE_DMR_UPD_008(int15, m_createPollingChannelBase, v_updateRequest, v_nullFields));//PollingChannel
v_ae1.done;
if(getverdict == pass){
v_primitiveContentRetrieveResource := f_getPrimitiveContentRetrievedResource(v_ae1);
//Check that the resource has NOT been udpated
if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) {
if(v_primitiveContentRetrieveResource.pollingChannel.expirationTime == v_expirationTime){
setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated")
}
}
}
}
} // end g_CSE_DMR_UPD_008
group g_CSE_DMR_UPD_009{
/**
......@@ -2228,52 +2168,6 @@ module OneM2M_Testcases_CSE_Release_2 {
group Create {
group g_CSE_SUB_CRE_001 {
/**
* @desc Check that the IUT rejects the creation of the <subscription> resource when the target subscribed-to RESOURCE_TYPE resource is not subscribable.
*
*/
testcase TC_CSE_SUB_CRE_001_CIN() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_parentResourceRequest := m_createContainerBase;
var template RequestPrimitive v_childResourceRequest := m_createContentInstanceBase;
var ResponsePrimitive v_responsePrimitive;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
const XSD.String c_content := "Random Value";
v_childResourceRequest.primitiveContent.contentInstance.content := "Random Value";
v_ae1.start(f_CSE_SUB_CRE_001(int3, v_parentResourceRequest, int4, v_childResourceRequest));
v_ae1.done;
}
testcase TC_CSE_SUB_CRE_001_SUB() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_parentResourceRequest := m_createSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SUB_CRE_001(int23, v_parentResourceRequest, int23, v_parentResourceRequest));
v_ae1.done;
}
testcase TC_CSE_SUB_CRE_001_TSI() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_parentResourceRequest := m_createTimeSeriesBase;
var template RequestPrimitive v_childResourceRequest := m_createTimeSeriesInstanceBase;
var ResponsePrimitive v_responsePrimitive;
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
const XSD.String c_content := "Random Value";
v_childResourceRequest.primitiveContent.timeSeriesInstance.content := "Random Value";
v_ae1.start(f_CSE_SUB_CRE_001(int29, v_parentResourceRequest, int30, v_childResourceRequest));
v_ae1.done;
}
}// end group g_CSE_DMR_CRE_014
}//end group Create
group Notify{
......
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