From 884ab77e0faedebcf86e22dff4304aa434e4934f Mon Sep 17 00:00:00 2001 From: reinaortega <miguelangel.reinaortega@etsi.org> Date: Wed, 17 Mar 2021 13:56:57 +0100 Subject: [PATCH] Implementation of PRP test cases Test cases implemented: - From TC_CSE_PP_001 to TC_CSE_PP_016 --- LibOneM2M/OneM2M_Functions.ttcn | 3 + LibOneM2M/OneM2M_Templates.ttcn | 438 +++- LibOneM2M/OneM2M_TypesAndValues.ttcn | 60 +- OneM2M_Testcases_CSE_Release_4.ttcn | 3202 +++++++++++++++++++++++++- 4 files changed, 3666 insertions(+), 37 deletions(-) diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index ff625e3..809477e 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -5217,6 +5217,9 @@ module OneM2M_Functions { if(ischosen(p_contentResource.timeSeriesInstanceAnnc)) { return p_contentResource.timeSeriesInstanceAnnc.resourceID; } + if(ischosen(p_contentResource.primitveProfile)) { + return p_contentResource.primitveProfile.resourceID; + } log(__SCOPE__&":WARNING: Primitive Content Kind not implemented"); diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 88cf6c1..fd8bb3a 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -129,7 +129,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }; /** @@ -207,7 +208,8 @@ module OneM2M_Templates { authorRelIndicator := *, semanticQueryIndicator := *, releaseVersionIndicator := ?, - vendorInformation := * + vendorInformation := *, + primitiveProfileIdentifier := * }; template RequestPrimitive mw_retrieveFormalOntology(template XSD.ID p_targetResourceAddress := ?, template XSD.ID p_originator := ?, template XSD.AnyURI p_ontologyServerUri := ?) modifies mw_retrieve := { @@ -252,7 +254,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }; /** @@ -291,7 +294,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }; /** @@ -300,7 +304,7 @@ module OneM2M_Templates { * @param p_filterCriteria FilterCriteria * @param p_originator Originator (from) */ - template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := { + template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage := int1) modifies m_retrieve := { requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000), filterCriteria := { createdBefore := omit, @@ -324,7 +328,7 @@ module OneM2M_Templates { attribute_list := {}, childAttribute_list := {}, parentAttribute_list := {}, - filterUsage := int1, + filterUsage := p_filterUsage, limit := omit, semanticsFilter_list := {}, filterOperation := omit, @@ -563,7 +567,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }; @@ -597,7 +602,8 @@ module OneM2M_Templates { authorRelIndicator := *, semanticQueryIndicator := *, releaseVersionIndicator := ?, - vendorInformation := * + vendorInformation := *, + primitiveProfileIdentifier := * }; /** @@ -624,6 +630,14 @@ module OneM2M_Templates { primitiveContent:= {container := m_contentUpdateContainer} }; + /** + * @desc UPDATE request primitive for Container resource + */ + template (value) RequestPrimitive m_updateContainerMaxByte(XSD.NonNegativeInteger p_maxByte) modifies m_updateContainerBase:= { + requestIdentifier := "m_updateContainer", + primitiveContent:= {container := m_contentUpdateContainerMaxByte(p_maxByte)} + }; + /** * @desc Base Reception template for update Container */ @@ -719,6 +733,19 @@ module OneM2M_Templates { primitiveContent:= {node := m_contentUpdateNode} } + template (value) RequestPrimitive m_updatePrimitiveProfileBase modifies m_update := { + requestIdentifier := "m_updatePrimitiveProfile", + primitiveContent:= {primitveProfile := m_contentUpdatePrimitiveProfile} + } + + template (value) RequestPrimitive m_updatePrimitiveProfileNonMutuallyExclusive modifies m_updatePrimitiveProfileBase := { + primitiveContent:= {primitveProfile := m_contentUpdatePrimitiveProfileNonMutuallyExclusive} + } + + template (value) RequestPrimitive m_updatePrimitiveProfileNonPermissibleParameters modifies m_updatePrimitiveProfileBase := { + primitiveContent:= {primitveProfile := m_contentUpdatePrimitiveProfileNonPermissibleParameters} + } + template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := { requestIdentifier := "m_updateRemoteCSEBase", primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE} @@ -854,7 +881,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }; @@ -891,7 +919,8 @@ module OneM2M_Templates { authorRelIndicator := *, semanticQueryIndicator := *, releaseVersionIndicator := ?, - vendorInformation := * + vendorInformation := *, + primitiveProfileIdentifier := * } /** @@ -1017,7 +1046,7 @@ module OneM2M_Templates { template (value) RequestPrimitive m_createContainerBase modifies m_create := { requestIdentifier := testcasename() & "-m_createContainer", resourceType := int3, - primitiveContent := {container := m_contentCreateContainer} + primitiveContent := {container := m_contentCreateContainerBase} }; /** @@ -1095,6 +1124,12 @@ module OneM2M_Templates { resourceType := int3, primitiveContent := {container := m_contentCreateContainer(p_resourceName)} }; + + template (value) RequestPrimitive m_createContainerMaxByte(XSD.NonNegativeInteger p_maxByte) modifies m_create := { + requestIdentifier := testcasename() & "-m_createContainer", + resourceType := int3, + primitiveContent := {container := m_contentCreateContainerMaxByte(p_maxByte)} + }; /** * @desc Reception template for CREATE Container @@ -1325,6 +1360,114 @@ module OneM2M_Templates { from_ := p_from, primitiveContent := {pollingChannel := mw_contentCreatePollingChannel} }; + + /** + * @desc Base CREATE request primitive for PrimitveProfile resource + */ + template (value) RequestPrimitive m_createPrimitveProfileBase modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileBase } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Add for Content resource + */ + template (value) RequestPrimitive m_createPrimitveProfileAddContainerMaxByte100(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileAddContainerMaxByte100(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Add for ResultContent=4, attribute and child resources + */ + template (value) RequestPrimitive m_createPrimitveProfileAddResultContentTo4(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileAddResultContentTo4(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Add for ResultContent=1, attribute and child resources + */ + template (value) RequestPrimitive m_createPrimitveProfileAddResultContentTo1(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileAddResultContentTo1(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Delete for ResultContent + */ + template (value) RequestPrimitive m_createPrimitveProfileDelteResultContent(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileDeleteResultContent(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Add for non permissible attribute + */ + template (value) RequestPrimitive m_createPrimitveProfileAddNonPermissibleAttribute(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileAddNonPermissibleAttribute(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Add for non permissible attribute + */ + template (value) RequestPrimitive m_createPrimitveProfileDeleteNonPermissibleAttribute(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileDeleteNonPermissibleAttribute(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Add for Content resource with non mutually exclusive attributes + */ + template (value) RequestPrimitive m_createPrimitveProfileAddNonMutuallyExclusive(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileAddNonMutuallyExclusive(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Delete for Content resource + */ + template (value) RequestPrimitive m_createPrimitveProfileDeleteContainerMaxByte(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileDeleteContainerMaxByte(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Delete from response. + */ + template (value) RequestPrimitive m_createPrimitveProfileAddMaxByte100ToResponse(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileAddMaxByte100ToResponse(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Delete from response. + */ + template (value) RequestPrimitive m_createPrimitveProfileDeleteFromResponse(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileDeleteFromResponse(p_IDList) } + }; + + /** + * @desc CREATE request primitive for PrimitveProfile resource with primitive Delete from response. + */ + template (value) RequestPrimitive m_createPrimitveProfileDeletePrimtiveContentFromResponse(in template ListOfM2MID p_IDList := omit) modifies m_create:= { + requestIdentifier := testcasename() & "-m_createPrimitveProfile", + resourceType := int59, + primitiveContent := {primitveProfile := m_contentCreatePrimitveProfileDeletePrimitiveContentFromResponse(p_IDList) } + }; /** * @desc Base CREATE request primitive for Schedule resource @@ -2109,7 +2252,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }; template RequestPrimitive mw_delete(template XSD.ID p_resourceAddress := ?, template XSD.ID p_from := *) := { @@ -2142,7 +2286,8 @@ module OneM2M_Templates { authorRelIndicator := *, semanticQueryIndicator := *, releaseVersionIndicator := ?, - vendorInformation := * + vendorInformation := *, + primitiveProfileIdentifier := * }; /** @@ -2190,7 +2335,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }; @@ -2242,7 +2388,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }; /** @@ -2278,7 +2425,8 @@ module OneM2M_Templates { authorRelIndicator := *, semanticQueryIndicator := *, releaseVersionIndicator := ?, - vendorInformation := * + vendorInformation := *, + primitiveProfileIdentifier := * }; /** @@ -3140,7 +3288,169 @@ module OneM2M_Templates { labels := *,//O expirationTime := *,//O choice := omit//NP - }; + }; + + /** + * @desc Base template primitiveContent for CREATE operation for PrimitveProfile resource + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + accessControlPolicyIDs := omit,//O + creationTime := omit,//NP + expirationTime := omit,//O + lastModifiedTime := omit,//NP + labels := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + dynamicAuthorizationConsultationIDs := omit,//O + creator := omit,//O + IDList := omit,//M + resourceTypes := omit,//O + operations := omit,//O + resourceIDs := omit,//O + releaseVersions := omit,//O + additions := omit,//O + deletions := omit,//O + modifications := omit,//O + applicability := omit,//O + choice := omit//NP + }; + + /** + * @desc Primitive Profile for adding MaxByte primitive of Content resource + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileAddContainerMaxByte100(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + additions := {{"maxByteSize", "100"}}, //O + applicability := REQUESTS_TO_CSE + }; + + /** + * @desc Primitive Profile for adding resultContent primitive of container resource + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileAddResultContentTo4(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + additions := {{"resultContent", "4"}}, //O + applicability := REQUESTS_TO_CSE + }; + + /** + * @desc Primitive Profile for adding resultContent primitive of container resource + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileAddResultContentTo1(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + additions := {{"resultContent", "1"}}, //O + applicability := REQUESTS_TO_CSE + }; + + /** + * @desc Primitive Profile for removing resultContent primitive of container resource + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileDeleteResultContent(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + additions := {{"resultContent"}}, //O + applicability := REQUESTS_TO_CSE + }; + + /** + * @desc Primitive Profile for adding a non permissible attribute + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileAddNonPermissibleAttribute(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + additions := {{"releaseVersionIndicator", "3"}}, //O + applicability := REQUESTS_TO_CSE + }; + + /** + * @desc Primitive Profile for deleting a non permissible attribute + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileDeleteNonPermissibleAttribute(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + deletions := {{"requestIdentifier"}}, //O + applicability := REQUESTS_TO_CSE + }; + + /** + * @desc Primitive Profile for adding MaxByte primitive of Content resource in a non mutually exclusive way + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileAddNonMutuallyExclusive(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + additions := {{"maxByteSize", "100"}}, //O + deletions := {"maxByteSize"}, //O + applicability := REQUESTS_TO_CSE + }; + + /** + * @desc Primitive Profile for deleting MaxByte primitive of Container resource + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileDeleteContainerMaxByte(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + deletions := {"maxByteSize"}, //O + applicability := REQUESTS_TO_CSE + }; + + /** + * @desc Primitive Profile for deleting MaxByte primitive of Resoponse Content + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileDeleteFromResponse(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + deletions := {"maxByteSize"}, //O + applicability := RESPONSES_FROM_CSE + }; + + /** + * @desc Primitive Profile for deleting MaxByte primitive of Resoponse Content + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileDeletePrimitiveContentFromResponse(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + deletions := {"primitiveContent"}, //O + applicability := RESPONSES_FROM_CSE + }; + + /** + * @desc Primitive Profile for adding MaxByte primitive to Resoponse Content + */ + template PrimitveProfile_optional m_contentCreatePrimitveProfileAddMaxByte100ToResponse(in template ListOfM2MID p_IDList) modifies m_contentCreatePrimitveProfileBase := { + resourceName := c_defaultPrimitiveProfileceResourceName, //O + IDList := p_IDList, //M + resourceTypes := {int3}, //O + operations := {int1, int2, int3, int4, int5},//O + additions := {{"maxByteSize", "100"}}, //O + applicability := RESPONSES_FROM_CSE + }; /** * @desc Base primitiveContent for CREATE operation for Schedule resource @@ -3708,12 +4018,13 @@ module OneM2M_Templates { choice := omit //O }; - /** - * @desc Base primitiveContent for CREATE operation for Container resource - * @param p_name Resource name - */ - template (value) Container_optional m_contentCreateContainer (in template (omit) XSD.String p_name := c_defaultContainerResourceName):= { - resourceName := p_name,//O + + /** + * @desc Base primitiveContent for CREATE operation for Container resource + * @param p_name Resource name + */ + template (value) Container_optional m_contentCreateContainerBase := { + resourceName := c_defaultContainerResourceName,//O resourceType := omit,//NP resourceID := omit,//NP parentID := omit,//NP @@ -3722,7 +4033,7 @@ module OneM2M_Templates { labels := omit,//O accessControlPolicyIDs := omit,//O expirationTime := omit,//O - dynamicAuthorizationConsultationIDs := omit, //O + dynamicAuthorizationConsultationIDs := omit, //O announceTo := omit,//O announcedAttribute := omit,//O stateTag := omit,//NP @@ -3737,8 +4048,25 @@ module OneM2M_Templates { ontologyRef := omit,//O disableRetrieval := omit, //O choice := omit//NP + }; + + + /** + * @desc Base primitiveContent for CREATE operation for Container resource + * @param p_name Resource name + */ + template (value) Container_optional m_contentCreateContainer (in template (omit) XSD.String p_name := c_defaultContainerResourceName) modifies m_contentCreateContainerBase:= { + resourceName := p_name//O }; + /** + * @desc Base primitiveContent for CREATE operation for Container resource + * @param p_name Resource name + */ + template (value) Container_optional m_contentCreateContainerMaxByte (in template (omit) XSD.NonNegativeInteger p_MaxByte) modifies m_contentCreateContainerBase:= { + maxByteSize := p_MaxByte//O + }; + /** * @desc Base primitiveContent for CREATE operation for DynamicAuthorizationConsultation resource * @param p_name Resource name @@ -5607,6 +5935,14 @@ module OneM2M_Templates { choice := omit//NP }; + /** + * @desc primitiveContent for UPDATE operation for Container resource + */ + template (value) Container_optional m_contentUpdateContainerMaxByte (XSD.NonNegativeInteger p_maxByte) modifies m_contentUpdateContainer := { + maxByteSize := p_maxByte//O + + }; + /** * @desc Base primitiveContent for UPDATE operation for ContentInstance resource */ @@ -5716,6 +6052,41 @@ module OneM2M_Templates { choice := omit } + template (value) PrimitveProfile_optional m_contentUpdatePrimitiveProfile := { + resourceName := omit, //O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + accessControlPolicyIDs := omit,//O + creationTime := omit,//NP + expirationTime := omit,//O + lastModifiedTime := omit,//NP + labels := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + dynamicAuthorizationConsultationIDs := omit,//O + creator := omit,//O + IDList := omit,//M + resourceTypes := omit,//O + operations := omit,//O + resourceIDs := omit,//O + releaseVersions := omit,//O + additions := omit,//O + deletions := omit,//O + modifications := omit,//O + applicability := omit,//O + choice := omit//NP + } + + template (value) PrimitveProfile_optional m_contentUpdatePrimitiveProfileNonMutuallyExclusive modifies m_contentUpdatePrimitiveProfile := { + additions := {{"maxByteSize", "100"}}, //O + deletions := {"maxByteSize"} //O + } + + template (value) PrimitveProfile_optional m_contentUpdatePrimitiveProfileNonPermissibleParameters modifies m_contentUpdatePrimitiveProfile := { + additions := {{"releaseVersionIndicator", "3"}} //O + } + template (value) AEAnnc_optional m_contentUpdateAEAnnc := { resourceName := omit, resourceType := omit, @@ -6934,6 +7305,10 @@ module OneM2M_Templates { choice := *//O }; + template Container_optional mw_contentContainerWithoutMaxByteSize modifies mw_contentContainerBase := { + maxByteSize := omit //O + }; + template Container_optional mw_contentContainer_any := { resourceName := *,//M resourceType := *,//M @@ -8238,7 +8613,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }, forcedFields := omit }; @@ -8322,7 +8698,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }, forcedFields := omit }; @@ -8374,7 +8751,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }, forcedFields := omit }; @@ -8426,7 +8804,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }, forcedFields := omit }; @@ -8655,7 +9034,8 @@ module OneM2M_Templates { authorRelIndicator := omit, semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, - vendorInformation := omit + vendorInformation := omit, + primitiveProfileIdentifier := omit }, forcedFields := omit }; diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index 3d4fe7d..d0862be 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -49,6 +49,7 @@ module OneM2M_TypesAndValues { const XSD.String c_defaultRoleResourceName := "MyRoleResource"; const XSD.String c_defaultTokenResourceName := "MyTokenResource"; const XSD.String c_defaultGenericInterworkingServiceResourceName := "MyGenericInterworkingServiceResource"; //<genericInterworkingService> + const XSD.String c_defaultPrimitiveProfileceResourceName := "MyPrimitiveProfileResource"; const XSD.String c_defaultAe1ResourceName := "MyAe1"; const XSD.String c_defaultAe2ResourceName := "MyAe2"; const XSD.String c_defaultAcpResourceName := "MyAcp"; @@ -357,7 +358,8 @@ group OptionalResourceTypes { CrossResourceSubscription crossResourceSubscription, TriggerRequest triggerRequest, TransactionMgmt transactionMgmt, - Transaction transaction + Transaction transaction, + PrimitveProfile primitiveProfile } choice_list } choice optional } @@ -822,7 +824,8 @@ group OptionalResourceTypes { CrossResourceSubscription crossResourceSubscription, BackgroundDataTransfer backgroundDataTransfer, TransactionMgmt transactionMgmt, - Transaction transaction + Transaction transaction, + PrimitveProfile primitiveProfile } choice_list } choice optional } @@ -1389,6 +1392,44 @@ group OptionalResourceTypes { variant (resourceName) "attribute"; }; + type record PrimitveProfile_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + AcpType accessControlPolicyIDs optional, + Timestamp creationTime optional, + Timestamp expirationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + ListOfURIs dynamicAuthorizationConsultationIDs optional, + XSD.ID creator optional, + ListOfM2MID IDList optional, + ResourceTypeList resourceTypes optional, + ListOfOperations operations optional, + ListOfURIs resourceIDs optional, + SupportedReleaseVersions releaseVersions optional, + ListOfAttributes additions optional, + AttributeList deletions optional, + ListOfAttributes modifications optional, + PrimitiveProfileApplicability applicability optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription, + Transaction transaction + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + type record RemoteCSE_optional { ResourceName resourceName optional, @@ -1445,7 +1486,8 @@ group OptionalResourceTypes { SemanticMashupInstanceAnnc semanticMashupInstanceAnnc, CrossResourceSubscription crossResourceSubscription, TransactionMgmt transactionMgmt, - Transaction transaction + Transaction transaction, + PrimitveProfile primitiveProfile } choice_list } choice optional } @@ -4130,7 +4172,14 @@ group InvalidTypes { group OtherTypes { type set of charstring SetOfCharstring; - + + type enumerated PrimitiveProfileApplicability { + REQUESTS_TO_CSE (1), + RESPONSES_FROM_CSE (2), + REQUESTS_FROM_CSE (4), + RESPONSES_TO_CSE (8) + } + type enumerated SyncPoints { e_done (0), e_error (1) @@ -4247,6 +4296,7 @@ group OtherTypes { OntologyRepository_optional ontologyRepository, Ontology_optional ontology, PollingChannel_optional pollingChannel, + PrimitveProfile_optional primitveProfile, Request_optional request, RemoteCSE_optional remoteCSE, RemoteCSEAnnc_optional remoteCSEAnnc, @@ -4336,7 +4386,7 @@ group OtherTypes { Schedule_invalid schedule_invalid, Subscription_invalid subscription_invalid, LocationPolicy_invalid locationPolicy_invalid, - TimeSeries_invalid timeSeries_invalid + TimeSeries_invalid timeSeries_invalid } } diff --git a/OneM2M_Testcases_CSE_Release_4.ttcn b/OneM2M_Testcases_CSE_Release_4.ttcn index db64fcf..6c038f0 100644 --- a/OneM2M_Testcases_CSE_Release_4.ttcn +++ b/OneM2M_Testcases_CSE_Release_4.ttcn @@ -22,6 +22,7 @@ module OneM2M_Testcases_CSE_Release_4 { import from OneM2M_Functions all; import from OneM2M_PermutationFunctions all; import from XSD all; + import from LibCommon_Time all; //Demos used for validation purposes group oneM2M_demos { @@ -1318,7 +1319,7 @@ module OneM2M_Testcases_CSE_Release_4 { group Semantic { }// end group Semantic - + group Discovery { group Basic_Operations{ @@ -2102,6 +2103,3201 @@ module OneM2M_Testcases_CSE_Release_4 { }//end group Discovery - }//end group CSE + group Primitive_Profile { + + group TC_CSE_PP_001 { + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by adding the applicable parameters/attributes when the request message contains a valid Primitive Profile Identifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_001_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_001_CRE()); + v_ae1.done; + } + + function f_CSE_PP_001_CRE() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource without "maxByte" primitive + v_requestContainerCreate := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_aeIndex); + // Link Primitve Prifle created to this Request + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_requestContainerCreate)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": maxByteSize primitive value in PrimitveProfile added to Create Container Request!"); + } else { + setverdict(fail, __SCOPE__ & ": maxByteSize primitive value in PrimitveProfile not added to Create Container Request!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_001_CRE + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by adding the applicable parameters/attributes when the request message contains a valid Primitive Profile Identifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_001_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_001_RET()); + v_ae1.done; + } + + function f_CSE_PP_001_RET() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_containerParentIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_retrieveRequest; + var template PrimitiveContent v_retriveContentResponse; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute resultContent=4(attribute and child resource) for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddResultContentTo4({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected response as per Result Content=4 (attribute and child resource) + v_retriveContentResponse.container := mw_contentContainer_rc4; + + //Create Container resource + v_containerParentIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + //Create child Container resource + f_cse_createResource(int3, m_createContainerBase, v_containerParentIndex); + + //Retrieve container with link to Primitve Profile + v_retrieveRequest := valueof(m_retrieve(f_getResourceAddress(v_containerParentIndex), f_getOriginator(v_containerParentIndex))); + v_retrieveRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + f_send(e_mcaPort, m_request(v_retrieveRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": ResultContent from Primtive Profile added to Retrieve Request"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": ResultContent from Primtive Profile not added to Retrieve Request"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_001_RET + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by adding the applicable parameters/attributes when the request message contains a valid Primitive Profile Identifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_001_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_001_DEL()); + v_ae1.done; + } + + function f_CSE_PP_001_DEL() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_containerIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_deleteRequest; + var template PrimitiveContent v_deleteContentResponse; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute resultContent=1 (attribute) for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddResultContentTo1({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container as per Result Content=1 + v_deleteContentResponse.container := mw_contentContainer_rc1; + + //Create Container resource + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Delete container resource with default resultContent (0-nothing) + v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))); + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_deleteRequest)); + tc_ac.start; + + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002, v_deleteContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": All attributes provided as per the resultContent in primtive profile"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_deleteContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong content provided when resultContent set to 1 in Primtive Profile"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_001_DEL + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by adding the applicable parameters/attributes when the request message contains a valid Primitive Profile Identifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_001_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_001_UPD()); + v_ae1.done; + } + + function f_CSE_PP_001_UPD() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_updateContainer; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResource := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource without Primtive Profile ID and no maxByte attribte + v_createdContainerResource := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Update container request with Primitive Profile ID, and not including update for maxByte + v_updateContainer:= f_getUpdateRequestPrimitive(int3, v_aeIndex, m_updateContainerBase); + + // Link Primitve Prifle created to this Request + v_updateContainer.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_updateContainer)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": maxByteSize primitive value in PrimitveProfile added correctly to Update Container Request!"); + } else { + setverdict(fail, __SCOPE__ & ": maxByteSize primitive value in PrimitveProfile not added to Update Container Request!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected response status code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_001_UPD + + } // TC_CSE_PP_001 + + group TC_CSE_PP_002 { + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by deleting the applicable parameters/attributes when the request message contains a valid PrimitiveProfileIdentifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_002_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_002_CRE()); + v_ae1.done; + } + + function f_CSE_PP_002_CRE() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResourceIndex := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with primitve "maxByte" to be deleted + v_createPrimitveProfile := m_createPrimitveProfileDeleteContainerMaxByte({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource without Primtive Profile ID and no maxByte attribte + v_createdContainerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Create container resource with "maxByte" primitive + v_requestContainerCreate := f_getCreateRequestPrimitive(int3, m_createContainerMaxByte(100), v_aeIndex); + // Link Primitve Prifle created to this Request + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_requestContainerCreate)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + setverdict(fail, __SCOPE__ & ": Delete maxByteSize primitive in PrimitveProfile not applied to Container resource!"); + } else { + setverdict(pass, __SCOPE__ & ": Delete maxByteSize primitive value in PrimitveProfile applied correctly to Container resource!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected response status code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_002_CRE + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by deleting the applicable parameters/attributes when the request message contains a valid PrimitiveProfileIdentifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_002_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_002_RET()); + v_ae1.done; + } + + function f_CSE_PP_002_RET() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerCreate; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_containerParentIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_retrieveRequest; + var template PrimitiveContent v_retriveContentResponse; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with Delete atribute resultContent for container resource. + v_createPrimitveProfile := m_createPrimitveProfileDelteResultContent({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container of retrieve request as per Result Content=1, the default value when RC is not present + v_retriveContentResponse.container := mw_contentContainer_rc1; + + //Create Container resource + v_containerParentIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Create child Container resource + f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Retrieve container with link to Primitve Profile + v_retrieveRequest := valueof(m_retrieve(f_getResourceAddress(v_containerParentIndex), f_getOriginator(v_containerParentIndex))); + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + f_send(e_mcaPort, m_request(v_retrieveRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": ResultContent from Primtive Profile added to Retrieve Request"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": ResultContent from Primtive Profile not added to Retrieve Request"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_002_RET + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by deleting the applicable parameters/attributes when the request message contains a valid PrimitiveProfileIdentifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_002_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_002_DEL()); + v_ae1.done; + } + + function f_CSE_PP_002_DEL() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_containerIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_deleteRequest; + var template PrimitiveContent v_deleteContentResponse; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with delete atribute resultContent of content resource. + v_createPrimitveProfile := m_createPrimitveProfileDelteResultContent({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container as per Result Content=1 + v_deleteContentResponse.container := mw_contentContainer_rc1; + + //Create Container resource + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Delete container resource with default resultContent (0-nothing) + v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))); + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_deleteRequest)); + tc_ac.start; + + alt { + // If primitive profile awas applied, the default value of resultContent(0=nothing) will be applied + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002, omit))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": All attributes provided as per the resultContent in primtive profile"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_002_DEL + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by deleting the applicable parameters/attributes when the request message contains a valid PrimitiveProfileIdentifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_002_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_002_UPD()); + v_ae1.done; + } + + function f_CSE_PP_002_UPD() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerUpdate; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResourceIndex := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with primitve "maxByte" to be deleted + v_createPrimitveProfile := m_createPrimitveProfileDeleteContainerMaxByte({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource without Primtive Profile ID and maxByte=100 + v_createdContainerResourceIndex := f_cse_createResource(int3, m_createContainerMaxByte(100), v_aeIndex); + + //Update container resource with "maxByte" primitive - nothing to update as it is same as exising resource + v_requestContainerUpdate := f_getCreateRequestPrimitive(int3, m_updateContainerMaxByte(100), v_aeIndex); + // Link Primitve Prifle created to this Request + v_requestContainerUpdate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_requestContainerUpdate)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + setverdict(fail, __SCOPE__ & ": Delete of maxByteSize primitive in PrimitveProfile not applied to Container resource!"); + } else { + setverdict(pass, __SCOPE__ & ": Delete of maxByteSize primitive value in PrimitveProfile applied correctly to Container resource!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_002_CRE + } // TC_CSE_PP_002 + + group TC_CSE_PP_003 { + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by modifying the applicable parameters/attributes when the request message contains a valid PrimitiveProfileIdentifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_003_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_003_CRE()); + v_ae1.done; + } + + function f_CSE_PP_003_CRE() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var MsgIn v_response; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource with "maxByte"=1000 primitive + v_requestContainerCreate := f_getCreateRequestPrimitive(int3, m_createContainerMaxByte(1000), v_aeIndex); + + // Link Primitve Prifle created to this Request + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_requestContainerCreate)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": maxByteSize primitive value in Create Container Request modified to the value in Primitive Profile!"); + } else { + setverdict(fail, __SCOPE__ & ": maxByteSize primitive value in Create Container Request not modified to the value in Primitive Profile!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_003_CRE + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by modifying the applicable parameters/attributes when the request message contains a valid PrimitiveProfileIdentifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_003_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_003_RET()); + v_ae1.done; + } + + function f_CSE_PP_003_RET() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerCreate; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_containerParentIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_retrieveRequest; + var template PrimitiveContent v_retriveContentResponse; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with Add atribute resultContent for container resource. + v_createPrimitveProfile := m_createPrimitveProfileAddResultContentTo4({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container of retrieve request as per Result Content=1, the default value when RC is not present + v_retriveContentResponse.container := mw_contentContainer_rc4; + + //Create Container resource + v_containerParentIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Create child Container resource + f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Retrieve container with link to Primitve Profile + v_retrieveRequest := valueof(m_retrieve(f_getResourceAddress(v_containerParentIndex), f_getOriginator(v_containerParentIndex))); + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + v_requestContainerCreate.resultContent := int1; // only attriubutes + f_send(e_mcaPort, m_request(v_retrieveRequest)); + + tc_ac.start; + alt { + // Expect response as per resultContent=4, specified in Primitive Profile + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": ResultContent(4) from Primtive Profile added to Retrieve Request"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": ResultContent from Primtive Profile not added to Retrieve Request"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_003_RET + + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by modifying the applicable parameters/attributes when the request message contains a valid PrimitiveProfileIdentifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_003_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_003_DEL()); + v_ae1.done; + } + + function f_CSE_PP_003_DEL() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_deleteRequest; + var template PrimitiveContent v_deleteContentResponse; + var integer v_containerParentIndex := -1; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with Add atribute resultContent=1 for container resource. + v_createPrimitveProfile := m_createPrimitveProfileAddResultContentTo1({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container as per Result Content=1 + v_deleteContentResponse.container := mw_contentContainer_rc1; + + //Create Container resource + v_containerParentIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Create child Container resource + f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Delete container resource with resultContent (4-attributes and child resource) + v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerParentIndex), f_getOriginator(v_containerParentIndex))); + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + v_deleteRequest.resultContent := int4; + + f_send(e_mcaPort, m_request(v_deleteRequest)); + tc_ac.start; + + alt { + // If primitive profile awas applied, value of resultContent(1=attribte) will be applied + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002, v_deleteContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Only attributes of parent provided as per the resultContent in primtive profile"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_deleteContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong content provided when resultContent set to 1 in Primtive Profile"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_003_DEL + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the request messages by modifying the applicable parameters/attributes when the request message contains a valid PrimitiveProfileIdentifier parameter and the referenced profile is accessible to the Hosting CSE. + * + */ + testcase TC_CSE_PP_003_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_003_UPD()); + v_ae1.done; + } + + function f_CSE_PP_003_UPD() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_updateContainer; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResource := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource with maxByte=1000 attribte + v_createdContainerResource := f_cse_createResource(int3, m_createContainerMaxByte(1000), v_aeIndex); + + //Update container request with maxByte=2000 and link to Primitive Profile + v_updateContainer:= f_getUpdateRequestPrimitive(int3, v_aeIndex, m_updateContainerMaxByte(2000)); + + // Link Primitve Prifle created to this Request + v_updateContainer.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_updateContainer)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": maxByteSize primitive value in PrimitveProfile is updated correctly to Update Container Request!"); + } else { + setverdict(fail, __SCOPE__ & ": maxByteSize primitive value in PrimitveProfile is not updated to Update Container Request!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_003_UPD + + } // TC_CSE_PP_003 + + group TC_CSE_PP_004 { + /** + * @desc Check that the IUT rejects the request without applying the profile when the <primitiveProfile> resource referenced by the PrimitiveProfileIdentifier parameter is not present or not accessible by Hosting CSE. + * + */ + testcase TC_CSE_PP_004_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_004_CRE()); + v_ae1.done; + } + + function f_CSE_PP_004_CRE() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var MsgIn v_response; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Delete the Primitive Profile + f_cse_deleteResource(v_primitiveProfileIndex); + + //Create container resource without "maxByte" primitive + v_requestContainerCreate := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_aeIndex); + // Link Primitve Prifle, which was deleted, to this Request + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_requestContainerCreate)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT rejected the create request with non existing primtive profile!"); + + // Commented out utnil TP is frozen - reject or accept. + /* + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(fail, __SCOPE__ & ": maxByteSize primitive value in invalid PrimitveProfile applied to Create Container Request!"); + } else { + setverdict(pass, __SCOPE__ & ": maxByteSize primitive value in invalid PrimitveProfile not applied to Create Container Request!"); + } */ + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT accepted the create request with non existing primtive profile!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_004_CRE + + /** + * @desc Check that the IUT rejects the request when the <primitiveProfile> resource referenced by the PrimitiveProfileIdentifier parameter is not present or not accessible by Hosting CSE. + * + */ + testcase TC_CSE_PP_004_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_004_RET()); + v_ae1.done; + } + + function f_CSE_PP_004_RET() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerCreate; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_containerParentIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_retrieveRequest; + var template PrimitiveContent v_retriveContentResponse; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with Add atribute resultContent for container resource. + v_createPrimitveProfile := m_createPrimitveProfileAddResultContentTo4({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create Container resource + v_containerParentIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Create child Container resource + f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + + // Delete the Primitive Profile + f_cse_deleteResource(v_primitiveProfileIndex); + + //Retrieve container with link to Primitve Profile + v_retrieveRequest := valueof(m_retrieve(f_getResourceAddress(v_containerParentIndex), f_getOriginator(v_containerParentIndex))); + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + v_requestContainerCreate.resultContent := int1; // only attriubutes + + // Set expected container of retrieve request as per Result Content=1, as the Primtive Prfile is not accessible + v_retriveContentResponse.container := mw_contentContainer_rc1; + + f_send(e_mcaPort, m_request(v_retrieveRequest)); + tc_ac.start; + alt { + + // Commenting out until TP is frozen + // Expect response as per resultContent=4, specified in Primitive Profile + /* + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": ResultContent from Primtive Profile added to Retrieve Request"); + } */ + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT rejected the create request with non existing primtive profile!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT accepted the create request with non existing primtive profile!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_004_RET + + /** + * @desc Check that the IUT rejects the request when the <primitiveProfile> resource referenced by the PrimitiveProfileIdentifier parameter is not present or not accessible by Hosting CSE. + * + */ + testcase TC_CSE_PP_004_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_004_DEL()); + v_ae1.done; + } + + function f_CSE_PP_004_DEL() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_containerIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_deleteRequest; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with Add atribute resultContent=1 for container resource. + v_createPrimitveProfile := m_createPrimitveProfileAddResultContentTo1({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Delete the Primitive Profile + f_cse_deleteResource(v_primitiveProfileIndex); + + //Create Container resource + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Delete container resource with default resultContent (0-nothing) + v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))); + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_deleteRequest)); + tc_ac.start; + + alt { + /* + // If primitive profile awas ignored, value of resultContent(0=nothing) will be applied + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002, omit))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Primitive Profile ignored as it is not accessible/does not exist"); + }*/ + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT rejected the create request with non existing primtive profile!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT accepted the create request with non existing primtive profile!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_004_DEL + + + /** + * @desc Check that the IUT successfully processes the request without applying the profile when the <primitiveProfile> resource referenced by the PrimitiveProfileIdentifier parameter in the request is not present or not accessible by Hosting CSE. + * + */ + testcase TC_CSE_PP_004_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_004_UPD()); + v_ae1.done; + } + + function f_CSE_PP_004_UPD() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_updateContainer; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResource := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Delete the Primitive Profile + f_cse_deleteResource(v_primitiveProfileIndex); + + //Create container resource without Primtive Profile ID and no maxByte attribte + v_createdContainerResource := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Update container request with Primitive Profile ID, and not including update for maxByte + v_updateContainer:= f_getUpdateRequestPrimitive(int3, v_aeIndex, m_updateContainerBase); + + // Link Primitve Prifle created to this Request + v_updateContainer.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_updateContainer)); + tc_ac.start; + alt { + + /* commented out until TP is frozen-reject/accept + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(fail, __SCOPE__ & ": maxByteSize primitive value in invalid PrimitveProfile applied to Update Container Request!"); + } else { + setverdict(pass, __SCOPE__ & ": maxByteSize primitive value in invalid PrimitveProfile not applied to Update Container Request!"); + } + } */ + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT rejected the create request with non existing primtive profile!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT accepted the create request with non existing primtive profile!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_004_UPD + } //end group TC_CSE_PP_004 + + group TC_CSE_PP_005 { + + /** + * @desc Check that the IUT successfully processes the request without applying the profile when the attributes in the request do not match with the referenced <primitiveProfile> resource attributes. + * + */ + testcase TC_CSE_PP_005_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_005_CRE()); + v_ae1.done; + } + + function f_CSE_PP_005_CRE() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var MsgIn v_response; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create ACP with link to Primitive Profile created + v_request := valueof(m_createAcp(omit, -, int63)); + v_request := f_getCreateRequestPrimitive(int1, v_request, v_aeIndex); + v_request.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + setverdict(pass, __SCOPE__ & ": IUT ignored non matching PrimitiveProfile linked!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT rejected the create request with non existing primtive profile!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_005_CRE + + /** + * @desc Check that the IUT successfully processes the request without applying the profile when the attributes in the request do not match with the referenced <primitiveProfile> resource attributes. + * + */ + testcase TC_CSE_PP_005_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_005_RET()); + v_ae1.done; + } + + function f_CSE_PP_005_RET() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_acpResourceIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_retrieveRequest; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create ACP with link to Primitive Profile created + v_acpResourceIndex := f_cse_createResource(int1, m_createAcpBase, v_aeIndex); + + //Retrieve ACP resource with link to Primitve Profile + v_retrieveRequest := valueof(m_retrieve(f_getResourceAddress(v_acpResourceIndex), f_getOriginator(v_acpResourceIndex))); + v_retrieveRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + f_send(e_mcaPort, m_request(v_retrieveRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response { + setverdict(pass, __SCOPE__ & ": IUT ignored non matching PrimitiveProfile linked!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT rejected the retrieve request with non existing primtive profile!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_005_RET + + /** + * @desc Check that the IUT successfully processes the request without applying the profile when the attributes in the request do not match with the referenced <primitiveProfile> resource attributes. + * + */ + testcase TC_CSE_PP_005_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_005_DEL()); + v_ae1.done; + } + + function f_CSE_PP_005_DEL() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_acpResourceIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_deleteRequest; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create ACP + v_acpResourceIndex := f_cse_createResource(int1, m_createAcpBase, v_aeIndex); + + //Delete ACP resource with link to Primitive Profile + v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_acpResourceIndex), f_getOriginator(v_acpResourceIndex))); + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_deleteRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + setverdict(pass, __SCOPE__ & ": IUT ignored request with non matching PrimitiveProfile linked!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT rejected the delete request with non existing primtive profile!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_005_DEL + + /** + * @desc Check that the IUT successfully processes the request without applying the profile when the attributes in the request do not match with the referenced <primitiveProfile> resource attributes. + * + */ + testcase TC_CSE_PP_005_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_005_UPD()); + v_ae1.done; + } + + function f_CSE_PP_005_UPD() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_acpResourceIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_updateAcpRequest; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + + //Create ACP resource + v_acpResourceIndex := f_cse_createResource(int1, valueof(m_createAcp(omit, -, int63)), v_aeIndex); + + //Update ACP resource with link to primitive profile + v_updateAcpRequest := f_getUpdateRequestPrimitive(int1, v_aeIndex, m_updateAcpBase); + v_updateAcpRequest.primitiveContent.accessControlPolicy.labels := {"VALUE_1"}; + + // Link Primitve Prifle created to non matching Primitive Profile + v_updateAcpRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_updateAcpRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT ignored non matching PrimitiveProfile linked!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT rejected the update request with non existing primtive profile!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_005_UPD + }//end group TC_CSE_PP_005 + + /** + * @desc Check that the IUT rejects the creation of a <primitiveProfile> resource when a mutual exclusivity check is failed, on the names of the attributes or parameters specified in the additions, deletions and modifications attributes in the request. + * + */ + testcase TC_CSE_PP_006() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_006()); + v_ae1.done; + } + + function f_CSE_PP_006() runs on AeSimu system CseSystem { + // Local variables + var RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var MsgIn v_response; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be added and deleted simultaneously. + v_createPrimitveProfile := m_createPrimitveProfileAddNonMutuallyExclusive({f_getOriginator(v_aeIndex)}); + + f_send(e_mcaPort, m_request(v_createPrimitveProfile)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT rejected Primitve Profile with attributes that are not mutually exclusive!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT accepted Primitve Profile with attributes that are not mutually exclusive!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_006 + + /** + * @desc Check that the IUT rejects the updation of <primitiveProfile> resource when a mutual exclusivity check is failed on the names of the attributes or parameters specified in the additions, deletions and modifications attributes of the request. + * + */ + testcase TC_CSE_PP_007() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_007()); + v_ae1.done; + } + + function f_CSE_PP_007() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_updatePrimitiveProfileRequest; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + v_updatePrimitiveProfileRequest := f_getUpdateRequestPrimitive(int59, v_primitiveProfileIndex, m_updatePrimitiveProfileNonMutuallyExclusive); + + f_send(e_mcaPort, m_request(v_updatePrimitiveProfileRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT rejected Primitve Profile with attributes that are not mutually exclusive!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT accepted Primitve Profile with attributes that are not mutually exclusive!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_006 + + /** + * @desc Check that the IUT rejects the creation of a <primitiveProfile> resource when a request contains non permissible parameters specified in the additions, deletions and modifications attributes. + * + */ + testcase TC_CSE_PP_008() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_008()); + v_ae1.done; + } + + function f_CSE_PP_008() runs on AeSimu system CseSystem { + // Local variables + var RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_updateContainer; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_acpResourceIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_updateAcpRequest; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile for adding non permissible parameters. + v_createPrimitveProfile := m_createPrimitveProfileAddNonPermissibleAttribute({f_getOriginator(v_aeIndex)}); + + f_send(e_mcaPort, m_request(v_createPrimitveProfile)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT rejected Primitve Profile with non permissible parameters!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT accepted Primitve Profile with non permissible parameters!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_008 + + /** + * @desc Check that the IUT rejects the UPDATE operation on resource <primitiveProfile> when a request contains non permissible parameters specified in the additions, deletions and modifications attributes. + * + */ + testcase TC_CSE_PP_009() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_009()); + v_ae1.done; + } + + function f_CSE_PP_009() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var MsgIn v_response; + var RequestPrimitive v_updatePrimitiveProfileRequest; + + // Preambleo + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with add atribute "maxByte" = "100" for content resource. + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + v_updatePrimitiveProfileRequest := f_getUpdateRequestPrimitive(int59, v_primitiveProfileIndex, m_updatePrimitiveProfileNonPermissibleParameters); + + f_send(e_mcaPort, m_request(v_updatePrimitiveProfileRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": IUT rejected Primitve Profile with non permissible parameters!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in status response code from IUT!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": IUT accepted Primitve Profile with non permissible parameters!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_009 + + /** + * @desc Check that IUT successfully applies the <primitiveProfile> to the notification (Notify request primitive) in case of nonBlockingRequestAsynch request having valid attribute PrimitiveProfileIdentifier. + * + */ + testcase TC_CSE_PP_010() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_010()); + v_ae1.done; + } + + function f_CSE_PP_010() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex, v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_primitiveProfileIndex := -1; + var template PrimitiveContent v_contentResponse; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createPrimitveProfile; + + // Test control + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); + stop; + } + + f_cf01Up(); + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be deleted from response. + v_createPrimitveProfile := m_createPrimitveProfileDeleteFromResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Container create with response type as nonBlockingRequestAsynch + v_requestContainerCreate := f_getCreateRequestPrimitive(int3, m_createContainerMaxByte(100), v_aeIndex); + v_requestContainerCreate.responseType.responseTypeValue := int2; //nonBlockingRequestAsynch + v_requestContainerCreate.responseType.notificationURI := {f_getResourceAddress(v_aeIndex)}; + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + //Expect notification + v_contentResponse.uRI := ?; + + f_send(e_mcaPort, m_request(valueof(v_requestContainerCreate))); + tc_ac.start; + + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002, v_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1002))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the notification is received with resource created. + //Activate defaults when running on a PTC + f_cse_activateDefaults_ae(); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(mw_responsePrimitive(int2001)))) -> value vc_request { + tc_ac.stop; + if(ispresent(vc_request.primitive.requestPrimitive.primitiveContent.container.maxByteSize)) { + setverdict(pass, __SCOPE__ & ":INFO: Notification received with Primitive Profile applied"); + } else { + setverdict(fail, __SCOPE__ & ":INFO: Notification received without applying Primitive Profile"); + } + v_responsePrimitive := valueof(m_responseNotification(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + } + [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(mw_responsePrimitiveOK))) -> value vc_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Notification received with wrong response status code"); + v_responsePrimitive := valueof(m_responseNotification(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + } + [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(mw_responsePrimitiveKO))) -> value vc_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Notification received, resource creation failed"); + v_responsePrimitive := valueof(m_responseNotification(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + } + [] mcaPortIn.receive(mw_request(mw_notifyResponsePrimitive(?))) -> value vc_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match"); + v_responsePrimitive := valueof(m_responseNotification(int2000, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No notification received"); + } + } + + if(isvalue(v_responsePrimitive)) { + f_send(e_mcaPortIn, m_response(v_responsePrimitive)); + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_010 + + /** + * @desc Check that IUT successfully applies the <primitiveProfile> to the response in case of nonBlockingRequestSynch request having valid Primitive Profile Identifier. + * + */ + testcase TC_CSE_PP_011() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_011()); + v_ae1.done; + } + + function f_CSE_PP_011() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_resourceIndex := -1; + var template PrimitiveContent v_contentResponseUri; + var template PrimitiveContent v_contentResponseRequestResource; + var RequestStatus v_requestStatus; + var URI v_requestResourceURI; + var template PrimitiveContent v_primitiveContent; + var template RequestPrimitive v_createContainerRequest := m_createContainerBase; + var template RequestPrimitive v_createPrimitveProfile; + + // Test control + if(not PICS_NON_BLOCKING_REQUEST_SYNCH){ + setverdict(inconc, __SCOPE__ & ": It is required to support Non-blocking access resource in synchronous mode to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + + v_contentResponseUri.uRI := ?; + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be added to response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Create resource with responseType as nonBlockingRequestSynch + v_createContainerRequest.to_ := f_getResourceAddress(v_aeIndex); + v_createContainerRequest.from_ := f_getOriginator(v_aeIndex); + v_createContainerRequest.responseType := {int1, omit}; + v_createContainerRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(valueof(v_createContainerRequest))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001, v_contentResponseUri))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": URI attribute is set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int1001))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI attribute is not set to <request> resource address"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing a Non-blocking access resource in synchronous mode operation"); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if (ischosen(v_response.primitive.responsePrimitive.primitiveContent.uRI)){ + v_contentResponseRequestResource.request := mw_contentRequestBase; + v_requestResourceURI := v_response.primitive.responsePrimitive.primitiveContent.uRI; + v_contentResponseRequestResource.request.primitiveContent := v_createContainerRequest.primitiveContent; + + v_primitiveContent := f_getTemplateFromPrimitiveContent(v_createContainerRequest.primitiveContent); + + f_send(e_mcaPort, m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex)))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response{ + v_requestStatus := v_response.primitive.responsePrimitive.primitiveContent.request.requestStatus; + if (v_requestStatus==int1){ //COMPLETED + tc_ac.stop; + + if (valueof(v_response.primitive.responsePrimitive.primitiveContent.request.operationResult.responseStatusCode) == int2001){ + // Check that IUT applied the Primitve Profile + if(v_response.primitive.responsePrimitive.primitiveContent.request.operationResult.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + }else{ + setverdict(fail, testcasename() & ": RequestStatus: COMPLETED and responseStatusCode attribute not correctly received"); + } + }else if (v_requestStatus==int2){ //FAILED + tc_ac.stop; + setverdict(fail, testcasename() & ": Retrieve <request> failed"); + }else{ //PENDING, FORWARDING or PARTIALLY_COMPLETED + f_sleep(PX_TAC/5.0); + f_send(e_mcaPort, m_request(m_retrieve(v_requestResourceURI, f_getOriginator(v_aeIndex)))); + repeat; + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) { + tc_ac.stop; + setverdict(fail, testcasename() & ": <request> resource not found"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Wrong response status code in the response while retrieving <request> resource"); + } + [] tc_ac.timeout { + setverdict(fail, testcasename() & ": No answer while retrieving <request> resource"); + } + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // f_CSE_PP_011 + + + /** + * @desc Check that IUT successfully applies the <primitiveProfile> to the notification request generated for the <subscription> resource + * + */ + testcase TC_CSE_PP_012() runs on Tester system CseSystem { + + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_012()); + v_ae1.done; + + } + + function f_CSE_PP_012() runs on AeSimu system CseSystem { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_primitiveProfileIndex := -1; + var template RequestPrimitive v_createRequest := omit; + var template PrimitiveContent v_contentNotification := {container := mw_contentContainerWithoutMaxByteSize};// container without MaxByteSize + var RequestPrimitive v_request; + var integer v_ae2Index := -1; + var template RequestPrimitive v_createPrimitveProfile; + + // Test control + + // Test component configuration + f_cf01Up(true); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be deleted from response. + v_createPrimitveProfile := m_createPrimitveProfileDeleteFromResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Subscription resource with notification to AE2 about container creation + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int3}), -, omit, omit, omit, -, omit); + + f_cse_preamble_subscriptionVerification(v_ae2Index, v_createRequest, int23); + + //Subscription resource creation with link to PrimitiveProfile + v_createRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription + + if(vc_ae2.running) { + vc_ae2.stop; + }; + + // Creation of container resource with MaxByteSize=100 + v_request:= f_getCreateRequestPrimitive(int3, m_createContainerMaxByte(100), v_aeIndex); + + vc_ae2.start(f_cse_notifyProcedure_representationHandler(v_contentNotification)); // check if the notification is well received and if its content matchs + + f_send(e_mcaPort, m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type int3 (Container) created successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type int3 (Container)"); + } + } + + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // end f_CSE_PP_012 + + group TC_CSE_PP_013 { + /** + * @desc Check that the IUT retargets the request to the hosting CSE without applying the <primitiveProfile> when the To parameter contains the hosting CSE-ID which is known by the IUT. + * + */ + testcase TC_CSE_PP_013_CRE() runs on CseSimu system CseSystem { + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + + v_cse1.start(f_CSE_PP_013_CRE()); + v_cse1.done; + } + + function f_CSE_PP_013_CRE() runs on CseSimu system CseSystem { + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_remoteCseIndex := -1; + var XSD.ID v_targetResourceAddress; + var template RequestPrimitive v_createContainerRequest := m_createContainerBase; + + f_cf02UpCseSimuMaster(); + + //Register remote CSE + v_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(vc_cseSimuDesc.cseId, -, -, -, -, {f_getLocalPoA(vc_cseSimuDesc.mccPortIn)})); + + + // Register AE1 + vc_ae1.start(f_cse_preamble_registerAe()); + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + v_aeIndex := f_getLatestResourceIndex(vc_ae1); + + //Create Primitive Profile from AE1 to add MaxByte Primtive to container resource creation + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + vc_ae1.start(f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex)); + v_primitiveProfileIndex := f_getLatestResourceIndex(vc_ae1); + + //Create container resource from AE1 with To as ID of remoteCSE + v_targetResourceAddress := f_getLocalResourceAddress(v_remoteCseIndex, PX_ADDRESSING_METHOD, e_spRelative); + v_createContainerRequest.from_ := f_getResourceAddress(v_aeIndex); + v_createContainerRequest.to_ := v_targetResourceAddress; + v_createContainerRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + vc_ae1.start(f_cse_operationResource(v_createContainerRequest)); + + //Expect request without applying Primitive Profile + f_cse_activateDefaults_cse1(); + + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(mw_createContainer)) -> value vc_request { + tc_ac.stop; + if(ispresent(vc_request.primitive.requestPrimitive.primitiveContent.container.maxByteSize)) { + if(vc_request.primitive.requestPrimitive.primitiveContent.container.maxByteSize == 100) { + setverdict(fail, __SCOPE__ & ":Primitive Profile applied by forwarding CSE"); + } else { + setverdict(pass, __SCOPE__ & ":Primitive Profile was not applied by forwarding CSE"); + } + + } else { + setverdict(pass, __SCOPE__ & ":Primitive Profile was not applied by forwarding CSE"); + } + } + [] mccPortIn.receive(mw_request(?)) -> value vc_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Unexpected request"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No request received"); + } + } + + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf02DownCseSimuMaster(); + } // f_CSE_PP_013_CRE + + /** + * @desc Check that the IUT retargets the request to the hosting CSE without applying the <primitiveProfile> when the To parameter contains the hosting CSE-ID which is known by the IUT. + * + */ + testcase TC_CSE_PP_013_RET() runs on CseSimu system CseSystem { + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + + v_cse1.start(f_CSE_PP_013_RET()); + v_cse1.done; + } + + function f_CSE_PP_013_RET() runs on CseSimu system CseSystem { + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_remoteCseIndex := -1; + var integer v_targetResourceIndex := -1; + var XSD.ID v_targetResourceAddress; + var template RequestPrimitive v_createContainerRequest := m_createContainerBase; + var RequestPrimitive v_retrieveRequest; + + f_cf02UpCseSimuMaster(); + + //Register remote CSE + v_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(vc_cseSimuDesc.cseId, -, -, -, -, {f_getLocalPoA(vc_cseSimuDesc.mccPortIn)})); + + + // Register AE1 + vc_ae1.start(f_cse_preamble_registerAe()); + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + v_aeIndex := f_getLatestResourceIndex(vc_ae1); + + //Create Primitive Profile from AE1, to add primtive resultContent=4 for container resource retrieval + v_createPrimitveProfile := m_createPrimitveProfileAddResultContentTo4({f_getOriginator(v_aeIndex)}); + vc_ae1.start(f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex)); + v_primitiveProfileIndex := f_getLatestResourceIndex(vc_ae1); + + // Create local container resource at Hosting CSE + v_targetResourceIndex := f_generateAndSetLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainerBase)), vc_cSEBaseIndex, int3); + v_targetResourceAddress := f_getLocalResourceAddress(v_targetResourceIndex, PX_ADDRESSING_METHOD, e_spRelative); + + //Retrieve the container resource from AE1, without any resultContent but with link to Primitve Profile created by AE1 + v_retrieveRequest := valueof(m_retrieve(v_targetResourceAddress, f_getResourceAddress(v_aeIndex))); + v_retrieveRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + vc_ae1.start(f_cse_operationResource(v_retrieveRequest)); + + //Expect request without applying Primitive Profile + f_cse_activateDefaults_cse1(); + + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(mw_retrieve(v_targetResourceAddress))) -> value vc_request { + tc_ac.stop; + if(ispresent(vc_request.primitive.requestPrimitive.resultContent)) { + if(vc_request.primitive.requestPrimitive.resultContent == int4) { + setverdict(fail, __SCOPE__ & ":Primitive Profile applied by forwarding CSE"); + } else { + setverdict(pass, __SCOPE__ & ":Primitive Profile was not applied by forwarding CSE"); + } + + } else { + setverdict(pass, __SCOPE__ & ":Primitive Profile was not applied by forwarding CSE"); + } + } + [] mccPortIn.receive(mw_request(?)) -> value vc_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Unexpected request"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No request received"); + } + } + + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf02DownCseSimuMaster(); + } // f_CSE_PP_013_RET + + /** + * @desc Check that the IUT retargets the request to the hosting CSE without applying the <primitiveProfile> when the To parameter contains the hosting CSE-ID which is known by the IUT. + * + */ + testcase TC_CSE_PP_013_DEL() runs on CseSimu system CseSystem { + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + + v_cse1.start(f_CSE_PP_013_DEL()); + v_cse1.done; + } + + function f_CSE_PP_013_DEL() runs on CseSimu system CseSystem { + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_remoteCseIndex := -1; + var XSD.ID v_targetResourceAddress; + var template RequestPrimitive v_createContainerRequest := m_createContainerBase; + var RequestPrimitive v_deleteRequest; + var integer v_targetResourceIndex := -1; + + f_cf02UpCseSimuMaster(); + + //Register remote CSE + v_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(vc_cseSimuDesc.cseId, -, -, -, -, {f_getLocalPoA(vc_cseSimuDesc.mccPortIn)})); + + + // Register AE1 + vc_ae1.start(f_cse_preamble_registerAe()); + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + v_aeIndex := f_getLatestResourceIndex(vc_ae1); + + // Primitive Profile with Add atribute resultContent=4 for container resource delete request. + v_createPrimitveProfile := m_createPrimitveProfileAddResultContentTo4({f_getOriginator(v_aeIndex)}); + vc_ae1.start(f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex)); + v_primitiveProfileIndex := f_getLatestResourceIndex(vc_ae1); + + // Create local container resource at Hosting CSE + v_targetResourceIndex := f_generateAndSetLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainerBase)), vc_cSEBaseIndex, int3); + v_targetResourceAddress := f_getLocalResourceAddress(v_targetResourceIndex, PX_ADDRESSING_METHOD, e_spRelative); + + //Delete container resource with link to Primitive Profile + v_deleteRequest := valueof(m_delete(v_targetResourceAddress, f_getResourceAddress(v_aeIndex))); + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + v_deleteRequest.resultContent := int1; + vc_ae1.start(f_cse_operationResource(v_deleteRequest)); + + //Expect request without applying Primitive Profile + f_cse_activateDefaults_cse1(); + + f_send(e_mcaPort, m_request(v_deleteRequest)); + tc_ac.start; + alt { + // If primitive profile was ignored, resultContent value in the request will be maintained as int1 + [] mccPortIn.receive(mw_request(mw_delete(?))) -> value vc_request { + tc_ac.stop; + if(ispresent(vc_request.primitive.requestPrimitive.resultContent)) { + if(vc_request.primitive.requestPrimitive.resultContent == int4) { + setverdict(fail, __SCOPE__ & ":Primitive Profile was applied by forwarding CSE"); + } else { + setverdict(pass, __SCOPE__ & ":Primitive Profile was not applied by forwarding CSE"); + } + } else { + setverdict(pass, __SCOPE__ & ":Primitive Profile was not applied by forwarding CSE"); + } + } + [] mccPortIn.receive(mw_request(?)) -> value vc_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Unexpected request"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No request received"); + } + } + + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf02DownCseSimuMaster(); + } // f_CSE_PP_013_DEL + + /** + * @desc Check that the IUT retargets the request to the hosting CSE without applying the <primitiveProfile> when the To parameter contains the hosting CSE-ID which is known by the IUT. + * + */ + testcase TC_CSE_PP_013_UPD() runs on CseSimu system CseSystem { + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + + v_cse1.start(f_CSE_PP_013_UPD()); + v_cse1.done; + } + + function f_CSE_PP_013_UPD() runs on CseSimu system CseSystem { + var template RequestPrimitive v_createPrimitveProfile; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_remoteCseIndex := -1; + var integer v_targetResourceIndex := -1; + var XSD.ID v_targetResourceAddress; + var template RequestPrimitive v_updateContainer := m_updateContainerBase; + + f_cf02UpCseSimuMaster(); + + //Register remote CSE + v_remoteCseIndex := f_cse_registerRemoteCse(m_createRemoteCSE_poa(vc_cseSimuDesc.cseId, -, -, -, -, {f_getLocalPoA(vc_cseSimuDesc.mccPortIn)})); + + + // Register AE1 + vc_ae1.start(f_cse_preamble_registerAe()); + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + v_aeIndex := f_getLatestResourceIndex(vc_ae1); + + //Create Primitive Profile from AE1, to add MaByte primitive to create container request + v_createPrimitveProfile := m_createPrimitveProfileAddContainerMaxByte100({f_getOriginator(v_aeIndex)}); + vc_ae1.start(f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex)); + v_primitiveProfileIndex := f_getLatestResourceIndex(vc_ae1); + + // Create Local container resource in Hosting CSE + v_targetResourceIndex := f_generateAndSetLocalResource(valueof(m_primitiveContentContainer(m_contentCreateContainer)), vc_cSEBaseIndex, int3); + v_targetResourceAddress := f_getLocalResourceAddress(v_targetResourceIndex, PX_ADDRESSING_METHOD, e_spRelative); + + //Update container request with link to Primitive Profile ID, and not including update for maxByte + v_updateContainer:= f_getUpdateRequestPrimitive(int3, v_aeIndex, m_updateContainerBase); + v_updateContainer.from_ := f_getOriginator(v_aeIndex); + v_updateContainer.to_ := v_targetResourceAddress; + v_updateContainer.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + vc_ae1.start(f_cse_operationResource(v_updateContainer)); + + //Expect request without applying Primitive Profile + f_cse_activateDefaults_cse1(); + + tc_ac.start; + alt { + [] mccPortIn.receive(mw_request(mw_updateContainer)) -> value vc_request { + tc_ac.stop; + if(ispresent(vc_request.primitive.requestPrimitive.primitiveContent.container.maxByteSize)) { + if(vc_request.primitive.requestPrimitive.primitiveContent.container.maxByteSize == 100) { + setverdict(fail, __SCOPE__ & ":Primitive Profile was applied by forwarding CSE"); + } else { + setverdict(pass, __SCOPE__ & ":Primitive Profile was not applied by forwarding CSE"); + } + } else { + setverdict(pass, __SCOPE__ & ":Primitive Profile was not applied by forwarding CSE"); + } + + } + [] mccPortIn.receive(mw_request(?)) -> value vc_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Unexpected request"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No request received"); + } + } + + f_cseSimu_checkComponentDoneAndGetVerdict(vc_ae1); + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf02DownCseSimuMaster(); + } // f_CSE_PP_013_CRE + } //end group TC_CSE_PP_013 + + group TC_CSE_PP_014 { + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by adding the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_014_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_014_CRE()); + v_ae1.done; + } + + function f_CSE_PP_014_CRE() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex, v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_primitiveProfileIndex := -1; + var template PrimitiveContent v_contentResponse; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createPrimitveProfile; + + f_cf01Up(); + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be added to response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource without "maxByte" primitive, but with link to Primitive Profile created + v_requestContainerCreate := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_aeIndex); + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100) { + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_014_CRE + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by adding the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_014_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_014_DEL()); + v_ae1.done; + } + + function f_CSE_PP_014_DEL() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_primitiveProfileIndex := -1; + var template RequestPrimitive v_createPrimitveProfile; + var template PrimitiveContent v_deleteContentResponse; + var RequestPrimitive v_deleteRequest; + + f_cf01Up(); + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be added to response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container in response as per resultContent=1 + v_deleteContentResponse.container := mw_contentContainer_rc1; + + //Create container resource without "maxByte" primitive + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Delete container resource with link to Primtive Profile + v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))); + v_deleteRequest.resultContent := int1; // attributes required to check value of maxByteSize + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_deleteRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002, v_deleteContentResponse))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100) { + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_deleteContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Response content is not as per resultContent=1"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_014_DEL + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by adding the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_014_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_014_RET()); + v_ae1.done; + } + + function f_CSE_PP_014_RET() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_primitiveProfileIndex := -1; + var integer v_containerIndex := -1; + var integer v_aeIndex := -1; + var RequestPrimitive v_requestContainerCreate; + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_retrieveRequest; + var template PrimitiveContent v_retriveContentResponse; + + f_cf01Up(); + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be added to response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container in response + v_retriveContentResponse.container := mw_contentContainerBase; + + //Create container resource without "maxByte" primitive + v_containerIndex := f_cse_createResource(int59, m_createContainerBase, v_aeIndex); + + //Retrieve container with link to Primitve Profile + v_retrieveRequest := valueof(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))); + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + f_send(e_mcaPort, m_request(v_retrieveRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100) { + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Response content is not as per resultContent=1"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_014_RET + + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by adding the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_014_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_014_CRE()); + v_ae1.done; + } + + function f_CSE_PP_014_UPD() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_updateContainer; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResource := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be deleted from response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource without Primtive Profile ID and no maxByte attribte + v_createdContainerResource := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Update container request with Primitive Profile ID, and without including update for maxByte + v_updateContainer:= f_getUpdateRequestPrimitive(int3, v_aeIndex, m_createContainerBase); + + // Link Primitve Prifle created to this Request + v_updateContainer.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_updateContainer)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100) { + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Response content is not as per resultContent=1"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_014_UPD + } // TC_CSE_PP_014 + + group TC_CSE_PP_015 { + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by deleting the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_015_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_015_CRE()); + v_ae1.done; + } + + function f_CSE_PP_015_CRE() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_primitiveProfileIndex := -1; + var template PrimitiveContent v_contentResponse; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createPrimitveProfile; + + f_cf01Up(); + + // AE registration + v_contentResponse.uRI := ?; + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be deleted from response. + v_createPrimitveProfile := m_createPrimitveProfileDeleteFromResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource with "maxByte" primitive + v_requestContainerCreate := f_getCreateRequestPrimitive(int3, m_createContainerMaxByte(100), v_aeIndex); + // Link Primitve Prifle, which was deleted, to this Request + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } else { + setverdict(pass, __SCOPE__ & ": Primitive Profile successfully applied to response primtive by deleting maxByteSize!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_015_CRE + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by adding the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_015_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_015_DEL()); + v_ae1.done; + } + + function f_CSE_PP_015_DEL() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_primitiveProfileIndex := -1; + var template RequestPrimitive v_createPrimitveProfile; + var template PrimitiveContent v_deleteContentResponse; + var RequestPrimitive v_deleteRequest; + + f_cf01Up(); + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be deleted from response. + v_createPrimitveProfile := m_createPrimitveProfileDeleteFromResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container in response as per resultContent=1 + v_deleteContentResponse.container := mw_contentContainer_rc1; + + //Create container resource with "maxByte" primitive + v_containerIndex := f_cse_createResource(int3, m_createContainerMaxByte(100), v_aeIndex); + + //Delete container resource with link to Primtive Profile + v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))); + v_deleteRequest.resultContent := int1; //attribute + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_deleteRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002, v_deleteContentResponse))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + setverdict(fail, __SCOPE__ & ": IUT did not apply primtive profile to the response primtive!"); + } else { + setverdict(pass, __SCOPE__ & ": IUT applied primtive profile to the response primtive!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_015_DEL + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by deleting the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_015_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_015_RET()); + v_ae1.done; + } + + function f_CSE_PP_015_RET() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_updateContainer; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResourceIndex := -1; + var MsgIn v_response; + var template PrimitiveContent v_retriveContentResponse; + var RequestPrimitive v_retrieveRequest; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be deleted from response. + v_createPrimitveProfile := m_createPrimitveProfileDeleteFromResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container in response + v_retriveContentResponse.container := mw_contentContainerBase; + + //Create container resource with maxByte attribte + v_createdContainerResourceIndex := f_cse_createResource(int3, m_updateContainerMaxByte(100), v_aeIndex); + + //Retrieve container with link to Primitve Profile + v_retrieveRequest := valueof(m_retrieve(f_getResourceAddress(v_createdContainerResourceIndex), f_getOriginator(v_createdContainerResourceIndex))); + v_retrieveRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + f_send(e_mcaPort, m_request(v_retrieveRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } else { + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_015_RET + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by deleting the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_015_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_015_CRE()); + v_ae1.done; + } + + function f_CSE_PP_015_UPD() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_updateContainer; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResource := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with attribute of Container resource 'MaxByte' to be deleted from response. + v_createPrimitveProfile := m_createPrimitveProfileDeleteFromResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource without Primtive Profile ID and no maxByte attribte + v_createdContainerResource := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + //Update container request with Primitive Profile ID, and including update for maxByte + v_updateContainer:= f_getUpdateRequestPrimitive(int3, v_aeIndex, m_updateContainerMaxByte(100)); + + // Link Primitve Prifle created to this Request + v_updateContainer.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_updateContainer)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize)){ + setverdict(fail, __SCOPE__ & ": Primitive Profile to delete a primitive not applied to response!!"); + } else { + setverdict(pass, __SCOPE__ & ": Primitive Profile to delete a primitive applied to response!"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Mismatch in response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_015_UPD + } // TC_CSE_PP_015 + + + group TC_CSE_PP_016 { + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by modifying the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_016_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_016_CRE()); + v_ae1.done; + } + + function f_CSE_PP_016_CRE() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex, v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_primitiveProfileIndex := -1; + var template PrimitiveContent v_contentResponse; + var RequestPrimitive v_requestContainerCreate; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createPrimitveProfile; + + f_cf01Up(); + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte'=100 to be added to response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource with "maxByte"=1000 + v_requestContainerCreate := f_getCreateRequestPrimitive(int3, m_createContainerMaxByte(1000), v_aeIndex); + // Link Primitve Prifle, which was deleted, to this Request + v_requestContainerCreate.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } + [] mcaPort.receive(mw_response(?)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected response from IUT!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_016_CRE + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by modifying the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_016_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_016_DEL()); + v_ae1.done; + } + + function f_CSE_PP_016_DEL() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex; + var integer v_resourceIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_containerIndex := -1; + var template PrimitiveContent v_contentResponse; + var template PrimitiveContent v_deleteContentResponse; + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_deleteRequest; + + f_cf01Up(); + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte'=100 to be added to response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container in response as per resultContent=1 + v_deleteContentResponse.container := mw_contentContainer_rc1; + + //Create container resource with 'MaxByte'=1000 + v_containerIndex := f_cse_createResource(int3, m_createContainerMaxByte(1000), v_aeIndex); + + //Delete container resource while applying Primtive Profile + v_deleteRequest := valueof(m_delete(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))); + v_deleteRequest.resultContent := int1; //attribute + v_deleteRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_deleteRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002, v_deleteContentResponse))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } + [] mcaPort.receive(mw_response(?)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected response from IUT!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_016_CRE + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by modifying the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_016_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_016_RET()); + v_ae1.done; + } + + function f_CSE_PP_016_RET() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_primitiveProfileIndex := -1; + var template RequestPrimitive v_createPrimitveProfile; + var template PrimitiveContent v_retriveContentResponse; + var RequestPrimitive v_retrieveRequest; + + f_cf01Up(); + + // AE registration + v_aeIndex := f_cse_preamble_registerAe(-, {f_getLocalPoA(vc_aeSimuDesc.mcaPortIn, "")});//c_CRUDNDi); + f_checkAeSimuStatus(); + + // Primitive Profile with attribute of Container resource 'MaxByte'=100 to be added to response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + // Set expected container in response + v_retriveContentResponse.container := mw_contentContainerBase; + + //Create container resource with "maxByte"=1000 + v_containerIndex := f_cse_createResource(int3, m_createContainerMaxByte(1000), v_aeIndex); + + //Retrieve container with link to Primitve Profile + v_retrieveRequest := valueof(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex))); + v_retrieveRequest.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + f_send(e_mcaPort, m_request(v_retrieveRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, v_retriveContentResponse))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": Primitive Profile applied to response primtive!"); + } else { + setverdict(pass, __SCOPE__ & ": Primitive Profile not applied to response primtive!"); + } + } + [] mcaPort.receive(mw_response(?)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected response from IUT!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_016_RET + + /** + * @desc Check that IUT applies the referenced <primitiveProfile> over the response messages by adding the applicable parameters/attributes when the originating AE specified a valid PrimitiveProfileIdentifier parameter in the corresponding request. + * + */ + testcase TC_CSE_PP_016_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_PP_016_CRE()); + v_ae1.done; + } + + function f_CSE_PP_016_UPD() runs on AeSimu system CseSystem { + // Local variables + var template RequestPrimitive v_createPrimitveProfile; + var RequestPrimitive v_updateContainer; + var ResponsePrimitive v_responsePrimitive; + var integer v_aeIndex := -1; + var integer v_primitiveProfileIndex := -1; + var integer v_createdContainerResource := -1; + var MsgIn v_response; + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -); + + // Primitive Profile with attribute of Container resource 'MaxByte'=100 to be added to response. + v_createPrimitveProfile := m_createPrimitveProfileAddMaxByte100ToResponse({f_getOriginator(v_aeIndex)}); + v_primitiveProfileIndex := f_cse_createResource(int59, v_createPrimitveProfile, v_aeIndex); + + //Create container resource without Primtive Profile ID and no maxByte attribte + v_createdContainerResource := f_cse_createResource(int3, m_createContainerMaxByte(1000), v_aeIndex); + + //Update container request with Primitive Profile ID, and without including update for maxByte + v_updateContainer:= f_getUpdateRequestPrimitive(int3, v_aeIndex, m_updateContainerMaxByte(2000)); + + // Link Primitve Prifle created to this Request + v_updateContainer.primitiveProfileIdentifier := f_getResourceId(vc_resourcesList[v_primitiveProfileIndex].resource); + + f_send(e_mcaPort, m_request(v_updateContainer)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + // Check that IUT applied the Primitve Profile + if(v_response.primitive.responsePrimitive.primitiveContent.container.maxByteSize == 100){ + setverdict(pass, __SCOPE__ & ": Primitive Profile to update a primitive applied to response!"); + } else { + setverdict(fail, __SCOPE__ & ": Primitive Profile to update a primitive not applied to response!!"); + } + } + [] mcaPort.receive(mw_response(?)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected response from IUT!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer from IUT for the last Request!"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + } // f_CSE_PP_016_UPD + } // TC_CSE_PP_016 + } //end group Primitive_Profile + }//end group CSE +}// -} -- GitLab