Commit 10e8d5b8 authored by Antonio Castillo Verdugo's avatar Antonio Castillo Verdugo
Browse files

- 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";
......
......@@ -1919,81 +1919,85 @@ module OneM2M_PermutationFunctions {
}//end f_CSE_DMR_CRE_001
function f_CSE_DMR_CRE_001_cseSimu(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseSimu return ResponsePrimitive {
function f_CSE_DMR_CRE_001_cseSimu(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, ResourceType p_parentResourceType := int2, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit) runs on CseSimu{
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_parentIndex := -1;
var integer v_resourceIndex := -1;
var integer v_ae1Index := -1;
var integer v_acpAuxIndex := -1;
var PoaList v_poaList := {"http://" & PX_AE1_ADDRESS & "/"};
// Test control
// Test component configuration
f_cf02UpCseSimuMaster();
// Local variables
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_parentIndex := -1;
var integer v_resourceIndex := -1;
var integer v_ae1Index := -1;
var integer v_acpAuxIndex := -1;
var PoaList v_poaList := {"http://" & PX_AE1_ADDRESS & "/"};
// Test control
// Test component configuration
f_cf02UpCseSimuMaster();
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
// Test adapter configuration
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
if(match(int23, p_resourceType)){
vc_ae1.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
vc_ae1.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered
f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
v_ae1Index := f_getResource(vc_ae1);
p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)};
vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
}
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, vc_remoteCseIndex);
if(match(int23, p_resourceType)){
vc_ae1.start(f_cse_preamble_createAcpAux("SubscriptionVerificationAcp", int63));
f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
vc_ae1.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_APP_ID, -, PX_AE1_ID_STEM, "MyAe", v_poaList), -1)); // AE1 is registered
f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1);
v_ae1Index := f_getResource(vc_ae1);
p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae1Index)};
vc_ae1.start(f_cse_notifyProcedure_subscriptionVerificationHandler());
}
mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, vc_remoteCseIndex);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
if (not ispresent(p_parentRequestPrimitive)){ //Create the resource directly under RemoteCSE
v_parentIndex := vc_remoteCseIndex;
}else{ //Create the resource under parentResource
v_parentIndex := f_cse_createResource_cseSimu(p_parentResourceType, p_parentRequestPrimitive, vc_remoteCseIndex);
}
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex);
mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
tc_ac.stop;
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
}
f_checkCseSimuStatus();
//Check to see if the resource is present or not
if (f_cse_isResourcePresent(v_resourceIndex)){
setverdict(pass, __SCOPE__ & ":INFO: Resource created");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf02DownCseSimuMaster();
return vc_response.primitive.responsePrimitive;
}//end f_CSE_DMR_CRE_001_cseSimu
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
}
}
f_checkCseSimuStatus();
//Check to see if the resource is present or not
if (f_cse_isResourcePresent(v_resourceIndex)){
setverdict(pass, __SCOPE__ & ":INFO: Resource created");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf02DownCseSimuMaster();
}//end f_CSE_DMR_CRE_001_cseSimu
function f_CSE_DMR_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on AeSimu return ResponsePrimitive{//system CseSystem { MRO system keyword not supported on functions in Titan
......@@ -2822,58 +2826,68 @@ module OneM2M_PermutationFunctions {
}//end f_CSE_DMR_CRE_017
function f_CSE_DMR_CRE_019(ResourceType p_resourceType, template RequestPrimitive p_createRequestAnnc) runs on CseSimu {
function f_CSE_DMR_CRE_019(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseSimu{
// Local variables
var MsgIn v_request;
var MsgIn v_response;
var RequestPrimitive v_request;
var integer v_parentIndex := -1;
var integer v_aeIndex := -1;
var integer v_resourceIndex;
var integer v_resourceIndex := -1;
var integer v_aEAnncIndex := -1;
var RequestPrimitive v_createAEAnnc;
var RequestPrimitive v_aeAnnc;
var ResponsePrimitive v_responsePrimitive;
// Test control
// Test component configuration
f_cf04Up();
// Test adapter configuration
// Register the CSE
f_cse_registerRemoteCse(m_createRemoteCSEBase);
// Preamble
vc_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSEBase);
v_aEAnncIndex := f_cse_createResource_cseSimu(int10002, m_createAEAnnc(omit, omit, omit, PX_CSE1_ID), vc_remoteCseIndex); //AEAnnnc under RemoteCSE
// Test Body
v_createAEAnnc := m_createAEAnnc(omit, omit, omit, PX_CSE1_ID);
v_aeAnnc := f_getCreateRequestPrimitive(int10002, v_createAEAnnc, -1);
mccPort.send(m_request(v_aeAnnc));
// Test Body
v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aEAnncIndex);
mccPort.send(f_getMsgOutPrimitive(m_request(v_request)));
tc_ac.start;
alt {
[] mccPortIn.receive(mw_request(p_createRequestAnnc)) -> value v_request {
[] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value vc_response {
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");
setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully");
f_checkAttributesToBeSaved(p_resourceType, v_request, vc_response.primitive.responsePrimitive);
v_resourceIndex := f_setResource(vc_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aEAnncIndex);
}
[] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Wrong response status code");
}
[] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value vc_response {
tc_ac.stop;
setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType)));
}
[] tc_ac.timeout {
setverdict(fail, __SCOPE__ & ":ERROR: No CREATE REQUEST received");
setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType)));
}
}
f_checkCseSimuStatus();
//Check to see if the resource is present or not
if (f_cse_isResourcePresent(v_resourceIndex)){
setverdict(pass, __SCOPE__ & ":INFO: Resource created");
} else {
setverdict(fail, __SCOPE__ & ":ERROR: Resource not created");
}
// Postamble
f_cse_postamble_deleteResourcesCSE();
// Tear down
f_cf04Down();
}//end f_CSE_DMR_CRE_019
function f_CSE_DMR_CRE_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on AeSimu {
......
......@@ -503,20 +503,17 @@ module OneM2M_Testcases_CSE_Release_2 {
}
testcase TC_CSE_DMR_CRE_001_SUB_AEA() runs on Tester system CseSystem {
// Local variables
//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;
var CseSimu v_cse1 := CseSimu.create("CSE1") alive;
v_createRequest.primitiveContent.timeSeries.resourceName := omit;
v_cse1.start(f_CSE_DMR_CRE_001_cseSimu(int23, v_createRequest, int10002, v_createAEAnnc));//Subscription
v_cse1.done;
if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_ae1);
if(getverdict == pass){ v_responsePrimitive := f_getResponsePrimitive(v_cse1);
if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){
setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided");
}
......@@ -524,22 +521,22 @@ module OneM2M_Testcases_CSE_Release_2 {
}
testcase TC_CSE_DMR_CRE_001_CNT_AEA() runs on Tester system CseSystem {
// Local variables
//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;