diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index 9f24d890882f3f2f79cc7ed0b57e19d0716c458e..dc2becd8815958024423046cbb08aea306e4c821 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -15148,7 +15148,9 @@ module OneM2M_Testcases { var RequestPrimitive v_request; var ListOfURIs v_memberIDs; var template RequestPrimitive v_createRequest; - + var template RequestPrimitive v_createContainerRequest_1 := m_createContainer_noResourceName; + var template RequestPrimitive v_createContainerRequest_2 := m_createContainer_noResourceName; + // Test control // Test component configuration @@ -15159,8 +15161,8 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, v_createContainerRequest_1, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, v_createContainerRequest_2, v_aeIndex); // AE child resource v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; @@ -15592,221 +15594,6 @@ module OneM2M_Testcases { f_cf01Down(); } - - group g_CSE_GMG_CRE_008 { - - /** - * @desc Check that IUT generates a request primitive for each resource in memberIDs with no relative address appended to it. - * - */ - testcase TC_CSE_GMG_CRE_008_CRE() runs on Tester system CseSystem { //Create - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template PrimitiveContent v_contentResponse; - v_contentResponse.container := mw_contentContainer_rc1; - - v_ae1.start(f_CSE_GMG_CRE_008(m_createContainerBase, v_contentResponse, int2001)); - v_ae1.done; - }//end TC_CSE_GMG_CRE_008_CRE - - testcase TC_CSE_GMG_CRE_008_UPD() runs on Tester system CseSystem { //Update - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template RequestPrimitive v_updateRequest := m_updateAeBase; - var template PrimitiveContent v_contentResponse; - var Labels v_labels_1:= {"VALUE_1"}; - v_contentResponse.aE := m_contentAe_allOmit; - v_contentResponse.aE.labels := ?; - v_updateRequest.primitiveContent.aE.labels := v_labels_1; - - v_ae1.start(f_CSE_GMG_CRE_008(v_updateRequest, v_contentResponse, int2004)); - v_ae1.done; - }//end TC_CSE_GMG_CRE_008_UPD - - testcase TC_CSE_GMG_CRE_008_RET() runs on Tester system CseSystem { //Retrieve - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template PrimitiveContent v_contentResponse; - v_contentResponse.aE := mw_contentAeBase; - - v_ae1.start(f_CSE_GMG_CRE_008(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000)); - v_ae1.done; - }//end TC_CSE_GMG_CRE_008_RET - - testcase TC_CSE_GMG_CRE_008_DEL() runs on Tester system CseSystem { //Delete - var AeSimu v_ae1 := AeSimu.create("AE1") alive; - var template PrimitiveContent v_contentResponse; - v_contentResponse.aE := mw_contentAeBase;// TODO see with wath should it be matched - - v_ae1.start(f_CSE_GMG_CRE_008(m_delete("Temporary", "Temporary"), v_contentResponse, int2002)); - v_ae1.done; - }//end TC_CSE_GMG_CRE_008_DEL - - function f_CSE_GMG_CRE_008(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { - //Local constants - const integer c_numberOfResponsePrimitive := 2; - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex_1 := -1; - var integer v_containerIndex_2 := -1; - var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - var integer i; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, -), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); - } - else{ - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ - setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); - } - else{ - for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); - } - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_CRE_008 - - } // end group g_CSE_GMG_CRE_008 - - - /** - * @desc Check that IUT generates a request primitive for each resource in memberIDs with a relative address appended to it. - * - */ - testcase TC_CSE_GMG_CRE_009() runs on AeSimu system CseSystem { - //Local constants - const integer c_numberOfResponsePrimitive := 2; - - // Local variables - var MsgIn v_response; - var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex := -1; - var integer i; - var ListOfURIs v_memberIDs; - var ListOfURIs v_membersAcpIds; - var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1")); - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); - var template PrimitiveContent v_contentResponse; - - v_contentResponse.contentInstance := mw_contentContentInstanceBase; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", omit), -1); // AE2 is registred - v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource - v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)}; - v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds, -), -); - - v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName; - v_createRequest.from_ := f_getOriginator(v_groupIndex); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN - - // Test Body - - mcaPort.send(m_request(v_createRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { - tc_ac.stop; - setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); - } - else{ - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ - setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); - } - else{ - for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ - setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); - } - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Wrong response status code"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, __SCOPE__ & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(fail, __SCOPE__ & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } // end TC_CSE_GMG_CRE_009 } // end group Create @@ -15822,15 +15609,16 @@ module OneM2M_Testcases { // Local variables var MsgIn v_response; - var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex, v_contentInstanceIndex_1, v_contentInstanceIndex_2 := -1; + var integer v_aeIndex_1, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex, v_contentInstanceIndex_1, v_contentInstanceIndex_2 := -1; var integer i; var ListOfURIs v_memberIDs; var ListOfURIs v_membersAcpIds; var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); var template PrimitiveContent v_contentResponse; var XSD.AnyURI v_fanoutPointAddress; + var RequestPrimitive v_containerRequestPrimitive := m_createContainer_noResourceName; - v_contentResponse.container := mw_contentContainerBase; + v_contentResponse.contentInstance := mw_contentContentInstanceBase; // Test control if(not(PICS_ACP_SUPPORT)) { @@ -15845,17 +15633,17 @@ module OneM2M_Testcases { // Preamble v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", omit), -1); // AE2 is registred v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource - v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource - v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource + v_containerRequestPrimitive := f_setAcpId(v_containerRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}); + v_containerIndex_1 := f_cse_createResource(int3, v_containerRequestPrimitive, v_aeIndex_1); // AE1 child resource + v_containerIndex_2 := f_cse_createResource(int3, v_containerRequestPrimitive, v_aeIndex_1); // AE2 child resource v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex_1); // Container_1 child resource v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex_2); // Container_2 child resource - v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)}; + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds), -1); + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), -1); - v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName & "/" & c_resourceShortNameLatest; + v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_resourceShortNameLatest; // Test Body mcaPort.send(m_request(m_retrieveResource(v_fanoutPointAddress, f_getOriginator(v_aeIndex_1)))); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN @@ -15937,11 +15725,12 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerCreateRequest.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource - v_containerIndex_2 := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3, -, - , -), v_aeIndex); + v_containerCreateRequest := f_setAcpId(v_containerCreateRequest, {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}); + v_containerIndex_2 := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource + v_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); // creating group @@ -16160,7 +15949,7 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); @@ -16182,8 +15971,8 @@ module OneM2M_Testcases { setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { - if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated != false) { - setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be FALSE"); + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated != true) { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be TRUE"); } } @@ -16256,7 +16045,7 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); @@ -16354,7 +16143,7 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); @@ -16807,7 +16596,8 @@ module OneM2M_Testcases { p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); + // Test Body mcaPort.send(m_request(valueof(p_requestPrimitive))); @@ -16922,6 +16712,7 @@ module OneM2M_Testcases { p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); // Test Body @@ -17027,6 +16818,7 @@ module OneM2M_Testcases { p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); // Test Body @@ -17142,6 +16934,7 @@ module OneM2M_Testcases { p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); // Test Body @@ -17174,6 +16967,271 @@ module OneM2M_Testcases { } // end f_CSE_GMG_004 } // end group g_CSE_GMG_004 + + group g_CSE_GMG_005 { + + /** + * @desc Check that IUT generates a request primitive for each resource in memberIDs with no relative address appended to it. + * + */ + testcase TC_CSE_GMG_005_CRE() runs on Tester system CseSystem { //Create + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template PrimitiveContent v_contentResponse; + v_contentResponse.container := mw_contentContainer_rc1; + + v_ae1.start(f_CSE_GMG_005(m_createContainerBase, v_contentResponse, int2001)); + v_ae1.done; + }//end TC_CSE_GMG_005_CRE + + testcase TC_CSE_GMG_005_UPD() runs on Tester system CseSystem { //Update + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var template PrimitiveContent v_contentResponse; + var Labels v_labels_1:= {"VALUE_1"}; + v_contentResponse.container := mw_contentContainerBase; + v_contentResponse.container.labels := ?; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + + v_ae1.start(f_CSE_GMG_005(v_updateRequest, v_contentResponse, int2004)); + v_ae1.done; + }//end TC_CSE_GMG_005_UPD + + testcase TC_CSE_GMG_005_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template PrimitiveContent v_contentResponse; + v_contentResponse.container := mw_contentContainerBase; + + v_ae1.start(f_CSE_GMG_005(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000)); + v_ae1.done; + }//end TC_CSE_GMG_005_RET + + testcase TC_CSE_GMG_005_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template PrimitiveContent v_contentResponse; + v_contentResponse.container := mw_contentContainerBase;// TODO see with wath should it be matched + + v_ae1.start(f_CSE_GMG_005(m_delete("Temporary", "Temporary"), v_contentResponse, int2002)); + v_ae1.done; + }//end TC_CSE_GMG_005_DEL + + function f_CSE_GMG_005(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { + //Local constants + const integer c_numberOfResponsePrimitive := 2; + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var ListOfURIs v_memberIDs; + var integer i; + var template RequestPrimitive v_createContainerRequest_1 := m_createContainer_noResourceName; + var template RequestPrimitive v_createContainerRequest_2 := m_createContainer_noResourceName; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_containerIndex_1 := f_cse_createResource(int3, v_createContainerRequest_1, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, v_createContainerRequest_2, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, -), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else{ + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ + setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); + } + else{ + for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); + } + } + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_005 + + } // end group g_CSE_GMG_005 + + group g_CSE_GMG_006 { + + /** + * @desc Check that IUT generates a request primitive for each resource in memberIDs with no relative address appended to it. + * + */ + testcase TC_CSE_GMG_006_CRE() runs on Tester system CseSystem { //Create + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template PrimitiveContent v_contentResponse; + v_contentResponse.container := mw_contentContainer_rc1; + + v_ae1.start(f_CSE_GMG_006(m_createContainerBase, v_contentResponse, int2001)); + v_ae1.done; + }//end TC_CSE_GMG_006_CRE + + testcase TC_CSE_GMG_006_UPD() runs on Tester system CseSystem { //Update + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var template PrimitiveContent v_contentResponse; + var Labels v_labels_1:= {"VALUE_1"}; + v_contentResponse.container := mw_contentContainerBase; + v_contentResponse.container.labels := ?; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + + v_ae1.start(f_CSE_GMG_006(v_updateRequest, v_contentResponse, int2004)); + v_ae1.done; + }//end TC_CSE_GMG_006_UPD + + testcase TC_CSE_GMG_006_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template PrimitiveContent v_contentResponse; + v_contentResponse.container := mw_contentContainerBase; + + v_ae1.start(f_CSE_GMG_006(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000)); + v_ae1.done; + }//end TC_CSE_GMG_006_RET + + testcase TC_CSE_GMG_006_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template PrimitiveContent v_contentResponse; + v_contentResponse.container := mw_contentContainerBase;// TODO see with wath should it be matched + + v_ae1.start(f_CSE_GMG_006(m_delete("Temporary", "Temporary"), v_contentResponse, int2002)); + v_ae1.done; + }//end TC_CSE_GMG_006_DEL + + /** + * @desc Check that IUT generates a request primitive for each resource in memberIDs with a relative address appended to it. + * + */ + function f_CSE_GMG_006(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on AeSimu { + //Local constants + const integer c_numberOfResponsePrimitive := 2; + + // Local variables + var MsgIn v_response; + var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex := -1; + var integer i; + var ListOfURIs v_memberIDs; + var ListOfURIs v_membersAcpIds; + var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1")); + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); + var template PrimitiveContent v_contentResponse; + + v_contentResponse.contentInstance := mw_contentContentInstanceBase; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", omit), -1); // AE2 is registred + v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)}; + v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds, -), -); + + v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName; + v_createRequest.from_ := f_getOriginator(v_groupIndex); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN + v_createRequest.requestIdentifier := v_createRequest.requestIdentifier & f_rnd(1, 1000000); + + // Test Body + + mcaPort.send(m_request(v_createRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else{ + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ + setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); + } + else{ + for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); + } + } + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_006 + }//end group g_CSE_GMG_006 }// End of Basic_Operations @@ -19407,6 +19465,7 @@ module OneM2M_Testcases { // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); p_requestPrimitive.from_ := "UnknowOriginator"; + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; @@ -19518,6 +19577,7 @@ module OneM2M_Testcases { // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; @@ -19614,6 +19674,7 @@ module OneM2M_Testcases { // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); p_requestPrimitive.from_ := "testDomain"; + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; @@ -19726,6 +19787,7 @@ module OneM2M_Testcases { // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); p_requestPrimitive.from_ := "UnknowOriginator"; + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start; @@ -19815,6 +19877,7 @@ module OneM2M_Testcases { // Test Body p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex); p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000); mcaPort.send(m_request(valueof(p_requestPrimitive))); tc_ac.start;