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

TC_CSE_GMG_UPD_010 - Some corrections (not finalised yet)


Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 538aa967
......@@ -15110,25 +15110,22 @@ module OneM2M_Testcases {
testcase TC_CSE_GMG_UPD_009() runs on CseTester system CseSystem
{
//Local constants
const integer c_maxNrOfMembers := 2;
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 integer v_contentInstanceIndex := -1;
var integer v_containerIndex_1 := -1;
var integer v_containerIndex_2 := -1;
var XSD.AnyURI v_memberId_1;
var XSD.AnyURI v_memberId_2;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var template RequestPrimitive v_createMember;
var PrimitiveContent v_primitiveContentRetrievedResource;
// Test control
......@@ -15140,29 +15137,22 @@ module OneM2M_Testcases {
// 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.group_ := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit);
v_createRequest.primitiveContent.group_.memberType := c_memberType1;
v_createRequest.primitiveContent.group_.memberTypeValidated := true;
v_createRequest.primitiveContent.group_.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");
v_contentInstanceIndex := 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
//TODO: -> register IUT to the remoteCSE
//TODO: Create one of the container in a remoteCSE
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_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex_1].resource);
v_memberId_2 := f_getResourceId(vc_resourcesList[v_containerIndex_2].resource);
v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, {v_memberId_1}, omit, int3));
v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex);
//Test Body
v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest);
// v_request.to_ := c_targetResourceAddress;
v_createRequest.primitiveContent.group_ := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit);
v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_1, v_memberId_2};
v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest);
mcaPort.send(m_request(v_request));
tc_ac.start;
alt {
......@@ -15176,7 +15166,7 @@ module OneM2M_Testcases {
if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 2) {
setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute");
} else {
if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] == c_memberResourceAddress1 and v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[1] == c_memberResourceAddress2) {
if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] == v_memberId_1 and v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[1] == v_memberId_2) {
setverdict(pass, __SCOPE__ & ": update successful");
} else {
setverdict(fail, __SCOPE__, ": Error, wrong memberIDs");
......@@ -15203,7 +15193,7 @@ module OneM2M_Testcases {
setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated");
}
if((v_primitiveContentRetrievedResource.group_.memberIDs[0] != c_memberResourceAddress1) and (v_primitiveContentRetrievedResource.group_.memberIDs[1] != c_memberResourceAddress2)){
if((v_primitiveContentRetrievedResource.group_.memberIDs[0] != v_memberId_1) and (v_primitiveContentRetrievedResource.group_.memberIDs[1] != v_memberId_2)){
setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct");
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment