Skip to content
Snippets Groups Projects
Commit 97ad7752 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

GMG test cases clean-up and verification

parent 3f9aef86
No related branches found
No related tags found
1 merge request!25Ae fixes
......@@ -7,7 +7,7 @@
*
* @author oneM2M
* @version $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $
* $Id: OneM2M_TypesAndValues.ttcn 306 2017-06-20 16:19:04Z reinaortega $
* $Id: OneM2M_TypesAndValues.ttcn 324 2017-07-24 16:16:08Z reinaortega $
* @desc Module containing types and values for oneM2M
*
*/
......@@ -41,6 +41,7 @@ module OneM2M_TypesAndValues {
const charstring c_invalid_location_update_period := "-PT30M10S" ;//duration set to invalid value (minus value)
const XSD.ID c_resourceShortNameLatest := "la"; //<latest>
const XSD.ID c_resourceShortNameOldest := "ol"; //<oldest>
const XSD.ID c_resourceShortNameFanOutPoint := "fopt"; //<fanOutPoint>
//AccessControlOperations
const XSD.Integer c_C := 1;
......
......@@ -7,7 +7,7 @@
*
* @author oneM2M
* @version $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $
* $Id: OneM2M_Testcases.ttcn 323 2017-07-18 07:32:04Z reinaortega $
* $Id: OneM2M_Testcases.ttcn 324 2017-07-24 16:16:08Z reinaortega $
* @desc Module containing test cases for oneM2M
*
*/
......@@ -10201,7 +10201,7 @@ module OneM2M_Testcases {
var RequestPrimitive v_request;
var template RequestPrimitive v_containerCreateRequest := m_createContainer_noResourceName;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, int61); //c_CUDNDi
var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyAcp", -, int61); //c_CUDNDi
// Test control
if(not(PICS_ACP_SUPPORT)) {
......@@ -10219,8 +10219,8 @@ module OneM2M_Testcases {
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, m_createContainer_noResourceName, 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_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_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); // creating group
......@@ -10426,7 +10426,7 @@ module OneM2M_Testcases {
setverdict(fail, testcasename(), ": Error, memberType attribute not provided");
}
else {
if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType != int0){ //Mixed is int0 in release 2 and int24 in release 1
if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType != int0){
setverdict(fail, testcasename(), ": Error, memberType attribute not correct");
}
}
......@@ -10476,7 +10476,7 @@ module OneM2M_Testcases {
v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex);
v_groupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex);
v_memberIDs := {f_getResourceId(vc_resourcesList[v_groupIndex].resource), f_getResourceId(vc_resourcesList[v_containerIndex].resource)};
v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, int2)); //Member type is set to container and consistencyStrategy is set to ABANDON GROUP
v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, int2, -, -)); //Member type is set to container and consistencyStrategy is set to ABANDON GROUP
v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);
// Test Body
......@@ -10537,7 +10537,7 @@ module OneM2M_Testcases {
v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex);
v_groupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex);
v_memberIDs := {f_getResourceId(vc_resourcesList[v_groupIndex].resource), f_getResourceId(vc_resourcesList[v_containerIndex].resource)};
v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, omit)); //Member type is set to container and consistencyStrategy is set to ABANDON MEMBER (default value)
v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, -, -, -)); //Member type is set to container and consistencyStrategy is set to ABANDON MEMBER (default value)
v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex);
// Test Body
......@@ -10615,7 +10615,7 @@ module OneM2M_Testcases {
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_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1, v_memberId_2}, omit, int3), v_aeIndex); // AE child resource
v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1, v_memberId_2}, omit, int3, -, -, -), v_aeIndex); // AE child resource
v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_2};
v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
......@@ -10641,6 +10641,10 @@ module OneM2M_Testcases {
}
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error update successful with wrong ResponseStatusCode");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating resource");
......@@ -10684,7 +10688,7 @@ module OneM2M_Testcases {
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_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3), v_aeIndex);
v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3, -, -, -), v_aeIndex);
v_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)};
v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
......@@ -10706,13 +10710,17 @@ module OneM2M_Testcases {
}
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error update successful with wrong ResponseStatusCode");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource");
}
}
//Postamble
......@@ -10753,7 +10761,7 @@ module OneM2M_Testcases {
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);
v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, int3), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to MIXED (int3)
v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, int3, -, -), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to MIXED (int3)
v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_1, v_memberId_2};
v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest);
......@@ -10787,6 +10795,10 @@ module OneM2M_Testcases {
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error update successful with wrong ResponseStatusCode");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
......@@ -10871,13 +10883,17 @@ module OneM2M_Testcases {
}
}
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error update successful with wrong ResponseStatusCode");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while updating resource");
}
}
//Postamble
......@@ -11006,13 +11022,17 @@ module OneM2M_Testcases {
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");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while retrieving resource");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error update successful while maxNrOfMembers has exceeded");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while retrieving resource");
}
}
//Postamble
......@@ -11715,11 +11735,13 @@ module OneM2M_Testcases {
// Local variables
var MsgIn v_response;
var integer v_aeIndex_1 := -1;
var integer v_aeIndex_2 := -1;
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 RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1"));
// Test control
......@@ -11729,13 +11751,14 @@ module OneM2M_Testcases {
// 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_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)};
v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2), -1);
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_1); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN
p_requestPrimitive.from_ := f_getOriginator(v_aeIndex);
// Test Body
......@@ -11771,6 +11794,31 @@ module OneM2M_Testcases {
}
}
//Connerie
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_responsePrimitiveOK)) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while creating resource");
}
[] tc_ac.timeout {
setverdict(inconc, testcasename() & ": No answer while creating resource");
}
}
// Postamble
f_cse_postamble_deleteResources();
......@@ -11818,14 +11866,14 @@ module OneM2M_Testcases {
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_createContainer_noResourceName, v_aeIndex_1); // AE1 child resource
v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex_2); // AE2 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), -1);
v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds, -), -);
v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/fopt" & "/myCon";
v_createRequest.from_ := f_getOriginator(v_aeIndex_1); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN
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
......@@ -11883,7 +11931,7 @@ 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 := -1;
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 i;
var ListOfURIs v_memberIDs;
var ListOfURIs v_membersAcpIds;
......@@ -11908,13 +11956,15 @@ module OneM2M_Testcases {
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_createContainer_noResourceName, v_aeIndex_1); // AE1 child resource
v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex_2); // AE2 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_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_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_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/fopt" & "/myCon" & "/la";
v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName & "/" & 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment