diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index 9a6862f54527a900a3e4b896d67a35387b40fa58..3df8afc89e3ab73e030bac8b31f2431050d4252e 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -3970,6 +3970,773 @@ module OneM2M_Testcases { }//end group Location + group Group_Managment { + + + // Test objective: + // Check that the IUT rejects the creation of the group resource when member ID exceed max number + // of members. + group g_CSE_GMG_BV_001 { + + testcase TC_CSE_GMG_BV_001() runs on M2M system M2MSystem { + + // Local variables + var M2MResponsePrimitive v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.any_1[0].Group_optional.currentNrOfMembers := 6; + v_createRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 5; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe();//c_CRUDNDi); + + // Test Body + v_request := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex); + + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int6010)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": Creation failed because member ID exceed max number of member"); + } + [] mcaPort.receive(mw_responseKO) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + } + + } // end group g_CSE_GMG_BV_001 + + + + + // Test objective: + // Check that the IUT rejects the creation of the group resource when the memberType cannot + // be retrieved due to lack of privilege. + group g_CSE_GMG_BV_002 { + + testcase TC_CSE_GMG_BV_002() runs on M2M system M2MSystem + { + //TODO + } + + } // end group g_CSE_GMG_BV_002 + + + + // Test objective: + // Check that the IUT rejects the update of the group resource when the + // memberType cannot be retrieved due to lack of privilege. + group g_CSE_GMG_BV_003 { + + testcase TC_CSE_GMG_BV_003() runs on M2M system M2MSystem + { + //TODO + } + + } // end group g_CSE_GMG_BV_003 + + // Test objective: + // Check that the IUT rejects the update of the group + // resource when member ID exceed max number of members. + group g_CSE_GMG_BV_004 { + + testcase TC_CSE_GMG_BV_004() runs on M2M system M2MSystem + { + + var M2MResponsePrimitive v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + + + v_updateRequest.primitiveContent.any_1[0].Group_optional.currentNrOfMembers := 6; + v_updateRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 5; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + v_resourceIndex := f_createResource(int9, v_createRequest, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(int9, v_resourceIndex, v_updateRequest); + + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int4005)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": Update failed because member ID exceed max number of member"); + } + [] mcaPort.receive(mw_responseKO) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + } + + } // end group g_CSE_GMG_BV_004 + + // Test objective: + // Check that the IUT accepts the creation of the RESOURCE_TYPE resource by using + // fanOutPoint in group resource. + group g_CSE_GMG_BV_005 { + + testcase TC_CSE_GMG_BV_005() runs on M2M system M2MSystem + { + + // TODO: use right values for c_fanoutPointAddress and c_RessourceType1 + var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS"; + var ResourceType c_RessourceType1 := int1; + + // Local variables + var M2MResponsePrimitive v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + + var template RequestPrimitive v_createRequest := m_createGroupBase; + + + v_createRequest.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress; + v_createRequest.primitiveContent.any_1[0].Group_optional.resourceType := c_RessourceType1; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + v_resourceIndex := f_createResource(int9, v_createRequest, v_aeIndex); + + // Test Body + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int2001)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource"); + +// TODO: check for aggregatedResponse representation + + } + [] mcaPort.receive(mw_responseKO) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + + } + + } // end group g_CSE_GMG_BV_005 + + // Test objective: + // Check that the IUT returns successfully the resource of the group members by using + // fanOutPoint in group resource. + group g_CSE_GMG_BV_006 { + + testcase TC_CSE_GMG_BV_006() runs on M2M system M2MSystem + { + + + + // TODO: use right values for c_fanoutPointAddress and c_RessourceType1 + var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS"; + var ResourceType c_RessourceType1 := int1; + + // Local variables + var XSD.ID v_resourceId := "NonExisting"; + var RequestPrimitive v_request; + var M2MResponsePrimitive v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + + v_request := m_retrieveResource(f_getResourceAddress(-2) & "/" & v_resourceId); + v_request.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + v_resourceIndex := f_createResource(int9, v_request, v_aeIndex); + + // Test Body + + mcaPort.send(m_request(valueof(v_request))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int2000)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": retrieve attributes successfull by using fanOutPoint in group resource"); + +// TODO: check for aggregatedResponse representation + } + [] mcaPort.receive(mw_responseKO) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + } + + } // end group g_CSE_GMG_BV_006 + + // Test objective: + // Check that the IUT accepts the update of the RESOURCE_TYPE resource by using + // fanOutPoint in group resource. + group g_CSE_GMG_BV_007 { + + testcase TC_CSE_GMG_BV_007() runs on M2M system M2MSystem + { + + // TODO: use right values for c_fanoutPointAddress and c_RessourceType1 + var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS"; + + // Local variables + var M2MResponsePrimitive v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + + var Group_optional v_group_optional; + v_updateRequest.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + v_resourceIndex := f_createResource(int9, v_createRequest, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(int9, v_resourceIndex, v_updateRequest); + + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int2004)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": update successfull by using fanOutPoint in group resource"); + +// TODO: check for aggregatedResponse representation + + } + [] mcaPort.receive(mw_responseKO) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + } + + } // end group g_CSE_GMG_BV_007 + + // Test objective: + // Check that the IUT could delete the RESOURCE_TYPE resource by using + // fanOutPoint in group resource. + group g_CSE_GMG_BV_008_1 { + + testcase TC_CSE_GMG_BV_008_1() runs on M2M system M2MSystem + { + // TODO: use right values for c_fanoutPointAddress and c_deleteAddress + var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS"; + var XSD.ID c_deleteAddress := "DELETE"; + + //Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var M2MResponsePrimitive v_response; + + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_deleteRequest := m_deleteRequest(c_deleteAddress); + + + v_deleteRequest.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + v_resourceIndex := f_createResource(int9, v_createRequest, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(int9, v_resourceIndex, v_deleteRequest); + + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int2002)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": delete successfull by using fanOutPoint in group resource"); + } + [] mcaPort.receive(mw_responseKO) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + + } + + } // end group g_CSE_GMG_BV_008_1 + + // Test objective: + // Check that the IUT detects the presence of duplicate member IDs during the creation of the + // group resource and removes the duplicate member IDs prior to creation of the group resource. + group g_CSE_GMG_BV_008_2 { + + testcase TC_CSE_GMG_BV_008_2() runs on M2M system M2MSystem + { + + // TODO: use right values for c_memberRessourceAddress + var XSD.AnyURI c_memberRessourceAddress := "MEMBER_RESSOURCE_ADDRESS"; + + // Local variables + var M2MResponsePrimitive v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var template RequestPrimitive v_createRequest := m_createGroupBase; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + + v_createRequest := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex); + + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup (1, {c_memberRessourceAddress, c_memberRessourceAddress}, omit); + + mcaPort.send(m_request(valueof(v_createRequest))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int2001)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource created successfuly"); + + if(not ispresent(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberIDs)){ + setverdict(fail, testcasename(), ": Error, memberID attribute not provided"); + } else { + if(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberIDs[0] != c_memberRessourceAddress){ + setverdict(fail, testcasename(), ": Error, memberIDs attribute not correct"); + } + } + + + } + [] mcaPort.receive(mw_responseKO) -> value v_response { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while creating resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + } + + } // end group g_CSE_GMG_BV_008_2 + + // Test objective: + // Check that the IUT validates the resource type during the creation of the + // group resource when memberType attribute is not ‘mixed’. + group g_CSE_GMG_BV_009 { + + testcase TC_CSE_GMG_BV_009() runs on M2M system M2MSystem + { +// Local variables + var M2MResponsePrimitive v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + + // TODO: use right values for c_RessourceType1 + var ResourceType c_RessourceType1 := int1; + + var ResponsePrimitive.primitiveContent v_responsePrimitive; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + + + v_request := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex); + + v_request.primitiveContent.any_1[0].Group_optional.resourceType := c_RessourceType1; + + + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int2001)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource created successfuly"); + + if(not ispresent(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberTypeValidated)){ + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false){ + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct"); + } + } + + } + [] mcaPort.receive(mw_responseKO) -> value v_response { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while creating resource" ); + } + } + + // Postamble + f_postamble_deleteResources(); + + } + } // end group g_CSE_GMG_BV_009 + + + // Test objective: + // Check that the IUT handles unsuccessful validation of the resource type during the creation of the + // group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. + group g_CSE_GMG_BV_010 { + + testcase TC_CSE_GMG_BV_010() runs on M2M system M2MSystem + { + + // TODO: use right values for c_RessourceType1 and c_RessourceType2 + var MemberType c_RessourceType1 := int1; + var MemberType c_RessourceType2 := int2; + + // Local variables + var ResponsePrimitive.primitiveContent v_responsePrimitive; + var M2MResponsePrimitive v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var RequestPrimitive v_request; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + + + + v_request := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex); + + v_request.primitiveContent.any_1[0].Group_optional.memberType := c_RessourceType2; + v_request.primitiveContent.any_1[0].Group_optional.consistencyStrategy := int3; // MIXED + + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int2001)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource created successfuly"); + + + // check for memberTypeValidated + if(not ispresent(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberTypeValidated)){ + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false){ + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct"); + } + } + // check for memberType (MIXED) + if(not ispresent(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberType)){ + setverdict(fail, testcasename(), ": Error, memberType attribute not provided"); + } else { + if(v_response.responsePrimitive_.primitiveContent.any_1[0].Group_optional.memberType != int3){ + setverdict(fail, testcasename(), ": Error, memberType attribute not correct"); + } + } + + } + [] mcaPort.receive(mw_responseKO) -> value v_response { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while creating resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + + } + } // end group g_CSE_GMG_BV_010 + + // Test objective: + // Check that the IUT handles unsuccessful validation of the resource type during the creation of the + // group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is + // ABANDON_MEMBER,. + group g_CSE_GMG_BV_011 { + + testcase TC_CSE_GMG_BV_011() runs on M2M system M2MSystem + { + + // TODO: use right values for c_RessourceType1 and c_RessourceType2 and c_memberRessourceAddress1 and c_memberRessourceAddress2 + var MemberType c_RessourceType1 := int1; + var MemberType c_RessourceType2 := int2; + var XSD.AnyURI c_memberRessourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + var XSD.AnyURI c_memberRessourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + +// Local variables + var M2MResponsePrimitive v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var template RequestPrimitive v_createRequest := m_createGroupBase; + var ResponsePrimitive.primitiveContent v_responsePrimitive; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + + v_createRequest := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_RessourceType1; + v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := int1; // ABANDON_MEMBER + + mcaPort.send(m_request(valueof(v_createRequest))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int2001)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource created successfuly"); + +// check for memberTypeValidated + if(not ispresent(v_responsePrimitive.any_1[0].Group_optional.memberTypeValidated)){ + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_responsePrimitive.any_1[0].Group_optional.memberTypeValidated == false){ + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct"); + } + } + // check for membersId + if(not ispresent(v_responsePrimitive.any_1[0].Group_optional.memberIDs)){ + setverdict(fail, testcasename(), ": Error, memberIDs attribute not provided"); + } else { + if(v_responsePrimitive.any_1[0].Group_optional.memberIDs[0] != c_memberRessourceAddress1){ + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct"); + } + } + } + [] mcaPort.receive(mw_responseKO) -> value v_response { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while creating resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + + + } + + } // end group g_CSE_GMG_BV_011 + + // Test objective: + // Check that the IUT handles unsuccessful validation of the resource type during the creation of the + // group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is + // ABANDON_GROUP. + group g_CSE_GMG_BV_012 { + + testcase TC_CSE_GMG_BV_012() runs on M2M system M2MSystem + { + + + // TODO: use right values for c_RessourceType1 and c_RessourceType2 and c_memberRessourceAddress1 and c_memberRessourceAddress2 + var MemberType c_RessourceType1 := int1; + var MemberType c_RessourceType2 := int2; + var XSD.AnyURI c_memberRessourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + var XSD.AnyURI c_memberRessourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + +// Local variables + var M2MResponsePrimitive v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_preamble_registerAe(); //c_CRUDNDi + + v_createRequest := f_getCreateRequestPrimitive(int9, omit, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup (1, {c_memberRessourceAddress1, c_memberRessourceAddress2}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_RessourceType1; + v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := int2; // ABANDON_GROUP + + mcaPort.send(m_request(valueof(v_createRequest))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(int6011)) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": unsuccessful validation of the resource type during the creation of the group"); + } + [] mcaPort.receive(mw_responseKO) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_postamble_deleteResources(); + } + + + } // end group g_CSE_GMG_BV_012 + + } // end group Group_Managment + }//end group CSE