Commit 863b9bbb authored by Pramod Kulkarni's avatar Pramod Kulkarni

Implemented TPs DMR_UPD_017, DMR_UPD_018, DMR_CRE_001_SUB_AEA,...

Implemented TPs DMR_UPD_017, DMR_UPD_018, DMR_CRE_001_SUB_AEA, DMR_CRE_001_CNT_AEA, DMR_CRE_001_GRP_AEA and DMR_CRE_001_ACP_AEA
parent fa6006a3
......@@ -4841,6 +4841,137 @@ module OneM2M_PermutationFunctions {
}
} //end function f_CSE_DMR_UPD_016
function f_CSE_DMR_UPD_017(ResourceType p_resourceType, template RequestPrimitive p_requestCreatePrimitive, template RequestPrimitive p_createRequestAnnc, template RequestPrimitive p_requestUpdatePrimitive) runs on CseSimu {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var MsgIn v_request;
var RequestPrimitive v_requestUpdatePrimitive;
var integer v_parentIndex := -1;
var integer v_aeIndex := -1;
var integer v_resourceIndex;
var integer v_aEAnncIndex := -1;
var integer v_latestResourceIndex;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
v_create.primitiveContent.aE.announceTo := {PX_CSE_ID};
//Test control
// Test component configuration
f_cf02UpCseSimuMaster();
// Test adapter configuration
// Register the CSE
f_cse_registerRemoteCse(m_createRemoteCSEBase);
//Preamble
v_ae1.start(f_cse_createResource(int2,v_create));
f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
v_ae1.done;
v_ae1.start(f_cse_createResource(p_resourceType, p_requestCreatePrimitive, vc_aeAuxIndex));
v_ae1.done;
v_latestResourceIndex := f_getLatestResourceIndex(v_ae1);
// Test Body
v_ae1.start(f_cse_updateResource(p_resourceType, v_latestResourceIndex, p_requestUpdatePrimitive));
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ":INFO: CREATE REQUEST received");
if(match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(lengthof(vc_localResourcesList)-1, e_hierarchical, e_spRelative)) or
match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(lengthof(vc_localResourcesList)-1, e_nonHierarchical, e_spRelative))) {
setverdict(pass, __SCOPE__ & ":matching ANNC_PARENT_RESOURCE_ADDRESS");
} else {
setverdict(fail, __SCOPE__ & ":mis-matching ANNC_PARENT_RESOURCE_ADDRESS");
}
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
}
}
v_ae1.done;
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf02DownCseSimuMaster();
}//end f_CSE_DMR_UPD_017
function f_CSE_DMR_UPD_018(ResourceType p_resourceType, template RequestPrimitive p_requestCreatePrimitive, template RequestPrimitive p_createRequestAnnc, template RequestPrimitive p_requestUpdatePrimitive, template RequestPrimitive p_updateRequestAnnc) runs on CseSimu {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var MsgIn v_request;
var RequestPrimitive v_requestUpdatePrimitive;
var integer v_parentIndex := -1;
var integer v_aeIndex := -1;
var integer v_resourceIndex;
var integer v_aEAnncIndex := -1;
var integer v_latestResourceIndex;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
v_create.primitiveContent.aE.announceTo := {PX_CSE_ID};
//Test control
// Test component configuration
f_cf02UpCseSimuMaster();
// Test adapter configuration
// Register the CSE
f_cse_registerRemoteCse(m_createRemoteCSEBase);
//Preamble
v_ae1.start(f_cse_createResource(int2,v_create));
f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
v_ae1.done;
v_ae1.start(f_cse_createResource(p_resourceType, p_requestCreatePrimitive, vc_aeAuxIndex));
f_cse_announcementProcedure_createHandler(p_createRequestAnnc);
v_ae1.done;
v_latestResourceIndex := f_getLatestResourceIndex(v_ae1);
p_updateRequestAnnc.to_ := f_getLocalResourceAddress(lengthof(vc_localResourcesList)-1);
// Test Body
v_ae1.start(f_cse_updateResource(p_resourceType, v_latestResourceIndex, p_requestUpdatePrimitive));
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(p_updateRequestAnnc)) -> value v_request {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ":INFO: Announcement received");
v_responsePrimitive := valueof(m_responsePrimitive(int2004,v_request.primitive.requestPrimitive.requestIdentifier));
v_responsePrimitive.from_ := PX_CSE1_ID;
v_responsePrimitive.to_ := v_request.primitive.requestPrimitive.from_;
mccPortIn.send(m_response(v_responsePrimitive));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No announcement received");
}
}
v_ae1.done;
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf02DownCseSimuMaster();
}//end f_CSE_DMR_UPD_018
}//end group Update
......
......@@ -490,6 +490,82 @@ module OneM2M_Testcases_CSE_Release_2 {
}
}
testcase TC_CSE_DMR_CRE_001_SUB_AEA() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createSubscriptionBase;
var ResponsePrimitive v_responsePrimitive;
var RequestPrimitive v_createAEAnnc := m_createAEAnnc(omit, omit, omit, PX_CSE1_ID);
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_createRequest.primitiveContent.subscription.resourceName := omit;
v_ae1.start(f_CSE_DMR_CRE_001(int23, v_createRequest, v_createAEAnnc));//Subscription
v_ae1.done;
if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1);
if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_001_CNT_AEA() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createContainerBase;
var ResponsePrimitive v_responsePrimitive;
var RequestPrimitive v_createAEAnnc := m_createAEAnnc(omit, omit, omit, PX_CSE1_ID);
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_createRequest.primitiveContent.subscription.resourceName := omit;
v_ae1.start(f_CSE_DMR_CRE_001(int3, v_createRequest, v_createAEAnnc));//Container
v_ae1.done;
if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1);
if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_001_GRP_AEA() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createGroupBase;
var ResponsePrimitive v_responsePrimitive;
var RequestPrimitive v_createAEAnnc := m_createAEAnnc(omit, omit, omit, PX_CSE1_ID);
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_createRequest.primitiveContent.subscription.resourceName := omit;
v_ae1.start(f_CSE_DMR_CRE_001(int9, v_createRequest, v_createAEAnnc));//Group
v_ae1.done;
if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1);
if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_001_ACP_AEA() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createAcpBase;
var ResponsePrimitive v_responsePrimitive;
var RequestPrimitive v_createAEAnnc := m_createAEAnnc(omit, omit, omit, PX_CSE1_ID);
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
v_createRequest.primitiveContent.subscription.resourceName := omit;
v_ae1.start(f_CSE_DMR_CRE_001(int1, v_createRequest, v_createAEAnnc));//Access Control Policy
v_ae1.done;
if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1);
if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
}
}
}
testcase TC_CSE_DMR_CRE_001_NOD_CB() runs on Tester system CseSystem {
// Local variables
var template RequestPrimitive v_createRequest := m_createNodeBase;
......@@ -4695,7 +4771,131 @@ module OneM2M_Testcases_CSE_Release_2 {
}
} // end group g_CSE_DMR_UPD_016
group g_CSE_DMR_UPD_017 {
/**
* @desc Check that the IUT updates successfully the value of the announceTo optional attribute of the RESOURCE_TYPE resource
*/
testcase TC_CSE_DMR_UPD_017_ACP() runs on Tester system CseSystem {
// Local variables
var MnCseSimu v_cse1 := MnCseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_createRequestAnnc := mw_createAccessControlPolicyAnnc;
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_DMR_UPD_017(int1, v_createRequest, v_createRequestAnnc, v_updateRequest));//AccessControlPolicy
v_cse1.done;
}
testcase TC_CSE_DMR_UPD_017_CNT() runs on Tester system CseSystem {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_createRequestAnnc := mw_createContainerAnncBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_updateRequest.primitiveContent.container.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_DMR_UPD_017(int3, v_createRequest, v_createRequestAnnc, v_updateRequest));//Container
v_cse1.done;
}
testcase TC_CSE_DMR_UPD_017_GRP() runs on Tester system CseSystem {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_createRequestAnnc := mw_createGroupAnncBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.group_.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_DMR_UPD_017(int9, v_createRequest, v_createRequestAnnc, v_updateRequest));//Group
v_cse1.done;
}
testcase TC_CSE_DMR_UPD_017_SCH() runs on Tester system CseSystem {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createScheduleBase;
var template RequestPrimitive v_createRequestAnnc := mw_createScheduleAnncBase;
var template RequestPrimitive v_updateRequest := m_updateScheduleBase;
v_updateRequest.primitiveContent.schedule.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_DMR_UPD_017(int18, v_createRequest, v_createRequestAnnc, v_updateRequest));//Schedule
v_cse1.done;
}
} //end group g_CSE_DMR_UPD_017
group g_CSE_DMR_UPD_018 {
testcase TC_CSE_DMR_UPD_018_CNT_MBS() runs on Tester system CseSystem {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createContainerBase;
var template RequestPrimitive v_createRequestAnnc := mw_createContainerAnncBase;
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
var template RequestPrimitive v_updateRequestAnnc := mw_updateContainerAnnc;
var XSD.NonNegativeInteger v_maxByteSize := 512;
v_createRequest.primitiveContent.container.announceTo := {PX_CSE1_ID};
v_createRequest.primitiveContent.container.maxByteSize := v_maxByteSize;
v_createRequestAnnc.primitiveContent.containerAnnc.maxByteSize := v_maxByteSize;
v_updateRequest.primitiveContent.container.announcedAttribute := {"maxByteSize"};
v_updateRequestAnnc.primitiveContent.containerAnnc.maxByteSize := v_maxByteSize;
v_cse1.start(f_CSE_DMR_UPD_018(int3, v_createRequest, v_createRequestAnnc, v_updateRequest, v_updateRequestAnnc));//Container
v_cse1.done;
}
testcase TC_CSE_DMR_UPD_018_GRP_MT() runs on Tester system CseSystem {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_createRequestAnnc := mw_createGroupAnncBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var template RequestPrimitive v_updateRequestAnnc := mw_updateGroupAnnc;
var MemberType v_memberType := int3;
v_createRequest.primitiveContent.group_.announceTo := {PX_CSE1_ID};
v_createRequest.primitiveContent.group_.memberType := v_memberType;
v_createRequestAnnc.primitiveContent.groupAnnc.memberType := v_memberType;
v_updateRequest.primitiveContent.group_.announcedAttribute := {"memberType"};
v_updateRequestAnnc.primitiveContent.groupAnnc.memberType := v_memberType;
v_cse1.start(f_CSE_DMR_UPD_018(int9, v_createRequest, v_createRequestAnnc, v_updateRequest, v_updateRequestAnnc));//Group
v_cse1.done;
}
testcase TC_CSE_DMR_UPD_018_SCH_SE() runs on Tester system CseSystem {
// Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createGroupBase;
var template RequestPrimitive v_createRequestAnnc := mw_createGroupAnncBase;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
var template RequestPrimitive v_updateRequestAnnc := mw_updateGroupAnnc;
v_createRequest.primitiveContent.schedule.announceTo := {PX_CSE1_ID};
v_createRequestAnnc.primitiveContent.scheduleAnnc.scheduleElement := {{"0 0 0,1,2 1 1 * *"}};//Attribute 1
v_updateRequest.primitiveContent.schedule.announcedAttribute := {"scheduleElement"};
v_updateRequestAnnc.primitiveContent.scheduleAnnc.scheduleElement := {{"1 1 1,2 1 1 * *"}}; //Attribute 1
v_cse1.start(f_CSE_DMR_UPD_018(int18, v_createRequest, v_createRequestAnnc, v_updateRequest, v_updateRequestAnnc));//Group
v_cse1.done;
}
} //end group g_CSE_DMR_UPD_018
}//end group Update
group Delete {
......
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