- New function: f_cse_createResource_cseSimu

- New Annc templates
- New Annc constants
- Functions updated: f_CSE_DMR_CRE_001_cseSimu, f_CSE_DMR_CRE_019
- Testcases updated: TC_CSE_DMR_CRE_001_SUB_AEA, TC_CSE_DMR_CRE_001_CNT_AEA, TC_CSE_DMR_CRE_001_GRP_AEA, TC_CSE_DMR_CRE_001_ACP_AEA, TC_CSE_DMR_CRE_019_CNTA_AEA, TC_CSE_DMR_CRE_019_GRPA_AEA, TC_CSE_DMR_CRE_019_ACPA_AEA
- New testcases: TC_CSE_DMR_CRE_001_TS_AEA, TC_CSE_DMR_UPD_017_TS, TC_CSE_DMR_UPD_017_TSI, TC_CSE_DMR_UPD_018_TS_MBS, TC_CSE_DMR_CRE_019_TSA_AEA
Signed-off-by: Antonio Castillo Verdugo's avataracverdugo <acverdugo@at4wireless.com>
parent f55867df
......@@ -2513,6 +2513,55 @@ module OneM2M_Functions {
}
}//End of function
/**
* @desc Creation of a resource using CseSimu
* @param p_resourceType Resource type of the resource to be created
* @param p_requestPrimitive CREATE request primitive for the resource to be created
* @param p_parentIndex Internal resource index which indicates the parent of the resource to be created
* @return Internal resource index of the created resource
* @verdict
*/
function f_cse_createResource_cseSimu(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on CseSimu return integer {
var RequestPrimitive v_request;
var integer v_resourceIndex := -1;
//Activate defaults when running on a PTC
f_cse_activateDefaults_cse1();
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex);
mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly");
f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, p_parentIndex);
if(p_resourceType == int16) { //remoteCSE
vc_remoteCseIndex := v_resourceIndex;
}
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) {
tc_ac.stop;
setverdict(inconc, __SCOPE__&":INFO: Error while creating resource type " & int2str(enum2int(p_resourceType)));
}
[] mccPort.receive {
tc_ac.stop;
setverdict(inconc, __SCOPE__&":INFO: Unexpected message received");
}
[] tc_ac.timeout {
setverdict(inconc, __SCOPE__&":INFO: No answer while creating resource type " & int2str(enum2int(p_resourceType)));
}
}
f_checkCseSimuStatus();
return v_resourceIndex;
}
/**
* @desc Send response to the IUT (Test System simulating a CSE)
......
......@@ -791,6 +791,15 @@ module OneM2M_Templates {
resourceType := int1,
primitiveContent := {accessControlPolicy := m_contentCreateAcp ()}
};
/**
* @desc Base CREATE request primitive for AccessControlPolicyAnnc resource
*/
template (value) RequestPrimitive m_createAcpAnncBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createAcpAnnc",
resourceType := int10001,
primitiveContent := {accessControlPolicyAnnc := m_contentCreateAcpAnnc ()}
};
template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name := c_defaultAccessControlPolicyResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) modifies m_create := {
to_ := p_parentResourceAddress,
......@@ -851,6 +860,15 @@ module OneM2M_Templates {
resourceType := int3,
primitiveContent := {container := m_contentCreateContainer}
};
/**
* @desc Base CREATE request primitive for ContainerAnnc resource
*/
template (value) RequestPrimitive m_createContainerAnncBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createContainerAnnc",
resourceType := int10003,
primitiveContent := {containerAnnc := m_contentCreateContainerAnnc}
};
/**
* @desc Base CREATE request primitive for Container resource using Container_update_invalid
......@@ -998,6 +1016,15 @@ module OneM2M_Templates {
resourceType := int9,
primitiveContent := {group_ := m_contentCreateGroup (1, {"NotInitialized"}, omit, omit)} //TODO: p_resourceId
};
/**
* @desc Base CREATE request primitive for GroupAnnc resource
*/
template (value) RequestPrimitive m_createGroupAnncBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createGroupAnnc",
resourceType := int10009,
primitiveContent := {groupAnnc := m_contentCreateGroupAnnc (1, {"NotInitialized"}, omit, omit)} //TODO: p_resourceId
};
template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers,
in template (value) ListOfURIs p_memberIds := {"NotInitialized"},
......@@ -1286,6 +1313,15 @@ module OneM2M_Templates {
resourceType := int29,
primitiveContent := {timeSeries := m_contentCreateTimeSeries ()}
};
/**
* @desc Base CREATE request primitive for timeSeriesAnnc resource
*/
template (value) RequestPrimitive m_createTimeSeriesAnncBase modifies m_create := {
requestIdentifier := testcasename() & "-m_createTimeSeriesAnnc",
resourceType := int10029,
primitiveContent := {timeSeriesAnnc := m_contentCreateTimeSeriesAnnc()}
};
template (value) RequestPrimitive m_createTimeSeries(in template (omit) XSD.String p_name := c_defaultTimeSeriesResourceName,
in XSD.Boolean p_missingDataDetect := true,
......@@ -1716,6 +1752,31 @@ module OneM2M_Templates {
choice := omit //NP
};
/**
* @desc Base primitiveContent for CREATE operation for AccessControlPolicyAnnc resource
* @param p_name Resource name
* @param p_acor Allowed originators
* @param p_allowedOperations Allowed operations
*/
template (value) AccessControlPolicyAnnc_optional m_contentCreateAcpAnnc (in template (omit) XSD.String p_name := c_defaultAccessControlPolicyAnncResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := {
resourceName := p_name,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O
expirationTime := omit,//O
link := omit,//M TODO Put the right value
privileges := {
accessControlRule_list := {valueof(m_createAcr(p_acor, p_allowedOperations))}
},//M
selfPrivileges := {
accessControlRule_list := {valueof(m_createAcr({"all"}, int63))}
},//M
choice := omit //NP
};
/**
* @desc Base reception template of primitiveContent for CREATE operation for AccessControlPolicyAnnc resource
* @param p_labels Labels
......@@ -1862,6 +1923,43 @@ module OneM2M_Templates {
choice := omit//NP
};
/**
* @desc Base primitiveContent for CREATE operation for GroupAnnc resource
* @param p_maxNrOfMembers Max number of members
* @param p_memberIds Member IDs
* @param p_accessControlPolicyIds ACP IDs for the GroupAnnc
* @param p_name Resource name
*/
template (value) GroupAnnc_optional m_contentCreateGroupAnnc ( in template (value) XSD.PositiveInteger p_maxNrOfMembers,
in template (value) ListOfURIs p_memberIds,
in template (omit) AcpType p_accessControlPolicyIds,
in template (omit) MemberType p_memberType := omit,
in template (omit) ConsistencyStrategy p_consistencyStrategy := omit,
in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit,
in template (omit) XSD.String p_name := c_defaultGroupAnncResourceName) := {
resourceName := p_name,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O
accessControlPolicyIDs := p_accessControlPolicyIds,//O
expirationTime := omit,//O
link := omit,//M TODO Put the right value
dynamicAuthorizationConsultationIDs := omit, //O
memberType := p_memberType,//O
currentNrOfMembers := omit,//NP
maxNrOfMembers := p_maxNrOfMembers,//M
memberIDs := p_memberIds,//M
membersAccessControlPolicyIDs := p_membersAccessControlPolicyIDs,//O
memberTypeValidated := omit,//NP
consistencyStrategy := p_consistencyStrategy,//O
groupName := omit,//O
semanticSupportIndicator := omit,//O
choice := omit//NP
};
/**
* @desc Base reception template of primitiveContent for CREATE operation for GroupAnnc resource
*/
......@@ -2249,6 +2347,34 @@ module OneM2M_Templates {
choice := omit//NP
};
/**
* @desc Base primitiveContent for CREATE operation for ContainerAnnc resource
* @param p_name Resource name
*/
template (value) ContainerAnnc_optional m_contentCreateContainerAnnc (in template (omit) XSD.String p_name := c_defaultContainerAnncResourceName):= {
resourceName := p_name,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O
accessControlPolicyIDs := omit,//O
expirationTime := omit,//O
link := omit,//M TODO Put the right value
dynamicAuthorizationConsultationIDs := omit, //O
stateTag := omit,//NP
maxNrOfInstances := omit,//O
maxByteSize := omit,//O
maxInstanceAge := omit,//O
currentNrOfInstances := omit,//NP
currentByteSize := omit,//NP
locationID := omit,//O
ontologyRef := omit,//O
disableRetrieval := omit, //O
choice := omit//NP
};
/**
* @desc Base primitiveContent for invalid CREATE operation for Container resource (using Container_update_invalid)
* @param p_name Resource name
......@@ -2569,7 +2695,7 @@ module OneM2M_Templates {
};
/**
* @desc Base primitiveContent for CREATE operation for timeSeries resource
* @desc Base primitiveContent for CREATE operation for timeSeries resource
* @param p_name Resource name
*/
template (value) TimeSeries_optional m_contentCreateTimeSeries (in template (omit) XSD.String p_name := c_defaultTimeSeriesResourceName):= {
......@@ -2602,6 +2728,37 @@ module OneM2M_Templates {
choice := omit//NP
};
/**
* @desc Base primitiveContent for CREATE operation for timeSeriesAnnc resource
* @param p_name Resource name
*/
template (value) TimeSeriesAnnc_optional m_contentCreateTimeSeriesAnnc (in template (omit) XSD.String p_name := c_defaultTimeSeriesAnncResourceName):= {
resourceName := p_name,//O
resourceType := omit,//NP
resourceID := omit,//NP
parentID := omit,//NP
creationTime := omit,//NP
lastModifiedTime := omit,//NP
labels := omit,//O
accessControlPolicyIDs := omit,//O
expirationTime := omit,//O
link := omit,//M TODO Put the right value
dynamicAuthorizationConsultationIDs := omit, //O
stateTag := omit,//NP
maxNrOfInstances := omit,//O
maxByteSize := omit,//O
maxInstanceAge := omit,//O
currentNrOfInstances := omit,//NP
currentByteSize := omit,//NP
periodicInterval := omit,//O
missingDataDetect := omit,//O
missingDataList := omit,//NP
missingDataCurrentNr := omit,//NP
missingDataDetectTimer := omit,//O
ontologyRef := omit,//O
choice := omit//NP
};
/**
* @desc Base primitiveContent for CREATE operation for TimeSeriesAnnc resource
* @param p_primitiveContent Content for the TimeSeriesAnnc
......@@ -2668,6 +2825,7 @@ module OneM2M_Templates {
missingDataMaxNr := p_missingDataMaxNr,//O
missingDataDetectTimer := p_missingDataDetectTimer//O
}
/**
* @desc Base primitiveContent for invalid CREATE operation for timeSeries resource (using Container_update_invalid)
* @param p_name Resource name
......
......@@ -18,12 +18,15 @@ module OneM2M_TypesAndValues {
/* Constants */
const XSD.String c_defaultResourceName := "MyResource";
const XSD.String c_defaultGroupResourceName := "MyGroupResource";
const XSD.String c_defaultGroupAnncResourceName := "MyGroupAnncResource";
const XSD.String c_defaultAccessControlPolicyResourceName := "MyAccessControlPolicyResource";
const XSD.String c_defaultAccessControlPolicyAnncResourceName := "MyAccessControlPolicyAnncResource";
const XSD.String c_defaultScheduleResourceName := "MyScheduleResource";
const XSD.String c_defaultPollingChannelResourceName := "MyPollingChannelResource";
const XSD.String c_defaultSubscriptionResourceName := "MySubscriptionResource";
const XSD.String c_defaultContentInstanceResourceName := "MyContentInstanceResource";
const XSD.String c_defaultContainerResourceName := "MyContainerResource";
const XSD.String c_defaultContainerAnncResourceName := "MyContainerAnncResource";
const XSD.String c_defaultDeliveryResourceName := "MyDeliveryResource";
const XSD.String c_defaultRemoteCSEResourceName := "MyRemoteCSEResource";
const XSD.String c_defaultMgmtObjResourceName := "MyMgmtObjResource";
......@@ -38,6 +41,7 @@ module OneM2M_TypesAndValues {
const XSD.String c_defaultm2mServiceSubscriptionProfileResourceName := "Mym2mServiceSubscriptionProfileResource";
const XSD.String c_defaultServiceSubscribedAppRuleResourceName := "MyServiceSubscribedAppRuleResource";
const XSD.String c_defaultTimeSeriesResourceName := "MyTimeSeriesResource";
const XSD.String c_defaultTimeSeriesAnncResourceName := "MyTimeSeriesAnncResource";
const XSD.String c_defaultTimeSeriesInstanceResourceName := "MyTimeSeriesInstanceResource";
const XSD.ID c_aeAuxName := "MyAe";
const XSD.String c_defaultAE2Name := "MyAe2";
......
This diff is collapsed.
This diff is collapsed.
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