Skip to content
Snippets Groups Projects
Commit 94f0d229 authored by Siddharth Trika's avatar Siddharth Trika Committed by Miguel Angel Reina Ortega
Browse files

New Testcases for SSM related to container and group update

parent 849f95b3
Branches Release4-onwards-SSM-Testcases-Backlog
No related tags found
1 merge request!67Release4 onwards ssm testcases backlog
......@@ -12927,6 +12927,84 @@ module OneM2M_Testcases_CSE_Release_4 {
f_cf01Down();
}
 
/**
* @desc Check that the IUT responds with an error when the authorized AE tries to perform OPERATION on the
* resource TARGET_RESOURCE_ADDRESS and it exceeds the limit for ATTRIBUTE_NAME in its
* m2mServiceSubscriptionProfile resource
*
*/
testcase TC_CSE_SSM_SSP_007_MIC_UPD() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SSM_SSP_007_MIC_UPD());
v_ae1.done;
}
function f_CSE_SSM_SSP_007_MIC_UPD() runs on AeSimu system CseSystem {
var integer v_subscriptionProfileIndex := -1;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1;
var template RequestPrimitive v_updateContainerMaxNrInstancesRequest := m_updateContainerMaxNrInstances(2);
var RequestPrimitive v_request;
// Test component configuration
f_cf01Up(true);
// directly on CSEBase from superAE, Create serviceSubscriptionProfile with maxNumInstancesPerContainer = 1
v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1);
// register one AE
// TODO: Link this AE to Subscription Profile created above
// NOTE: Its assumed that the CSE has the mapping of this AE with ServiceSubscriptionProfile
vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// Create one container
v_aeIndex := f_getLatestResourceIndex(vc_ae2);
vc_ae2.start(f_cse_createResource(int3, m_createContainerBase, v_aeIndex));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// Create 1 content instance under
v_containerIndex := f_getLatestResourceIndex(vc_ae2);
vc_ae2.start(f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// UPDATE container's attribute maxNumInstancesPerContainer = 2 from same AE. maxNumInstancesPerContainer in SSP allowed 1
v_request := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateContainerMaxNrInstancesRequest);
f_send(e_mcaPort, m_request(v_request));
tc_ac.start;
alt {
// SERVICE_SUBSCRIPTION_LIMITS_EXCEEDED
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4141))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Request successfully Rejected");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4141))) -> value vc_response{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Request should be rejected with 4141 (SERVICE_SUBSCRIPTION_LIMITS_EXCEEDED) instead of " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
f_checkAeSimuStatus();
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}
/**
* @desc Check that the IUT responds with an error when the authorized AE tries to perform OPERATION on the
* resource TARGET_RESOURCE_ADDRESS and it exceeds the limit for ATTRIBUTE_NAME in its
......@@ -13091,6 +13169,102 @@ module OneM2M_Testcases_CSE_Release_4 {
f_cf01Down();
}
/**
* @desc Check that the IUT responds with an error when the authorized AE tries to perform OPERATION on the
* resource TARGET_RESOURCE_ADDRESS and it exceeds the limit for ATTRIBUTE_NAME in its
* m2mServiceSubscriptionProfile resource
*
*/
testcase TC_CSE_SSM_SSP_007_MMG_UPD() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SSM_SSP_007_MMG_UPD());
v_ae1.done;
}
function f_CSE_SSM_SSP_007_MMG_UPD() runs on AeSimu system CseSystem {
var integer v_subscriptionProfileIndex := -1;
var integer v_aeIndex := -1;
var integer v_containerOneIndex := -1;
var integer v_containerTwoIndex := -1;
var integer v_groupIndex := -1;
var RequestPrimitive v_request;
var ListOfURIs v_memberIDs;
var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1;
var template RequestPrimitive v_updateGroupMaxNrMembers := m_updateGroupMaxNrMembers(2);
// Test component configuration
f_cf01Up(true);
// directly on CSEBase from superAE, Create serviceSubscriptionProfile with maxMembersPerGroup = 1
v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1);
// register one AE
// TODO: Link this AE to Subscription Profile created above
// NOTE: Its assumed that the CSE has the mapping of this AE with ServiceSubscriptionProfile
vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// Create one container
v_aeIndex := f_getLatestResourceIndex(vc_ae2);
vc_ae2.start(f_cse_createResource(int3, m_createContainerBase, v_aeIndex));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_containerOneIndex := f_getLatestResourceIndex(vc_ae2);
// Create another container from same AE
vc_ae2.start(f_cse_createResource(int3, m_createContainerBase, v_aeIndex));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_containerTwoIndex := f_getLatestResourceIndex(vc_ae2);
// Create one Group resource with 2 containers above as members
v_memberIDs := {
f_getResourceId(vc_resourcesList[v_containerOneIndex].resource),
f_getResourceId(vc_resourcesList[v_containerTwoIndex].resource)
};
// Create Group with 2 members from same AE
vc_ae2.start(f_cse_createResource(int3, m_createGroup(2, v_memberIDs, omit, int2, -, omit,-), -1));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_groupIndex := f_getLatestResourceIndex(vc_ae2);
// UPDATE Group's attribute maxMembersPerGroup = 2 from same AE. maxNumMembersPerGroup in SSP allowed 1
v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateGroupMaxNrMembers);
f_send(e_mcaPort, m_request(v_request));
tc_ac.start;
alt {
// SERVICE_SUBSCRIPTION_LIMITS_EXCEEDED
[] mcaPort.receive(mw_response(mw_responsePrimitive(int4141))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Request successfully Rejected");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4141))) -> value vc_response{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Request should be rejected with 4141 (SERVICE_SUBSCRIPTION_LIMITS_EXCEEDED) instead of " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
f_checkAeSimuStatus();
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}
/**
* @desc Check that the IUT responds with an error when the authorized AE tries to perform OPERATION on the
* resource TARGET_RESOURCE_ADDRESS and it exceeds the limit for ATTRIBUTE_NAME in its
......@@ -13532,6 +13706,86 @@ module OneM2M_Testcases_CSE_Release_4 {
f_cf01Down();
}
 
/**
* @desc Check that the IUT processes the request when the authorized AE
* having not exceeded the limit for ATTRIBUTE_NAME in its m2mServiceSubscriptionProfile resource
* tries to perform OPERATION on the resource TARGET_RESOURCE_ADDRESS
*
*/
testcase TC_CSE_SSM_SSP_008_MIC_UPD() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SSM_SSP_008_MIC_UPD());
v_ae1.done;
}
function f_CSE_SSM_SSP_008_MIC_UPD() runs on AeSimu system CseSystem {
var integer v_subscriptionProfileIndex := -1;
var integer v_aeIndex := -1;
var integer v_containerIndex := -1;
var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1;
var template RequestPrimitive v_createContentInstanceRequest := m_createContentInstanceBase;
var template RequestPrimitive v_createContainerRequest := m_createContainerBase;
var template RequestPrimitive v_updateContainerMaxNrInstancesRequest := m_updateContainerMaxNrInstances(1);
var RequestPrimitive v_request;
// Test component configuration
f_cf01Up(true);
// directly on CSEBase from superAE, Create serviceSubscriptionProfile with maxNumInstancesPerContainer = 1
v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1);
// register one AE
// TODO: Link this AE to Subscription Profile created above
// NOTE: Its assumed that the CSE has the mapping of this AE with ServiceSubscriptionProfile
vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// Create one container
v_aeIndex := f_getLatestResourceIndex(vc_ae2);
v_createContainerRequest.from_ := PX_ALLOWED_C_AE_IDS[0];
vc_ae2.start(f_cse_createResource(int3, v_createContainerRequest, v_aeIndex));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// UPDATE container's attribute maxNumInstancesPerContainer = 1 from same AE. maxNumInstancesPerContainer in SSP allowed 1
v_containerIndex := f_getLatestResourceIndex(vc_ae2);
v_request := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateContainerMaxNrInstancesRequest);
f_send(e_mcaPort, m_request(v_request));
tc_ac.start;
alt {
// SUCCESSFULL CREATION
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource successfully created");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value vc_response{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Request should successfully create instead of " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
f_checkAeSimuStatus();
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}
/**
* @desc Check that the IUT processes the request when the authorized AE
* having not exceeded the limit for ATTRIBUTE_NAME in its m2mServiceSubscriptionProfile resource
......@@ -13687,6 +13941,93 @@ module OneM2M_Testcases_CSE_Release_4 {
f_cf01Down();
}
/**
* @desc Check that the IUT processes the request when the authorized AE
* having not exceeded the limit for ATTRIBUTE_NAME in its m2mServiceSubscriptionProfile resource
* tries to perform OPERATION on the resource TARGET_RESOURCE_ADDRESS
*
*/
testcase TC_CSE_SSM_SSP_008_MMG_UPD() runs on Tester system CseSystem {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_ae1.start(f_CSE_SSM_SSP_008_MMG_UPD());
v_ae1.done;
}
function f_CSE_SSM_SSP_008_MMG_UPD() runs on AeSimu system CseSystem {
var integer v_subscriptionProfileIndex := -1;
var integer v_aeIndex := -1;
var integer v_containerOneIndex := -1;
var integer v_groupIndex := -1;
var RequestPrimitive v_request;
var ListOfURIs v_memberIDs;
var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1;
var template RequestPrimitive v_createContainerRequest := m_createContainerBase;
var template RequestPrimitive v_updateGroupMaxNrMembers := m_updateGroupMaxNrMembers(1);
// Test component configuration
f_cf01Up(true);
// directly on CSEBase from superAE, Create serviceSubscriptionProfile with maxMembersPerGroup = 1
v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1);
// register one AE
// TODO: Link this AE to Subscription Profile created above
// NOTE: Its assumed that the CSE has the mapping of this AE with ServiceSubscriptionProfile
vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
// Create one container
v_aeIndex := f_getLatestResourceIndex(vc_ae2);
v_createContainerRequest.from_ := PX_ALLOWED_C_AE_IDS[0];
vc_ae2.start(f_cse_createResource(int3, v_createContainerRequest, v_aeIndex));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_containerOneIndex := f_getLatestResourceIndex(vc_ae2);
// Create Empty Group from same AE
vc_ae2.start(f_cse_createResource(int3, m_createGroup(1, -, omit, int2, -, -, -), -1));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_groupIndex := f_getLatestResourceIndex(vc_ae2);
// UPDATE Group's attribute maxMembersPerGroup = 1 from same AE. maxNumMembersPerGroup in SSP allowed 1
v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateGroupMaxNrMembers);
v_request.from_ := PX_ALLOWED_C_AE_IDS[0];
f_send(e_mcaPort, m_request(v_request));
tc_ac.start;
alt {
// SUCCESSFULL CREATION
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource successfully created");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value vc_response{
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Request should successfully create instead of " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while retrieving resource");
}
}
f_checkAeSimuStatus();
// Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf01Down();
}
/**
* @desc Check that the IUT processes the request when the authorized AE
* having not exceeded the limit for ATTRIBUTE_NAME in its m2mServiceSubscriptionProfile resource
......
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