Commit 9d268e35 authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Review of TC_CSE_GMG_006


Signed-off-by: Miguel Angel Reina Ortega's avatarreinaortega <miguelangel.reinaortega@etsi.org>
parent 0d0e97a1
......@@ -7445,16 +7445,11 @@ module OneM2M_PermutationFunctions {
const integer c_numberOfResponsePrimitive := 2;
// 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_ae2LocalIndex, v_groupIndex := -1;
var integer i;
var ListOfURIs v_memberIDs;
var ListOfURIs v_membersAcpIds;
var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1"));
var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -);
var template PrimitiveContent v_contentResponse;
v_contentResponse.contentInstance := mw_contentContentInstanceBase;
var AcpType v_acpIds;
var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "PermissionForEveryone", -, -);
// Test control
if(not(PICS_ACP_SUPPORT)) {
......@@ -7463,43 +7458,60 @@ module OneM2M_PermutationFunctions {
}
// Test component configuration
f_cf01Up();
f_cf01Up(true);
// Test adapter configuration
// Preamble
v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi
v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_TS_AE2.appId, -, PX_TS_AE2.aeIdStem, c_defaultAE2Name, omit), -1); // AE2 is registred
v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource
v_acpIndex := f_cse_createResource(int1, v_createAcp, -); // AE child resource
v_acpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
v_aeIndex_1 := f_cse_preamble_registerAe(v_acpIds, -); //c_CRUDNDi
//vc_ae2.start(f_cse_createAccessControlPolicyAux("PermissionForAE1",{"all"}, int63));
//f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_TS_AE2.appId, v_acpIds, PX_TS_AE2.aeIdStem, c_defaultAE2Name, omit), -1)); // AE2 is registred
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_aeIndex_2 := f_getLatestResourceIndex(vc_ae2);
v_ae2LocalIndex := f_getLatestResource(vc_ae2);
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, -), -);
vc_ae2.start(f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2));
f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2);
v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_ae2LocalIndex].resource)};
//v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)};
v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_acpIds, -), v_aeIndex_1);
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
v_createRequest.requestIdentifier := v_createRequest.requestIdentifier & f_rnd(1, 1000000);
p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName;
p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN
p_requestPrimitive.requestIdentifier := p_requestPrimitive.requestIdentifier & f_rnd(1, 1000000);
// Test Body
f_send(e_mca_port, m_request(v_createRequest));
f_send(e_mca_port, m_request(valueof(p_requestPrimitive)));
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Operation performed successfully by using fanOutPoint in group resource");
if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){
if(not ispresent(vc_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){
setverdict(fail, __SCOPE__ & ": Error, aggregatedResponse attribute not provided");
}
else{
if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){
if(lengthof(vc_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){
setverdict(fail, __SCOPE__ & ": Error, length of aggregatedResponse is not valid");
}
else{
for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){
if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){
if(not match(vc_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){
setverdict(fail, __SCOPE__ & ": Error, aggregatedResponse doesn't match with template expected");
}
}
......
......@@ -12236,9 +12236,9 @@ module OneM2M_Testcases_CSE_Release_1 {
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var template PrimitiveContent v_contentResponse;
v_contentResponse.container := mw_contentContainer_rc1;
v_contentResponse.contentInstance := mw_contentContentInstanceBase;
v_ae1.start(f_CSE_GMG_006(m_createContainerBase, v_contentResponse));
v_ae1.start(f_CSE_GMG_006(m_createContentInstance("NotInitialized", "Value1"), v_contentResponse));
v_ae1.done;
}//end TC_CSE_GMG_006_CRE
......
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