Commit 37480ea7 authored by Pramod Kulkarni's avatar Pramod Kulkarni
Browse files

Implemented TP DMR/UPD/018 and its permutations

parent 0d0f1c4c
......@@ -405,6 +405,20 @@ module OneM2M_Templates {
primitiveContent := {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)}
};
template (value) RequestPrimitive m_updateNodeBase modifies m_update := {
requestIdentifier := "m_updateNode" & f_rnd(1, 1000000),
primitiveContent:= {node := m_contentUpdateNode}
}
template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := {
requestIdentifier := "m_updateRemoteCSEBase" & f_rnd(1, 1000000),
primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE}
}
template (value) RequestPrimitive m_updateAE modifies m_update := {
requestIdentifier := "m_updateAE" & f_rnd(1, 1000000),
primitiveContent := {aE := m_contentUpdateAE}
}
}//end group Update
group Create {
......@@ -2144,6 +2158,76 @@ module OneM2M_Templates {
locationStatus := omit, //NP
choice := omit //NP
};
template (value) Node_optional m_contentUpdateNode := {
resourceName := omit,
resourceType := omit,
resourceID := omit,
parentID := omit,
creationTime := omit,
lastModifiedTime := omit,
labels := omit,
accessControlPolicyIDs := omit,
expirationTime := omit,
dynamicAuthorizationConsultationIDs := omit,
announceTo := omit,
announcedAttribute := omit,
nodeID := omit,
hostedCSELink := omit,
mgmtClientAddress := omit,
choice := omit
}
template (value) RemoteCSE_optional m_contentUpdateRemoteCSE := {
resourceName := omit,
resourceType := omit,
resourceID := omit,
parentID := omit,
creationTime := omit,
lastModifiedTime := omit,
labels := omit,
accessControlPolicyIDs := omit,
expirationTime := omit,
dynamicAuthorizationConsultationIDs := omit,
announceTo := omit,
announcedAttribute := omit,
cseType := omit,
pointOfAccess := omit,
cSEBase := omit,
cSE_ID := omit,
m2M_Ext_ID := omit,
trigger_Recipient_ID := omit,
requestReachability := omit,
nodeLink := omit,
e2eSecInfo := omit,
triggerReferenceNumber := omit,
choice := omit
}
template (value) AE_optional m_contentUpdateAE := {
resourceName := omit,
resourceType := omit,
resourceID := omit,
parentID := omit,
creationTime := omit,
lastModifiedTime := omit,
labels := omit,
accessControlPolicyIDs := omit,
expirationTime := omit,
dynamicAuthorizationConsultationIDs := omit,
announceTo := omit,
announcedAttribute := omit,
appName := omit,
app_ID := omit,
aE_ID := omit,
pointOfAccess := omit,
ontologyRef := omit,
nodeLink := omit,
requestReachability := omit,
contentSerialization := omit,
e2eSecInfo := omit,
choice := omit
}
}//end group ContentUpdate
......
......@@ -8697,6 +8697,409 @@ module OneM2M_Testcases {
}//end TC_CSE_DMR_UPD_013
} // end group g_CSE_DMR_UPD_013
group g_CSE_DMR_UPD_017{
testcase TC_CSE_DMR_UPD_017_CSR_LBL() runs on CseTester system CseSystem {
var Labels v_labels := {"MyLabel"};
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
v_updateRequest.primitiveContent.remoteCSE.labels := v_labels;
f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest);//Remote CSE
}
testcase TC_CSE_DMR_UPD_017_CSR_POA() runs on CseTester system CseSystem {
var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"};
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := v_poaList;
f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest);//Remote CSE
}
testcase TC_CSE_DMR_UPD_017_CSR_NL() runs on CseTester system CseSystem {
var XSD.AnyURI v_nodeLink := "MyNodeId";
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
v_updateRequest.primitiveContent.remoteCSE.nodeLink := v_nodeLink;
f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest);//Remote CSE
}
testcase TC_CSE_DMR_UPD_017_NOD_LBL() runs on CseTester system CseSystem {
var Labels v_labels := {"MyLabel"};
const AttributeAux c_optionalAttribute := {"labels", omit};
var template RequestPrimitive v_updateRequest := m_updateNodeBase;
v_updateRequest.primitiveContent.node.labels := v_labels;
f_CSE_DMR_UPD_017(int9, m_createNodeBase, v_updateRequest);//Node
}
testcase TC_CSE_DMR_UPD_017_NOD_ACPI() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_NOD_HCL() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_AE_LBL() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_AE_ACPI() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_AE_APN() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_AE_POA() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_AE_OR() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_CNT_LBL() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_CNT_ACPI() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_CNT_MNI() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_CNT_MBS() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_CNT_MIA() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_CNT_OR() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_CNT_LI() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_ACP_LBL() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_ACPI() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_LBL() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_ENC() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_EXC() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_GPI() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_NFU() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_BN() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_RL() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_PN() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_NSP() runs on CseTester system CseSystem {
}
testcase TC_CSE_DMR_UPD_017_SUB_LN() runs on CseTester system CseSystem {
}
function f_CSE_DMR_UPD_017(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester {
//Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var CseTester v_notifyHandler;
var integer v_ae2Index := -1;
// Test control
// Test component configuration
f_cf02Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
if (p_resourceType!=int16){ //ResourceType != RemoteCSE
f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource
} else { //ResourceType = RemoteCSE
v_resourceIndex := f_cse_registerRemoteCse(p_createRequestPrimitive);
}
//Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
if(p_resourceType!=int16) {
mcaPort.send(m_request(v_request)); //CSEBase
} else {
mccPort.send(m_request(v_request)); //RemoteCSE
}
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating optional attribute");
}
[] tc_ac.timeout {
setverdict(fail, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
//Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf02Down();
} // end function f_CSE_DMR_UPD_017
} // end group g_CSE_DMR_UPD_017
group g_CSE_DMR_UPD_018 {
testcase TC_CSE_DMR_UPD_018_CSR_ET() runs on CseTester system CseSystem {
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
v_updateRequest.primitiveContent.remoteCSE.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_018(int16, m_createRemoteCSEBase, v_updateRequest);//Remote CSE
}
testcase TC_CSE_DMR_UPD_018_CSR_RR() runs on CseTester system CseSystem {
var XSD.Boolean v_requestReachability := true;
var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase;
v_updateRequest.primitiveContent.remoteCSE.requestReachability := v_requestReachability;
f_CSE_DMR_UPD_018(int16, m_createRemoteCSEBase, v_updateRequest);//Remote CSE
}
testcase TC_CSE_DMR_UPD_018_NOD_ET() runs on CseTester system CseSystem {
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateNodeBase;
v_updateRequest.primitiveContent.node.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_018(int9, m_createNodeBase, v_updateRequest);//Node
}
testcase TC_CSE_DMR_UPD_018_NOD_NI() runs on CseTester system CseSystem {
var template RequestPrimitive v_updateRequest := m_updateNodeBase;
var XSD.Token v_targetId := "TARGET-ID";
v_updateRequest.primitiveContent.node.nodeID := v_targetId;
f_CSE_DMR_UPD_018(int9, m_createNodeBase, v_updateRequest);//Node
}
testcase TC_CSE_DMR_UPD_018_AE_ET() runs on CseTester system CseSystem {
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateAE;
v_updateRequest.primitiveContent.aE.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_018(int2, m_createAe(PX_APP_ID), v_updateRequest);//AE
}
testcase TC_CSE_DMR_UPD_018_AE_RR() runs on CseTester system CseSystem {
var XSD.Boolean v_requestReachability := true;
var template RequestPrimitive v_updateRequest := m_updateAE;
v_updateRequest.primitiveContent.aE.requestReachability := v_requestReachability;
f_CSE_DMR_UPD_018(int2, m_createAe(PX_APP_ID), v_updateRequest);//AE
}
testcase TC_CSE_DMR_UPD_018_CNT_ET() runs on CseTester system CseSystem {
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateContainerBase;
v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_018(int3, m_createContainerBase, v_updateRequest);//Container
}
testcase TC_CSE_DMR_UPD_018_ACP_ET() runs on CseTester system CseSystem {
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_018_ACP_PV() runs on CseTester system CseSystem {
var SetOfAcrs v_privileges_1 := { //
accessControlRule_list := {
{
accessControlOriginators := {PX_SUPER_USER},
accessControlOperations := int61,
accessControlContexts_list := {},
accessControlAuthenticationFlag := omit,
accessControlObjectDetails_list := {}
}
}
}
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1;
f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_018_ACP_PVS() runs on CseTester system CseSystem {
var SetOfAcrs v_privileges_1 := { //
accessControlRule_list := {
{
accessControlOriginators := {PX_SUPER_USER},
accessControlOperations := int61,
accessControlContexts_list := {},
accessControlAuthenticationFlag := omit,
accessControlObjectDetails_list := {}
}
}
}
var template RequestPrimitive v_updateRequest := m_updateAcpBase;
v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_privileges_1;
f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy
}
testcase TC_CSE_DMR_UPD_018_SUB_ET() runs on CseTester system CseSystem {
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest);//Subscription
}
testcase TC_CSE_DMR_UPD_018_SUB_NU() runs on CseTester system CseSystem {
var ListOfURIs v_notificationURI := {"NotReachableNotificationURI"};
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.subscription.notificationURI := v_notificationURI;
f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest);//Subscription
}
testcase TC_CSE_DMR_UPD_018_SUB_NCT() runs on CseTester system CseSystem {
var NotificationContentType v_notificationContentType := int2;
var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase;
v_updateRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType;
f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest);//Subscription
}
testcase TC_CSE_DMR_UPD_018_GRP_ET() runs on CseTester system CseSystem {
var Timestamp v_expirationTime := "20001231T012345";
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.group_.expirationTime := v_expirationTime;
f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_018_GRP_MNM() runs on CseTester system CseSystem {
var XSD.PositiveInteger v_maxNrOfMembers := 10;
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.group_.maxNrOfMembers := v_maxNrOfMembers;
f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest);//Group
}
testcase TC_CSE_DMR_UPD_018_GRP_MID() runs on CseTester system CseSystem {
var ListOfURIs v_memberIDs := {"NotInitialized"};
var template RequestPrimitive v_updateRequest := m_updateGroupBase;
v_updateRequest.primitiveContent.group_.memberIDs := v_memberIDs;
f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest);//Group
}
function f_CSE_DMR_UPD_018(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester {
//Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_aeIndex := -1;
var integer v_resourceIndex := -1;
var CseTester v_notifyHandler;
var integer v_ae2Index := -1;
// Test control
// Test component configuration
f_cf02Up();
// Test adapter configuration
// Preamble
v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi);
if (p_resourceType!=int16){ //ResourceType != RemoteCSE
f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType);
v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource
} else { //ResourceType = RemoteCSE
v_resourceIndex := f_cse_registerRemoteCse(p_createRequestPrimitive);
}
//Test Body
v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive);
if(p_resourceType!=int16){
mcaPort.send(m_request(v_request)); //CSEBase
} else {
mccPort.send(m_request(v_request)); //RemoteCSE
}
tc_ac.start;
alt {
[] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response {
tc_ac.stop;
setverdict(pass, testcasename() & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully");
}
[] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response {
tc_ac.stop;
setverdict(fail, testcasename() & ": Error while updating mandatory attribute");
}
[] tc_ac.timeout {
setverdict(fail, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType)));
}
}
//Postamble
f_cse_postamble_deleteResources();
// Tear down
f_cf02Down();
} //end function f_CSE_DMR_UPD_018
} // end group g_CSE_DMR_UPD_018
}//end group Update
......
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