diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 62a4012b980b61a623a2fd868dc73895c8e45594..f480e165c2b9cff202b204acca6b1f253b0a7870 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -7,7 +7,7 @@ * * @author ETSI * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $ - * $Id: OneM2M_Functions.ttcn 127 2016-10-10 08:36:57Z reinaortega $ + * $Id: OneM2M_Functions.ttcn 134 2016-10-11 09:33:13Z reinaortega $ * @desc Module containing functions for oneM2M * */ diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index e18ee42e037ac84c4e58b6f10e698658ebf4f09b..db1b55fb85c3312ef839852ff84648e9503f1d30 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -7,7 +7,7 @@ * * @author ETSI * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Pixits.ttcn $ - * $Id: OneM2M_Pixits.ttcn 127 2016-10-10 08:36:57Z reinaortega $ + * $Id: OneM2M_Pixits.ttcn 134 2016-10-11 09:33:13Z reinaortega $ * @desc Module containing Pixits for oneM2M * */ diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 1e97ca00c4614a04510b06dc1a787bf821f5ea4a..b9278af7ebbdfc4ee90ee8301cb294f53d4a262e 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -7,7 +7,7 @@ * * @author ETSI * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $ - * $Id: OneM2M_Templates.ttcn 131 2016-10-10 11:54:46Z reinaortega $ + * $Id: OneM2M_Templates.ttcn 134 2016-10-11 09:33:13Z reinaortega $ * @desc Module containing templates for oneM2M * */ diff --git a/LibOneM2M/OneM2M_Types.ttcn b/LibOneM2M/OneM2M_Types.ttcn index 26d7c9e4101ef02c72abd41ee5a3813be9bdbcc6..3a6faa429ca5a4ef4772ded2b7c624982c0605b0 100644 --- a/LibOneM2M/OneM2M_Types.ttcn +++ b/LibOneM2M/OneM2M_Types.ttcn @@ -7,7 +7,7 @@ * * @author ETSI * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Types.ttcn $ - * $Id: OneM2M_Types.ttcn 131 2016-10-10 11:54:46Z reinaortega $ + * $Id: OneM2M_Types.ttcn 134 2016-10-11 09:33:13Z reinaortega $ * @desc Test System module for oneM2M * */ @@ -6930,7 +6930,7 @@ group optionalResourceTypes { }; }//end group - + group invalidTypes { @@ -7079,6 +7079,6 @@ with { encode "XML"; variant "namespace as 'http://www.onem2m.org/xml/protocols' prefix 'm2m'"; variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; - extension "anytype Notification, AggregatedNotification, ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid, LocationPolicy_optional, LocationPolicy_update_invalid" + extension "anytype Notification, AggregatedNotification, AggregatedResponse, ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid, LocationPolicy_optional, LocationPolicy_update_invalid" } diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index 81502671637561a87dfd2d9e0f556e00feaac973..a2b3713aca438674ad566a1989a998db04a49741 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -7,7 +7,7 @@ * * @author ETSI * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $ - * $Id: OneM2M_TypesAndValues.ttcn 131 2016-10-10 11:54:46Z reinaortega $ + * $Id: OneM2M_TypesAndValues.ttcn 134 2016-10-11 09:33:13Z reinaortega $ * @desc Module containing types and values for oneM2M * */ diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index f8fbea26685ff0a5ae9dd8ac5e1ad9a9e968c2da..71212a301d21ccb3a4bf7f0cff97730fd534ee9c 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -7,7 +7,7 @@ * * @author ETSI * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $ - * $Id: OneM2M_Testcases.ttcn 132 2016-10-10 12:20:14Z reinaortega $ + * $Id: OneM2M_Testcases.ttcn 134 2016-10-11 09:33:13Z reinaortega $ * @desc Module containing test cases for oneM2M * */ @@ -4279,7 +4279,7 @@ module OneM2M_Testcases { testcase TC_CSE_LOC_BV_001() runs on CseTester system CseSystem { - var integer v_aeAuxIndex := -1; + var integer v_aeAuxIndex := -1; var RequestPrimitive v_request; var MsgIn v_response; var LocationSource v_locationSource := int1;//Network-based @@ -4327,7 +4327,7 @@ module OneM2M_Testcases { group g_CSE_LOC_BV_002{ testcase TC_CSE_LOC_BV_002() runs on CseTester system CseSystem { - var integer v_aeAuxIndex := -1; + var integer v_aeAuxIndex := -1; var LocationSource v_locationSource := int1;//Network-based var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; @@ -4382,14 +4382,14 @@ module OneM2M_Testcases { var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_request; - var MsgIn v_response; + var MsgIn v_response; //Test component configuration f_cf01Up(); //Preamble v_aeAuxIndex := f_cse_preamble_registerAe(int62);//c_RUDNDi //No resource creation privilege - + //Set requestPrimitive v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource,omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeAuxIndex); @@ -4522,9 +4522,9 @@ module OneM2M_Testcases { }//end testcase TC_CSE_LOC_BI_001 }//end group g_CSE_LOC_BI_001 - + group g_CSE_LOC_BV_003 { - + testcase TC_CSE_LOC_BV_003() runs on CseTester system CseSystem{ //TO RETRIEVE a <container> resource that has created in cse and linked with a <locationPolicy> resource (network-based case) @@ -5028,7 +5028,15 @@ module OneM2M_Testcases { 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.currentNrOfMembers := 6; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESOURCE_ADDRESS_2"; + const XSD.AnyURI c_memberResourceAddress3 := "MEMBER_RESOURCE_ADDRESS_3"; + const XSD.AnyURI c_memberResourceAddress4 := "MEMBER_RESOURCE_ADDRESS_4"; + const XSD.AnyURI c_memberResourceAddress5 := "MEMBER_RESOURCE_ADDRESS_5"; + const XSD.AnyURI c_memberResourceAddress6 := "MEMBER_RESOURCE_ADDRESS_6"; + + v_createRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {c_memberResourceAddress1, c_memberResourceAddress2, c_memberResourceAddress3, c_memberResourceAddress4, c_memberResourceAddress5, c_memberResourceAddress6}; v_createRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 5; @@ -5080,9 +5088,64 @@ module OneM2M_Testcases { // be retrieved due to lack of privilege. group g_CSE_GMG_BV_002 { - testcase TC_CSE_GMG_BV_002() runs on CseTester system CseSystem + testcase TC_CSE_GMG_BV_002() runs on CseTester system CseSystem { - //TODO + // Local constants + const ResourceType c_ResourceTypeGroup := int9; // <group> ? + const ResourceType c_ResourceTypeAcp := int1; // <ACP> + const XSD.String c_acpName := "ACP_NAME"; + const ListOfURIs c_acor := {"NA"}; + const AccessControlOperations c_allowedOperations := int63; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_createAcp := m_createAcp(c_acpName, c_acpName, c_acor, c_allowedOperations); + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + v_request := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); // creating group + + v_acpIndex := f_cse_createResource(c_ResourceTypeAcp, v_createAcp, v_aeIndex); + v_request.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs := {f_getResourceAddress(v_acpIndex)}; + + // Test Body + + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": creation failed due to lack of privilege"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); } } // end group g_CSE_GMG_BV_002 @@ -5095,8 +5158,67 @@ module OneM2M_Testcases { group g_CSE_GMG_BV_003 { testcase TC_CSE_GMG_BV_003() runs on CseTester system CseSystem - { - //TODO + { + // Local constants + const ResourceType c_ResourceTypeGroup := int9; // <group> ? + const ResourceType c_ResourceTypeAcp := int1; // <ACP> + const XSD.String c_acpName := "ACP_NAME"; + const ListOfURIs c_acor := {"NA"}; + const AccessControlOperations c_allowedOperations := int63; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_groupResourceIndex := -1; + + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createAcp := m_createAcp(c_acpName, c_acpName, c_acor, c_allowedOperations); + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + v_groupResourceIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); // create group resource + + v_acpIndex := f_cse_createResource(c_ResourceTypeAcp, v_createAcp, v_groupResourceIndex); + + + // Test Body + v_request := f_getUpdateRequestPrimitive(int9, v_groupResourceIndex, v_updateRequest); + v_request.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs := {f_getResourceAddress(v_acpIndex)}; + + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": creation failed due to lack of privilege"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); } } // end group g_CSE_GMG_BV_003 @@ -5117,8 +5239,15 @@ module OneM2M_Testcases { 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.currentNrOfMembers := 6; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESOURCE_ADDRESS_2"; + const XSD.AnyURI c_memberResourceAddress3 := "MEMBER_RESOURCE_ADDRESS_3"; + const XSD.AnyURI c_memberResourceAddress4 := "MEMBER_RESOURCE_ADDRESS_4"; + const XSD.AnyURI c_memberResourceAddress5 := "MEMBER_RESOURCE_ADDRESS_5"; + const XSD.AnyURI c_memberResourceAddress6 := "MEMBER_RESOURCE_ADDRESS_6"; + + v_updateRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {c_memberResourceAddress1, c_memberResourceAddress2, c_memberResourceAddress3, c_memberResourceAddress4, c_memberResourceAddress5, c_memberResourceAddress6}; v_updateRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 5; @@ -5198,7 +5327,9 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_resourceIndex := f_cse_createResource(int9, v_createRequest, v_aeIndex); + //v_resourceIndex := f_cse_createResource(int9, v_createRequest, v_aeIndex); // not used anymore -> Issue #4 + + v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // Test Body @@ -5209,8 +5340,9 @@ module OneM2M_Testcases { tc_ac.stop; setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource"); -// TODO: check for aggregatedResponse representation - + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ + setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; @@ -5277,8 +5409,10 @@ module OneM2M_Testcases { tc_ac.stop; setverdict(pass, testcasename() & ": retrieve attributes successfull by using fanOutPoint in group resource"); -// TODO: check for aggregatedResponse representation - } + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ + setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); + } + } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; setverdict(fail, testcasename() & ": Error while retrieving resource"); @@ -5306,8 +5440,7 @@ module OneM2M_Testcases { testcase TC_CSE_GMG_BV_007() runs on CseTester system CseSystem { - // TODO: use right values for c_fanoutPointAddress and c_RessourceType1 - var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS"; + const ResourceType c_RessourceType1 := int9; // <group> ? // Local variables var MsgIn v_response; @@ -5317,10 +5450,14 @@ module OneM2M_Testcases { var template RequestPrimitive v_createRequest := m_createGroupBase; var template RequestPrimitive v_updateRequest := m_updateGroupBase; - - //v_updateRequest.primitiveContent.any_1[0].Group_optional.fanOutPoint := c_fanoutPointAddress;TODO <--------------------------------------- - + const XSD.AnyURI c_memberRessourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberRessourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + const XSD.AnyURI c_memberRessourceAddress3 := "MEMBER_RESSOURCE_ADDRESS_3"; + const XSD.AnyURI c_memberRessourceAddress4 := "MEMBER_RESSOURCE_ADDRESS_4"; + const XSD.AnyURI c_memberRessourceAddress5 := "MEMBER_RESSOURCE_ADDRESS_5"; + const XSD.AnyURI c_memberRessourceAddress6 := "MEMBER_RESSOURCE_ADDRESS_6"; + // Test control // Test component configuration @@ -5329,6 +5466,10 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble + + //var XSD.AnyURI c_memberRessourceAddress6 := "MEMBER_RESSOURCE_ADDRESS_6"; + v_createRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {c_memberRessourceAddress1, c_memberRessourceAddress2, c_memberRessourceAddress3, c_memberRessourceAddress4, c_memberRessourceAddress5, c_memberRessourceAddress6}; + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_resourceIndex := f_cse_createResource(int9, v_createRequest, v_aeIndex); @@ -5343,8 +5484,9 @@ module OneM2M_Testcases { tc_ac.stop; setverdict(pass, testcasename() & ": update successfull by using fanOutPoint in group resource"); -// TODO: check for aggregatedResponse representation - + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ + setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; @@ -5368,9 +5510,9 @@ module OneM2M_Testcases { // 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 { + group g_CSE_GMG_BV_008 { - testcase TC_CSE_GMG_BV_008_1() runs on CseTester system CseSystem + testcase TC_CSE_GMG_BV_008() runs on CseTester system CseSystem { // TODO: use right values for c_fanoutPointAddress and c_deleteAddress var XSD.AnyURI c_fanoutPointAddress := "FANOUTPOINT_ADDRESS"; @@ -5411,6 +5553,10 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": delete successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ + setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; @@ -5429,14 +5575,14 @@ module OneM2M_Testcases { } - } // end group g_CSE_GMG_BV_008_1 + } // end group g_CSE_GMG_BV_008 // 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 { + group g_CSE_GMG_BV_009 { - testcase TC_CSE_GMG_BV_008_2() runs on CseTester system CseSystem + testcase TC_CSE_GMG_BV_009() runs on CseTester system CseSystem { // TODO: use right values for c_memberRessourceAddress @@ -5496,14 +5642,14 @@ module OneM2M_Testcases { } - } // end group g_CSE_GMG_BV_008_2 + } // end group g_CSE_GMG_BV_009 // 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 { + group g_CSE_GMG_BV_010 { - testcase TC_CSE_GMG_BV_009() runs on CseTester system CseSystem + testcase TC_CSE_GMG_BV_010() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; @@ -5570,15 +5716,15 @@ module OneM2M_Testcases { f_cf01Down(); } - } // end group g_CSE_GMG_BV_009 + } // 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 SET_MIXED. - group g_CSE_GMG_BV_010 { + group g_CSE_GMG_BV_011 { - testcase TC_CSE_GMG_BV_010() runs on CseTester system CseSystem + testcase TC_CSE_GMG_BV_011() runs on CseTester system CseSystem { // TODO: use right values for c_RessourceType1 and c_RessourceType2 @@ -5624,7 +5770,7 @@ module OneM2M_Testcases { if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)){ setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); } else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false){ + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated != false){ setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct"); } } @@ -5654,15 +5800,15 @@ module OneM2M_Testcases { f_cf01Down(); } - } // end group g_CSE_GMG_BV_010 + } // 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_MEMBER,. - group g_CSE_GMG_BV_011 { + group g_CSE_GMG_BV_012 { - testcase TC_CSE_GMG_BV_011() runs on CseTester system CseSystem + testcase TC_CSE_GMG_BV_012() runs on CseTester system CseSystem { // TODO: use right values for c_RessourceType1 and c_RessourceType2 and c_memberRessourceAddress1 and c_memberRessourceAddress2 @@ -5676,6 +5822,7 @@ module OneM2M_Testcases { var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := m_createGroupBase; + //var ResponsePrimitive.primitiveContent v_responsePrimitive; // not used anymore -> issue #5 // Test control @@ -5732,15 +5879,15 @@ module OneM2M_Testcases { } - } // end group g_CSE_GMG_BV_011 + } // end group g_CSE_GMG_BV_012 // 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 { + group g_CSE_GMG_BV_013 { - testcase TC_CSE_GMG_BV_012() runs on CseTester system CseSystem + testcase TC_CSE_GMG_BV_013() runs on CseTester system CseSystem { @@ -5798,7 +5945,875 @@ module OneM2M_Testcases { } - } // end group g_CSE_GMG_BV_012 + } // end group g_CSE_GMG_BV_013 + + // 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 updating of the group resource. + group g_CSE_GMG_BV_014 { + testcase TC_CSE_GMG_BV_014() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; // "group": TS-0004, Table 6.3.4.2.1-1 + const ResourceType c_ResourceType1 := int4; // "contentInstance": TS-0004, Table 6.3.4.2.1-1 + const XSD.String c_primitiveContent := "any content instance value"; // embedded value of a contentInstance +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; // resource type can be <CSEBase>, <AE>, <remoteCSE> + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; // any resource type + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; // any resource type + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; // initialization with dummy value + var integer v_groupIndex := -1; // initialization with dummy value + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + // and the IUT having registered the AE + v_aeIndex := f_cse_preamble_registerAe(); // create auxiliar AE + + // and the IUT having a resource at TARGET_RESOURCE_ADDRESS of type <group> + // containing memberIDs attribute + // set to MEMBER_RESOURCE_ADDRESS_1 + // and the AE having privileges to perform UPDATE operation on the TARGET_RESOURCE_ADDRESS + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); // build request primitive + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit); + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); // create resource + + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_1 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_2 + // having resourceType attribute RESOURCE_TYPE_1 + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); // build request primitive + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); // request new member + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_2"); // build request primitive + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); // request new member + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_request.primitiveContent.any_1[0].Group_optional := valueof(m_contentCreateGroup(2, {c_memberResourceAddress2, c_memberResourceAddress2}, omit)); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": update successful"); + + + // check for membersId + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs)){ + setverdict(fail, testcasename(), ": Error, memberIDs attribute not provided"); + } else { + + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs) != 1) { + setverdict(fail, testcasename() & ": Error, wrong number of memberIDs attribute"); + } + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[0] != c_memberResourceAddress2){ + setverdict(fail, testcasename(), ": Error, memberIDs attribute not correct"); + } + } + + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_014 + + /** + * @desc Check that the IUT validates the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’. + */ + group g_CSE_GMG_BV_015 { + testcase TC_CSE_GMG_BV_015() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const XSD.String c_primitiveContent := "any content instance value"; // embedded value of a contentInstance +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_groupIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + + // and the IUT having a resource at TARGET_RESOURCE_ADDRESS of type <group> + // containing + // memberIDs attribute set to MEMBER_RESOURCE_ADDRESS_1 + // memberType attribute set to RESOURCE_TYPE_1 + // and the AE having privileges to perform UPDATE operation on the TARGET_RESOURCE_ADDRESS + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_memberType1; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_1 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_2 + // having resourceType attribute RESOURCE_TYPE_1 + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_2"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_request.primitiveContent.any_1[0].Group_optional := valueof(m_contentCreateGroup(1, {c_memberResourceAddress2}, omit)); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": update successful"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)) { + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false) { + setverdict(fail, testcasename(), ": Error, memberTypeValidated wrong value"); + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_015 + + group g_CSE_GMG_BV_016 { + // Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. + testcase TC_CSE_GMG_BV_016() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const ResourceType c_ResourceType2 := int5; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const MemberType c_memberType2 := int5; // should be set same type as c_ResourceType2 + const MemberType c_memberType_MIXED := int0; // "mixed": TS-0004, Table 6.3.4.2.11-1 + const XSD.String c_primitiveContent := "any embedded primitive_content"; + const ConsistencyStrategy c_consistentcyStrategy := int3; // "SET_MIXED": TS-0004, Table 6.3.4.2.12-1 +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_groupIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + + // and the IUT having a resource at TARGET_RESOURCE_ADDRESS of type <group> + // containing + // memberIDs attribute set to MEMBER_RESOURCE_ADDRESS_1 + // memberType attribute set to RESOURCE_TYPE_1 + // memberTypeValidated attribute set to TRUE + // consistencyStrategy attribute set to SET_MIXED + // and the AE having privileges to perform UPDATE operation on the TARGET_RESOURCE_ADDRESS + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_memberType1; + v_createRequest.primitiveContent.any_1[0].Group_optional.memberTypeValidated := true; + v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := c_consistentcyStrategy; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_1 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_2 + // having resourceType attribute RESOURCE_TYPE_2 + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_2"); + f_cse_createResource(c_ResourceType2, v_createMember, v_aeIndex); + + + //Test Body + + // the IUT receives an valid UPDATE request from AE containing + // To set to TARGET_RESOURCE_ADDRESS and + // From set to AE-ID and + // Content set to <group> resource containing + // memberIDs attribute set to + // MEMBER_RESOURCE_ADDRESS_1, + // MEMBER_RESOURCE_ADDRESS_2 + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_request.primitiveContent.any_1[0].Group_optional := valueof(m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit)); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": update successful"); + + //memberTypeValidated attribute set to FALSE + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)) { + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated != false) { + setverdict(fail, testcasename(), ": Error, memberTypeValidated must be FALSE"); + }} + + //memberType attribute set to MIXED + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberType)) { + setverdict(fail, testcasename(), ": Error, memberType attribute not provided"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberType != c_memberType_MIXED) { + setverdict(fail, testcasename(), ": Error, memberType was not set to MIXED"); + }} + + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_016 + + group g_CSE_GMG_BV_017 { + // Test objective: Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_MEMBER. + testcase TC_CSE_GMG_BV_017() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const ResourceType c_ResourceType2 := int5; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const MemberType c_memberType2 := int5; // should be set same type as c_ResourceType2 + const XSD.String c_primitiveContent := "primitive_content"; + const ConsistencyStrategy c_consistentcyStrategy := int1; // ABANDOND_MEMBER: TS-0004, Table 6.3.4.2.12-1 +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_groupIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + + // and the IUT having a resource at TARGET_RESOURCE_ADDRESS of type <group> + // containing + // memberIDs attribute set to MEMBER_RESOURCE_ADDRESS_1 + // memberType attribute set to RESOURCE_TYPE_1 + // memberTypeValidated attribute set to TRUE + // consistencyStrategy attribute set to ABANDON_MEMBER + // and the AE having privileges to perform UPDATE operation on the TARGET_RESOURCE_ADDRESS + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_memberType1; + v_createRequest.primitiveContent.any_1[0].Group_optional.memberTypeValidated := true; + v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := c_consistentcyStrategy; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_1 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_2 + // having resourceType attribute RESOURCE_TYPE_2 + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_2"); + f_cse_createResource(c_ResourceType2, v_createMember, v_aeIndex); + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_request.primitiveContent.any_1[0].Group_optional := valueof(m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit)); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": update successful"); + + //memberTypeValidated attribute set to TRUE + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)) { + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated != true) { + setverdict(fail, testcasename(), ": Error, memberTypeValidated must be TRUE"); + }} + + //memberIDs attribute set to + // MEMBER_RESOURCE_ADDRESS_1 + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs)){ + setverdict(fail, testcasename(), ": Error, memberIDs attribute not provided"); + } else { + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs) != 1) { + setverdict(fail, testcasename() & ": Error, wrong number of memberIDs attribute"); + } + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[0] != c_memberResourceAddress1){ + setverdict(fail, testcasename(), ": Error, memberIDs attribute not correct"); + } + } + + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_017 + + group g_CSE_GMG_BV_018 { + // 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. + testcase TC_CSE_GMG_BV_018() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const ResourceType c_ResourceType2 := int5; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const MemberType c_memberType2 := int5; // should be set same type as c_ResourceType2 + const XSD.String c_primitiveContent := "primitive_contet"; + const ConsistencyStrategy c_consistentcyStrategy := int2; // ABANDOND_GROUP +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_groupIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + + // and the IUT having a resource at TARGET_RESOURCE_ADDRESS of type <group> + // containing + // memberIDs attribute set to MEMBER_RESOURCE_ADDRESS_1 + // memberType attribute set to RESOURCE_TYPE_1 + // memberTypeValidated attribute set to TRUE + // consistencyStrategy attribute set to # (ABANDON_GROUP) + // and the AE having privileges to perform UPDATE operation on the + // TARGET_RESOURCE_ADDRESS + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_memberType1; + v_createRequest.primitiveContent.any_1[0].Group_optional.memberTypeValidated := true; + v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := c_consistentcyStrategy; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_1 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_2 + // having resourceType attribute RESOURCE_TYPE_2 + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_2"); + f_cse_createResource(c_ResourceType2, v_createMember, v_aeIndex); + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_request.primitiveContent.any_1[0].Group_optional := valueof(m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit)); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + setverdict(pass, testcasename() & ": deleted successful"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_018 + + group g_CSE_GMG_BV_019 { + // Test objective: Check that the IUT detects when the number of memberIDs exceeds the limitation of maxNrOfMembers. + testcase TC_CSE_GMG_BV_019() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const XSD.String c_primitiveContent := "primitive_contet"; +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + const XSD.AnyURI c_memberResourceAddress3 := "MEMBER_RESSOURCE_ADDRESS_3"; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_groupIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + + // and the IUT having a resource at TARGET_RESOURCE_ADDRESS of type <group> + // containing + // memberIDs attribute set to MEMBER_RESOURCE_ADDRESS_1, + // MEMBER_RESOURCE_ADDRESS_2 + // maxNrOfMembers attribute set to 2 + // and the AE having privileges to perform UPDATE operation on the TARGET_RESOURCE_ADDRESS + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 2; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_1 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_2 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_3 + // having resourceType attribute RESOURCE_TYPE_1 + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_2"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_3"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_request.primitiveContent.any_1[0].Group_optional := valueof(m_contentCreateGroup(3, {c_memberResourceAddress1, c_memberResourceAddress2, c_memberResourceAddress3}, omit)); + + 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, testcasename() & ": operation is not allowed"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_019 + + group g_CSE_GMG_BV_020 { + // Test objective: Check that the IUT detects when the value provided for maxNrOfMembers attribute is less than the value of the currentNrOfMembers attribute. + testcase TC_CSE_GMG_BV_020() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const XSD.String c_primitiveContent := "primitive_contet"; +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + const XSD.AnyURI c_memberResourceAddress3 := "MEMBER_RESSOURCE_ADDRESS_3"; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_groupIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + + // and the IUT having a resource at TARGET_RESOURCE_ADDRESS of type <group> + // containing + // memberIDs attribute set to MEMBER_RESOURCE_ADDRESS_1, + // MEMBER_RESOURCE_ADDRESS_2 + // maxNrOfMembers attribute set to 2 + // and the AE having privileges to perform UPDATE operation on the TARGET_RESOURCE_ADDRESS + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(3, {c_memberResourceAddress1, c_memberResourceAddress2, c_memberResourceAddress3}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 3; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_1 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_2 + // having resourceType attribute RESOURCE_TYPE_1 + // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_3 + // having resourceType attribute RESOURCE_TYPE_1 + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_2"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_3"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_request.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 2; + + 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, testcasename() & ": operation is not allowed"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_020 + + group g_CSE_GMG_BV_021 { + // Test objective: Check that the IUT handles validation of the resource type during an UPDATE of the <group> resource when memberIDs contains a sub-group on a temporarily unreachable Hosting CSE. + testcase TC_CSE_GMG_BV_021() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const XSD.String c_primitiveContent := "primitive_contet"; + const ConsistencyStrategy c_consistentcyStrategy := int1; // ABANDOND_MEMBER +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_groupIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi +// TODO: -> register IUT to the remoteCSE + + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_memberType1; + v_createRequest.primitiveContent.any_1[0].Group_optional.memberTypeValidated := true; + v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := c_consistentcyStrategy; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + // TODO: -> do the resources actually need to be created? + // TODO: choose the right template for member resource + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + + // TODO: create resource of type <group> at c_memberResourceAddress2 on remoteCSE + // TODO: set onlineStatus to false on remoteCSE + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)) { + setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false) { + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs) != 2) { + setverdict(fail, testcasename() & ": Error, wrong number of memberIDs attribute"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[0] == c_memberResourceAddress1 and v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[1] == c_memberResourceAddress2) { + setverdict(pass, testcasename() & ": update successful"); + } else { + setverdict(fail, testcasename(), ": Error, wrong memberIDs"); + } + } + } else { + setverdict(fail, testcasename(), ": Error, memberTypeValidated must be set to FALSE"); + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_021 + + group g_CSE_GMG_BV_022 { + // Test objective: Check that the IUT handles validation of the resource type during an UPDATE of the <group> resource when memberIDs contains a sub-group on a a previously unreachable Hosting CSE that has become reachable + testcase TC_CSE_GMG_BV_022() runs on CseTester system CseSystem + { + //Local constants + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const XSD.String c_primitiveContent := "primitive_contet"; + const ConsistencyStrategy c_consistentcyStrategy := int1; // ABANDOND_MEMBER +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_remoteCSEIndex := -1; + var integer v_groupIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi +// TODO: -> register IUT to the remoteCSE + //v_remoteCSEIndex := ... + + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit); + v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_memberType1; + v_createRequest.primitiveContent.any_1[0].Group_optional.memberTypeValidated := false; + v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := c_consistentcyStrategy; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + // TODO: -> the AE having a subscription to c_targetResourceAddress + + // TODO: -> do the resources actually need to be created? + // TODO: choose the right template for member resource + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + + // TODO: create resource of type <group> at c_memberResourceAddress2 on remoteCSE + // TODO: set onlineStatus to false on remoteCSE + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); + //v_request.from_ := CSE-ID + v_request.to_ := f_getResourceAddress(v_remoteCSEIndex); + //Content set to <remoteCSE> resource containing onlineStatus := false; + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + + + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } // end group g_CSE_GMG_BV_022 } // end group Group_Managment @@ -5864,6 +6879,7 @@ module OneM2M_Testcases { var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; + v_createRequest.primitiveContent.any_1[0].Subscription_optional.resourceName := omit; // Test control // Test component configuration @@ -5876,7 +6892,7 @@ module OneM2M_Testcases { v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container - v_contentInstanceResourceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_aeIndex), "Random Value"), v_aeIndex);//ContentInstance + v_contentInstanceResourceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_aeIndex), "Random Value"), v_containerResourceIndex);//ContentInstance v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_contentInstanceResourceIndex);