Commit c675cb35 authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

Implemented CSE/ANNC/CRE/005 and CSE/ANNC/CRE/006


Signed-off-by: Pramod Kulkarni's avatarpkulkarni <pkulkarni75@gmail.com>
parent 9c0ea3a8
......@@ -731,6 +731,13 @@ module OneM2M_Templates {
primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnnc(-)}
};
/**
* @desc Reception template for CREATE AcpAnnc
*/
template RequestPrimitive mw_createRemoteCSEAnnc(template XSD.ID p_from := ?, template XSD.ID p_to := ?, template AcpType p_accessControlPolicyIds := ?) modifies mw_create := {
resourceType := int10016,
primitiveContent := {remoteCSEAnnc := mw_contentCreateRemoteCSEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)}
};
/**
* @desc Base CREATE request primitive for AccessControlPolicy resource (AUX)
......@@ -1432,6 +1439,34 @@ module OneM2M_Templates {
choice := omit//NA
};
/**
* @desc Base reception template of primitiveContent for CREATE operation for RemoteCSEAnnc resource
* @param p_labels Labels
* @param p_accessControlPolicyIds AcpIDs
* @param p_appId App ID
* @param p_nodeLink Node link
*/
template RemoteCSEAnnc_optional mw_contentCreateRemoteCSEAnnc (in template Labels p_labels := ?, in template AcpType p_accessControlPolicyIds := ?, template XSD.AnyURI p_link := ?) := {
resourceName := omit,//NA M
resourceType := omit,//NA M
resourceID := omit,//NA M
parentID := omit,//NA M
creationTime := omit,//NA M
lastModifiedTime := omit,//NA M
labels := p_labels,//MA
accessControlPolicyIDs := p_accessControlPolicyIds,//MA
expirationTime := ?,//MA M
link := p_link,//M
dynamicAuthorizationConsultationIDs := omit, //OA
cseType := *,//OA
pointOfAccess := *,//OA
cSE_ID := *,//OA
requestReachability := *, //OA {"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA
nodeLink := *,//OA
e2eSecInfo := ?,//OA
choice := omit//NA
};
/**
* @desc Base primitiveContent for CREATE operation for AE resource
* @param p_name Resource name
......
......@@ -6455,7 +6455,7 @@ module OneM2M_PermutationFunctions {
v_ae1.start(f_cse_sendUpdateRequestPrimitive(p_resourceType, p_requestUpdatePrimitive));
v_ae1.done;
v_remoteCSEAnncIndex := f_cse_announcementProcedure_createHandler(p_createRequestAnnc);
f_cse_announcementProcedure_createHandler(p_createRequestAnnc);
// Postamble
f_cse_postamble_deleteResourcesCSE();
......@@ -6525,11 +6525,10 @@ module OneM2M_PermutationFunctions {
}//end f_CSE_ANNC_CRE_003
function f_CSE_ANNC_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
function f_CSE_ANNC_CRE_004_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var MsgIn v_request;
var RequestPrimitive v_request;
var integer v_parentIndex := -1;
var integer v_aeIndex := -1;
var integer v_resourceIndex;
......@@ -6547,7 +6546,7 @@ module OneM2M_PermutationFunctions {
f_cse_registrationRemoteCse(mw_createRemoteCSE);
//Preamble
v_aEAnncIndex := f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
f_cse_announcementProcedure_createHandler(mw_createAEAnnc(-, -, -));
v_ae1.start(f_cse_createResource(int2,v_create));
v_ae1.done;
......@@ -6582,6 +6581,118 @@ module OneM2M_PermutationFunctions {
}//end f_CSE_ANNC_CRE_004
function f_CSE_ANNC_CRE_005_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var MsgIn v_request;
var integer v_parentIndex := -1;
var integer v_aeIndex := -1;
var integer v_resourceIndex;
var integer v_remoteCSEAnncIndex := -1;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
// Test control
// Test component configuration
f_cf02UpCseSimuMaster();
// Test adapter configuration
// Register the CSE
f_cse_registrationRemoteCse(mw_createRemoteCSE);
//Preamble
f_cse_announcementProcedure_createHandler(mw_createRemoteCSEAnnc(-, -, -));
v_ae1.start(f_cse_createResource(int2,v_create));
v_ae1.done;
// Test Body
v_ae1.start(f_cse_sendCreateRequestPrimitive(p_resourceType,p_requestCreatePrimitive, v_parentIndex));
v_ae1.done;
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(v_aEAnncIndex, e_hierarchical, e_spRelative)) or
match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, 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");
}
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf02DownCseSimuMaster();
}//end f_CSE_ANNC_CRE_005
function f_CSE_ANNC_CRE_006_CseSimu(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc, in template RequestPrimitive p_requestCreatePrimitive := omit) runs on CseSimu {
// Local variables
var AeSimu v_ae1 := AeSimu.create("AE1") alive;
var MsgIn v_request;
var integer v_parentIndex := -1;
var integer v_aeIndex := -1;
var integer v_resourceIndex;
var integer v_remoteCSEAnncIndex := -1;
var ResponsePrimitive v_responsePrimitive;
var template RequestPrimitive v_create := m_createAe(PX_APP_ID, omit, omit);
// Test control
// Test component configuration
f_cf02UpCseSimuMaster();
// Test adapter configuration
// Register the CSE
f_cse_registrationRemoteCse(mw_createRemoteCSE);
//Preamble
f_cse_announcementProcedure_createHandler(mw_createRemoteCSEAnnc(-, -, -));
v_ae1.start(f_cse_createResource(int2,v_create));
v_ae1.done;
// Test Body
v_ae1.start(f_cse_sendCreateRequestPrimitive(p_resourceType,p_requestCreatePrimitive, v_parentIndex));
v_ae1.done;
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(v_aEAnncIndex, e_hierarchical, e_spRelative)) or
match(v_request.primitive.requestPrimitive.to_, f_getLocalResourceAddress(v_aEAnncIndex, 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");
}
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf02DownCseSimuMaster();
}//end f_CSE_ANNC_CRE_006
} //end group Create
}// end group Announcement
......
......@@ -6996,6 +6996,112 @@ module OneM2M_Testcases_CSE_Release_2 {
}
}// end group g_CSE_ANNC_CRE_004
group g_CSE_ANNC_CRE_005 {
testcase TC_CSE_ANNC_CRE_005_ACP() runs on Tester system CseSystem {
//Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_createRequestAnnc := mw_createAccessControlPolicyAnnc;
v_createRequest.primitiveContent.accessControlPolicy.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_005_CseSimu(int1, v_createRequestAnnc, v_createRequest));//AccessControlPolicy
v_cse1.done;
}
testcase TC_CSE_ANNC_CRE_005_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;
v_createRequest.primitiveContent.container.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_005_CseSimu(int3, v_createRequestAnnc, v_createRequest));//Container
v_cse1.done;
}
testcase TC_CSE_ANNC_CRE_005_CIN() runs on Tester system CseSystem {
//Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
var template RequestPrimitive v_createRequestAnnc := mw_createContentInstanceAnnc;
v_createRequest.primitiveContent.contentInstance.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_005_CseSimu(int4, v_createRequestAnnc, v_createRequest));//ContentInstance
v_cse1.done;
}
testcase TC_CSE_ANNC_CRE_005_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;
v_createRequest.primitiveContent.group_.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_005_CseSimu(int9, v_createRequestAnnc, v_createRequest));//Group
v_cse1.done;
}
} //end group g_CSE_ANNC_CRE_005
group g_CSE_ANNC_CRE_006 {
testcase TC_CSE_ANNC_CRE_006_ACP() runs on Tester system CseSystem {
//Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createAcpBase;
var template RequestPrimitive v_createRequestAnnc := mw_createAccessControlPolicyAnnc;
v_createRequest.primitiveContent.accessControlPolicy.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_006_CseSimu(int1, v_createRequestAnnc, v_createRequest));//AccessControlPolicy
v_cse1.done;
}
testcase TC_CSE_ANNC_CRE_006_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;
v_createRequest.primitiveContent.container.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_006_CseSimu(int3, v_createRequestAnnc, v_createRequest));//Container
v_cse1.done;
}
testcase TC_CSE_ANNC_CRE_006_CIN() runs on Tester system CseSystem {
//Local variables
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
var template RequestPrimitive v_createRequest := m_createContentInstanceBase;
var template RequestPrimitive v_createRequestAnnc := mw_createContentInstanceAnnc;
v_createRequest.primitiveContent.contentInstance.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_006_CseSimu(int4, v_createRequestAnnc, v_createRequest));//ContentInstance
v_cse1.done;
}
testcase TC_CSE_ANNC_CRE_006_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;
v_createRequest.primitiveContent.group_.announceTo := {PX_CSE1_ID};
v_cse1.start(f_CSE_ANNC_CRE_006_CseSimu(int9, v_createRequestAnnc, v_createRequest));//Group
v_cse1.done;
}
} //end group g_CSE_ANNC_CRE_006
}
}//end group Announcement
......
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