diff --git a/LibCommon/LibCommon_AbstractData.ttcn b/LibCommon/LibCommon_AbstractData.ttcn index 5b4efbdd04106e048aba5799ae39c55296265ba1..0710c439314c31512bbf24d39fe9d45996f82d3b 100644 --- a/LibCommon/LibCommon_AbstractData.ttcn +++ b/LibCommon/LibCommon_AbstractData.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI - * @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_AbstractData.ttcn $ - * $Id: LibCommon_AbstractData.ttcn 46 2014-01-16 10:23:16Z filatov $ + * @version $URL: https://oldforge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_AbstractData.ttcn $ + * $Id: LibCommon_AbstractData.ttcn 64 2016-12-14 15:09:43Z berge $ * @desc A collection of functions for abstract data types which may be * useful in the implementation of any TTCN-3 test suite. * @remark End users should be aware that any changes made to the in @@ -9,6 +9,11 @@ * End users are encouraged to contact the distributers of this * module regarding their modifications or additions so that future * updates will include your changes. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * */ module LibCommon_AbstractData { diff --git a/LibCommon/LibCommon_BasicTypesAndValues.ttcn b/LibCommon/LibCommon_BasicTypesAndValues.ttcn index 0d98bdb745bd721a76739f0743129f98b98e35ed..318a1933e105835f437f0ad9bec0538b9d458dc3 100644 --- a/LibCommon/LibCommon_BasicTypesAndValues.ttcn +++ b/LibCommon/LibCommon_BasicTypesAndValues.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI - * @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_BasicTypesAndValues.ttcn $ - * $Id: LibCommon_BasicTypesAndValues.ttcn 53 2014-07-01 13:29:07Z garciay $ + * @version $URL: https://oldforge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_BasicTypesAndValues.ttcn $ + * $Id: LibCommon_BasicTypesAndValues.ttcn 64 2016-12-14 15:09:43Z berge $ * @desc A collection of basic type and value definitions which may be * useful in the implementation of any TTCN-3 test suite. <br><br> * @remark End users should be aware that any changes made to the in @@ -9,6 +9,11 @@ * End users are encouraged to contact the distributers of this * module regarding their modifications or additions so that future * updates will include your changes. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * */ module LibCommon_BasicTypesAndValues { diff --git a/LibCommon/LibCommon_DataStrings.ttcn b/LibCommon/LibCommon_DataStrings.ttcn index 1c2d4c4349abbc46d49a396ea654cf37624f6274..ac6e63da04653db9bb8a684c6873a98139bb9232 100644 --- a/LibCommon/LibCommon_DataStrings.ttcn +++ b/LibCommon/LibCommon_DataStrings.ttcn @@ -1,8 +1,8 @@ /** * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_DataStrings.ttcn $ - * $Id: LibCommon_DataStrings.ttcn 61 2016-08-24 13:29:29Z garciay $ + * @version $URL: https://oldforge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_DataStrings.ttcn $ + * $Id: LibCommon_DataStrings.ttcn 64 2016-12-14 15:09:43Z berge $ * @desc A collection of data string type and value definitions which * may be useful in the implementation of any TTCN-3 test * suite. "Data string" refers to TTCN-3 hexstring, octetstring @@ -12,6 +12,11 @@ * End users are encouraged to contact the distributers of this * module regarding their modifications or additions so that future * updates will include your changes. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * */ module LibCommon_DataStrings { diff --git a/LibCommon/LibCommon_Sync.ttcn b/LibCommon/LibCommon_Sync.ttcn index 69a664ea5c632977a105f8046f5b4d1fd6afa5cb..38e29df924fe40e808448a50008ad62ccc765d27 100644 --- a/LibCommon/LibCommon_Sync.ttcn +++ b/LibCommon/LibCommon_Sync.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI - * @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_Sync.ttcn $ - * $Id: LibCommon_Sync.ttcn 46 2014-01-16 10:23:16Z filatov $ + * @version $URL: https://oldforge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_Sync.ttcn $ + * $Id: LibCommon_Sync.ttcn 66 2017-03-06 09:59:41Z filatov $ * @desc This module implements _one_ generic synchronization mechanism * for TTCN-3 test cases with one or more test components. * Key concept is here that one test component acts as a @@ -53,6 +53,11 @@ * End users are encouraged to contact the distributers of this * module regarding their modifications or additions so that future * updates will include your changes. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * */ module LibCommon_Sync { @@ -143,7 +148,11 @@ module LibCommon_Sync { * @see LibCommon_Sync.ServerSyncComp * @see LibCommon_Sync.ClientSyncComp */ - type port SyncPort message { inout SyncCmd } + type port SyncPort message { + inout SyncCmd + } with { + extension "internal" + } /** diff --git a/LibCommon/LibCommon_TextStrings.ttcn b/LibCommon/LibCommon_TextStrings.ttcn index 2514fce36943e31d8ee32e97b5161a947777618a..213e85c1e5f90ac5afbeed7f247477f33ba0d575 100644 --- a/LibCommon/LibCommon_TextStrings.ttcn +++ b/LibCommon/LibCommon_TextStrings.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI - * @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_TextStrings.ttcn $ - * $Id: LibCommon_TextStrings.ttcn 46 2014-01-16 10:23:16Z filatov $ + * @version $URL: https://oldforge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_TextStrings.ttcn $ + * $Id: LibCommon_TextStrings.ttcn 64 2016-12-14 15:09:43Z berge $ * @desc A collection of text string type and value definitions which * may be useful in the implementation of any TTCN-3 test * suite. "Text string" refers to TTCN-3 charstring and universal @@ -11,6 +11,11 @@ * End users are encouraged to contact the distributers of this * module regarding their modifications or additions so that future * updates will include your changes. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * */ module LibCommon_TextStrings { diff --git a/LibCommon/LibCommon_Time.ttcn b/LibCommon/LibCommon_Time.ttcn index ac4b6cffeaa5929b939ea3702b5e9ce9f88d3137..6efbb847d1b826366b332df7742bc6a472812f4e 100644 --- a/LibCommon/LibCommon_Time.ttcn +++ b/LibCommon/LibCommon_Time.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI - * @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_Time.ttcn $ - * $Id: LibCommon_Time.ttcn 46 2014-01-16 10:23:16Z filatov $ + * @version $URL: https://oldforge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_Time.ttcn $ + * $Id: LibCommon_Time.ttcn 64 2016-12-14 15:09:43Z berge $ * @desc A collection of time handling functions which may be useful in * the implementation of any TTCN-3 test suite. * @remark End users should be aware that any changes made to the in @@ -9,6 +9,11 @@ * End users are encouraged to contact the distributers of this * module regarding their modifications or additions so that future * updates will include your changes. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * */ module LibCommon_Time { diff --git a/LibCommon/LibCommon_VerdictControl.ttcn b/LibCommon/LibCommon_VerdictControl.ttcn index b5dd019bbb1a7aa5b9c579ba8e45bf4c5e0d4a0b..e71c7b89d68c5753552bc12219d09360cc5af3e5 100644 --- a/LibCommon/LibCommon_VerdictControl.ttcn +++ b/LibCommon/LibCommon_VerdictControl.ttcn @@ -1,7 +1,7 @@ /** * @author ETSI - * @version $URL: https://forge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_VerdictControl.ttcn $ - * $Id: LibCommon_VerdictControl.ttcn 46 2014-01-16 10:23:16Z filatov $ + * @version $URL: https://oldforge.etsi.org/svn/LibCommon/tags/v1.4.0/ttcn/LibCommon_VerdictControl.ttcn $ + * $Id: LibCommon_VerdictControl.ttcn 64 2016-12-14 15:09:43Z berge $ * @desc Contains generic functions which set test component verdicts * based on generic function return codes according to established * test implementation practice. These functions should only be called @@ -11,6 +11,11 @@ * End users are encouraged to contact the distributers of this * module regarding their modifications or additions so that future * updates will include your changes. + * @copyright ETSI Copyright Notification + * No part may be reproduced except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * All rights reserved. + * */ module LibCommon_VerdictControl { diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 6ac8d050717d20eae31728d126237d1cd72ece0d..2086bd792d04722d6223dd76bee80592dc937237 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -6,14 +6,13 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Functions.ttcn $ - * $Id: OneM2M_Functions.ttcn 183 2016-11-25 13:31:34Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Functions.ttcn $ + * $Id: OneM2M_Functions.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Module containing functions for oneM2M * */ module OneM2M_Functions { - import from LibCommon_Time {modulepar all;} import from XSD all; import from OneM2M_Templates all; import from OneM2M_Types all;//{type XSD.ID}; @@ -24,52 +23,62 @@ module OneM2M_Functions { // import from OneM2M_AdditionalTypes all; - group configFunctions { + group ConfigFunctions { + /** @desc Ports mapping and default behaviour activation for Config 1 */ function f_cf01Up() runs on CseTester { - + // Variables - + vc_config := e_cf01; + // Map map(self:mcaPort, system:mcaPort); map(self:acPort, system:acPort); activate(a_default()); activate(a_cse_cf01()); - + // Connect - + //Initialze the IUT - + } // end f_cf01Up + /** + * @desc Ports mapping and default behaviour activation for Config 02 + */ function f_cf02Up() runs on CseTester { - + // Variables - + vc_config := e_cf02; + // Map map(self:mcaPort, system:mcaPort); map(self:mccPort, system:mccPort); map(self:acPort, system:acPort); activate(a_default()); activate(a_cse_cf02()); - + // Connect - + //Initialze the IUT - + } // end f_cf02Up - function f_cf03Up() runs on CseTester { + /** + * @desc Ports mapping and default behaviour activation for Config 03 + */ + function f_cf03Up() runs on AeTester { // Variables - + vc_config := e_cf03; + // Map map(self:mcaPort, system:mcaPort); map(self:acPort, system:acPort); activate(a_default()); - activate(a_cse_cf01()); + activate(a_ae_cf03()); // Connect @@ -77,30 +86,90 @@ module OneM2M_Functions { } // end f_cf03Up + /** + * @desc Ports mapping and default behaviour activation for Config 04 + */ + function f_cf04Up() runs on CseTester { + + // Variables + vc_config := e_cf04; + + // Map + map(self:mccPort, system:mccPort); + map(self:acPort, system:acPort); + activate(a_default()); + activate(a_cse_cf04()); + + // Connect + + //Initialze the IUT + + } // end f_cf03Up + + /** + * @desc Ports unmapping + * @verdict + */ + function f_cfCseTesterDown() runs on CseTester { + + if(vc_config == e_cf01) { + f_cf01Down() + } else if (vc_config == e_cf02){ + f_cf02Down() + } + } + /** + * @desc Ports unmapping + * @verdict + */ + function f_cfAeTesterDown() runs on AeTester { + + if(vc_config == e_cf03) { + f_cf03Down() + } + } /** * @desc Ports unmapping * @verdict */ function f_cf01Down() runs on CseTester { - + unmap(self:mcaPort, system:mcaPort); unmap(self:acPort, system:acPort); - //stop; } - + /** + * @desc Ports unmapping + * @verdict + */ function f_cf02Down() runs on CseTester { - + unmap(self:mcaPort, system:mcaPort); unmap(self:mccPort, system:mccPort); unmap(self:acPort, system:acPort); - //stop; } - + /** + * @desc Ports unmapping for Config 03 + */ + function f_cf03Down() runs on AeTester { + + unmap(self:mcaPort, system:mcaPort); + unmap(self:acPort, system:acPort); + } + + /** + * @desc Ports unmapping for Config 04 + */ + function f_cf04Down() runs on CseTester { + + unmap(self:mccPort, system:mccPort); + unmap(self:acPort, system:acPort); + } + }//end group configFunctions - group cseFunctions { + group CseFunctions { - group preambleFunctions { + group PreambleFunctions { /** * @desc Creation of auxiliar resources ACP for correct execution of the test case @@ -109,12 +178,12 @@ module OneM2M_Functions { * @verdict */ function f_cse_preamble_createAcpAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi - + return f_cse_createAccessControlPolicyAux(p_acpName, p_allowedOperations); - + } - + /** * @desc Creation of auxiliar resources ACP and AE for correct execution of the test case * @param p_allowedOperations Allowed operations for the auxiliar AE resource @@ -122,54 +191,56 @@ module OneM2M_Functions { * @verdict */ function f_cse_preamble_registerAe(template (omit) AcpType p_accessControlPolicyIDs := omit, in template (omit) PoaList p_poaList := omit) runs on CseTester return integer {//c_CRUDNDi - + var RequestPrimitive v_request; var MsgIn v_response; var integer v_aeAuxIndex := -1; - + v_request := valueof(m_createAeAux(p_accessControlPolicyIDs, p_poaList)); v_request.to_ := f_getResourceAddress(); mcaPort.send(m_request(v_request)); - + tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - log("Preamble: Application registered successfuly"); - if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional)) { - vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional; - - v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent); - vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_aeAuxIndex}; - + setverdict(pass,__SCOPE__&":INFO: Application registered successfuly"); + if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)) { + vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.aE; + + f_checkAttributesToBeSaved(int2, v_request, v_response.primitive.responsePrimitive); + + v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); + if(ispresent(vc_aeAux.aE_ID)){ f_sendAcPrimitive("AE-ID_changed", oct2char(unichar2oct(vc_aeAux.aE_ID))); } else { f_sendAcPrimitive("AE-ID_changed", "0"); - } - }; + } + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(inconc, "Preamble: Error while registering application"); + setverdict(inconc, __SCOPE__&":INFO: Error while registering application"); stop; } [] mcaPort.receive { tc_ac.stop; - setverdict(inconc, "Preamble: Unexpected message received"); + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); stop; - } + }; [] tc_ac.timeout { - setverdict(inconc, "Preamble: No answer while registering resource"); + setverdict(inconc, __SCOPE__&":INFO: No answer while registering resource"); stop; } } - + + f_checkCseTesterStatus(); return v_aeAuxIndex; - + } - + /** * @desc Creation of auxiliar resources ACP and AE for correct execution of the test case * @param p_allowedOperations Allowed operations for the auxiliar AE resource @@ -177,24 +248,24 @@ module OneM2M_Functions { * @verdict */ function f_cse_preamble_registerAeWithId(XSD.ID p_appId, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi - + var RequestPrimitive v_request; var MsgIn v_response; var integer v_aeAuxIndex := -1; var integer v_acpAuxIndex := -1; - + if(PICS_ACP_SUPPORT){ v_acpAuxIndex := f_cse_createAccessControlPolicyAux(p_allowedOperations := p_allowedOperations); vc_acpAuxIndex := v_acpAuxIndex; } - + if(v_acpAuxIndex != -1) { vc_resourcesIndexToBeDeleted := {v_acpAuxIndex}; v_request := valueof(m_createAe(p_appId, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -)); - + //TODO Test, to be removed v_request.to_ := f_getResourceAddress(); - + mcaPort.send(m_request(v_request)); //mcaPort.send(m_request(m_createAeAux(p_name, {PX_URI_CSE & PX_CSE_NAME & "/" & PX_ACPAUX_NAME}))); } else { @@ -204,13 +275,12 @@ module OneM2M_Functions { alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - log("Preamble: Application registered successfuly"); - if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional)) { - vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AE_optional; - - v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent); - vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_aeAuxIndex}; - + setverdict(pass, __SCOPE__&": INFO: Application registered successfuly"); + if(ischosen(v_response.primitive.responsePrimitive.primitiveContent.aE)) { + vc_aeAux := v_response.primitive.responsePrimitive.primitiveContent.aE; + + v_aeAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int2); + if(ispresent(vc_aeAux.aE_ID)){ f_sendAcPrimitive("AE-ID_changed", oct2char(unichar2oct(vc_aeAux.aE_ID))); } else { @@ -218,54 +288,53 @@ module OneM2M_Functions { } } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) + { tc_ac.stop; - setverdict(inconc, "Preamble: Error while registering application"); + setverdict(inconc, __SCOPE__&":INFO: Error while registering application"); stop; } [] mcaPort.receive { tc_ac.stop; - setverdict(inconc, "Preamble: Unexpected message received"); + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); stop; } [] tc_ac.timeout { - setverdict(inconc, "Preamble: No answer while registering resource"); + setverdict(inconc, __SCOPE__&":INFO: No answer while registering resource"); stop; } } - + + f_checkCseTesterStatus(); return v_aeAuxIndex; - + } - - //Added by @Naum - function f_cse_preamble_createServiceSubscribedAppRule(in template ListOfM2MID p_allowedAEs := {""}, in template (value) AccessControlOperations p_allowedOperations := int63) runs on CseTester return integer {//c_CRUDNDi - - var MsgIn v_response; + + function f_cse_preamble_createServiceSubscribedAppRule(in template ListOfM2MID p_allowedAEs := {""}) runs on CseTester return integer {//c_CRUDNDi + var integer v_serviceSubscribedAppRuleIndex := -1; - var RequestPrimitive v_request; - + v_serviceSubscribedAppRuleIndex := f_cse_createResource(int19, m_createServiceSubscribedAppRule({"None"}, {PX_APP_ID}, valueof(p_allowedAEs))); - + return v_serviceSubscribedAppRuleIndex; - + } - - function f_cse_preamble_subscriptionVerification(out CseTester p_notifyHandler,in integer p_aeIndex, inout integer p_ae2Index, inout template RequestPrimitive p_createRequestPrimitive,in ResourceType p_resourceType ) runs on CseTester { + + function f_cse_preamble_subscriptionVerification(out CseTester p_notifyHandler,in integer p_aeIndex, inout integer p_ae2Index, inout template RequestPrimitive p_createRequestPrimitive,in ResourceType p_resourceType, in ResponseStatusCode p_responseStatusCode := int2001) runs on CseTester { if(p_resourceType == int23){ p_notifyHandler := CseTester.create("NotifyHandler") alive; - p_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", {"http://" & PX_TESTER_ADDRESS & "/"}), -1); // AE2 is registred - if(ischosen(p_createRequestPrimitive.primitiveContent.any_1[0].Subscription_optional)){ //this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced - p_createRequestPrimitive.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(p_ae2Index)}; + p_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", {f_getAnnouncementTargetPoA("HTTP", PX_AE2_ADDRESS, "")}), -1); // AE2 is registred + if(ischosen(p_createRequestPrimitive.primitiveContent.subscription)){ //this condition is necessary for Subscription TCs where notification URI is set in m_createSubscriptionAdvanced + p_createRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_ae2Index)}; } - p_notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(p_aeIndex))); + p_notifyHandler.start(f_cse_notifyProcedure_subscriptionVerificationHandler(p_aeIndex, p_responseStatusCode)); } } - + }//end group preambleFunctions - - group postambleFunctions { - + + group PostambleFunctions { + /** * @desc Deletion of all resources created during the test case execution. IUT gets clean and ready for next execution * @verdict @@ -273,44 +342,49 @@ module OneM2M_Functions { function f_cse_postamble_deleteResources() runs on CseTester { var integer i; var XSD.ID v_resourceAddress; - var MsgIn v_response; var RequestPrimitive v_request; - + if (PX_RUN_POSTAMBLE) { - + for(i := lengthof(vc_resourcesIndexToBeDeleted) -1; i >=0; i := i - 1) { v_resourceAddress := f_getResourceAddress(vc_resourcesIndexToBeDeleted[i]); v_request := valueof(m_deleteRequest(v_resourceAddress)); - - if(PX_FROM_IS_AE_ID){ - if(ischosen(vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional)) { - v_request.from_ := vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.any_1[0].AE_optional.aE_ID; - } - } + + //For deletion of AEs, priority is to use AE-ID in From parameter + //For other resources PX_SUPER_USER should be able to do DELETE operation + //TODO Replace below code by f_getOriginator + v_request.from_ := f_getOriginator(vc_resourcesIndexToBeDeleted[i]); +// if(PX_USE_RESOURCE_ID_AS_ORIGINATOR){ +// if(ischosen(vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.aE)) { +// v_request.from_ := vc_resourcesList[vc_resourcesIndexToBeDeleted[i]].resource.aE.aE_ID; +// } +// } + mcaPort.send(m_request(v_request)); - + tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; - log("Postamble: AE Resource deleted"); + log(__SCOPE__&" INFO: Resource " & v_request.to_ & " deleted"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - log("Postamble: Error while deleting resource"); + log(__SCOPE__&" INFO: Error while deleting resource " & v_request.to_); } [] tc_ac.timeout { - log("Postamble: No answer while deleting resource"); + log(__SCOPE__&" INFO: No answer while deleting resource " & v_request.to_); } } + } } - + f_cse_postamble_default(); } - + /** * @desc Default postamble * @verdict @@ -319,23 +393,23 @@ module OneM2M_Functions { } function f_is_component_done(in CseTester p_notifyHandler) runs on CseTester { - + tc_ac.start(10.0); alt { [] p_notifyHandler.done { tc_ac.stop; } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": Notify verification not received"); + setverdict(inconc, __SCOPE__ & "INFO: Notify verification not received"); } } } //end f_is_component_done - - + + }//end group postambleFunctions - - group helpingFunctions { - + + group HelpingFunctions { + /** * @desc Creation of a resource * @param p_resourceType Resource type of the resource to be created @@ -345,42 +419,41 @@ module OneM2M_Functions { * @verdict */ function f_cse_createResource(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on CseTester return integer { - + var MsgIn v_response; var RequestPrimitive v_request; - var XSD.ID v_resourceId; var integer v_resourceIndex := -1; - + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex); - + mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, "f_createResource: Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly"); - v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_parentIndex); - if(match(int2, p_resourceType) or match(-1, p_parentIndex)) {//If created resource is an AE or created under CSEBase, it needs to be added to the resourceToBeDeleted list - vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_resourceIndex}; - } + setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly"); + f_checkAttributesToBeSaved(p_resourceType, v_request, v_response.primitive.responsePrimitive); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, p_parentIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(inconc, "f_createResource: Error while creating resource type " & int2str(enum2int(p_resourceType))); + setverdict(inconc, __SCOPE__&":INFO: Error while creating resource type " & int2str(enum2int(p_resourceType))); } [] mcaPort.receive { tc_ac.stop; - setverdict(inconc, "f_createResource: Unexpected message received"); + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); } [] tc_ac.timeout { - setverdict(inconc, "f_createResource: No answer while creating resource type " & int2str(enum2int(p_resourceType))); + setverdict(inconc, __SCOPE__&":INFO: No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } - + + f_checkCseTesterStatus(); + return v_resourceIndex; - + } - + /** * @desc Creation of the auxiliar ACP resource * @param p_acpName ACP name @@ -392,39 +465,41 @@ module OneM2M_Functions { var RequestPrimitive v_request; var MsgIn v_response; var integer v_acpAuxIndex := -1; - + v_request := valueof(m_createAcpAux(p_acpName := p_acpName, p_allowedOperations := p_allowedOperations)); - + v_request.to_ := f_getResourceAddress(); - + mcaPort.send(m_request(v_request)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, "f_createAccessControlPolicy: Resource type " & int2str(1) & " created successfuly"); - v_acpAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent); + setverdict(pass, __SCOPE__&":INFO: Resource type " & int2str(1) & " created successfuly"); + f_checkAttributesToBeSaved(int1, v_request, v_response.primitive.responsePrimitive); + v_acpAuxIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1); vc_acpAuxIndex := v_acpAuxIndex; - vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_acpAuxIndex}; } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(inconc, "f_createAccessControlPolicy: Error while creating resource type " & int2str(1)); + setverdict(inconc, __SCOPE__&":INFO: Error while creating resource type " & int2str(1)); } [] mcaPort.receive { tc_ac.stop; - setverdict(inconc, "f_createAccessControlPolicy: Unexpected message received"); + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); } [] tc_ac.timeout { - setverdict(inconc, "f_createAccessControlPolicy: No answer while creating resource type " & int2str(1)); + setverdict(inconc, __SCOPE__&":INFO: No answer while creating resource type " & int2str(1)); } } - + + f_checkCseTesterStatus(); + return v_acpAuxIndex; - + } - - + + /** * @desc Creation of the auxiliar Container resource * @param p_parentIndex Internal resource index which indicates the parent of the Container resource to be created @@ -432,24 +507,23 @@ module OneM2M_Functions { * @verdict */ function f_cse_createContainerResourceAux (integer p_parentIndex := -1) runs on CseTester return integer { - - var MsgIn v_response; + var RequestPrimitive v_request; var integer v_acpAuxIndex := -1; var integer v_containerResourceIndex := -1; - + v_acpAuxIndex := f_cse_createAccessControlPolicyAux(p_acpName := c_acpAuxName);//"MyAcp_2" - + v_request := valueof(m_createContainerBase); - v_request.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}; - v_request.primitiveContent.any_1[0].Container_optional.resourceName := "MyContainerAux"; - + v_request.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}; + v_request.primitiveContent.container.resourceName := "MyContainerAux"; + v_containerResourceIndex := f_cse_createResource(int3, v_request, p_parentIndex); - + return v_containerResourceIndex; - + } - + /** * @desc * @param p_requestPrimitive @@ -463,224 +537,850 @@ module OneM2M_Functions { alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource updated successfuly"); + setverdict(pass, __SCOPE__&":INFO: Attribute of resource updated successfuly"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource"); + setverdict(inconc, __SCOPE__&":INFO: Error while updating resource"); } [] mcaPort.receive{ tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource"); + setverdict(inconc, __SCOPE__&":INFO: No answer while updating resource"); } } + + f_checkCseTesterStatus(); + }// end f_cse_updateResource - + /** - * @desc Update of the auxiliar ACP resource - * @param p_allowedOperations New allowed operations + * @desc + * @param p_resourceIndex * @verdict */ - function f_cse_updateAcpAuxResource (in template (value) AccessControlOperations p_allowedOperations) runs on CseTester { - var RequestPrimitive v_request; - - v_request := valueof(m_updateAcpBase); - - v_request.to_ := f_getResourceAddress(vc_acpAuxIndex); - v_request.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list := { - { - accessControlOriginators := PX_ACOR, //{"admin:admin"} - accessControlOperations := valueof(p_allowedOperations), - accessControlContexts_list := {} - } - }; - - mcaPort.send(m_request(v_request)); + function f_cse_retrieveResource(integer p_resourceIndex) runs on CseTester return PrimitiveContent{ + var MsgIn v_response; + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, "f_updateAcpAuxResource: " & v_request.to_ & " resource updated successfuly"); + setverdict(pass, __SCOPE__&":INFO: Resource retrieved successfuly"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Error while retrieving resource"); + } + [] mcaPort.receive{ tc_ac.stop; - setverdict(fail, "f_updateAcpAuxResource: Error while updating " & v_request.to_ & " resource"); + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); } [] tc_ac.timeout { - setverdict(inconc, "f_updateAcpAuxResource: No answer while updating " & v_request.to_ & " resource" ); + setverdict(inconc, __SCOPE__&":INFO: No answer while retrieving resource"); } - } - } - - function f_subscriptionVerificationHandler(in XSD.ID p_creator, in ResponseStatusCode v_responseStatusCode := int2001) runs on CseTester { - // Local variables - var MsgIn v_response; - var ResponsePrimitive v_responsePrimitive; - var template Notification v_notificationRequest := mw_contentNotificationBase; - var PrimitiveContent v_notificationResponse; // TODO Need to see if this parameter is required however there is a problem if it s omitted during the verification + } + + f_checkCseTesterStatus(); + + return v_response.primitive.responsePrimitive.primitiveContent; + + }// end f_cse_retrievingResource - map(self:mcaPort, system:mcaPort); - map(self:acPort, system:acPort); - - v_notificationResponse.any_1 := {{Notification := valueof(mw_contentNotificationAllOmit)}}; - - v_notificationRequest.verificationRequest := true; - v_notificationRequest.creator := p_creator; - //v_notificationRequest.subscriptionReference := "I Don't know which URI is expected"; // TODO mandatory parameter - v_responsePrimitive := valueof(m_responseNotification(v_responseStatusCode,v_notificationResponse));//TODO No PrimitiveContent is expected - - if(v_responseStatusCode != int2001){ - v_responsePrimitive.primitiveContent := omit; - } - - tc_ac.start; - alt { - [] mcaPort.receive(mw_request(mw_notify(v_notificationRequest))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Notification received"); - //mcaPort.send(m_response(p_responsePrimitive)); - } - [] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Notification received but verificationRequest isn't set to TRUE"); - } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No notification received"); + /** + * @desc + * @param p_requestPrimitive + * @verdict + */ + function f_cse_deleteResource(in integer p_index, in template (omit) RequestPrimitive p_requestPrimitive := omit) runs on CseTester { + var RequestPrimitive v_request; + + if(not isvalue(p_requestPrimitive)) { + v_request := valueof(m_deleteRequest(f_getResourceAddress(p_index))); + } else { + v_request := valueof(p_requestPrimitive); } + + mcaPort.send(m_request(v_request)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(pass, __SCOPE__&"INFO: Resource " & v_request.to_ & " deleted"); + + f_removeElementFromList(vc_resourcesIndexToBeDeleted, p_index); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(inconc, __SCOPE__&"INFO: Error while deleting resource " & v_request.to_); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&"INFO: No answer while deleting resource " & v_request.to_); + } + } + + f_checkCseTesterStatus(); + + }// end f_cse_deleteResource + + /** + * @desc Check that a resource is present in the IUT (resourceId is known) + * @param p_resourceIndex Resource index + * @return boolean + */ + function f_isResourcePresent (integer p_resourceIndex) runs on CseTester return boolean { + + //Check to see if the resource is present or not + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource present: " & f_getResourceAddress(p_resourceIndex)); + return true; + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(?, -))) { + tc_ac.stop; + setverdict(inconc, testcasename() & ": Wrong response status code in the response"); + return false; + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + return false; + } + } + return false; } - - mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted - - unmap(self:mcaPort, system:mcaPort); - unmap(self:acPort, system:acPort); - - } //end f_subscriptionVerificationHandler + + /** + * @desc Check that a resource is not present in the IUT (resourceId is NOT known) + * @param p_parentIndex Index of the parent resource + * @param p_resourceName Resource name (Hierarchical method is used) + * @return boolean + */ + function f_isResourceNotPresent (integer p_parentIndex, XSD.String p_resourceName) runs on CseTester return boolean { + + log(testcasename() & ":INFO: Hierarchical method is required to check the non presence of the resource"); + vc_addressingMethod := e_hierarchical; + //Check to see if the resource has NOT been created + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_parentIndex) & "/" & p_resourceName, f_getOriginator(p_parentIndex)))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource not present"); + vc_addressingMethod := PX_ADDRESSING_METHOD; + return true; + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(?))) { + tc_ac.stop; + setverdict(inconc, testcasename() & ": Wrong response status code in the response"); + vc_addressingMethod := PX_ADDRESSING_METHOD; + return false; + } + [] tc_ac.timeout { + setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + vc_addressingMethod := PX_ADDRESSING_METHOD; + return false; + } + } + return false; + } + + /** + * @desc Update of the auxiliar ACP resource + * @param p_allowedOperations New allowed operations + * @verdict + */ + function f_cse_updateAcpAuxResource (in template (value) AccessControlOperations p_allowedOperations) runs on CseTester { + var RequestPrimitive v_request; + + v_request := valueof(m_updateAcpBase); + + v_request.to_ := f_getResourceAddress(vc_acpAuxIndex); + v_request.from_ := f_getOriginator(vc_acpAuxIndex); + v_request.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {valueof(m_createAcr(PX_ACOR, p_allowedOperations))}; + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: " & v_request.to_ & " resource updated successfuly"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Error while updating " & v_request.to_ & " resource"); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while updating " & v_request.to_ & " resource" ); + } + } + + f_checkCseTesterStatus(); + } + + /** + * @desc Function to handle announcement of resources + * @param p_from + * @param p_to + * @verdict + */ + //TODO To finalize this function + function f_cse_resourceAnnouncementHandler(template XSD.ID p_from := *, template XSD.ID p_to := ?) runs on CseTester { + // Local variables + var MsgIn v_request; + var ResponsePrimitive v_responsePrimitive; + + map(self:mccPort, system:mccPort); + map(self:acPort, system:acPort); - function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on CseTester return boolean{ - // Local variables - var boolean v_matchResult := false; - var integer i; - var integer v_numberOfAggregatedNotification; + tc_ac.start; + alt { + [] mcaPort.receive(mw_request(mw_create(p_from, p_to))) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ":INFO: Announcement received"); + v_responsePrimitive := f_getCreateResponsePrimitive(v_request.primitive.requestPrimitive.resourceType, v_request.primitive.requestPrimitive); + mcaPort.send(m_response(v_responsePrimitive)); + } + [] mcaPort.receive{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No announcement received"); + } + } - if (ischosen(p_primitiveContent.any_1[0].AE_optional)){ - if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.resource)) { - v_matchResult := match(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.resource.AE_optional, p_primitiveContent.any_1[0].AE_optional) + unmap(self:mccPort, system:mccPort); + unmap(self:acPort, system:acPort); + + } //end f_cse_resourceAnnouncementHandler + + function f_checkAttributesToBeSaved (ResourceType p_resourceType, RequestPrimitive p_request, inout ResponsePrimitive p_response) { + select (p_resourceType) { + case (int1) { + if(isvalue(p_response.primitiveContent.accessControlPolicy) and + not(ispresent(p_response.primitiveContent.accessControlPolicy.resourceName))) { + p_response.primitiveContent.accessControlPolicy.resourceName := p_request.primitiveContent.accessControlPolicy.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.accessControlPolicy.resourceName) + } + } + case (int2) { + if(isvalue(p_response.primitiveContent.aE) and + not(ispresent(p_response.primitiveContent.aE.resourceName))) { + p_response.primitiveContent.aE.resourceName := p_request.primitiveContent.aE.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.aE.resourceName) + } + } + case (int3) { + if(isvalue(p_response.primitiveContent.container) and + not(ispresent(p_response.primitiveContent.container.resourceName))) { + p_response.primitiveContent.container.resourceName := p_request.primitiveContent.container.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.container.resourceName) + } + } + case (int4) { + if(isvalue(p_response.primitiveContent.contentInstance) and + not(ispresent(p_response.primitiveContent.contentInstance.resourceName))) { + p_response.primitiveContent.contentInstance.resourceName := p_request.primitiveContent.contentInstance.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.contentInstance.resourceName) + } + } + case (int15) { + if (isvalue(p_response.primitiveContent.pollingChannel) and + not(ispresent(p_response.primitiveContent.pollingChannel.resourceName))) { + p_response.primitiveContent.pollingChannel.resourceName := p_request.primitiveContent.pollingChannel.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.pollingChannel.resourceName) + } + } + case (int16) { + if (isvalue(p_response.primitiveContent.remoteCSE) and + not(ispresent(p_response.primitiveContent.remoteCSE.resourceName))) { + p_response.primitiveContent.remoteCSE.resourceName := p_request.primitiveContent.remoteCSE.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.remoteCSE.resourceName) + } + } + case (int18) { + if (isvalue(p_response.primitiveContent.schedule) and + not(ispresent(p_response.primitiveContent.schedule.resourceName))) { + p_response.primitiveContent.schedule.resourceName := p_request.primitiveContent.schedule.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.schedule.resourceName) + } + } + case (int23) { + if (isvalue(p_response.primitiveContent.subscription) and + not(ispresent(p_response.primitiveContent.subscription.resourceName))) { + p_response.primitiveContent.subscription.resourceName := p_request.primitiveContent.subscription.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.subscription.resourceName) + } + } + case (int9) { + if (isvalue(p_response.primitiveContent.group_) and + not(ispresent(p_response.primitiveContent.group_.resourceName))) { + p_response.primitiveContent.group_.resourceName := p_request.primitiveContent.group_.resourceName; + log(__SCOPE__ & ":INFO: resourceName not returned. Using the one provided in the request: " & p_request.primitiveContent.group_.resourceName) + } + } + case else { + log(__SCOPE__&":WARNING: Resource Type "&int2str(enum2int(p_resourceType))&" not implemented"); + } } - else if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.responsePrimitive)) { - v_matchResult :=match(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.responsePrimitive.primitiveContent.any_1[0].AE_optional, p_primitiveContent.any_1[0].AE_optional) + + // TODO test that if the resource name is returned is the same resource name as used in the create message + } + + function f_compareURIs(in integer p_expectedURIIndex, in XSD.ID p_receivedURI) runs on CseTester return boolean{ + // Local variables + var boolean v_matchResult := false; + + if (f_isNonHierarchical(p_receivedURI)) { + vc_addressingMethod := e_nonHierarchical; + } else if (f_isHierarchical(p_receivedURI)) { + vc_addressingMethod := e_hierarchical; + } + if (f_isScopeCseRelative(p_receivedURI)) { + vc_primitiveScope := e_cseRelative; + } + if (f_isScopeSpRelative(p_receivedURI)) { + vc_primitiveScope := e_spRelative; } - else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification)) { + if (f_isScopeAbsolute(p_receivedURI)) { + vc_primitiveScope := e_absolute; + } + + if(match(f_getResourceAddress(p_expectedURIIndex), p_receivedURI)) { v_matchResult := true; - v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list); - for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){ - if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list[i].notificationEvent.representation.resource)) { - if(not (match(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list[i].notificationEvent.representation.resource.AE_optional, p_primitiveContent.any_1[0].AE_optional))){ - v_matchResult := false; + } else { + v_matchResult := false; + } + + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + vc_addressingMethod := PX_ADDRESSING_METHOD; + + return v_matchResult; + + } //end f_compareURIs + + group NotificationFunctions { + + function f_cse_notifyProcedure_subscriptionVerificationHandler(in integer p_creatorIndex, in ResponseStatusCode p_responseStatusCode := int2001) runs on CseTester { + // Local variables + var MsgIn v_request; + var ResponsePrimitive v_responsePrimitive; + var template Notification v_notificationRequest := mw_contentNotificationVerification; + + map(self:mcaPort, system:mcaPort); + map(self:acPort, system:acPort); + + //Preparation of expected Notification verification + //TODO To add checks for creator and subscription reference + //v_notificationRequest.creator := p_creator; TODO To check what address format is to be expected + //Some participants use SP relative UNSTRUCTURED + //v_notificationRequest.subscriptionReference := "I Don't know which URI is expected"; // TODO mandatory parameter + + //Preparation of Notification response to be sent + v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_request(mw_notify(valueof(v_notificationRequest)))) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + v_responsePrimitive.requestIdentifier := v_request.primitive.requestPrimitive.requestIdentifier; +// if(f_isHierarchical(v_request.primitive.requestPrimitive.primitiveContent.notification.creator)) { +// setverdict(fail, __SCOPE__ & ": Creator cannot contain a hierarchical address"); +// v_responsePrimitive.responseStatusCode := int4000; +// } +// if(f_compareURIs(p_creatorIndex, v_request.primitive.requestPrimitive.primitiveContent.notification.creator)) { +// setverdict(pass, __SCOPE__ & ": Creator set to originator of the subscription creation primitive"); +// } else { +// setverdict(fail, __SCOPE__ & ": Creator not set to originator of the subscription creation primitive"); +// v_responsePrimitive.responseStatusCode := int4000; +// } + mcaPort.send(m_httpResponse(v_responsePrimitive)); + } + [] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_request { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: Notification received but verificationRequest isn't set to TRUE"); + } + [] mcaPort.receive{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No notification received"); + } + } + + //mcaPort.send(m_response(v_responsePrimitive)); // TODO have to be deleted + + unmap(self:mcaPort, system:mcaPort); + unmap(self:acPort, system:acPort); + + } //end f_subscriptionVerificationHandler + + function f_cse_notifyProcedure_representationHandler(template PrimitiveContent p_primitiveContent) runs on CseTester { + // Local variables + var MsgIn v_request; + + map(self:mcaPort, system:mcaPort); + map(self:acPort, system:acPort); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_request { + tc_ac.stop; + if(f_check_notificationContent(v_request.primitive.requestPrimitive, p_primitiveContent)){ + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + mcaPort.send(m_response(valueof(m_responseNotification(int2001)))); + } + else{ + setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match"); } } - else if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive)) { - if(not (match(p_requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.any_1[0].AE_optional, p_primitiveContent.any_1[0].AE_optional))){ - v_matchResult := false; + [] mcaPort.receive{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No notification received"); + } + } + + + unmap(self:mcaPort, system:mcaPort); + unmap(self:acPort, system:acPort); + + } //end f_cse_notifyProcedure_representationHandler + + function f_cse_notifyProcedure_aggregatedNoficationHandler(template PrimitiveContent p_primitiveContent,in integer p_numberOfAggregatedNotification) runs on CseTester { + // Local variables + var MsgIn v_response; + + map(self:mcaPort, system:mcaPort); + map(self:acPort, system:acPort); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_request(mw_aggregatedNotifyBase)) -> value v_response { + tc_ac.stop; + if(p_numberOfAggregatedNotification == lengthof(v_response.primitive.requestPrimitive.primitiveContent.aggregatedNotification.notification_list)){ + if(f_check_notificationContent(v_response.primitive.requestPrimitive, p_primitiveContent)){ + setverdict(pass, __SCOPE__ & ": Notification received"); + } + else{ + setverdict(fail, __SCOPE__ & ": Notification received but the content doesn't match"); + } } - } + else { + setverdict(fail, __SCOPE__ & ": Number of Notification in Aggregatednotification isn't right"); + } + } + [] mcaPort.receive{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No notification received"); + } } - if (i == 0){ - v_matchResult := false; + + unmap(self:mcaPort, system:mcaPort); + unmap(self:acPort, system:acPort); + + } //end f_cse_notifyProcedure_aggregatedNotificationHandler + + function f_cse_notifyProcedure_subscriptionDeletionHandler( template PrimitiveContent p_primitiveContent) runs on CseTester { + var MsgIn v_response; + + map(self:mcaPort, system:mcaPort); + map(self:acPort, system:acPort); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response { + tc_ac.stop; + mcaPort.send(m_response(valueof(m_responseNotification(int2001)))); + if(not(match(v_response.primitive.requestPrimitive.primitiveContent.notification.subscriptionDeletion, true))) { + setverdict(fail, __SCOPE__ & ":ERROR: subscriptionDeletion attribute have to be set to TRUE"); + } + if(f_check_notificationContent(v_response.primitive.requestPrimitive, p_primitiveContent)){ + setverdict(pass, __SCOPE__ & ":INFO: Notification received"); + } + else{ + setverdict(fail, __SCOPE__ & ":ERROR: Notification received but the content doesn't match"); + } + } + [] mcaPort.receive{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ":ERROR: unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ":ERROR: No notification received"); + } } - } - - } + + unmap(self:mcaPort, system:mcaPort); + unmap(self:acPort, system:acPort); - if (ischosen(p_primitiveContent.any_1[0].Container_optional)){ - if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.resource)) { - v_matchResult := match(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.resource.Container_optional, p_primitiveContent.any_1[0].Container_optional) - } - else if(ischosen(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.responsePrimitive)) { - v_matchResult := match(p_requestPrimitive.primitiveContent.any_1[0].Notification.notificationEvent.representation.responsePrimitive.primitiveContent.any_1[0].Container_optional, p_primitiveContent.any_1[0].Container_optional) - } - } + } //end f_cse_notifyProcedure_subscriptionDeletionHandler + + function f_cse_notifyProcedure_noNotificationHandler() runs on CseTester { + // Local variables + var MsgIn v_response; - return v_matchResult; - - } //end f_check_notificationContent + map(self:mcaPort, system:mcaPort); + map(self:acPort, system:acPort); - function f_cse_notifyProcedure(template PrimitiveContent p_primitiveContent) runs on CseTester { - // Local variables - var MsgIn v_response; + tc_ac.start(10.0); + alt { + [] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, Non expected notification received"); + } + [] tc_ac.timeout { + setverdict(pass, __SCOPE__ & ": No notification received"); + } + } + + unmap(self:mcaPort, system:mcaPort); + unmap(self:acPort, system:acPort); + + } //end f_cse_notifyProcedure_noNotification Handler + + function f_check_notificationContent(in RequestPrimitive p_requestPrimitive, template PrimitiveContent p_primitiveContent) runs on CseTester return boolean{ + // Local variables + var boolean v_matchResult := false; + var integer i; + var integer v_numberOfAggregatedNotification; + + if (ischosen(p_primitiveContent.aE)){ + if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource)) { + v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.aE, p_primitiveContent.aE) + } + else if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive)) { + v_matchResult :=match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE) + } + else if (ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification)) { + v_matchResult := true; + v_numberOfAggregatedNotification := lengthof(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list); + for(i := 0; i< v_numberOfAggregatedNotification; i := i + 1){ + if(ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource)) { + if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.resource.aE, p_primitiveContent.aE))){ + v_matchResult := false; + } + } + else if(ischosen(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive)) { + if(not (match(p_requestPrimitive.primitiveContent.aggregatedNotification.notification_list[i].notificationEvent.representation.responsePrimitive.primitiveContent.aE, p_primitiveContent.aE))){ + v_matchResult := false; + } + } + } + if (i == 0){ + v_matchResult := false; + } + } - map(self:mcaPort, system:mcaPort); - map(self:acPort, system:acPort); + } + + if (ischosen(p_primitiveContent.container)){ + if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource)) { + v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.resource.container, p_primitiveContent.container) + } + else if(ischosen(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive)) { + v_matchResult := match(p_requestPrimitive.primitiveContent.notification.notificationEvent.representation.responsePrimitive.primitiveContent.container, p_primitiveContent.container) + } + } + + return v_matchResult; - tc_ac.start; - alt { - [] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response { - tc_ac.stop; - if(f_check_notificationContent(v_response.primitive.requestPrimitive, p_primitiveContent)){ - setverdict(pass, testcasename() & ": Notification received"); - mcaPort.send(m_response(valueof(m_responseNotification(int2001)))); + } //end f_check_notificationContent + + }// end of group NotificationFunctions + + /** + * @desc It determines whether the addressing method of the given address is non-hierarchical. Not valid for CSE-Base as target + * @param p_resourceAddress + * @return boolean + */ + function f_isNonHierarchical(XSD.ID p_resourceAddress) runs on Tester return boolean { + var integer i; + var integer v_nbOfSlashes:= 0; + + for (i := 0; i < lengthof(p_resourceAddress); i:= i+1){ + if(match (p_resourceAddress[i], "/")){ + v_nbOfSlashes:= v_nbOfSlashes+1; + } + } + + if(f_isScopeCseRelative(p_resourceAddress)) { + if(v_nbOfSlashes == 0 ) { + return true; + } else { + return false; } - else{ - setverdict(fail, testcasename() & ": Notification received but the content doesn't match"); + + } else if (f_isScopeSpRelative(p_resourceAddress)){ + if(v_nbOfSlashes == 2 ) { + return true; + } else { + return false; + } + } else if (f_isScopeAbsolute(p_resourceAddress)){ + if(v_nbOfSlashes == 4 ) { + return true; + } else { + return false; } + } else { + return false; } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + } + + + /** + * @desc It determines whether the addressing method of the given address is hierarchical. Not valid for CSE-Base as target + * @param p_resourceAddress + * @return boolean + */ + function f_isHierarchical(XSD.ID p_resourceAddress) runs on Tester return boolean { + if(f_isNonHierarchical(p_resourceAddress)) { + return false; + } else { + return true; + } + } + + /** + * @desc It determines whether the primitive scope of the given address is CSE-Relative + * @param p_resourceAddress + * @return boolean + */ + function f_isScopeCseRelative(XSD.ID p_resourceAddress) runs on Tester return boolean { + if (p_resourceAddress[0] != "/") { + return true; + } else { + return false; + } + } + + /** + * @desc It determines whether the primitive scope of the given address is SP-Relative + * @param p_resourceAddress + * @return boolean + */ + function f_isScopeSpRelative(XSD.ID p_resourceAddress) runs on Tester return boolean { + if ((p_resourceAddress[0] == "/") and (p_resourceAddress[1] != "/")){ + return true; + } else { + return false; } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No notification received"); + } + + /** + * @desc It determines whether the primitive scope of the given address is Absolute + * @param p_resourceAddress + * @return boolean + */ + function f_isScopeAbsolute(XSD.ID p_resourceAddress) runs on Tester return boolean { + if ((p_resourceAddress[0] == "/") and (p_resourceAddress[1] == "/")) { + return true; + } else { + return false; } } - - - unmap(self:mcaPort, system:mcaPort); - unmap(self:acPort, system:acPort); - - } //end f_cse_notifyProcedure + + /** + * @desc Registration of Test System (simulating a CSE) to the CSE IUT (creation of remoteCSE) + * @param p_requestPrimitive Template request primitive + * @return Internal resource index of the created resource + */ + function f_cse_registerRemoteCse(in template RequestPrimitive p_requestPrimitive) runs on CseTester return integer { + + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_resourceIndex := -1; + + v_request := f_getCreateRequestPrimitive(int16, p_requestPrimitive, -1); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: Resource type RemoteCSE created successfuly"); + f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16, -1); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Error while creating resource type RemoteCSE"); + } + [] mccPort.receive { + tc_ac.stop; + setverdict(inconc, __SCOPE__&":INFO: Unexpected message received"); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while creating resource type RemoteCSE"); + } + } + + f_checkCseTesterStatus(); + + return v_resourceIndex; - + } + + }//end group helpingFunctions - - group altstepFunctions { - + + group CseAltstepFunctions { + /** * @desc Cse altstep for config 01 */ altstep a_cse_cf01() runs on CseTester { [] mcaPort.receive { - log("a_default: WARNING: Unexpected message received"); + log(__SCOPE__&": WARNING: Unexpected message received"); repeat; } } - + /** * @desc Cse altstep for config 02 */ altstep a_cse_cf02() runs on CseTester { - + [] mcaPort.receive { - log("a_default: WARNING: Unexpected message received"); + log(__SCOPE__&": WARNING: Unexpected message received"); + repeat; + } + [] mccPort.receive { + log(__SCOPE__&": WARNING: Unexpected message received"); repeat; } + } + + /** + * @desc Cse altstep for config 04 + */ + altstep a_cse_cf04() runs on CseTester { + [] mccPort.receive { - log("a_default: WARNING: Unexpected message received"); + log(__SCOPE__&": WARNING: Unexpected message received"); repeat; } - } + } }//end group altstepFunctions - + }//end cseFunctions - group aeFunctions { + group AeFunctions { + + group preambleFunctions { + + /** + * @desc Waits for AE registration request and process it + * @return Internal resource index of AE or -1 in case of failure + * @verdict inconc if no AE registration request is received + */ + function f_ae_preamble_registerAe() runs on AeTester return integer { + + var MsgIn v_request; + var PrimitiveContent v_modifiedResource; + var integer v_resourceIndex, v_parentIndex; + var RequestPrimitive v_rp; + + tc_ac.start; + alt { + [] mcaPort.receive(mw_request(mw_createAe)) -> value v_request { + tc_ac.stop; + + v_rp := v_request.primitive.requestPrimitive; + v_parentIndex := f_getResourceIndex(v_rp.to_); + v_resourceIndex := f_ae_createResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType, v_modifiedResource); + if(v_resourceIndex != -1) { + mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource))); + setverdict(pass, __SCOPE__&":INFO: Application registered successfuly"); + } + else { + mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))); + setverdict(inconc, __SCOPE__&":INFO: AE registration failed"); + } + } + + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: AE registration request not received"); + stop; + } + } + + f_checkAeTesterStatus(); + + return v_resourceIndex; + } + + } // end preambleFunctions + + group helpingFunctions { + + /** + * @desc Creates specified resource + * @param p_resource Resource to be created + * @param p_parentIndex Parent index of resource to be saved + * @param p_resourceType Type of the resource to be created + * @param p_modifiedResource Assigned and/or modified fields + * @return Internal resource index of the saved resource or -1 + */ + function f_ae_createResource(in PrimitiveContent p_resource, in integer p_parentIndex, in ResourceType p_resourceType, out PrimitiveContent p_modifiedResource) runs on AeTester return integer { + + var integer v_resourceIndex; + + // AE TODO To review the code (use of indexes, generation of value for certain attributes, etc..) + if(p_resourceType == int2 and ispresent(p_resource)) { + if(ischosen(p_resource.aE)){ + var AE_optional v_ae := p_resource.aE; + var AE_optional v_aeModified; + + v_resourceIndex := lengthof(vc_resourcesList) - 1; + v_ae.resourceType := p_resourceType; + + v_ae.parentID := int2str(p_parentIndex); + v_ae.creationTime := fx_generateTimestamp(); + v_ae.lastModifiedTime := v_ae.creationTime; + v_ae.resourceID := "ae" & int2char(v_resourceIndex); + v_ae.aE_ID := "ae" & int2char(v_resourceIndex); + v_ae.resourceName := "ae" & int2char(v_resourceIndex); + + v_aeModified.parentID := v_ae.parentID; + v_aeModified.creationTime := v_ae.creationTime; + v_aeModified.lastModifiedTime := v_ae.lastModifiedTime; + v_aeModified.resourceID := v_ae.resourceID; + v_aeModified.aE_ID := v_ae.aE_ID; + v_aeModified.resourceName := v_ae.resourceName; + + p_resource.aE := v_ae; + p_modifiedResource.aE := v_aeModified; + return f_setResource(p_resource, p_resourceType, p_parentIndex); + + } + + } + + // TODO: implement other resource types + + // Error + return -1; + } + + } // end helpingFunctions group altstepFunctions { @@ -688,20 +1388,56 @@ module OneM2M_Functions { * @desc Ae altstep */ altstep a_ae_default() runs on AeTester { - + + var MsgIn v_request; + + [] mcaPort.receive(mw_request(?)) -> value v_request { + log(__SCOPE__ & ":WARNING: Unexpected request received"); + mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))); + repeat; + } + [] mcaPort.receive { - log("a_default: WARNING: Unexpected message received"); + log(__SCOPE__ & ":WARNING: Unexpected message received"); repeat; } } + + /** + * @desc Waits for CREATE request, stores resource and replies to request + * @remark This altstep includes a_ae_default + * @see a_ae_default + */ + altstep a_ae_cf03() runs on AeTester { + + var MsgIn v_request; + var PrimitiveContent v_modifiedResource; + var integer v_resourceIndex, v_parentIndex; + var RequestPrimitive v_rp; + + [] mcaPort.receive(mw_request(mw_create)) -> value v_request { + v_rp := v_request.primitive.requestPrimitive; + v_parentIndex := f_getResourceIndex(v_rp.to_); + v_resourceIndex := f_ae_createResource(v_rp.primitiveContent, v_parentIndex, v_rp.resourceType, v_modifiedResource); + if(v_resourceIndex != -1) { + mcaPort.send(m_response(m_responsePrimitive_content(int2001, v_rp.requestIdentifier, v_modifiedResource))); + } + else { + mcaPort.send(m_response(m_responsePrimitive(int5000, v_request.primitive.requestPrimitive.requestIdentifier))); + } + repeat; + } + + [] a_ae_default(); + } }//end group altstepFunctions }//end of aeFunctions - group getSetFunctions { - + group GetSetFunctions { + /** * @desc Creation of a CREATE request primitive from a template request primitive * @param p_resourceType Type of resource to be created @@ -711,55 +1447,114 @@ module OneM2M_Functions { * @verdict */ function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on CseTester return RequestPrimitive { - var integer p_locresourceIndex := p_parentIndex; - var template ListOfURIs v_defaultListOfURIs := {"Not Initialized"}; - - p_request.from_ := f_getOriginator(p_parentIndex); + var template ListOfURIs v_defaultListOfURIs := {"NotInitialized"}; + var template AcpType v_defaultAcpIDs := {"NotInitialized"}; + + if(p_resourceType != int2) { + p_request.from_ := f_getOriginator(p_parentIndex); + } p_request.to_ := f_getResourceAddress(p_parentIndex); - + if (p_resourceType == int1) {//AccessControlPolicy + } if (p_resourceType == int9) {//group - if(match(valueof(p_request.primitiveContent.any_1[0].Group_optional.memberIDs), v_defaultListOfURIs )){ - p_request.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(p_parentIndex)}; + if(match(valueof(p_request.primitiveContent.group_.memberIDs), v_defaultListOfURIs )){ + p_request.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[p_parentIndex].resource)}; } } if(p_resourceType == int3){//container //when a container is created by hosting cse for storing location information, the container is seen as a location container if(PX_IS_LOC_CONTAINER){ - p_request.primitiveContent.any_1[0].Container_optional.locationID := f_getResourceId(vc_resourcesList[p_locresourceIndex].resource);//resourceID of the locationPolicy - } + p_request.primitiveContent.container.locationID := f_getResourceId(vc_resourcesList[p_parentIndex].resource);//resourceID of the locationPolicy + } + if(ispresent(p_request.primitiveContent.container.accessControlPolicyIDs)) { + if(match(valueof(p_request.primitiveContent.container.accessControlPolicyIDs), v_defaultAcpIDs )){ + p_request.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}; + } + } } if (p_resourceType == int15) {//pollingChannel - if(ischosen(vc_resourcesList[p_parentIndex].resource.any_1[0].AE_optional)) { - p_request.from_ := vc_resourcesList[p_parentIndex].resource.any_1[0].AE_optional.aE_ID; + if(ischosen(vc_resourcesList[p_parentIndex].resource.aE)) { + p_request.from_ := vc_resourcesList[p_parentIndex].resource.aE.aE_ID; } } if (p_resourceType == int18) {//schedule } - + if (p_resourceType == int23) {//subscription - if(match(valueof(p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI), v_defaultListOfURIs )){ - p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(p_parentIndex)}; + //notificationURI + if(match(valueof(p_request.primitiveContent.subscription.notificationURI), v_defaultListOfURIs )){ + p_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_parentIndex)}; } - /*if(PX_FROM_IS_AE_ID) { - if(PX_UNSTRUCTURED){ - p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {vc_aeAux.aE_ID}; - } else { - p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {PX_CSE_ID & "/" & vc_aeAux.aE_ID}; - } - } else { - p_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {"/" & PX_CSE_NAME & "/" & PX_AEAUX_NAME};//c_aeAuxName - }*/ + //creator attribute + if(ispresent(p_request.primitiveContent.subscription.creator)) { + p_request.primitiveContent.subscription.creator := f_getCreator(p_parentIndex); + } + //accessControlPolicyIds + if(ispresent(p_request.primitiveContent.subscription.accessControlPolicyIDs)) { + if(match(valueof(p_request.primitiveContent.subscription.accessControlPolicyIDs), v_defaultAcpIDs )){ + p_request.primitiveContent.subscription.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[vc_acpAuxIndex].resource)}; + } + } + } + if (p_resourceType == int4) {//contentInstance + //creator attribute + if(ispresent(p_request.primitiveContent.contentInstance.creator)) { + p_request.primitiveContent.contentInstance.creator := f_getCreator(p_parentIndex); + } + } + + return valueof(p_request); + } + + /** + * @desc Creation of a CREATE response primitive from a template request primitive + * @param p_resourceType Type of resource to be created + * @param p_request Template request primitive + * @return Created CREATE response primitive + * @verdict + */ + //TODO To be completed + function f_getCreateResponsePrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create) runs on CseTester return ResponsePrimitive { + var template ResponsePrimitive v_responsePrimitive; + + if(p_resourceType != int2) { + v_responsePrimitive.from_ := p_request.to_; + } + p_request.to_ := p_request.from_; + + if (p_resourceType == int1) {//AccessControlPolicy + + } + + if (p_resourceType == int9) {//group + + } + + if(p_resourceType == int3){//container + + } + + if (p_resourceType == int15) {//pollingChannel + + } + + if (p_resourceType == int18) {//schedule + } + + if (p_resourceType == int23) {//subscription + + } - - return valueof(p_request); + + return valueof(v_responsePrimitive); } - + /** * @desc Creation of an UPDATE request primitive from a template request primitive * @param p_resourceType Type of resource to be created @@ -769,37 +1564,37 @@ module OneM2M_Functions { * @verdict */ function f_getUpdateRequestPrimitive(in ResourceType p_resourceType, integer p_resourceIndex, template RequestPrimitive p_request) runs on CseTester return RequestPrimitive { - + p_request.from_ := f_getOriginator(p_resourceIndex); - + p_request.to_ := f_getResourceAddress(p_resourceIndex); - + if (p_resourceType == int3) {//Container - + //TODO } - + if (p_resourceType == int9) {//group //TODO - + } - + if (p_resourceType == int18) {//schedule //TODO - + } - + if (p_resourceType == int15) {//pollingChannel //TODO } - + if (p_resourceType == int23) {//subscription //TODO } - + return valueof(p_request); } - + /** * @desc Extraction from a primitiveContent field the resourceID attribute * @param p_contentResource primitiveContent field @@ -807,32 +1602,40 @@ module OneM2M_Functions { * @verdict */ function f_getResourceId(PrimitiveContent p_contentResource) return XSD.ID { - - if(ischosen(p_contentResource.any_1[0].AccessControlPolicy_optional)) { - return p_contentResource.any_1[0].AccessControlPolicy_optional.resourceID; + + if(ischosen(p_contentResource.accessControlPolicy)) { + return f_resourceIdCleaner(p_contentResource.accessControlPolicy.resourceID); } - if(ischosen(p_contentResource.any_1[0].Container_optional)) { - return p_contentResource.any_1[0].Container_optional.resourceID; + if(ischosen(p_contentResource.container)) { + return f_resourceIdCleaner(p_contentResource.container.resourceID); } - if(ischosen(p_contentResource.any_1[0].Schedule_optional)) { - return p_contentResource.any_1[0].Schedule_optional.resourceID; + if(ischosen(p_contentResource.contentInstance)) { + return f_resourceIdCleaner(p_contentResource.contentInstance.resourceID); } - if(ischosen(p_contentResource.any_1[0].PollingChannel_optional)) { - return p_contentResource.any_1[0].PollingChannel_optional.resourceID; + if(ischosen(p_contentResource.schedule)) { + return f_resourceIdCleaner(p_contentResource.schedule.resourceID); } - if(ischosen(p_contentResource.any_1[0].Subscription_optional)) { - return p_contentResource.any_1[0].Subscription_optional.resourceID; + if(ischosen(p_contentResource.pollingChannel)) { + return f_resourceIdCleaner(p_contentResource.pollingChannel.resourceID); } - if(ischosen(p_contentResource.any_1[0].Group_optional)) { - return p_contentResource.any_1[0].Group_optional.resourceID; + if(ischosen(p_contentResource.subscription)) { + return f_resourceIdCleaner(p_contentResource.subscription.resourceID); } - if(ischosen(p_contentResource.any_1[0].AE_optional)) { - return p_contentResource.any_1[0].AE_optional.resourceID; + if(ischosen(p_contentResource.group_)) { + return f_resourceIdCleaner(p_contentResource.group_.resourceID); } - return "1"; - + if(ischosen(p_contentResource.aE)) { + return f_resourceIdCleaner(p_contentResource.aE.resourceID); + } + if(ischosen(p_contentResource.serviceSubscribedAppRule)) { + return f_resourceIdCleaner(p_contentResource.serviceSubscribedAppRule.resourceID); + } + log(__SCOPE__&":WARNING: Primitive Content Kind not implemented"); + + return "resourceIDNotFound"; + } - + /** * @desc Extraction from a primitiveContent field the resourceName attribute * @param p_contentResource primitiveContent field @@ -840,33 +1643,40 @@ module OneM2M_Functions { * @verdict */ function f_getResourceName(PrimitiveContent p_contentResource) return XSD.ID { - - if(ischosen(p_contentResource.any_1[0].AccessControlPolicy_optional)) { - return p_contentResource.any_1[0].AccessControlPolicy_optional.resourceName; + + if(ischosen(p_contentResource.accessControlPolicy)) { + return p_contentResource.accessControlPolicy.resourceName; } - if(ischosen(p_contentResource.any_1[0].Container_optional)) { - return p_contentResource.any_1[0].Container_optional.resourceName; + if(ischosen(p_contentResource.container)) { + return p_contentResource.container.resourceName; } - if(ischosen(p_contentResource.any_1[0].Schedule_optional)) { - return p_contentResource.any_1[0].Schedule_optional.resourceName; + if(ischosen(p_contentResource.contentInstance)) { + return p_contentResource.contentInstance.resourceName; } - if(ischosen(p_contentResource.any_1[0].PollingChannel_optional)) { - return p_contentResource.any_1[0].PollingChannel_optional.resourceName; + if(ischosen(p_contentResource.schedule)) { + return p_contentResource.schedule.resourceName; } - if(ischosen(p_contentResource.any_1[0].Subscription_optional)) { - return p_contentResource.any_1[0].Subscription_optional.resourceName; + if(ischosen(p_contentResource.pollingChannel)) { + return p_contentResource.pollingChannel.resourceName; } - if(ischosen(p_contentResource.any_1[0].Group_optional)) { - return p_contentResource.any_1[0].Group_optional.resourceName; + if(ischosen(p_contentResource.subscription)) { + return p_contentResource.subscription.resourceName; } - if(ischosen(p_contentResource.any_1[0].AE_optional)) { - return p_contentResource.any_1[0].AE_optional.resourceName; + if(ischosen(p_contentResource.group_)) { + return p_contentResource.group_.resourceName; } - - return "1"; - + if(ischosen(p_contentResource.aE)) { + return p_contentResource.aE.resourceName; + } + if(ischosen(p_contentResource.serviceSubscribedAppRule)) { + return p_contentResource.serviceSubscribedAppRule.resourceName; + } + log(__SCOPE__&":WARNING: Primitive Content Kind not implemented"); + + return "resourceNameNotFound"; + } - + /** * @desc Resolution of the originator field (from) for a given resource * @param p_targetResourceIndex Internal resource index of the given resource @@ -874,22 +1684,47 @@ module OneM2M_Functions { * @verdict */ function f_getOriginator(integer p_targetResourceIndex := -1) runs on CseTester return XSD.AnyURI { - + if(p_targetResourceIndex == -1) { return PX_SUPER_USER; } - - if(PX_FROM_IS_AE_ID) { - if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.any_1[0].AE_optional)) { - return vc_resourcesList[p_targetResourceIndex].resource.any_1[0].AE_optional.aE_ID; + + if(PX_USE_RESOURCE_ID_AS_ORIGINATOR) { + if(vc_resourcesList[p_targetResourceIndex].parentIndex == -1) { + return f_getResourceId(vc_resourcesList[p_targetResourceIndex].resource); } else { return f_getOriginator(vc_resourcesList[p_targetResourceIndex].parentIndex); +// if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.aE)) { +// return vc_resourcesList[p_targetResourceIndex].resource.aE.aE_ID; +// } else { +// return f_getOriginator(vc_resourcesList[p_targetResourceIndex].parentIndex); +// } } } else { return PX_SUPER_USER; } } - + + /** + * @desc Resolution of the creator attribute for a given resource + * @param p_targetResourceIndex Internal resource index of the given resource + * @return AE-ID or CSE-ID of the entity creating the given resource + * @verdict + */ + function f_getCreator(integer p_targetResourceIndex := -1) runs on CseTester return XSD.ID { + + if(p_targetResourceIndex == -1) { + return PX_CSE_ID; + } + + if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.aE)) { + return vc_resourcesList[p_targetResourceIndex].resource.aE.aE_ID; + } else { + return f_getCreator(vc_resourcesList[p_targetResourceIndex].parentIndex); + } + + } + /** * @desc Return of a index of a specific attribute from an attributeList by attributeName * @param p_attributeList Target attributeList @@ -899,16 +1734,45 @@ module OneM2M_Functions { */ function f_getAttribute(in AttributeList p_attributeList, in XSD.NCName p_attributeName) return integer { var integer i; - var Attribute v_attribute := {-, -}; - + for (i:=0; i < lengthof(p_attributeList); i := i + 1){ if(p_attributeList[i] == p_attributeName){ return i; } } - + return -1; + + } + + /** + * @desc Resolution of the announcement target CSE PoA + * @param p_protocolBinding Protocol Binding + * @param p_announcementTargetAddress Announcement Target Address + * @param p_announcementTargetResource Announcement Target Resource + * @return p_annoucementTargetPoA Announcemenet Target PoA + */ + function f_getAnnouncementTargetPoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "/CseBaseTester" ) return charstring { + + if(p_protocolBinding == "HTTP") { + return "http://" & p_announcementTargetAddress & "/" & p_announcementTargetResource; + } else if (p_protocolBinding == "COAP") { + return "coap://" & p_announcementTargetAddress & "/" & p_announcementTargetResource; + } else if (p_protocolBinding == "MQTT") { + return "mqtt://" & PX_SUT_ADDRESS & "/" & p_announcementTargetResource;//TODO + } else { + return "ws://" & p_announcementTargetAddress & "/" & p_announcementTargetResource; + } + } + + /** + * @desc Resolution of the resource index for a given resource address (URI) + * @param p_address Resource URI (can be structured/unstructured cseRelative/spRelative/absolute) + * @return Internal resource index of the given resource or -1 in case of error + */ + function f_getResourceIndex(in XSD.AnyURI p_address) return integer { + return -1; //TODO } /** @@ -917,14 +1781,14 @@ module OneM2M_Functions { * @return Resource address for the given resource * @verdict */ - function f_getResourceAddress(integer p_targetResourceIndex := -1) runs on CseTester return XSD.ID { + function f_getResourceAddress(integer p_targetResourceIndex := -1) runs on Tester return XSD.ID { var XSD.ID v_resourceAddress; - - if(PX_ADDRESSING_FORMAT == e_cseRelative) { - - if(PX_UNSTRUCTURED) { + + if(vc_primitiveScope == e_cseRelative) { + + if(vc_addressingMethod == e_nonHierarchical) { if(p_targetResourceIndex == -1) { - return ""; + return PX_CSE_RESOURCE_ID; } else { return f_getResourceId(vc_resourcesList[p_targetResourceIndex].resource); } @@ -936,9 +1800,9 @@ module OneM2M_Functions { return v_resourceAddress; } } - - } else if (PX_ADDRESSING_FORMAT == e_spRelative) { - if(PX_UNSTRUCTURED) { + + } else if (vc_primitiveScope == e_spRelative) { + if(vc_addressingMethod == e_nonHierarchical) { if(p_targetResourceIndex == -1) { return "/" & PX_CSE_ID; } else { @@ -953,17 +1817,17 @@ module OneM2M_Functions { return v_resourceAddress; } } - } else if (PX_ADDRESSING_FORMAT == e_absolute) { - if(PX_UNSTRUCTURED) { + } else if (vc_primitiveScope == e_absolute) { + if(vc_addressingMethod == e_nonHierarchical) { if(p_targetResourceIndex == -1) { - return "//" &"SpId" & "/" & PX_CSE_ID; + return "//" & PX_SP_ID & "/" & PX_CSE_ID; } else { v_resourceAddress := f_getResourceAddress() & "/" & f_getResourceId(vc_resourcesList[p_targetResourceIndex].resource); return v_resourceAddress; } } else { if(p_targetResourceIndex == -1) { - return "//" &"SpId" & "/" & PX_CSE_ID & "/" & PX_CSE_NAME; + return "//" & PX_SP_ID & "/" & PX_CSE_ID & "/" & PX_CSE_NAME; } else { v_resourceAddress := f_getResourceAddress(vc_resourcesList[p_targetResourceIndex].parentIndex) & "/" & f_getResourceName(vc_resourcesList[p_targetResourceIndex].resource); return v_resourceAddress; @@ -972,7 +1836,7 @@ module OneM2M_Functions { } else { return ""; } - + } /** * @desc Saving of a resource and its parent index in the internal resource list @@ -981,18 +1845,23 @@ module OneM2M_Functions { * @return Internal resource index of the saved resource * @verdict */ - function f_setResource(PrimitiveContent p_resource, integer p_parentIndex := -1) runs on Tester return integer { - + function f_setResource(PrimitiveContent p_resource, ResourceType p_resourceType, integer p_parentIndex := -1) runs on Tester return integer { + var integer v_newIndex := -1; if(isbound(vc_resourcesList)) { - vc_resourcesList[lengthof(vc_resourcesList)] := {p_parentIndex, p_resource}; + vc_resourcesList[lengthof(vc_resourcesList)] := {p_parentIndex, p_resourceType, p_resource}; } else { - vc_resourcesList[0] := {p_parentIndex, p_resource}; + vc_resourcesList[0] := {p_parentIndex, p_resourceType, p_resource}; } - return lengthof(vc_resourcesList)-1; - + + v_newIndex := lengthof(vc_resourcesList)-1; + if(match(int2, p_resourceType) or match(-1, p_parentIndex)) {//If created resource is an AE or created under CSEBase, it needs to be added to the resourceToBeDeleted list + vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_newIndex}; + } + + return v_newIndex; + } - /** * @desc Set Acpid into the requestPrimitive * @param p_requestPrimitive RequestPrimitive to be modified @@ -1002,30 +1871,80 @@ module OneM2M_Functions { */ function f_setAcpId(template RequestPrimitive p_requestPrimitive, template AcpType p_accessControlPolicyIDs) runs on CseTester return RequestPrimitive{ - if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].AE_optional)){ - p_requestPrimitive.primitiveContent.any_1[0].AE_optional.accessControlPolicyIDs := p_accessControlPolicyIDs; + if (ischosen(p_requestPrimitive.primitiveContent.aE)){ + p_requestPrimitive.primitiveContent.aE.accessControlPolicyIDs := p_accessControlPolicyIDs; } - else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].Container_optional)){ - p_requestPrimitive.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := p_accessControlPolicyIDs; + else if (ischosen(p_requestPrimitive.primitiveContent.container)){ + p_requestPrimitive.primitiveContent.container.accessControlPolicyIDs := p_accessControlPolicyIDs; } - else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].Group_optional)){ - p_requestPrimitive.primitiveContent.any_1[0].Group_optional.accessControlPolicyIDs := p_accessControlPolicyIDs; + else if (ischosen(p_requestPrimitive.primitiveContent.group_)){ + p_requestPrimitive.primitiveContent.group_.accessControlPolicyIDs := p_accessControlPolicyIDs; } - else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].ServiceSubscribedAppRule_optional)){ - p_requestPrimitive.primitiveContent.any_1[0].ServiceSubscribedAppRule_optional.accessControlPolicyIDs := p_accessControlPolicyIDs; + else if (ischosen(p_requestPrimitive.primitiveContent.serviceSubscribedAppRule)){ + p_requestPrimitive.primitiveContent.serviceSubscribedAppRule.accessControlPolicyIDs := p_accessControlPolicyIDs; } - else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].Subscription_optional)){ - p_requestPrimitive.primitiveContent.any_1[0].Subscription_optional.accessControlPolicyIDs := p_accessControlPolicyIDs; + else if (ischosen(p_requestPrimitive.primitiveContent.subscription)){ + p_requestPrimitive.primitiveContent.subscription.accessControlPolicyIDs := p_accessControlPolicyIDs; } - else if (ischosen(p_requestPrimitive.primitiveContent.any_1[0].LocationPolicy_optional)){ - p_requestPrimitive.primitiveContent.any_1[0].LocationPolicy_optional.accessControlPolicyIDs := p_accessControlPolicyIDs; + else if (ischosen(p_requestPrimitive.primitiveContent.locationPolicy)){ + p_requestPrimitive.primitiveContent.locationPolicy.accessControlPolicyIDs := p_accessControlPolicyIDs; } return valueof(p_requestPrimitive); } + + /** + * @desc Retrieve AE_ID for a given AE resource + * @param p_targetResourceIndex Internal resource index of the given resource + * @return AE_ID of the given resource + */ + function f_getAeId(integer p_targetResourceIndex := -1) runs on AeTester return XSD.ID { + + if(ischosen(vc_resourcesList[p_targetResourceIndex].resource.aE)) { + return vc_resourcesList[p_targetResourceIndex].resource.aE.aE_ID; + } + + log(__SCOPE__ & ":WARNING: p_targetResourceIndex does not refer to AE resource"); + return ""; + + } // end f_getAeId }//end group getSetFunctions - group commonFunctions { + group CommonFunctions { + + + + /** + * @desc Sending of an Adapter Control primitive + * @param event Action to be performed by TA + * @param data Corresponding information for the correct execution of the given action + * @verdict + */ + function f_checkCseTesterStatus() runs on CseTester { + + if (getverdict != pass) { + f_cse_postamble_deleteResources(); + // Tear down + f_cfCseTesterDown(); + stop; + } + } + + /** + * @desc Sending of an Adapter Control primitive + * @param event Action to be performed by TA + * @param data Corresponding information for the correct execution of the given action + * @verdict + */ + function f_checkAeTesterStatus() runs on AeTester { + + if (getverdict != pass) { + //f_ae_postamble_deleteResources(); + // Tear down + f_cfAeTesterDown(); + stop; + } + } /** * @desc Sending of an Adapter Control primitive @@ -1033,30 +1952,335 @@ module OneM2M_Functions { * @param data Corresponding information for the correct execution of the given action * @verdict */ - function f_sendAcPrimitive(in charstring event, in charstring data) runs on Tester { + function f_sendAcPrimitive(in charstring p_event, in charstring p_data) runs on Tester { + - var charstring v_data := "" & data; // clear encoding rules (ttwb issue ?) - acPort.send(AcRequestPrimitive:{event, {charstring := v_data}}); + var charstring v_data := "" & p_data; // clear encoding rules (ttwb issue ?) + acPort.send(AcRequestPrimitive:{p_event, {charstring := v_data}}); } - group altstepFunctions { - + group AltstepFunctions { + /** * @desc Default altstep */ altstep a_default() runs on Tester { - + [] tc_wait.timeout { - setverdict(inconc,"a_default: ERROR: Timeout while awaiting reaction of the IUT prior to Upper Tester action"); + setverdict(inconc, __SCOPE__&":INFO: Timeout while awaiting reaction of the IUT prior to Upper Tester action"); } [] tc_ac.timeout { - setverdict(inconc,"a_default: ERROR: Timeout while awaiting the reception of a message"); + setverdict(inconc, __SCOPE__&":INFO: Timeout while awaiting the reception of a message"); } - } + } }//end group altstepFunctions + function f_resourceIdCleaner(in XSD.ID p_resourceID) return XSD.ID { + var integer v_length := lengthof(p_resourceID); + var integer i; + var XSD.ID result := ""; + + for (i := v_length - 1; i>=0; i := i-1){ + if(p_resourceID[i]=="/"){ + return result; + } + else{ + result := p_resourceID[i] & result; + } + } + return result; + } + + /** + * @desc It removes the poa from a given url + * @param p_url URL + * @return Resource Identifier + * NOT USED FOR THE TIME BEING + */ + function f_removePoa(in XSD.ID p_url) return XSD.ID { + var integer v_length := lengthof(p_url); + var integer i; + var integer v_numberOfColons := 0; + var boolean v_lookForSlash := false; + var boolean v_getURI := false; + var XSD.ID v_uri := ""; + + //TODO Process when FQDN is used in the URL + for (i := 0; i<v_length; i := i + 1){ + if(v_getURI) { + v_uri := v_uri & p_url[i]; + } else { + if(p_url[i]==":"){ + v_numberOfColons := v_numberOfColons + 1; + } + if(v_numberOfColons >= 2) { + v_lookForSlash := true; + } + if(v_lookForSlash) { + if(p_url[i]=="/") { + v_getURI := true; + } + } + } + } + + + if(v_uri == "") { + return p_url; + } else { + return v_uri; + } + } + + function f_removeElementFromList (inout IntegerList p_list, in integer p_valueToBeDeleted) { + var IntegerList result := {}; + var integer i; + for(i := 0; i < lengthof(p_list); i := i+1){ + if(p_list[i] != p_valueToBeDeleted){ + result := result & {p_list[i]}; + } + } + p_list := result; + } + + function f_getTemplateFromPrimitiveContent (in template PrimitiveContent p_primitiveContent) return template PrimitiveContent{ + var template PrimitiveContent v_primitiveContent := omit; + + if(ischosen(p_primitiveContent.container)){ // Container + v_primitiveContent := {container := mw_contentContainerBase}; + + if(ispresent(p_primitiveContent.container.labels)){ + v_primitiveContent.container.labels := ?; + } + if(ispresent(p_primitiveContent.container.accessControlPolicyIDs)){ + v_primitiveContent.container.accessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.container.announceTo)){ + v_primitiveContent.container.announceTo := ?; + } + if(ispresent(p_primitiveContent.container.announcedAttribute)){ + v_primitiveContent.container.announcedAttribute := ?; + } + if(ispresent(p_primitiveContent.container.creator)){ + v_primitiveContent.container.creator := ?; + } + if(ispresent(p_primitiveContent.container.maxNrOfInstances)){ + v_primitiveContent.container.maxNrOfInstances := ?; + } + if(ispresent(p_primitiveContent.container.maxByteSize)){ + v_primitiveContent.container.maxByteSize := ?; + } + if(ispresent(p_primitiveContent.container.maxInstanceAge)){ + v_primitiveContent.container.maxInstanceAge := ?; + } + if(ispresent(p_primitiveContent.container.locationID)){ + v_primitiveContent.container.locationID := ?; + } + if(ispresent(p_primitiveContent.container.ontologyRef)){ + v_primitiveContent.container.ontologyRef := ?; + } + } + + else if(ischosen(p_primitiveContent.aE)){ // AE + v_primitiveContent := {aE := mw_contentAeBase}; + + if(ispresent(p_primitiveContent.aE.labels)){ + v_primitiveContent.aE.labels := ?; + } + if(ispresent(p_primitiveContent.aE.accessControlPolicyIDs)){ + v_primitiveContent.aE.accessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.aE.announceTo)){ + v_primitiveContent.aE.announceTo := ?; + } + if(ispresent(p_primitiveContent.aE.announcedAttribute)){ + v_primitiveContent.aE.announcedAttribute := ?; + } + if(ispresent(p_primitiveContent.aE.appName)){ + v_primitiveContent.aE.appName := ?; + } + if(ispresent(p_primitiveContent.aE.pointOfAccess)){ + v_primitiveContent.aE.pointOfAccess := ?; + } + if(ispresent(p_primitiveContent.aE.ontologyRef)){ + v_primitiveContent.aE.ontologyRef := ?; + } + if(ispresent(p_primitiveContent.aE.nodeLink)){ + v_primitiveContent.aE.nodeLink := ?; + } + if(ispresent(p_primitiveContent.aE.contentSerialization)){ + v_primitiveContent.aE.contentSerialization := ?; + } + } + + else if(ischosen(p_primitiveContent.accessControlPolicy)){ // ACP + v_primitiveContent := {accessControlPolicy := mw_contentAcpBase}; + + if(ispresent(p_primitiveContent.accessControlPolicy.labels)){ + v_primitiveContent.accessControlPolicy.labels := ?; + } + if(ispresent(p_primitiveContent.accessControlPolicy.announceTo)){ + v_primitiveContent.accessControlPolicy.announceTo := ?; + } + } + + else if(ischosen(p_primitiveContent.contentInstance)){ // ContentInstance + v_primitiveContent := {contentInstance := mw_contentContentInstanceBase}; + + if(ispresent(p_primitiveContent.contentInstance.labels)){ + v_primitiveContent.contentInstance.labels := ?; + } + if(ispresent(p_primitiveContent.contentInstance.announceTo)){ + v_primitiveContent.contentInstance.announceTo := ?; + } + if(ispresent(p_primitiveContent.contentInstance.announcedAttribute)){ + v_primitiveContent.contentInstance.announcedAttribute := ?; + } + if(ispresent(p_primitiveContent.contentInstance.creator)){ + v_primitiveContent.contentInstance.creator := ?; + } + if(ispresent(p_primitiveContent.contentInstance.contentInfo)){ + v_primitiveContent.contentInstance.contentInfo := ?; + } + if(ispresent(p_primitiveContent.contentInstance.ontologyRef)){ + v_primitiveContent.contentInstance.ontologyRef := ?; + } + } + + else if(ischosen(p_primitiveContent.group_)){ // Group + v_primitiveContent := {group_ := mw_contentGroupBase}; + + if(ispresent(p_primitiveContent.group_.labels)){ + v_primitiveContent.group_.labels := ?; + } + if(ispresent(p_primitiveContent.group_.accessControlPolicyIDs)){ + v_primitiveContent.group_.accessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.group_.announceTo)){ + v_primitiveContent.group_.announceTo := ?; + } + if(ispresent(p_primitiveContent.group_.announcedAttribute)){ + v_primitiveContent.group_.announcedAttribute := ?; + } + if(ispresent(p_primitiveContent.group_.creator)){ + v_primitiveContent.group_.creator := ?; + } + if(ispresent(p_primitiveContent.group_.membersAccessControlPolicyIDs)){ + v_primitiveContent.group_.membersAccessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.group_.memberTypeValidated)){ + v_primitiveContent.group_.memberTypeValidated := ?; + } + if(ispresent(p_primitiveContent.group_.consistencyStrategy)){ + v_primitiveContent.group_.consistencyStrategy := ?; + } + if(ispresent(p_primitiveContent.group_.groupName)){ + v_primitiveContent.group_.groupName := ?; + } + } + + else if(ischosen(p_primitiveContent.pollingChannel)){ // PollingChannel + v_primitiveContent := {pollingChannel := mw_contentPollingChannelBase}; + + if(ispresent(p_primitiveContent.pollingChannel.labels)){ + v_primitiveContent.pollingChannel.labels := ?; + } + } + + else if(ischosen(p_primitiveContent.schedule)){ // Schedule + v_primitiveContent := {schedule := mw_contentScheduleBase}; + + if(ispresent(p_primitiveContent.schedule.labels)){ + v_primitiveContent.schedule.labels := ?; + } + if(ispresent(p_primitiveContent.schedule.announceTo)){ + v_primitiveContent.schedule.announceTo := ?; + } + if(ispresent(p_primitiveContent.schedule.announcedAttribute)){ + v_primitiveContent.schedule.announcedAttribute := ?; + } + } + + else if(ischosen(p_primitiveContent.subscription)){ // Schedule + v_primitiveContent := {subscription := mw_contentSubscriptionBase}; + + if(ispresent(p_primitiveContent.subscription.labels)){ + v_primitiveContent.subscription.labels := ?; + } + if(ispresent(p_primitiveContent.subscription.accessControlPolicyIDs)){ + v_primitiveContent.subscription.accessControlPolicyIDs := ?; + } + if(ispresent(p_primitiveContent.subscription.creator)){ + v_primitiveContent.subscription.creator := ?; + } + if(ispresent(p_primitiveContent.subscription.eventNotificationCriteria)){ + v_primitiveContent.subscription.eventNotificationCriteria := ?; + } + if(ispresent(p_primitiveContent.subscription.expirationCounter)){ + v_primitiveContent.subscription.expirationCounter := ?; + } + if(ispresent(p_primitiveContent.subscription.groupID)){ + v_primitiveContent.subscription.groupID := ?; + } + if(ispresent(p_primitiveContent.subscription.notificationForwardingURI)){ + v_primitiveContent.subscription.notificationForwardingURI := ?; + } + if(ispresent(p_primitiveContent.subscription.batchNotify)){ + v_primitiveContent.subscription.batchNotify := ?; + } + if(ispresent(p_primitiveContent.subscription.rateLimit)){ + v_primitiveContent.subscription.rateLimit := ?; + } + if(ispresent(p_primitiveContent.subscription.preSubscriptionNotify)){ + v_primitiveContent.subscription.preSubscriptionNotify := ?; + } + if(ispresent(p_primitiveContent.subscription.pendingNotification)){ + v_primitiveContent.subscription.pendingNotification := ?; + } + if(ispresent(p_primitiveContent.subscription.notificationStoragePriority)){ + v_primitiveContent.subscription.notificationStoragePriority := ?; + } + if(ispresent(p_primitiveContent.subscription.latestNotify)){ + v_primitiveContent.subscription.latestNotify := ?; + } + if(ispresent(p_primitiveContent.subscription.notificationContentType)){ + v_primitiveContent.subscription.notificationContentType := ?; + } + if(ispresent(p_primitiveContent.subscription.notificationEventCat)){ + v_primitiveContent.subscription.notificationEventCat := ?; + } + if(ispresent(p_primitiveContent.subscription.subscriberURI)){ + v_primitiveContent.subscription.subscriberURI := ?; + } + } + return v_primitiveContent; + } + + function f_match2PrimitiveContent (in PrimitiveContent p_responsePrimitiveContent, in template PrimitiveContent p_requestPrimitiveContent) runs on CseTester { + var template PrimitiveContent v_primitiveContent; + var PrimitiveContent v_response; + v_response := p_responsePrimitiveContent; + v_primitiveContent := f_getTemplateFromPrimitiveContent(p_requestPrimitiveContent); + if(not(match(v_response, v_primitiveContent))){ + setverdict(inconc, __SCOPE__&":INFO: Resource incomplete, some attribute missing "); + } + + } + + }//end of commonFunctions + group externalFunctions { + + /** + * @desc Generates a oneM2M timestamp based on current time. + * Format shall be YYYYMMDDTHHMMSS + */ + external function fx_generateTimestamp() return charstring; + + } // end externalFunctions + } // end of module + \ No newline at end of file diff --git a/LibOneM2M/OneM2M_Pics.ttcn b/LibOneM2M/OneM2M_Pics.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..c2974733f8c28f1cb46d89b551036e1a0d025c14 --- /dev/null +++ b/LibOneM2M/OneM2M_Pics.ttcn @@ -0,0 +1,26 @@ +/* + * Copyright Notification + * No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC). + * All rights reserved. + * + * @author ETSI + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Pics.ttcn $ + * $Id: OneM2M_Pics.ttcn 347 2017-08-11 08:48:20Z reinaortega $ + * @desc Module containing Pixits for oneM2M + * + */ +module OneM2M_Pics { + + /** + * @desc AccessControlPolicy resource support + * @see oneM2M TS-0017 A.5.5.1/1 + */ + modulepar boolean PICS_ACP_SUPPORT := true; + modulepar boolean PICS_IN_CSE := true; + modulepar boolean PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true; + modulepar boolean PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT := true; + + +} // end of module diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index 3e97734fb6038ce407b35b5f3e9f24a0d6fe4583..68cd900067a5cb98dad93632190e41814ba90d7c 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -6,8 +6,8 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Pixits.ttcn $ - * $Id: OneM2M_Pixits.ttcn 175 2016-11-22 12:39:39Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Pixits.ttcn $ + * $Id: OneM2M_Pixits.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Module containing Pixits for oneM2M * */ @@ -16,27 +16,37 @@ module OneM2M_Pixits { import from XSD all; import from OneM2M_Types all; - group testAdapterParameters {} + group TestAdapterParameters {} modulepar boolean PX_DELETE_CREATED_RESOURCES := true; modulepar XSD.AnyURI PX_RESOURCE_TO_BE_DELETED := "/ae_test"; - modulepar XSD.IDREFS PX_RESOURCES_TO_BE_DELETED := {"/ae_test", "/MyAcp"}; + modulepar XSD.IDREFS PX_RESOURCES_TO_BE_DELETED := {"MyAe"}; modulepar charstring PX_SUT_ADDRESS := "127.0.0.1:8080"; + + modulepar charstring PX_AE1_ADDRESS := "127.0.0.1:3131"; - modulepar charstring PX_TESTER_ADDRESS := "127.0.0.1:3131"; + modulepar charstring PX_AE2_ADDRESS := "127.0.0.1:3132"; - modulepar charstring PX_XML_NAMESPACE := "om2m=""http://www.onem2m.org/xml/protocols"""; + modulepar charstring PX_CSE1_ADDRESS := "127.0.0.1:3141"; - modulepar XSD.ID PX_CSE_NAME := "in-name"; + modulepar charstring PX_XML_NAMESPACE := "m2m=""http://www.onem2m.org/xml/protocols"""; - modulepar XSD.AnyURI PX_URI_CSE := "in-name";//TODO to be deleted + modulepar XSD.ID PX_CSE_NAME := "cseName"; - modulepar boolean PX_UNSTRUCTURED := false; + modulepar XSD.ID PX_CSE_ID := "cseId"; + + modulepar XSD.ID PX_SP_ID := "om2m.org"; + + modulepar XSD.ID PX_CSE1_ID := "MyCSEId"; + + modulepar XSD.ID PX_CSE_RESOURCE_ID := "cseResourceId"; + + modulepar XSD.ID PX_AE1_ID_STEM := ""; - modulepar XSD.ID PX_AE_ID_STEM := ""; + modulepar XSD.ID PX_AE2_ID_STEM := ""; modulepar XSD.ID PX_SUPER_USER := "admin:admin"; @@ -46,22 +56,21 @@ module OneM2M_Pixits { modulepar ListOfURIs PX_ACOR := {"*"}; - modulepar AddressingFormat PX_ADDRESSING_FORMAT := e_cseRelative; + modulepar AddressingMethod PX_ADDRESSING_METHOD := e_hierarchical; + + modulepar PrimitiveScope PX_PRIMITIVE_SCOPE := e_cseRelative; modulepar charstring PX_SERIALIZATION := "XML"; modulepar charstring PX_PROTOCOL_BINDING := "HTTP"; - - modulepar XSD.ID PX_CSE_ID := "in-cse"; - modulepar boolean PX_FROM_IS_AE_ID := true; - //@Martin + modulepar boolean PX_USE_RESOURCE_ID_AS_ORIGINATOR := true; + //for checking whether the locationPolicy creation request is originated from a ASN-AE //NOTE: Apply to Device-based location request, and this requires Test System (TS) to activate ASN-AE mode to test IUT modulepar boolean PX_IUT_IS_ASN_CSE := false; //default //set it to true when running Device-based location testcases modulepar boolean PX_IUT_IS_MN_CSE := false; //default //set it to true when running Share-based location testcases - //@Martin //constant parameters for LOC modulepar XSD.Token PX_LOCATION_TARGET_ID := "{LOCATION-TARGET-ID}"; //SUPPOSE TO BE RECEIVED FROM LOCATION SERVER modulepar XSD.AnyURI PX_LOCATION_SERVER_ADDRESS := "{LOCATION-SERVER-ADDRESS}"; @@ -69,8 +78,11 @@ module OneM2M_Pixits { modulepar charstring PX_LOCATION_UPDATE_PERIOD := "PT10M10S" ;//10 Minute 10 Seconds modulepar charstring PX_LOCATION_CONTAINER_NAME := "myLoContainer"; - modulepar Labels LABELS := {"VALUE_1"}; + modulepar Labels PX_LABELS := {"VALUE_1"}; modulepar boolean PX_IS_LOC_CONTAINER := false;//default //set it to true when the container is created to store location information + modulepar PoaList PX_POA := {""}; + modulepar ResourceTypeList_1 PX_SRT := {int1, int2, int3, int4}; + } // end of module diff --git a/LibOneM2M/OneM2M_Ports.ttcn b/LibOneM2M/OneM2M_Ports.ttcn new file mode 100644 index 0000000000000000000000000000000000000000..5da6c3b8186ce4022f61dee06603569fcb10f134 --- /dev/null +++ b/LibOneM2M/OneM2M_Ports.ttcn @@ -0,0 +1,45 @@ +/** + * Copyright Notification + * No part of this document may be reproduced, in an electronic retrieval system or otherwise, except as authorized by written permission. + * The copyright and the foregoing restriction extend to reproduction in all media. + * © 2016, oneM2M Partners Type 1 (ARIB, ATIS, CCSA, ETSI, TIA, TSDSI, TTA, TTC). + * All rights reserved. + * + * @author oneM2M + * @version + * @desc Port modules for oneM2M Test System + * + */ + +module OneM2M_Ports { + + import from OneM2M_Types all; + /* *************************************** + * oneM2M Ports + * *************************************** + */ + /** + * @desc Port to transport oneM2M primitives + * @desc Output MsgOut + * @desc Input MsgIn + * @desc this port is allowed to extend for futher usage + * @desc e.g. extend OneM2MPort to dual-faced port + */ + type port OneM2MPort message { + in + MsgIn; + out + MsgOut; + }; + + /** + * @desc Port to transport Adaptor Control primitives + */ + type port AdapterControlPort message { + in + AcResponsePrimitive; + out + AcRequestPrimitive; + } + +}//end module diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 64ab4b5a0a2cedad902ed89fe34a919190b033a3..59eda53f8bc4cad846bce855b9a35e0cf3a60abb 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -6,8 +6,8 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Templates.ttcn $ - * $Id: OneM2M_Templates.ttcn 183 2016-11-25 13:31:34Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Templates.ttcn $ + * $Id: OneM2M_Templates.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Module containing templates for oneM2M * */ @@ -15,7 +15,6 @@ module OneM2M_Templates { import from XSD all; import from OneM2M_Types all; - import from OneM2M_TestSystem all; import from OneM2M_TypesAndValues all; //import from OneM2M_AdditionalTypes all; import from OneM2M_Pixits all; @@ -37,33 +36,46 @@ module OneM2M_Templates { /* Templates */ - group primitives { + group Primitives { /** * @desc Base template for request sending operations * @param p_requestPrimitive */ - template (value) MsgOut m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeList_1 p_nullFields := omit ) := { + template (value) MsgOut m_request(in template (value) RequestPrimitive p_requestPrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := { primitive := { requestPrimitive := p_requestPrimitive}, host := PX_SUT_ADDRESS, xmlNamespace := PX_XML_NAMESPACE, protocolBinding := PX_PROTOCOL_BINDING, serialization := PX_SERIALIZATION, - nullFields := p_nullFields + forcedFields := p_forcedFields }; /** * @desc Base template for response sending operations * @param p_responsePrimitive */ - template (value) MsgOut m_response(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeList_1 p_nullFields := omit ) := { + template (value) MsgOut m_response(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := { primitive := { responsePrimitive := p_responsePrimitive}, host := PX_SUT_ADDRESS, xmlNamespace := PX_XML_NAMESPACE, protocolBinding := PX_PROTOCOL_BINDING, serialization := PX_SERIALIZATION, - nullFields := p_nullFields + forcedFields := p_forcedFields }; - //Added by @Naum + + /** + * @desc Base template for response sending operations + * @param p_responsePrimitive + */ + template (value) MsgOut m_httpResponse(in template (value) ResponsePrimitive p_responsePrimitive, in template (omit) AttributeAux_list p_forcedFields := omit) := { + primitive := { responsePrimitive := p_responsePrimitive}, + host := PX_SUT_ADDRESS, + xmlNamespace := PX_XML_NAMESPACE, + protocolBinding := "HTTP", + serialization := PX_SERIALIZATION, + forcedFields := p_forcedFields + }; + template MsgIn mw_request(in template (present) RequestPrimitive p_requestPrimitive) := { primitive := { requestPrimitive := p_requestPrimitive} }; @@ -81,31 +93,6 @@ module OneM2M_Templates { group RequestPrimitives { group Retrieve { - - /** - * @desc - */ - template (value) RequestPrimitive m_retrieveCseBase := { - operation := int2, - to_ := PX_URI_CSE,//c_uri_cse,//@Martin - from_ := "admin:admin", - requestIdentifier := "m_retrieveCseBase" & f_rnd(1, 1000000), - resourceType := omit, - primitiveContent := omit, - role := omit, - originatingTimestamp := omit, - requestExpirationTimestamp := omit, - resultExpirationTimestamp := omit, - operationExecutionTime := omit, - responseType := omit, - resultPersistence := omit, - resultContent := omit, - eventCategory := omit, - deliveryAggregation := omit, - groupRequestIdentifier := omit, - filterCriteria := omit, - discoveryResultType := omit - }; /** * @desc Base RETRIEVE request primitive @@ -119,7 +106,7 @@ module OneM2M_Templates { requestIdentifier := "m_retrieveResource" & f_rnd(1, 1000000), resourceType := omit, primitiveContent := omit, - role := omit, + role := omit, originatingTimestamp := omit, requestExpirationTimestamp := omit, resultExpirationTimestamp := omit, @@ -145,7 +132,7 @@ module OneM2M_Templates { from_ := p_originator, requestIdentifier := "m_retrieveResourceAttributeOptionTo" & f_rnd(1, 1000000), resourceType := omit, - primitiveContent := omit, + primitiveContent := omit, role := omit, originatingTimestamp := omit, requestExpirationTimestamp := omit, @@ -173,9 +160,7 @@ module OneM2M_Templates { from_ := p_originator, requestIdentifier := "m_retrieveResourceAttributeContentOption" & f_rnd(1, 1000000), resourceType := omit, - primitiveContent := { - any_1 := {{AttributeList := p_attributeList}} - }, + primitiveContent := {attributeList := p_attributeList}, role := omit, originatingTimestamp := omit, requestExpirationTimestamp := omit, @@ -190,6 +175,92 @@ module OneM2M_Templates { filterCriteria := omit, discoveryResultType := omit }; + + /** + * @desc RETRIEVE request primtive containing the Filter Criteria in the filterCriteria field + * @param p_targetResourceAddress Target resource address + * @param p_filterCriteria FilterCriteria + * @param p_originator Originator (from) + */ + template (value) RequestPrimitive m_retrieveResourceFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieveResource := { + requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000), + filterCriteria := { + createdBefore := omit, + createdAfter := omit, + modifiedSince := omit, + unmodifiedSince := omit, + stateTagSmaller := omit, + stateTagBigger := omit, + expireBefore := omit, + expireAfter := omit, + labels := omit, + resourceType := omit, + sizeAbove := omit, + sizeBelow := omit, + contentType_list := {}, + attribute_list := {}, + filterUsage := p_filterUsage, + limit := omit + } + }; + + /** + * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field + * @param p_targetResourceAddress Target resource address + * @param p_filterCriteria FilterCriteria + * @param p_originator Originator (from) + */ + template (value) RequestPrimitive m_retrieveResourceDiscResTypeFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) DiscResType p_discResType, in template (value) FilterUsage p_filterUsage) modifies m_retrieveResource := { + requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000), + filterCriteria := { + createdBefore := omit, + createdAfter := omit, + modifiedSince := omit, + unmodifiedSince := omit, + stateTagSmaller := omit, + stateTagBigger := omit, + expireBefore := omit, + expireAfter := omit, + labels := omit, + resourceType := omit, + sizeAbove := omit, + sizeBelow := omit, + contentType_list := {}, + attribute_list := {}, + filterUsage := p_filterUsage, + limit := omit + }, + discoveryResultType := p_discResType + }; + + /** + * @desc RETRIEVE request primtive containing the Discovery Type in the discoveryResultType field and Filter Criteria in the filterCriteria field + * @param p_targetResourceAddress Target resource address + * @param p_filterCriteria FilterCriteria + * @param p_originator Originator (from) + */ + template (value) RequestPrimitive m_retrieveResourceInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieveResource := { + requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000), + filterCriteria := { + createdBefore := omit, + createdAfter := omit, + modifiedSince := omit, + unmodifiedSince := omit, + stateTagSmaller := omit, + stateTagBigger := omit, + expireBefore := omit, + expireAfter := omit, + labels := omit, + resourceType := omit, + sizeAbove := omit, + sizeBelow := omit, + contentType_list := {}, + attribute_list := {}, + filterUsage := omit, + limit := omit + } + }; + }//end group Retrieve group Update { @@ -201,7 +272,7 @@ module OneM2M_Templates { requestIdentifier := "m_update" & f_rnd(1, 1000000), resourceType := omit, primitiveContent:= omit, - role := omit, + role := omit, originatingTimestamp := omit, requestExpirationTimestamp := omit, resultExpirationTimestamp := omit, @@ -220,97 +291,105 @@ module OneM2M_Templates { * @desc Base UPDATE request primitive for Ae resource */ template (value) RequestPrimitive m_updateAeBase modifies m_update:= { - from_ := PX_AE_ID_STEM, requestIdentifier := "m_updateAe" & f_rnd(1, 1000000), - primitiveContent:= { - any_1 := {{AE_optional := m_contentUpdateAe}} - } + primitiveContent:= {aE := m_contentUpdateAe} }; /** * @desc Base UPDATE request primitive for Container resource */ template (value) RequestPrimitive m_updateContainerBase modifies m_update:= { - from_ := PX_AE_ID_STEM, requestIdentifier := "m_updateContainer" & f_rnd(1, 1000000), - primitiveContent:= { - any_1 := {{Container_optional := m_contentUpdateContainer}} - } + primitiveContent:= {container := m_contentUpdateContainer} + }; + + /** + * @desc Base UPDATE request primitive for ContentInstance resource + */ + template (value) RequestPrimitive m_updateContentInstanceBase modifies m_update:= { + requestIdentifier := "m_updateContentInstance" & f_rnd(1, 1000000), + primitiveContent:= {contentInstance := m_contentUpdateContentInstance} }; /** * @desc Base UPDATE request primitive for AccessControlPolicy resource */ template (value) RequestPrimitive m_updateAcpBase modifies m_update := { - from_ := PX_AE_ID_STEM, requestIdentifier := "m_updateAcp" & f_rnd(1, 1000000), - primitiveContent:= { - any_1 := {{AccessControlPolicy_optional := m_contentUpdateAcp}} - } + primitiveContent:= {accessControlPolicy := m_contentUpdateAcp} }; template (value) RequestPrimitive m_updateAcpPrivileges(in template(omit) SetOfAcrs p_privileges := omit, in template(omit) SetOfAcrs p_selfPrivileges := omit) modifies m_update := { - from_ := PX_AE_ID_STEM, requestIdentifier := "m_updateAcp" & f_rnd(1, 1000000), - primitiveContent:= { - any_1 := {{AccessControlPolicy_optional := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)}} - } + primitiveContent:= {accessControlPolicy := m_contentUpdateAcpPrivileges(p_privileges, p_selfPrivileges)} }; /** * @desc Base UPDATE request primitive for Group resource */ template (value) RequestPrimitive m_updateGroupBase modifies m_update := { - from_ := PX_AE_ID_STEM, requestIdentifier := "m_updateGroup" & f_rnd(1, 1000000), - primitiveContent:= { - any_1 := {{Group_optional := m_contentUpdateGroup}} - } + primitiveContent:= {group_ := m_contentUpdateGroup} + }; + + /** + * @desc Base UPDATE request primitive for CSEBase resource + */ + template (value) RequestPrimitive m_updateCSEBaseBase modifies m_update := { + requestIdentifier := "m_updateGroup" & f_rnd(1, 1000000), + primitiveContent:= {cSEBase := m_contentUpdateCSEBase} }; /** * @desc Base UPDATE request primitive for Schedule resource */ template (value) RequestPrimitive m_updateScheduleBase modifies m_update := { - from_ := PX_AE_ID_STEM, requestIdentifier := "m_updateSchedule" & f_rnd(1, 1000000), - primitiveContent:= { - any_1 := {{Schedule_optional := m_contentUpdateSchedule}} - } + primitiveContent:= {schedule := m_contentUpdateSchedule} }; /** * @desc Base UPDATE request primitive for PollingChannel resource */ template (value) RequestPrimitive m_updatePollingChannelBase modifies m_update := { - from_ := PX_AE_ID_STEM, requestIdentifier := "m_updatePollingChannel" & f_rnd(1, 1000000), - primitiveContent:= { - any_1 := {{PollingChannel_optional := m_contentUpdatePollingChannel}} - } + primitiveContent:= {pollingChannel := m_contentUpdatePollingChannel} }; /** * @desc Base UPDATE request primitive for Subscription resource */ template (value) RequestPrimitive m_updateSubscriptionBase modifies m_update := { - from_ := PX_AE_ID_STEM, requestIdentifier := "m_updateSubscription" & f_rnd(1, 1000000), - primitiveContent:= { - any_1 := {{Subscription_optional := m_contentUpdateSubscription}} - } + primitiveContent:= {subscription := m_contentUpdateSubscription} }; - //@Martin - template (value) RequestPrimitive m_updateLocationPolicy(XSD.ID p_locResourceAddress, in template (omit) AcpType p_accessControlPolicyIDs, in template (omit) XSD.Duration locationUpdatePeriod) modifies m_update := { + template (value) RequestPrimitive m_updateLocationPolicy(XSD.ID p_locResourceAddress, in template (omit) AcpType p_accessControlPolicyIds, in template (value) XSD.Duration p_locationUpdatePeriod) modifies m_update := { to_ := p_locResourceAddress, - from_ := PX_AE_ID_STEM, //AE originator id e.g. requestIdentifier := "m_updateLocationPolicy", - primitiveContent := { - any_1 := {{ LocationPolicy_optional := m_contentUpdateLocationPolicy(p_accessControlPolicyIDs, locationUpdatePeriod) }} - } + primitiveContent := {locationPolicy := m_contentUpdateLocationPolicy(p_accessControlPolicyIds, p_locationUpdatePeriod)} }; + template (value) RequestPrimitive m_updateNodeBase modifies m_update := { + requestIdentifier := "m_updateNode" & f_rnd(1, 1000000), + primitiveContent:= {node := m_contentUpdateNode} + } + + template (value) RequestPrimitive m_updateRemoteCSEBase modifies m_update := { + requestIdentifier := "m_updateRemoteCSEBase" & f_rnd(1, 1000000), + primitiveContent := {remoteCSE := m_contentUpdateRemoteCSE} + } + + template (value) RequestPrimitive m_updateAE modifies m_update := { + requestIdentifier := "m_updateAE" & f_rnd(1, 1000000), + primitiveContent := {aE := m_contentUpdateAe} + } + + template (value) RequestPrimitive m_updateAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_to := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_stemId := "") modifies m_update:= { + requestIdentifier := testcasename() & "-m_updateAEAnnc" & f_rnd(1, 1000000), + resourceType := int10002, + primitiveContent := {aEAnnc := m_contentUpdateAEAnnc} + }; }//end group Update group Create { @@ -319,7 +398,7 @@ module OneM2M_Templates { operation := int1, to_ := "NotInitialized", from_ := "NotInitialized", - requestIdentifier := "m_create" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_create" & f_rnd(1, 1000000), resourceType := omit, primitiveContent := omit, role := omit, @@ -338,18 +417,15 @@ module OneM2M_Templates { }; /** - * @desc Base CREATE request primitive for AE resource (AUX) + * @desc Base Reception template for create operation */ - //Added by @Naum - template RequestPrimitive mw_createAEannc(template (omit) AcpType p_accessControlPolicyIDs := omit,template (omit) XSD.ID p_from := omit, XSD.ID p_appId) := { + template RequestPrimitive mw_create(template XSD.ID p_from := *, template XSD.ID p_to := ?) := { operation := int1, - to_ := ?, - from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c" + to_ := p_to, + from_ := p_from, requestIdentifier := ?, - resourceType := int10002, - primitiveContent := { - any_1 := {{AEAnnc_optional := mw_contentCreateAEannc(c_aeAuxName, p_accessControlPolicyIDs, p_appId)}} - }, + resourceType := ?, + primitiveContent := ?, role := *, originatingTimestamp := *, requestExpirationTimestamp := *, @@ -363,46 +439,80 @@ module OneM2M_Templates { groupRequestIdentifier := *, filterCriteria := *, discoveryResultType := * + } + + + /** + * @desc Base CREATE request primitive for AEAnnc resource + * @param p_accessControlPolicyIds + * @param p_to + * @param p_from + * @param p_appId + * @param p_stemId + */ + template (value) RequestPrimitive m_createAEAnnc(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) XSD.ID p_to := omit, template (omit) XSD.ID p_from := omit, XSD.ID p_appId, XSD.ID p_stemId := "") modifies m_create:= { + to_ := p_to, + from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c" + requestIdentifier := testcasename() & "-m_createAEAnnc" & f_rnd(1, 1000000), + resourceType := int10002, + primitiveContent := {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds, p_appId, valueof(p_to) & "/" & p_stemId)} + }; + + /** + * @desc Reception template for CREATE AEAnnc + */ + template RequestPrimitive mw_createAEAnnc(template (omit) XSD.ID p_from := omit, template (omit) XSD.ID p_to := omit, template (omit) AcpType p_accessControlPolicyIds := omit) modifies mw_create := { + resourceType := int10002, + primitiveContent := {aEAnnc := mw_contentCreateAEAnnc({"Credential-ID:None"}, p_accessControlPolicyIds)} }; - //Added by @Naum - template (value) RequestPrimitive m_createAe(XSD.ID p_appId, template (omit) AcpType p_accessControlPolicyIDs := omit,template (omit) XSD.ID p_from := omit, template (omit) ResourceName p_resourceName := c_aeAuxName, in template (omit) PoaList p_poaList := omit) modifies m_create := { + template (value) RequestPrimitive m_createAe(XSD.ID p_appId, template (omit) AcpType p_accessControlPolicyIds := omit,template (omit) XSD.ID p_from := omit, template (omit) ResourceName p_resourceName := c_aeAuxName, in template (omit) PoaList p_poaList := omit) modifies m_create := { from_ := p_from,//PX_AE_ID_STEM,//TODO We should use omit, "s", or "c" - requestIdentifier := "m_createAe" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createAe" & f_rnd(1, 1000000), resourceType := int2, - primitiveContent := { - any_1 := {{AE_optional := m_contentCreateAe(p_accessControlPolicyIDs,p_resourceName, p_appId, p_poaList)}} - } + primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds,p_resourceName, p_appId, p_poaList)} }; - template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIDs := omit, in template (omit) PoaList p_poaList) modifies m_create := { - from_ := PX_AE_ID_STEM,//TODO We should use omit, "s", or "c"//@Martin - requestIdentifier := "m_createAe" & f_rnd(1, 1000000), + /** + * @desc Reception template for AE registration + */ + template RequestPrimitive mw_createAe(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { resourceType := int2, - primitiveContent := { - any_1 := {{AE_optional := m_contentCreateAe(p_accessControlPolicyIDs, c_aeAuxName, -, p_poaList)}} - } + primitiveContent := {aE := ?} + }; + + template (value) RequestPrimitive m_createAeAux(template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) PoaList p_poaList) modifies m_create := { + from_ := PX_AE1_ID_STEM,//TODO We should use omit, "s", or "c" + requestIdentifier := testcasename() & "-m_createAe" & f_rnd(1, 1000000), + resourceType := int2, + primitiveContent := {aE := m_contentCreateAe(p_accessControlPolicyIds, c_aeAuxName, -, p_poaList)} }; /** * @desc Base CREATE request primitive for AccessControlPolicy resource */ template (value) RequestPrimitive m_createAcpBase modifies m_create := { - requestIdentifier := "m_createAcp" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createAcp" & f_rnd(1, 1000000), resourceType := int1, - primitiveContent := { - any_1 := {{AccessControlPolicy_optional := m_contentCreateAcp ()}} - } + primitiveContent := {accessControlPolicy := m_contentCreateAcp ()} }; - template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name := c_defaultResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) modifies m_create := { + template (value) RequestPrimitive m_createAcp(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name := c_defaultAccessControlPolicyResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63) modifies m_create := { to_ := p_parentResourceAddress, - from_ := PX_AE_ID_STEM, - requestIdentifier := "m_createAcp" & f_rnd(1, 1000000), + from_ := PX_SUPER_USER, + requestIdentifier := testcasename() & "-m_createAcp" & f_rnd(1, 1000000), resourceType := int1, - primitiveContent := { - any_1 := {{AccessControlPolicy_optional := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)}} - } + primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_name, p_acor, p_allowedOperations)} + }; + + /** + * @desc Reception template for CREATE AcpAnnc + */ + template RequestPrimitive mw_createAccessControlPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + to_ := p_to, + from_ := p_from, + resourceType := int10002, + primitiveContent := {accessControlPolicyAnnc := mw_contentCreateAcpAnnc(-)} }; @@ -411,21 +521,25 @@ module OneM2M_Templates { */ template (value) RequestPrimitive m_createAcpAux(in template (value) XSD.String p_acpName := c_acpAuxName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) modifies m_create := { from_ := PX_SUPER_USER, - requestIdentifier := "m_createAcpAux" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createAcpAux" & f_rnd(1, 1000000), resourceType := int1, - primitiveContent := { - any_1 := {{AccessControlPolicy_optional := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)}} - } + primitiveContent := {accessControlPolicy := m_contentCreateAcp (p_acpName, p_acor, p_allowedOperations)} }; - //Added by @Naum - template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := { - from_ := PX_AE_ID_STEM, - requestIdentifier := "m_createCSE" & f_rnd(1, 1000000), + /*template (value) RequestPrimitive m_createCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) modifies m_create := { + from_ := PX_SUPER_USER, + requestIdentifier := testcasename() & "-m_createCSE" & f_rnd(1, 1000000), resourceType := int1,//FIXME Is this the value for CSEBase? In any case, this template is not used at all - primitiveContent := { - any_1 := {{CSEBase_optional := m_contentCreateCSEBase (p_serviceSubscribedAppRule)}} - } + primitiveContent := {cSEBase := m_contentCreateCSEBase (p_serviceSubscribedAppRule)} + };*/ + + /** + * @desc Base CREATE request primitive for CSEBase resource + */ + template (value) RequestPrimitive m_createCSEBaseBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000), + resourceType := int5, + primitiveContent := {cSEBase := m_contentCreateCSEBase} }; @@ -433,133 +547,284 @@ module OneM2M_Templates { * @desc Base CREATE request primitive for Container resource */ template (value) RequestPrimitive m_createContainerBase modifies m_create := { - requestIdentifier := "m_createContainer" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000), resourceType := int3, - primitiveContent := { - - any_1 := {{Container_optional := m_contentCreateContainer}} - } + primitiveContent := {container := m_contentCreateContainer} + }; + + /** + * @desc Base CREATE request primitive for remoteCSE resource + */ + template (value) RequestPrimitive m_createRemoteCSEBase(template (omit) AcpType p_accessControlPolicyIds := omit, template (omit) ResourceName p_resourceName := c_defaultRemoteCSEResourceName, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE_ID) modifies m_create := { + requestIdentifier := testcasename() & "-m_createRemoteCSE" & f_rnd(1, 1000000), + resourceType := int16, + primitiveContent := {remoteCSE := m_contentCreateRemoteCSE(p_resourceName, p_accessControlPolicyIds,p_cSEBase, p_cSE_ID)} + }; + + /** + * @desc CREATE request primitive for Container resource wiht no resourceName provided + */ + template (value) RequestPrimitive m_createContainer_noResourceName modifies m_createContainerBase := { + primitiveContent := {container := m_contentCreateContainer(omit)} }; - template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName) modifies m_create := { + template (value) RequestPrimitive m_createContainer(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_resourceName := c_defaultContainerResourceName) modifies m_create := { to_ := p_parentResourceAddress, - from_ := PX_AE_ID_STEM, - requestIdentifier := "m_createContainer" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createContainer" & f_rnd(1, 1000000), resourceType := int3, - primitiveContent := { - any_1 := {{Container_optional := m_contentCreateContainer}} - } + primitiveContent := {container := m_contentCreateContainer(p_resourceName)} + }; + + /** + * @desc Reception template for CREATE Container + */ + template RequestPrimitive mw_createContainer(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int3, + primitiveContent := {container := ?} + }; + + /** + * @desc Base Reception template for CREATE ContainerAnnc + */ + template RequestPrimitive mw_createContainerAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10003, + primitiveContent := {containerAnnc := mw_contentCreateContainerAnncBase} }; + /** + * @desc Base CREATE request primitive for Content Instance resource + */ + template (value) RequestPrimitive m_createContentInstanceBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createContentInstance" & f_rnd(1, 1000000), + resourceType := int4, + primitiveContent := {contentInstance := m_contentCreateContentInstance} + }; + + /** + * @desc CREATE request primitive for Content Instance resource with no resourceName provided + */ + template (value) RequestPrimitive m_createContentInstance_noResourceName modifies m_createContentInstanceBase := { + primitiveContent := {contentInstance := m_contentCreateContentInstance(omit)} + }; + template (value) RequestPrimitive m_createContentInstance(XSD.ID p_parentResourceAddress, XSD.String p_primitiveContent) modifies m_create := { to_ := p_parentResourceAddress, from_ := "admin:admin", - requestIdentifier := "m_createContentInstance" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createContentInstance" & f_rnd(1, 1000000), resourceType := int4, - primitiveContent := { - any_1 := {{ContentInstance_optional := m_contentCreateContentInstance(p_primitiveContent)}} - } + primitiveContent := {contentInstance := m_contentCreateContentInstance(-, p_primitiveContent)} }; + /** + * @desc Reception template for CREATE ContentInstanceAnnc + */ + template RequestPrimitive mw_createContentInstanceAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10014, + primitiveContent := {contentInstanceAnnc := ?} + }; + + /** + * @desc Base Reception template for CREATE ContentInstanceAnnc + */ + template RequestPrimitive mw_createContentInstanceAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10014, + primitiveContent := {contentInstanceAnnc := mw_contentCreateContentInstanceAnncBase} + }; + + /** + * @desc Base CREATE request primitive for Delivery resource + */ + /*template (value) RequestPrimitive m_createDeliveryBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createDelivery" & f_rnd(1, 1000000), + resourceType := int6, + primitiveContent := {delivery := m_contentCreateDelivery()} + };*/ + /** * @desc Base CREATE request primitive for Group resource */ template (value) RequestPrimitive m_createGroupBase modifies m_create := { - requestIdentifier := "m_createGroup" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createGroup" & f_rnd(1, 1000000), resourceType := int9, - primitiveContent := { - any_1 := {{Group_optional := m_contentCreateGroup (1, {"/" & PX_CSE_NAME & "/" & "NotInitialized"}, omit)}} //TODO: p_resourceId - } + primitiveContent := {group_ := m_contentCreateGroup (1, {"NotInitialized"}, omit, omit)} //TODO: p_resourceId }; template (value) RequestPrimitive m_createGroup(in template (value) XSD.NonNegativeInteger p_maxNrOfMembers, - in template (value) ListOfURIs p_memberIds := {"Not Initialized"}, - in template (omit) AcpType p_accessControlPolicyIDs, - in template (omit) MemberType p_memberType := omit, - in template (omit) ConsistencyStrategy p_consistencyStrategy := omit, - in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit, - in template (omit) XSD.String p_name := "MyGroup") modifies m_create := { - requestIdentifier := "m_createGroup" & f_rnd(1, 1000000), - resourceType := int9, - primitiveContent := { - any_1 := {{Group_optional := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIDs, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)}} //TODO: p_resourceId - } - }; + in template (value) ListOfURIs p_memberIds := {"NotInitialized"}, + in template (omit) AcpType p_accessControlPolicyIds, + in template (omit) MemberType p_memberType := omit, + in template (omit) ConsistencyStrategy p_consistencyStrategy := omit, + in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit, + in template (omit) XSD.String p_name := "MyGroup") modifies m_create := { + requestIdentifier := testcasename() & "-m_createGroup" & f_rnd(1, 1000000), + resourceType := int9, + primitiveContent := {group_ := m_contentCreateGroup (p_maxNrOfMembers, p_memberIds, p_accessControlPolicyIds, p_memberType, p_consistencyStrategy, p_membersAccessControlPolicyIDs, p_name)} //TODO: p_resourceId + }; + + /** + * @desc Reception template for CREATE GroupAnnc + */ + template RequestPrimitive mw_createGroupAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10009, + primitiveContent := {groupAnnc := ?} + }; + + /** + * @desc Base Reception template for CREATE GroupAnnc + */ + template RequestPrimitive mw_createGroupAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10009, + primitiveContent := {groupAnnc := mw_contentCreateGroupAnncBase} + }; + + /** + * @desc Base CREATE request primitive for MgmtCmd resource + */ + template (value) RequestPrimitive m_createMgmtCmdBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createMgmtCmd" & f_rnd(1, 1000000), + resourceType := int12, + primitiveContent := {mgmtResource := m_contentCreateMgmtCmd (-,-)} + }; + + /** + * @desc Base CREATE request primitive for MgmtObj resource + */ + template (value) RequestPrimitive m_createMgmtObjBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createMgmtObj" & f_rnd(1, 1000000), + resourceType := int13, + primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-,-)} + }; + + /** + * @desc CREATE request primitive for MgmtObj resource + */ + template (value) RequestPrimitive m_createMgmtObj modifies m_create := { + requestIdentifier := testcasename() & "-m_createMgmtObj" & f_rnd(1, 1000000), + resourceType := int13, + primitiveContent := {mgmtResource := m_contentCreateMgmtObj (-, -)} + }; + + /** + * @desc Reception template for CREATE MgmtObjAnnc + */ + template RequestPrimitive mw_createMgmtObjAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10013, + primitiveContent := {announcedMgmtResource := ?} + }; + + /** + * @desc Base Reception template for CREATE MgmtObjAnnc + */ + template RequestPrimitive mw_createMgmtObjAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10013, + primitiveContent := {announcedMgmtResource := mw_contentCreateMgmtObjAnncBase} + }; + + /** + * @desc Base CREATE request primitive for Node resource + */ + template (value) RequestPrimitive m_createNodeBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createNode" & f_rnd(1, 1000000), + resourceType := int14, + primitiveContent := {node := m_contentCreateNode(-, -, -) } + }; + + /** + * @desc CREATE request primitive for Node resource + */ + template (value) RequestPrimitive m_createNode modifies m_create := { + requestIdentifier := testcasename() & "-m_createNode" & f_rnd(1, 1000000), + resourceType := int14, + primitiveContent := {node := m_contentCreateNode(-,-,-) } + }; + /** + * @desc Reception template for CREATE NodeAnnc + */ + template RequestPrimitive mw_createNodeAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10014, + primitiveContent := {nodeAnnc := ?} + }; /** * @desc Base CREATE request primitive for PollingChannel resource */ template (value) RequestPrimitive m_createPollingChannelBase modifies m_create := { - requestIdentifier := "m_createPollingChannel" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createPollingChannel" & f_rnd(1, 1000000), resourceType := int15, - primitiveContent := { - any_1 := {{PollingChannel_optional := m_contentCreatePollingChannel (-)}} - } + primitiveContent := {pollingChannel := m_contentCreatePollingChannel (-)} }; - template (value) RequestPrimitive m_createPollingChannel(XSD.ID p_parentResourceAddress, in template (value)XSD.ID p_originatorId, in template (omit) AcpType p_accessControlPolicyIDs ) modifies m_create := { + template (value) RequestPrimitive m_createPollingChannel(XSD.ID p_parentResourceAddress, in template (value)XSD.ID p_originatorId) modifies m_create := { to_ := p_parentResourceAddress, from_ := p_originatorId, - requestIdentifier := "m_createPollingChannel" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createPollingChannel" & f_rnd(1, 1000000), resourceType := int15, - primitiveContent := { - any_1 := {{PollingChannel_optional := m_contentCreatePollingChannel ()}} - } + primitiveContent := {pollingChannel := m_contentCreatePollingChannel ()} }; /** * @desc Base CREATE request primitive for Schedule resource */ template (value) RequestPrimitive m_createScheduleBase modifies m_create := { - requestIdentifier := "m_createSchedule" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createSchedule" & f_rnd(1, 1000000), resourceType := int18, - primitiveContent := { - any_1 := {{Schedule_optional := m_contentCreateSchedule ({{"0,0,0 1 2,1,1,*"}})}} - } + primitiveContent := {schedule := m_contentCreateSchedule ({{"0 0 0,1,2 1 1 * *"}})} }; template (value) RequestPrimitive m_createSchedule(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name, in template (value) ScheduleEntries p_scheduleElement ) modifies m_create := { to_ := p_parentResourceAddress, - from_ := PX_AE_ID_STEM, - requestIdentifier := "m_createSchedule" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createSchedule" & f_rnd(1, 1000000), resourceType := int18, - primitiveContent := { - any_1 := {{Schedule_optional := m_contentCreateSchedule (p_scheduleElement)}} - } + primitiveContent := {schedule := m_contentCreateSchedule (p_scheduleElement, p_name)} }; - //Added by @Naum - template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedApp_IDs, in ListOfM2MID p_allowedAEs) modifies m_create := { - from_ := PX_AE_ID_STEM, - requestIdentifier := "m_createServiceSubscribedAppRule" & f_rnd(1, 1000000), + /** + * @desc Reception template for CREATE ScheduleAnnc + */ + template RequestPrimitive mw_createScheduleAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10018, + primitiveContent := {scheduleAnnc := ?} + }; + + /** + * @desc Base Reception template for CREATE ScheduleAnnc + */ + template RequestPrimitive mw_createScheduleAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10018, + primitiveContent := {scheduleAnnc := mw_contentCreateScheduleAnncBase} + }; + + template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) modifies m_create := { + requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRule" & f_rnd(1, 1000000), resourceType := int19,//FIXME Is this the correct value? - primitiveContent := { - any_1 := {{ServiceSubscribedAppRule_optional := m_contentCreateServiceSubscribedAppRule (p_applicableCredIDs, p_allowedApp_IDs, p_allowedAEs)}} - } + primitiveContent := {serviceSubscribedAppRule := m_contentCreateServiceSubscribedAppRule (p_applicableCredIDs, p_allowedAppIDs, p_allowedAEs)} }; + /** + * @desc Base CREATE request primitive for ServiceSubscribedAppRule Resource + */ + template (value) RequestPrimitive m_createServiceSubscribedAppRuleBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRuleBase" & f_rnd(1, 1000000), + resourceType := int19, + primitiveContent := {serviceSubscribedAppRule := m_contentCreateServiceSubscribedAppRuleBase} + }; /** * @desc Base CREATE request primitive for Subscription resource */ template (value) RequestPrimitive m_createSubscriptionBase modifies m_create := { - requestIdentifier := "m_createSubscription" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createSubscription" & f_rnd(1, 1000000), resourceType := int23, - primitiveContent := { - any_1 := {{Subscription_optional := m_contentCreateSubscription ({"Not Initialized"})}} - } + primitiveContent := {subscription := m_contentCreateSubscription ({"NotInitialized"})} }; template (value) RequestPrimitive m_createSubscription(XSD.ID p_parentResourceAddress, in template (omit) XSD.String p_name, in template (value) ListOfURIs p_notificationURI := {"NotInitialized"}) modifies m_create := { to_ := p_parentResourceAddress, - from_ := PX_AE_ID_STEM, - requestIdentifier := "m_createSubscription" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_createSubscription" & f_rnd(1, 1000000), resourceType := int23, - primitiveContent := { - any_1 := {{Subscription_optional := m_contentCreateSubscription (p_notificationURI, p_name)}} - } + primitiveContent := {subscription := m_contentCreateSubscription (p_notificationURI, p_name)} }; template (value) RequestPrimitive m_createSubscriptionAdvanced( XSD.ID p_parentResourceAddress, @@ -571,62 +836,85 @@ module OneM2M_Templates { in template (omit) XSD.Boolean p_latestNotify := omit, in template (omit) XSD.AnyURI p_subscriberURI := omit, in template (omit) NotificationContentType p_notificationContentType := int1) modifies m_createSubscription := { - primitiveContent := { - any_1 := {{Subscription_optional := m_contentCreateSubscriptionAdvanced (p_notificationURI, p_name, p_eventNotificationCriteria, p_expirationCounter, p_batchNotify, p_latestNotify, p_subscriberURI, p_notificationContentType)}} - } + primitiveContent := {subscription := m_contentCreateSubscriptionAdvanced (p_notificationURI, p_name, p_eventNotificationCriteria, p_expirationCounter, p_batchNotify, p_latestNotify, p_subscriberURI, p_notificationContentType)} + }; + + /** + * @desc Base CREATE request primitive for Location Policy resource + */ + template (value) RequestPrimitive m_createLocationPolicyBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createLocationPolicy" & f_rnd(1, 1000000), + resourceType := int10, + primitiveContent := {locationPolicy := m_contentCreateLocationPolicyBase} }; - //@Martin - template (value) RequestPrimitive m_createLocationPolicy(in template (value) LocationSource locationSource, in template (omit) AcpType p_accessControlPolicyIDs, in template (omit) XSD.Duration locationUpdatePeriod, in template (omit) NodeID locationTargetID, in template (omit) XSD.AnyURI locationServerAddress) modifies m_create := { - requestIdentifier := "m_createLocationPolicy" & f_rnd(1, 1000000), //the requestIdentifier is supposed to be set similar as "C190XX7T/001" by prepending the AE-ID-Stem and slash(‘/’) in front of it + template (value) RequestPrimitive m_createLocationPolicy(in template (value) LocationSource p_locationSource, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.Duration p_locationUpdatePeriod, in template (omit) NodeID p_locationTargetID, in template (omit) XSD.AnyURI p_locationServerAddress) modifies m_create := { + + requestIdentifier := testcasename() & "-m_createLocationPolicy" & f_rnd(1, 1000000), //the requestIdentifier is supposed to be set similar as "C190XX7T/001" by prepending the AE-ID-Stem and slash(‘/’) in front of it resourceType := int10, - primitiveContent := { - any_1 := {{ LocationPolicy_optional := m_contentCreateLocationPolicy(locationSource, p_accessControlPolicyIDs, locationUpdatePeriod, locationTargetID, locationServerAddress) }} - }, + primitiveContent := {locationPolicy := m_contentCreateLocationPolicy(p_locationSource, p_accessControlPolicyIds, p_locationUpdatePeriod, p_locationTargetID, p_locationServerAddress) }, resultContent := int1//default }; - //@Martin - template (value) RequestPrimitive m_createNotification(in template (value) Representation resourcePresentation, in template (omit)NotificationEventType notifEventType, in template (omit) XSD.AnyURI subscriptionReference, in template (omit) XSD.AnyURI notifForwardingURI) modifies m_create := { - requestIdentifier := "m_createNotification" & f_rnd(1, 1000000), - primitiveContent := { - any_1 := {{ Notification := m_contentCreateNotification(resourcePresentation, notifEventType, subscriptionReference, notifForwardingURI)}} - }, + + /** + * @desc Reception template for CREATE LocationPolicyAnnc + */ + template RequestPrimitive mw_createLocationPolicyAnnc(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10010, + primitiveContent := {locationPolicyAnnc := ?} + }; + + /** + * @desc Base Reception template for CREATE LocationPolicyAnnc + */ + template RequestPrimitive mw_createLocationPolicyAnncBase(template XSD.ID p_from := *, template XSD.ID p_to := ?) modifies mw_create := { + resourceType := int10010, + primitiveContent := {locationPolicyAnnc := mw_contentCreateLocationPolicyAnncBase} + }; + + template (value) RequestPrimitive m_createNotification(in template (value) Representation p_resourcePresentation, in template (omit)NotificationEventType p_notifEventType, in template (omit) XSD.AnyURI p_subscriptionReference, in template (omit) XSD.AnyURI p_notifForwardingURI) modifies m_create := { + requestIdentifier := testcasename() & "-m_createNotification" & f_rnd(1, 1000000), + primitiveContent := {notification := m_contentCreateNotification(p_resourcePresentation, p_notifEventType, p_subscriptionReference, p_notifForwardingURI)}, resultContent := int1 //default }; - - + + /** + * @desc Base CREATE request primitive for Stats Config resource + */ + template (value) RequestPrimitive m_createStatsConfigBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createStatsConfig" & f_rnd(1, 1000000), + resourceType := int22, + primitiveContent := {statsConfig := m_contentCreateStatsConfigBase} + }; + + /** + * @desc Base CREATE request primitive for Stats Config resource + */ + template (value) RequestPrimitive m_createStatsCollectBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createStatsCollect" & f_rnd(1, 1000000), + resourceType := int21, + primitiveContent := {statsCollect := m_contentCreateStatCollectBase} + }; + + /** + * @desc Base CREATE request primitive for M2mServiceSubscriptionProfile resource + */ + template (value) RequestPrimitive m_createM2mServiceSubscriptionProfileBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createM2mServiceSubscriptionProfile" & f_rnd(1, 1000000), + resourceType := int11, + primitiveContent := {m2mServiceSubscriptionProfile := m_contentCreatem2mServiceSubscriptionProfileBase} + }; + }//end group Create group Delete { - template (value) RequestPrimitive m_deleteRequest(XSD.ID p_resourceAddress) := { - operation := int4, - to_ := p_resourceAddress, - from_ := PX_SUPER_USER, - requestIdentifier := "m_deleteResource" & f_rnd(1, 1000000), - resourceType := omit, - primitiveContent := omit, - role := omit, - originatingTimestamp := omit, - requestExpirationTimestamp := omit, - resultExpirationTimestamp := omit, - operationExecutionTime := omit, - responseType := omit, - resultPersistence := omit, - resultContent := omit, - eventCategory := omit, - deliveryAggregation := omit, - groupRequestIdentifier := omit, - filterCriteria := omit, - discoveryResultType := omit - }; - - template (value) RequestPrimitive m_delete(XSD.ID p_resourceAddress) := { + template (value) RequestPrimitive m_deleteRequest(XSD.ID p_resourceAddress, in XSD.ID p_originator := PX_SUPER_USER) := { operation := int4, to_ := p_resourceAddress, - from_ := PX_AE_ID_STEM, - requestIdentifier := "m_deleteAe" & f_rnd(1, 1000000), + from_ := p_originator, + requestIdentifier := testcasename() & "-m_deleteResource" & f_rnd(1, 1000000), resourceType := omit, primitiveContent := omit, role := omit, @@ -642,7 +930,6 @@ module OneM2M_Templates { groupRequestIdentifier := omit, filterCriteria := omit, discoveryResultType := omit - }; }//end group Delete @@ -658,7 +945,7 @@ module OneM2M_Templates { from_ := *, requestIdentifier := ?, resourceType := *, - primitiveContent := { any_1 := {{ Notification := mw_contentNotificationBase}} }, + primitiveContent := {notification := mw_contentNotificationBase}, role := *, originatingTimestamp := *, requestExpirationTimestamp := *, @@ -683,7 +970,7 @@ module OneM2M_Templates { from_ := *, requestIdentifier := ?, resourceType := *, - primitiveContent := { any_1 := {{ AggregatedNotification := ?}} }, + primitiveContent := { aggregatedNotification := ?}, role := *, originatingTimestamp := *, requestExpirationTimestamp := *, @@ -703,10 +990,8 @@ module OneM2M_Templates { * @desc Base NOTIFY request primitive */ - template RequestPrimitive mw_notify(in template Notification p_notification) modifies mw_notifyBase := { - primitiveContent := { - any_1 := {{ Notification := p_notification}} - } + template RequestPrimitive mw_notify(in template (present) Notification p_notification) modifies mw_notifyBase := { + primitiveContent := {notification := p_notification} }; @@ -716,36 +1001,70 @@ module OneM2M_Templates { }//end group RequestPrimitives group ContentCreate { - - - template (value) AEAnnc_optional mw_contentCreateAEannc (in template (omit) XSD.String p_name, in template (omit) AcpType p_accessControlPolicyIDs, XSD.ID p_appId := PX_APP_ID) := { - resourceName := p_name,//O + /** + * @desc Base primitiveContent for CREATE operation for AEAnnc resource + * @param p_labels Labels + * @param p_accessControlPolicyIds AcpIDs + * @param p_appId App ID + * @param p_nodeLink Node link + */ + template AEAnnc_optional m_contentCreateAEAnnc (in template (omit) Labels p_labels, in template (omit) AcpType p_accessControlPolicyIds, XSD.ID p_appId := PX_APP_ID, in template (omit) XSD.AnyURI p_nodeLink := omit) := { + resourceName := omit,//O TODO resourceType := omit,//NP resourceID := omit,//NP parentID := omit,//NP creationTime := omit,//NP lastModifiedTime := omit,//NP - labels := omit,//O - accessControlPolicyIDs := p_accessControlPolicyIDs,//O + labels := p_labels,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O expirationTime := omit,//O - link := omit,//O + link := omit,//M TODO Put the right value appName := omit,//O app_ID := p_appId,//M aE_ID := omit,//NP pointOfAccess := omit, //{"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA ontologyRef := omit,//O - nodeLink := omit,//NP + nodeLink := p_nodeLink,//NP requestReachability := true,//M contentSerialization := omit,//O choice := omit//NP }; + + /** + * @desc Base reception template of primitiveContent for CREATE operation for AEAnnc resource + * @param p_labels Labels + * @param p_accessControlPolicyIds AcpIDs + * @param p_appId App ID + * @param p_nodeLink Node link + */ + template AEAnnc_optional mw_contentCreateAEAnnc (in template Labels p_labels := ?, in template AcpType p_accessControlPolicyIds := ?) := { + resourceName := omit,//NA M + resourceType := omit,//NA M + resourceID := omit,//NA M + parentID := omit,//NA M + creationTime := omit,//NA M + lastModifiedTime := omit,//NA M + labels := p_labels,//MA + accessControlPolicyIDs := p_accessControlPolicyIds,//MA + expirationTime := ?,//MA M + link := ?,//M + appName := omit,//OA + app_ID := omit,//OA + aE_ID := omit,//OA + pointOfAccess := omit, //OA {"http://127.0.0.1:1400/monitor"},//O //{"http://192.168.1.92:18080/notifications/AE"}, // TODO: Check this => AE PoA + ontologyRef := omit,//OA + nodeLink := omit,//OA + requestReachability := omit,//OA + contentSerialization := omit,//OA + choice := omit//NA + }; /** * @desc Base primitiveContent for CREATE operation for AE resource * @param p_name Resource name - * @param p_accessControlPolicyIDs ACP IDs for the AE + * @param p_accessControlPolicyIds ACP IDs for the AE */ - template (value) AE_optional m_contentCreateAe (in template (omit) AcpType p_accessControlPolicyIDs, in template (omit) XSD.String p_name := c_defaultResourceName, in template (omit) XSD.ID p_appId := PX_APP_ID, in template (omit) PoaList p_poaList) := { + template (value) AE_optional m_contentCreateAe (in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.String p_name := c_defaultAeResourceName, in template (omit) XSD.ID p_appId := PX_APP_ID, in template (omit) PoaList p_poaList) := { resourceName := p_name,//O resourceType := omit,//NP @@ -754,7 +1073,7 @@ module OneM2M_Templates { creationTime := omit,//NP lastModifiedTime := omit,//NP labels := omit,//O - accessControlPolicyIDs := p_accessControlPolicyIDs,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O expirationTime := omit,//O announceTo := omit,//O announcedAttribute := omit,//O @@ -775,7 +1094,7 @@ module OneM2M_Templates { * @param p_acor Allowed originators * @param p_allowedOperations Allowed operations */ - template (value) AccessControlPolicy_optional m_contentCreateAcp (in template (omit) XSD.String p_name := c_defaultResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := { + template (value) AccessControlPolicy_optional m_contentCreateAcp (in template (omit) XSD.String p_name := c_defaultAccessControlPolicyResourceName, in template (value) ListOfURIs p_acor := PX_ACOR, in template (value) AccessControlOperations p_allowedOperations := int63 ) := { resourceName := p_name,//O resourceType := omit,//NP resourceID := omit,//NP @@ -795,14 +1114,32 @@ module OneM2M_Templates { choice := omit //NP }; + /** + * @desc Base reception template of primitiveContent for CREATE operation for AccessControlPolicyAnnc resource + * @param p_labels Labels + */ + template AccessControlPolicyAnnc_optional mw_contentCreateAcpAnnc (in template (omit) Labels p_labels := omit) := { + resourceName := omit,//NA M + resourceType := omit,//NA M + resourceID := omit,//NA M + parentID := omit,//NA M + creationTime := omit,//NA M + lastModifiedTime := omit,//NA M + labels := p_labels,//MA + expirationTime := ?,//MA M + link := ?,//M + privileges := *,//MA + selfPrivileges := *,//MA + choice := omit//NA + }; + template (value) AccessControlRule m_createAcr (in template (value) ListOfURIs p_acor, in template (value) AccessControlOperations p_allowedOperations) := { accessControlOriginators := p_acor,//{"*"},//{PX_AE_ID_STEM}, //{"admin:admin"}, accessControlOperations := p_allowedOperations, accessControlContexts_list := {} } - //added by @Naum - template (value) CSEBase_optional m_contentCreateCSEBase (in ServiceSubscribedAppRule p_serviceSubscribedAppRule) := { + /*template (value) CSEBase_optional m_contentCreateCSEBase (in template (value) ServiceSubscribedAppRule p_serviceSubscribedAppRule) := { resourceName := omit, resourceType := omit, resourceID := omit, @@ -816,56 +1153,228 @@ module OneM2M_Templates { supportedResourceType := omit, pointOfAccess := omit, nodeLink := omit, + e2eSecInfo := omit, choice := { choice_list := {{ serviceSubscribedAppRule := p_serviceSubscribedAppRule }} } - } + }*/ + + /** + * @desc Base primitiveContent for CREATE operation for CSEBase resource + * @param p_name Resource name + */ + template (value) CSEBase_optional m_contentCreateCSEBase (in template (omit) XSD.String p_name := c_defaultResourceName):= { + resourceName := p_name,//O + resourceType := omit, + resourceID := omit, + parentID := omit, + creationTime := omit, + lastModifiedTime := omit, + labels := omit, + accessControlPolicyIDs := omit, + cseType := omit, + cSE_ID := omit, + supportedResourceType := omit, + pointOfAccess := omit, + nodeLink := omit, + choice := omit + }; + + /** + * @desc Base primitiveContent for CREATE operation for PollingChannel resource + * @param p_accessControlPolicyIds ACP IDs for the PollingChannel + * @param p_name Resource name + */ + template (value) Delivery_optional m_contentCreateDelivery (in template (omit) XSD.String p_name := c_defaultDeliveryResourceName, + in template (omit) AcpType p_accessControlPolicyIds, + in template (value) XSD.ID p_source, + in template (value) XSD.ID p_target, + in template (value) Timestamp p_lifespan, + in template (value) EventCat p_eventCat, + in template (value) DeliveryMetaData p_deliveryMetaData) := { + + resourceName := p_name,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O + expirationTime := omit,//O + stateTag := omit,//NP + source := p_source,//M + target := p_target,//M + lifespan := p_lifespan,//M + eventCat := p_eventCat,//M + deliveryMetaData := p_deliveryMetaData,//M + aggregatedRequest := omit,//O + choice := omit//NP + + }; /** - * @desc Base primitiveContent for CREATE operation for Group resource - * @param p_maxNrOfMembers Max number of members - * @param p_memberIds Member IDs - * @param p_accessControlPolicyIDs ACP IDs for the Group - * @param p_name Resource name - */ - template (value) Group_optional m_contentCreateGroup ( in template (value) XSD.NonNegativeInteger p_maxNrOfMembers, - in template (value) ListOfURIs p_memberIds, - in template (omit) AcpType p_accessControlPolicyIDs, - in template (omit) MemberType p_memberType := omit, - in template (omit) ConsistencyStrategy p_consistencyStrategy := omit, - in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit, - in template (omit) XSD.String p_name := c_defaultResourceName) := { - resourceName := p_name,//O - resourceType := omit,//NP - resourceID := omit,//NP - parentID := omit,//NP - creationTime := omit,//NP - lastModifiedTime := omit,//NP - labels := omit,//O - accessControlPolicyIDs := p_accessControlPolicyIDs,//O - expirationTime := omit,//O - announceTo := omit,//O - announcedAttribute := omit,//O - creator := omit,//O - memberType := p_memberType,//O - currentNrOfMembers := omit,//NP - maxNrOfMembers := p_maxNrOfMembers,//M - memberIDs := p_memberIds,//M - membersAccessControlPolicyIDs := p_membersAccessControlPolicyIDs,//O - memberTypeValidated := omit,//NP - consistencyStrategy := p_consistencyStrategy,//O - groupName := omit,//O - choice := omit//NP - }; + * @desc Base primitiveContent for CREATE operation for Group resource + * @param p_maxNrOfMembers Max number of members + * @param p_memberIds Member IDs + * @param p_accessControlPolicyIds ACP IDs for the Group + * @param p_name Resource name + */ + template (value) Group_optional m_contentCreateGroup ( in template (value) XSD.PositiveInteger p_maxNrOfMembers, + in template (value) ListOfURIs p_memberIds, + in template (omit) AcpType p_accessControlPolicyIds, + in template (omit) MemberType p_memberType := omit, + in template (omit) ConsistencyStrategy p_consistencyStrategy := omit, + in template (omit) ListOfURIs p_membersAccessControlPolicyIDs := omit, + in template (omit) XSD.String p_name := c_defaultGroupResourceName) := { + resourceName := p_name,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O + expirationTime := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + creator := omit,//O + memberType := p_memberType,//O + currentNrOfMembers := omit,//NP + maxNrOfMembers := p_maxNrOfMembers,//M + memberIDs := p_memberIds,//M + membersAccessControlPolicyIDs := p_membersAccessControlPolicyIDs,//O + memberTypeValidated := omit,//NP + consistencyStrategy := p_consistencyStrategy,//O + groupName := omit,//O + choice := omit//NP + }; + + /** + * @desc Base reception template of primitiveContent for CREATE operation for GroupAnnc resource + */ + template GroupAnnc_optional mw_contentCreateGroupAnncBase := { + resourceName := omit,//NA M + resourceType := omit,//NA M + resourceID := omit,//NA M + parentID := omit,//NA M + creationTime := omit,//NA M + lastModifiedTime := omit,//NA M + labels := ?,//MA + accessControlPolicyIDs := ?,//MA + expirationTime := ?,//MA M + link := ?, + memberType := *, //OA + currentNrOfMembers := *, //OA + maxNrOfMembers := *, //OA + memberIDs := *, //OA + membersAccessControlPolicyIDs := *, //OA + memberTypeValidated := *, //OA + consistencyStrategy := *, //OA + groupName := *, //OA + choice := omit //NA + }; + + /** + * @desc Base primitiveContent for CREATE operation for MgmtObj resource + * @param p_name Resource name + * @param p_accessControlPolicyIds ACP IDs for the AE + */ + template (value) MgmtResource_optional m_contentCreateMgmtObj (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultMgmtObjResourceName) := { + + resourceName := p_name,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O + expirationTime := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + mgmtDefinition := omit,//O + objectIDs := omit,//O + objectPaths := omit,//O + description := omit//O + }; + + /** + * @desc Base primitiveContent for CREATE operation for MgmtCmd resource + * @param p_name Resource name + * @param p_accessControlPolicyIds ACP IDs for the AE + */ + template (value) MgmtResource_optional m_contentCreateMgmtCmd (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultMgmtCmdResourceName) := { + + resourceName := p_name,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O + expirationTime := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + mgmtDefinition := omit,//O + objectIDs := omit,//O + objectPaths := omit,//O + description := omit//O + }; + + /** + * @desc Base reception template of primitiveContent for CREATE operation for MgmtObjAnnc resource + */ + template AnnouncedMgmtResource_optional mw_contentCreateMgmtObjAnncBase := { + resourceName := omit,//NA M + resourceType := omit,//NA M + resourceID := omit,//NA M + parentID := omit,//NA M + creationTime := omit,//NA M + lastModifiedTime := omit,//NA M + labels := ?,//MA + accessControlPolicyIDs := ?,//MA + expirationTime := ?,//MA M + link := ?, + mgmtDefinition := ?, //MA + objectIDs := *, //OA + objectPaths := *, //OA + description := * //OA + }; + + /** + * @desc Base primitiveContent for CREATE operation for Node resource + * @param p_name Resource name + * @param p_accessControlPolicyIds ACP IDs for the AE + */ + template (value) Node_optional m_contentCreateNode (in template (omit) AcpType p_accessControlPolicyIds := omit, in template (omit) XSD.String p_name := c_defaultNodeResourceName, in template (omit) XSD.ID p_nodeId := "NodeID") := {//TODO Create PX for NodeID + + resourceName := p_name,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O + expirationTime := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + nodeID := p_nodeId,//M + hostedCSELink := omit,//O + choice := omit//O + }; + /** * @desc Base primitiveContent for CREATE operation for PollingChannel resource - * @param p_accessControlPolicyIDs ACP IDs for the PollingChannel + * @param p_accessControlPolicyIds ACP IDs for the PollingChannel * @param p_name Resource name */ - template (value) PollingChannel_optional m_contentCreatePollingChannel (in template (omit) XSD.String p_name := c_defaultResourceName) := { + template (value) PollingChannel_optional m_contentCreatePollingChannel (in template (omit) XSD.String p_name := c_defaultPollingChannelResourceName) := { resourceName := p_name,//O resourceType := omit,//NP resourceID := omit,//NP @@ -874,7 +1383,7 @@ module OneM2M_Templates { lastModifiedTime := omit,//NP labels := omit,//O expirationTime := omit//O - }; + }; /** * @desc Base primitiveContent for CREATE operation for Schedule resource @@ -882,7 +1391,7 @@ module OneM2M_Templates { * @param p_name Resource name */ template (value) Schedule_optional m_contentCreateSchedule (in template (value) ScheduleEntries p_scheduleElement, - in template (omit) XSD.String p_name := c_defaultResourceName) := { + in template (omit) XSD.String p_name := c_defaultScheduleResourceName) := { resourceName := p_name,//O resourceType := omit,//NP resourceID := omit,//NP @@ -895,9 +1404,25 @@ module OneM2M_Templates { announcedAttribute := omit,//O scheduleElement := p_scheduleElement,//M choice := omit//NP - }; + }; - template (value) ServiceSubscribedAppRule_optional m_contentCreateServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedApp_IDs, in ListOfM2MID p_allowedAEs) := { + /** + * @desc Base reception template of primitiveContent for CREATE operation for ScheduleAnnc resource + */ + template ScheduleAnnc_optional mw_contentCreateScheduleAnncBase := { + resourceName := omit,//NA M + resourceType := omit,//NA M + resourceID := omit,//NA M + parentID := omit,//NA M + creationTime := omit,//NA M + lastModifiedTime := omit,//NA M + labels := ?,//MA + expirationTime := ?,//MA M + link := ?, + scheduleElement := * //OA + }; + + template (value) ServiceSubscribedAppRule_optional m_contentCreateServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) := { resourceName := omit,//TODO TS-0004 7.4.29.1 2 Missing attribute resourceType := omit,//NP resourceID := omit,//NP @@ -908,10 +1433,28 @@ module OneM2M_Templates { accessControlPolicyIDs := omit,//O expirationTime := omit,//O applicableCredIDs := p_applicableCredIDs,//O - allowedApp_IDs := p_allowedApp_IDs,//O + allowedApp_IDs := p_allowedAppIDs,//O allowedAEs := p_allowedAEs,//O choice := omit //O } + + /** + * @desc Base primitiveContent for CREATE operation for StatsConfig resource + * @param p_name Resource name + */ + template (value) StatsConfig_optional m_contentCreateStatsConfig (in template (omit) XSD.String p_name := c_defaultStatsConfigResourceName) := { + resourceName := p_name,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + creator := omit,//O + choice := omit//O + }; /** @@ -920,7 +1463,7 @@ module OneM2M_Templates { * @param p_name Resource name */ template (value) Subscription_optional m_contentCreateSubscription (in template (value) ListOfURIs p_notificationURI, - in template (omit) XSD.String p_name := c_defaultResourceName) := { + in template (omit) XSD.String p_name := c_defaultSubscriptionResourceName) := { resourceName := p_name,//O resourceType := omit,//NP resourceID := omit,//NP @@ -936,7 +1479,6 @@ module OneM2M_Templates { groupID := omit,//O notificationForwardingURI := omit,//O batchNotify := omit,//O - rateLimit := omit,//O preSubscriptionNotify := omit,//O pendingNotification := omit,//O @@ -950,7 +1492,7 @@ module OneM2M_Templates { }; template (value) Subscription_optional m_contentCreateSubscriptionAdvanced (in template (value) ListOfURIs p_notificationURI, - in template (omit) XSD.String p_name := c_defaultResourceName, + in template (omit) XSD.String p_name := c_defaultSubscriptionResourceName, in template (omit) EventNotificationCriteria p_eventNotificationCriteria, in template (omit) XSD.PositiveInteger p_expirationCounter, in template (omit) BatchNotify p_batchNotify, @@ -965,7 +1507,7 @@ module OneM2M_Templates { subscriberURI := p_subscriberURI//O }; - template (value) EventNotificationCriteria m_eventNotificationCriteria ( in EventNotificationCriteria.notificationEventType_list p_notificationEventType_list := {}, in EventNotificationCriteria.attribute p_attribute_list := {}) := { //the parameter should be a list of NotificationEventTypeEventType + template (value) EventNotificationCriteria m_eventNotificationCriteria ( in EventNotificationCriteria.notificationEventType_list p_notificationEventType_list := {}, template (omit) EventNotificationCriteria.attribute p_attribute_list := omit) := { //the parameter should be a list of NotificationEventTypeEventType createdBefore := omit, createdAfter := omit, modifiedSince := omit, @@ -977,7 +1519,7 @@ module OneM2M_Templates { sizeAbove := omit, sizeBelow := omit, operationMonitor_list := {}, - attribute := p_attribute_list, // TODO this list should be able to be omited see 9.6.8 + attribute := p_attribute_list, notificationEventType_list := p_notificationEventType_list// TODO this list should be able to be omited see 9.6.8 (TS0001) }; @@ -994,8 +1536,8 @@ module OneM2M_Templates { * @desc Base primitiveContent for CREATE operation for ContentInstance resource * @param p_primitiveContent Content for the ContentInstance */ - template (value) ContentInstance_optional m_contentCreateContentInstance(XSD.String p_primitiveContent) := { - resourceName := c_defaultResourceName,//O + template (value) ContentInstance_optional m_contentCreateContentInstance(in template (omit) XSD.String p_name := c_defaultContentInstanceResourceName, XSD.String p_primitiveContent := "AnyValue") := { + resourceName := p_name,//O resourceType := omit,//NP resourceID := omit,//NP parentID := omit,//NP @@ -1010,18 +1552,35 @@ module OneM2M_Templates { contentInfo := "a",//O contentSize := omit,//NP ontologyRef := omit,//O - content := { - embed_values := {p_primitiveContent}, - attr := omit, - elem_list := {} - } //M + content := p_primitiveContent//M + }; + + /** + * @desc Base primitiveContent for CREATE operation for ContentInstanceAnnc resource + * @param p_primitiveContent Content for the ContentInstanceAnnc + */ + template ContentInstanceAnnc_optional mw_contentCreateContentInstanceAnncBase := { + resourceName := omit,//NA M + resourceType := omit,//NA M + resourceID := omit,//NA M + parentID := omit,//NA M + creationTime := omit,//NA M + lastModifiedTime := omit,//NA M + labels := ?,//MA + expirationTime := omit,//O NA + link := omit, //O NA + stateTag := *,// OA + contentInfo := *,//OA + contentSize := *,//OA + ontologyRef := *,//OA + content := * //OA }; /** * @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_defaultResourceName):= { + template (value) Container_optional m_contentCreateContainer (in template (omit) XSD.String p_name := c_defaultContainerResourceName):= { resourceName := p_name,//O resourceType := omit,//NP resourceID := omit,//NP @@ -1045,23 +1604,74 @@ module OneM2M_Templates { choice := omit//NP }; - //@Martin - template (value) LocationPolicy_optional m_contentCreateLocationPolicy (in template (value) LocationSource locationSource, in template (omit) AcpType p_accessControlPolicyIDs, in template (value) XSD.Duration locationUpdatePeriod, in template (value) NodeID locationTargetID, in template (value) XSD.AnyURI locationServerAddress) := { - resourceName := c_defaultResourceName, //O + /** + * @desc Base primitiveContent for CREATE operation for Container resource + * @param p_name Resource name + */ + template (value) RemoteCSE_optional m_contentCreateRemoteCSE (in template (omit) XSD.String p_name := c_defaultRemoteCSEResourceName, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.AnyURI p_cSEBase := PX_CSE1_ID, in template (omit) XSD.ID p_cSE_ID := PX_CSE_ID):= { + resourceName := p_name,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O + expirationTime := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + cseType := omit,//O + pointOfAccess := omit,//O + cSEBase := "/" & valueof(p_cSEBase),//M + cSE_ID := "/" & valueof(p_cSE_ID),//M + m2M_Ext_ID := omit,//O + trigger_Recipient_ID := omit,//O + requestReachability := true,//M + nodeLink := omit,//O + choice := omit//O + }; + + /** + * @desc Base reception template of primitiveContent for CREATE operation for ContainerAnnc resource + */ + template ContainerAnnc_optional mw_contentCreateContainerAnncBase := { + resourceName := omit,//NA M + resourceType := omit,//NA M + resourceID := omit,//NA M + parentID := omit,//NA M + creationTime := omit,//NA M + lastModifiedTime := omit,//NA M + labels := ?,//MA M + accessControlPolicyIDs := ?,//MA + expirationTime := ?,//MA M + link := ?, //M + stateTag := *, //OA + maxNrOfInstances := *, //OA + maxByteSize := *, //OA + maxInstanceAge := *, //OA + currentNrOfInstances := *, //OA + currentByteSize := *, //OA + locationID := *, //OA + ontologyRef := *, //OA + choice := omit //NA + }; + + template (value) LocationPolicy_optional m_contentCreateLocationPolicy (in template (value) LocationSource p_locationSource, in template (omit) AcpType p_accessControlPolicyIds, in template (omit) XSD.Duration p_locationUpdatePeriod, in template (omit) NodeID p_locationTargetID, in template (omit) XSD.AnyURI p_locationServerAddress) := { + resourceName := c_defaultLocationPolicyResourceName, //O resourceType := omit, //NP resourceID := omit, //NP parentID := omit, //NP creationTime := omit, //NP lastModifiedTime := omit, //NP - labels := LABELS,//O - accessControlPolicyIDs := p_accessControlPolicyIDs, //O + labels := PX_LABELS,//O + accessControlPolicyIDs := p_accessControlPolicyIds, //O expirationTime := omit, //O announceTo := omit, //O announcedAttribute := omit, //O - locationSource := locationSource, //M - locationUpdatePeriod := locationUpdatePeriod, //O - locationTargetID := locationTargetID, //O - locationServer := locationServerAddress,//O + locationSource := p_locationSource, //M + locationUpdatePeriod := p_locationUpdatePeriod, //O + locationTargetID := p_locationTargetID, //O + locationServer := p_locationServerAddress,//O locationContainerID := omit, //NP locationContainerName := PX_LOCATION_CONTAINER_NAME,//O locationStatus := omit, //NP @@ -1069,7 +1679,51 @@ module OneM2M_Templates { }; - //@Martin + template (value) LocationPolicy_optional m_contentCreateLocationPolicyBase := { + resourceName := c_defaultLocationPolicyResourceName, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + creationTime := omit, //NP + lastModifiedTime := omit, //NP + labels := PX_LABELS,//O + accessControlPolicyIDs := omit, //O + expirationTime := omit, //O + announceTo := omit, //O + announcedAttribute := omit, //O + locationSource := omit, //M + locationUpdatePeriod := omit, //O + locationTargetID := omit, //O + locationServer := omit,//O + locationContainerID := omit, //NP + locationContainerName := PX_LOCATION_CONTAINER_NAME,//O + locationStatus := omit, //NP + choice := omit //NP + }; + + /** + * @desc Base reception template of primitiveContent for CREATE operation for LocationPolicyAnnc resource + */ + template LocationPolicyAnnc_optional mw_contentCreateLocationPolicyAnncBase := { + resourceName := omit,//NA M + resourceType := omit,//NA M + resourceID := omit,//NA M + parentID := omit,//NA M + creationTime := omit,//NA M + lastModifiedTime := omit,//NA M + labels := ?,//MA + accessControlPolicyIDs := ?,//MA + expirationTime := ?,//MA M + link := ?, + locationSource := *, //OA + locationUpdatePeriod := *, //OA + locationTargetID := *, //OA + locationServer := *, //OA + locationContainerID := *, //OA + locationContainerName := *, //OA + locationStatus := * //OA + }; + template (value) Notification m_contentCreateNotification (in template (value) Representation p_resourcePresentation, in template (omit) NotificationEventType p_notifEventType, in template (omit) XSD.AnyURI p_subReference, @@ -1088,7 +1742,86 @@ module OneM2M_Templates { creator := omit, notificationForwardingURI := p_notifForwardingURI }; - + + /** + * @desc Base primitiveContent for CREATE operation for StatConfig resource + * @param p_primitiveConten t Content for the StatConfig + */ + template StatsConfig_optional m_contentCreateStatsConfigBase := { + resourceName := c_defaultStatsConfigResourceName, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + creationTime := omit, //NP + lastModifiedTime := omit, //NP + labels := PX_LABELS,//O + accessControlPolicyIDs := omit, //O + expirationTime := omit, //O + creator := omit, + choice := omit //NP + }; + + /** + * @desc Base primitiveContent for CREATE operation for StatCollect resource + * @param p_primitiveContent Content for the StatCollect + */ + template StatsCollect_optional m_contentCreateStatCollectBase := { + resourceName := c_defaultStatsCollectResourceName, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + creationTime := omit, //NP + lastModifiedTime := omit, //NP + labels := PX_LABELS,//O + accessControlPolicyIDs := omit, //O + expirationTime := omit, //O + creator := omit, + statsCollectID := omit, + collectingEntityID := omit, + collectedEntityID := omit, + statsRuleStatus := omit, + statModel := omit, + collectPeriod := omit, + eventID := omit, + choice := omit //NP + }; + + /** + * @desc Base primitiveContent for CREATE operation for M2mServiceSubscriptionProfile resource + * @param p_primitiveContent Content for the M2mServiceSubscriptionProfile + */ + template M2mServiceSubscriptionProfile_optional m_contentCreatem2mServiceSubscriptionProfileBase := { + resourceName := c_defaultm2mServiceSubscriptionProfileResourceName, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + creationTime := omit, //NP + lastModifiedTime := omit, //NP + labels := PX_LABELS,//O + accessControlPolicyIDs := omit, //O + expirationTime := omit, //O + choice := omit //NP + }; + + /** + * @desc Base primitiveContent for CREATE operation for ServiceSubscribedAppRule_optional resource + * @param p_primitiveContent Content for the ServiceSubscribedAppRule_optional + */ + template ServiceSubscribedAppRule_optional m_contentCreateServiceSubscribedAppRuleBase := { + resourceName := c_defaultServiceSubscribedAppRuleResourceName, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + creationTime := omit, //NP + lastModifiedTime := omit, //NP + labels := PX_LABELS,//O + accessControlPolicyIDs := omit, //O + expirationTime := omit, //O + applicableCredIDs := omit, + allowedApp_IDs := omit, + allowedAEs := omit, + choice := omit //NP + }; }//end group ContentCreate group ContentUpdate { @@ -1170,6 +1903,27 @@ module OneM2M_Templates { choice := omit//NP }; + + /** + * @desc Base primitiveContent for UPDATE operation for CSEBase resource + */ + template (value) CSEBase_optional m_contentUpdateCSEBase := { + resourceName := omit, + resourceType := omit, + resourceID := omit, + parentID := omit, + creationTime := omit, + lastModifiedTime := omit, + labels := omit, + accessControlPolicyIDs := omit, + cseType := omit, + cSE_ID := omit, + supportedResourceType := omit, + pointOfAccess := omit, + nodeLink := omit, + choice := omit + + }; /** * @desc Base primitiveContent for UPDATE operation for PollingChannel resource @@ -1261,21 +2015,42 @@ module OneM2M_Templates { choice := omit//NP }; - //@Martin - template (value) LocationPolicy_optional m_contentUpdateLocationPolicy (in template (omit) AcpType p_accessControlPolicyIDs, in template (value) XSD.Duration locationUpdatePeriod) := { + /** + * @desc Base primitiveContent for UPDATE operation for ContentInstance resource + */ + template (value) ContentInstance_optional m_contentUpdateContentInstance := { + resourceName := omit,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + expirationTime := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + stateTag := omit,//NP + creator := omit,//O + contentInfo := omit,//O + contentSize := omit,//NP + ontologyRef := omit,//O + content := omit //M + }; + + template (value) LocationPolicy_optional m_contentUpdateLocationPolicy (in template (omit) AcpType p_accessControlPolicyIds, in template (value) XSD.Duration p_locationUpdatePeriod) := { resourceName := omit,//NP resourceType := omit,//NP resourceID := omit,//NP parentID := omit,//NP creationTime := omit,//NP lastModifiedTime := omit,//NP - labels := LABELS,//O - accessControlPolicyIDs := p_accessControlPolicyIDs,//O + labels := PX_LABELS,//O + accessControlPolicyIDs := p_accessControlPolicyIds,//O expirationTime := omit,//O announceTo := omit,//O announcedAttribute := omit,//O locationSource := omit,//NP - locationUpdatePeriod := locationUpdatePeriod, //O + locationUpdatePeriod := p_locationUpdatePeriod, //O locationTargetID := omit, //NP locationServer := omit, //NP locationContainerID := omit, //NP @@ -1283,14 +2058,76 @@ module OneM2M_Templates { locationStatus := omit, //NP choice := omit //NP }; - - }//end group ContentUpdate - - group responseContent { - - template AE_optional mw_contentAeBase := { - resourceName := ?,//M - resourceType := ?,//M + + template (value) Node_optional m_contentUpdateNode := { + resourceName := omit, + resourceType := omit, + resourceID := omit, + parentID := omit, + creationTime := omit, + lastModifiedTime := omit, + labels := omit, + accessControlPolicyIDs := omit, + expirationTime := omit, + announceTo := omit, + announcedAttribute := omit, + nodeID := omit, + hostedCSELink := omit, + choice := omit + } + + template (value) RemoteCSE_optional m_contentUpdateRemoteCSE := { + resourceName := omit, + resourceType := omit, + resourceID := omit, + parentID := omit, + creationTime := omit, + lastModifiedTime := omit, + labels := omit, + accessControlPolicyIDs := omit, + expirationTime := omit, + announceTo := omit, + announcedAttribute := omit, + cseType := omit, + pointOfAccess := omit, + cSEBase := omit, + cSE_ID := omit, + m2M_Ext_ID := omit, + trigger_Recipient_ID := omit, + requestReachability := omit, + nodeLink := omit, + choice := omit + } + + template (value) AEAnnc_optional m_contentUpdateAEAnnc := { + resourceName := omit, + resourceType := omit, + resourceID := omit, + parentID := omit, + creationTime := omit, + lastModifiedTime := omit, + labels := omit, + accessControlPolicyIDs := omit, + expirationTime := omit, + link := omit, + appName := omit, + app_ID := omit, + aE_ID := omit, + pointOfAccess := omit, + ontologyRef := omit, + nodeLink := omit, + requestReachability := omit, + contentSerialization := omit, + choice := omit + } + + }//end group ContentUpdate + + group ResponseContent { + + template AE_optional mw_contentAeBase := { + resourceName := ?,//M + resourceType := ?,//M resourceID := ?,//M parentID := ?,//M creationTime := ?,//M @@ -1299,7 +2136,7 @@ module OneM2M_Templates { accessControlPolicyIDs := *,//O expirationTime := ?,//M announceTo := *,//O - announcedAttribute := ?,//M + announcedAttribute := *,//O appName := *,//O app_ID := ?,//M aE_ID := ?,//M @@ -1311,7 +2148,7 @@ module OneM2M_Templates { choice := *//O }; - template AE_optional mw_contentAe_allOmit := { + template AE_optional m_contentAe_allOmit := { resourceName := omit,//M resourceType := omit,//M resourceID := omit,//M @@ -1322,7 +2159,7 @@ module OneM2M_Templates { accessControlPolicyIDs := omit,//O expirationTime := omit,//M announceTo := omit,//O - announcedAttribute := omit,//M + announcedAttribute := omit,//O appName := omit,//O app_ID := omit,//M aE_ID := omit,//M @@ -1333,6 +2170,29 @@ module OneM2M_Templates { contentSerialization := omit,//O choice := omit//O }; + + template AE_optional mw_contentAe_any := { + resourceName := *,//M + resourceType := *,//M + resourceID := *,//M + parentID := *,//M + creationTime := *,//M + lastModifiedTime := *,//M + labels := *,//O + accessControlPolicyIDs := *,//O + expirationTime := *,//M + announceTo := *,//O + announcedAttribute := *,//O + appName := *,//O + app_ID := *,//M + aE_ID := *,//M + pointOfAccess := *,//O + ontologyRef := *,//O + nodeLink := *,//O + requestReachability := *,//M + contentSerialization := *,//O + choice := *//O + }; template AccessControlPolicy_optional mw_contentAcpBase := { resourceName := ?,//M @@ -1350,7 +2210,23 @@ module OneM2M_Templates { choice := *//O }; - template AccessControlPolicy_optional mw_contentAcp_allOmit modifies mw_contentAcpBase := { + template AccessControlPolicy_optional mw_contentAcp_any := { + resourceName := *,//M + resourceType := *,//M + resourceID := *,//M + parentID := *,//M + creationTime := *,//M + lastModifiedTime := *,//M + labels := *,//O + expirationTime := *,//M + announceTo := *,//O + announcedAttribute := *,//M + privileges := *,//M + selfPrivileges := *,//M + choice := *//O + } + + template AccessControlPolicy_optional m_contentAcp_allOmit := { resourceName := omit,//M resourceType := omit,//M resourceID := omit,//M @@ -1366,6 +2242,28 @@ module OneM2M_Templates { choice := omit//O } + template LocationPolicy_optional m_contentLocationPolicy_allOmit := { + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + announceTo := omit,//O + announcedAttribute := omit,//O + locationSource := omit,//M + locationUpdatePeriod := omit,//O + locationTargetID := omit,//O + locationServer := omit,//O + locationContainerID := omit,//O + locationContainerName := omit,//O + locationStatus := omit,//M + choice := omit//O + } + template AccessControlPolicy_optional mw_contentAcp_rc1 modifies mw_contentAcpBase := { choice := omit //O } @@ -1373,8 +2271,9 @@ module OneM2M_Templates { //TODO template XSD.AnyURI mw_contentAcp_rc2 := ?; - template AccessControlPolicy_optional mw_contentAcp_rc3 modifies mw_contentAcpBase := { - choice := omit //O + template Resource mw_contentAcp_rc3 := { + choice := {accessControlPolicy := ?}, + uRI := ? } template AccessControlPolicy_optional mw_contentAcp_rc4 modifies mw_contentAcpBase := { @@ -1404,6 +2303,10 @@ module OneM2M_Templates { template AccessControlPolicy_optional mw_contentAcp_rc7 modifies mw_contentAcpBase := { } + + template AccessControlPolicy_optional mw_contentAcp_rc8 modifies m_contentAcp_allOmit := { + choice := {childResource_list := ?} //O + } template Group_optional mw_contentGroupBase := { resourceName := ?,//M @@ -1429,7 +2332,31 @@ module OneM2M_Templates { choice := *//O }; - template Group_optional mw_contentGroup_allOmit modifies mw_contentGroupBase := { + template Group_optional mw_contentGroup_any := { + resourceName := *,//M + resourceType := *,//M + resourceID := *,//M + parentID := *,//M + creationTime := *,//M + lastModifiedTime := *,//M + labels := *,//O + accessControlPolicyIDs := *,//O + expirationTime := *,//M + announceTo := *,//O + announcedAttribute := *,//M + creator := *,//O + memberType := *,//M + currentNrOfMembers := *,//M + maxNrOfMembers := *,//M + memberIDs := *,//M + membersAccessControlPolicyIDs := *,//O + memberTypeValidated := *,//M + consistencyStrategy := *,//O + groupName := *,//O + choice := *//O + } + + template Group_optional m_contentGroup_allOmit := { resourceName := omit,//M resourceType := omit,//M resourceID := omit,//M @@ -1459,8 +2386,9 @@ module OneM2M_Templates { template XSD.AnyURI mw_contentGroup_rc2 := ?; - template Group_optional mw_contentGroup_rc3 modifies mw_contentGroupBase := { - choice := omit //O + template Resource mw_contentGroup_rc3 := { + choice := {group_ := ?}, + uRI := ? } template Group_optional mw_contentGroup_rc4 modifies mw_contentGroupBase := { @@ -1498,6 +2426,32 @@ module OneM2M_Templates { template Group_optional mw_contentGroup_rc7 modifies mw_contentGroupBase := { } + + template Group_optional mw_contentGroup_rc8 modifies m_contentGroup_allOmit := { + choice := {childResource_list := ?} //O + } + + template MgmtCmd_optional m_contentMgmtCmd_allOmit := { + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + description := omit,//O + cmdType := omit,//M + execReqArgs := omit,//O + execEnable := omit,//M + execTarget := omit,//M + execMode := omit,//O + execFrequency := omit,//O + execDelay := omit,//O + execNumber := omit,//O + choice := omit//M + } template PollingChannel_optional mw_contentPollingChannelBase := { resourceName := ?,//M @@ -1510,7 +2464,18 @@ module OneM2M_Templates { expirationTime := ?//M }; - template PollingChannel_optional mw_contentPollingChannel_allOmit := { + template PollingChannel_optional mw_contentPollingChannel_any := { + resourceName := *,//M + resourceType := *,//M + resourceID := *,//M + parentID := *,//M + creationTime := *,//M + lastModifiedTime := *,//M + labels := *,//O + expirationTime := *//M + }; + + template PollingChannel_optional m_contentPollingChannel_allOmit := { resourceName := omit,//M resourceType := omit,//M resourceID := omit,//M @@ -1521,6 +2486,79 @@ module OneM2M_Templates { expirationTime := omit//M }; + template PollingChannel_optional mw_contentPollingChannel_rc1 modifies mw_contentPollingChannelBase := { + } + + template XSD.AnyURI mw_contentPollingChannel_rc2 := ?; + + template Resource mw_contentPollingChannel_rc3 := { + choice := {pollingChannel := ?}, + uRI := ? + } + + template PollingChannel_optional mw_contentPollingChannel_rc4 modifies mw_contentPollingChannelBase := { + } + + template PollingChannel_optional mw_contentPollingChannel_rc5 modifies mw_contentPollingChannelBase := { + } + + template PollingChannel_optional mw_contentPollingChannel_rc6 modifies mw_contentPollingChannelBase := { + resourceName := *,//M + resourceType := *,//M + resourceID := *,//M + parentID := *,//M + creationTime := *,//M + lastModifiedTime := *,//M + labels := *,//O + expirationTime := *//M + } + + template RemoteCSE_optional m_contentRemoteCSE_allOmit := { + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + announceTo := omit,//O + announcedAttribute := omit,//O + cseType := omit,//O + pointOfAccess := omit,//O + cSEBase := omit,//M + cSE_ID := omit,//M + m2M_Ext_ID := omit,//O + trigger_Recipient_ID := omit,//O + requestReachability := omit,//M + nodeLink := omit,//O + choice := omit//O + }; + + template RemoteCSE_optional mw_contentRemoteCSEBase := { + resourceName := ?,//M + resourceType := ?,//M + resourceID := ?,//M + parentID := ?,//M + creationTime := ?,//M + lastModifiedTime := ?,//M + labels := *,//O + accessControlPolicyIDs := *,//O + expirationTime := ?,//M + announceTo := *,//O + announcedAttribute := *,//O + cseType := *,//O + pointOfAccess := *,//O + cSEBase := ?,//M + cSE_ID := ?,//M + m2M_Ext_ID := *,//O + trigger_Recipient_ID := *,//O + requestReachability := ?,//M + nodeLink := *,//O + choice := *//O + }; + template Schedule_optional mw_contentScheduleBase := { resourceName := ?,//M resourceType := ?,//M @@ -1536,7 +2574,22 @@ module OneM2M_Templates { choice := *//O }; - template Schedule_optional mw_contentSchedule_allOmit modifies mw_contentScheduleBase := { + template Schedule_optional mw_contentSchedule_any := { + resourceName := *,//M + resourceType := *,//M + resourceID := *,//M + parentID := *,//M + creationTime := *,//M + lastModifiedTime := *,//M + labels := *,//O + expirationTime := *,//M + announceTo := *,//O + announcedAttribute := *,//M + scheduleElement := *,//M + choice := *//O + } + + template Schedule_optional m_contentSchedule_allOmit := { resourceName := omit,//M resourceType := omit,//M resourceID := omit,//M @@ -1557,8 +2610,9 @@ module OneM2M_Templates { template XSD.AnyURI mw_contentSchedule_rc2 := ?; - template Schedule_optional mw_contentSchedule_rc3 modifies mw_contentScheduleBase := { - choice := omit //O + template Resource mw_contentSchedule_rc3 := { + choice := {schedule := ?}, + uRI := ? } template Schedule_optional mw_contentSchedule_rc4 modifies mw_contentScheduleBase := { @@ -1587,6 +2641,45 @@ module OneM2M_Templates { template Schedule_optional mw_contentSchedule_rc7 modifies mw_contentScheduleBase := { } + + template Schedule_optional mw_contentSchedule_rc8 modifies m_contentSchedule_allOmit := { + choice := {childResource_list := ?} //O + } + + template StatsCollect_optional m_contentStatsCollect_allOmit := { + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + creator := omit,//O + statsCollectID := omit,//M + collectingEntityID := omit,//M + collectedEntityID := omit,//M + statsRuleStatus := omit,//M + statModel := omit,//M + collectPeriod := omit,//O + eventID := omit,//O + choice := omit//M + } + + template StatsConfig_optional m_contentStatsConfig_allOmit := { + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + creator := omit,//O + choice := omit//M + } template Subscription_optional mw_contentSubscriptionBase := { resourceName := ?,//M @@ -1615,7 +2708,35 @@ module OneM2M_Templates { subscriberURI := *,//O choice := *//O }; - template Subscription_optional mw_contentSubscription_allOmit modifies mw_contentSubscriptionBase := { + template Subscription_optional mw_contentSubscription_any := { + resourceName := *,//M + resourceType := *,//M + resourceID := *,//M + parentID := *,//M + creationTime := *,//M + lastModifiedTime := *,//M + labels := *,//O + accessControlPolicyIDs := *,//O + expirationTime := *,//M + eventNotificationCriteria := *,//O + expirationCounter := *,//O + notificationURI := *,//M + groupID := *,//O + notificationForwardingURI := *,//O + batchNotify := *,//O + rateLimit := *,//O + preSubscriptionNotify := *,//O + pendingNotification := *,//O + notificationStoragePriority := *,//O + latestNotify := *,//O + notificationContentType := *,//M + notificationEventCat := *,//O + creator := *,//O + subscriberURI := *,//O + choice := *//O + } + + template Subscription_optional m_contentSubscription_allOmit := { resourceName := omit,//M resourceType := omit,//M resourceID := omit,//M @@ -1642,15 +2763,15 @@ module OneM2M_Templates { subscriberURI := omit,//O choice := omit//O } - template Subscription_optional mw_contentSubscription_rc1 modifies mw_contentSubscriptionBase := { choice := omit //O } template XSD.AnyURI mw_contentSubscription_rc2 := ?; - template Subscription_optional mw_contentSubscription_rc3 modifies mw_contentSubscriptionBase := { - choice := omit //O + template Resource mw_contentSubscription_rc3 := { + choice := {subscription := ?}, + uRI := ? } template Subscription_optional mw_contentSubscription_rc4 modifies mw_contentSubscriptionBase := { @@ -1692,6 +2813,10 @@ module OneM2M_Templates { template Subscription_optional mw_contentSubscription_rc7 modifies mw_contentSubscriptionBase := { } + + template Subscription_optional mw_contentSubscription_rc8 modifies m_contentSubscription_allOmit := { + choice := {childResource := ?} //O + } template ContentInstance_optional mw_contentContentInstanceBase := { resourceName := ?,//M @@ -1709,10 +2834,12 @@ module OneM2M_Templates { contentInfo := *,//O contentSize := ?,//M ontologyRef := *,//O - content := ?//M - + content := ?//M }; + template ContentInstance_optional mw_contentContentInstance_rc1 modifies mw_contentContentInstanceBase := { + } + template Container_optional mw_contentContainerBase := { resourceName := ?,//M resourceType := ?,//M @@ -1737,7 +2864,31 @@ module OneM2M_Templates { choice := *//O }; - template Container_optional mw_contentContainer_allOmit modifies mw_contentContainerBase := { + template Container_optional mw_contentContainer_any := { + resourceName := *,//M + resourceType := *,//M + resourceID := *,//M + parentID := *,//M + creationTime := *,//M + lastModifiedTime := *,//M + labels := *,//O + accessControlPolicyIDs := *,//O + expirationTime := *,//M + announceTo := *,//O + announcedAttribute := *,//M + stateTag := *,//M + creator := *,//M + maxNrOfInstances := *,//O + maxByteSize := *,//O + maxInstanceAge := *,//O + currentNrOfInstances := *,//M + currentByteSize := *,//M + locationID := *,//O + ontologyRef := *,//O + choice := *//O + } + + template Container_optional m_contentContainer_allOmit := { resourceName := omit,//M resourceType := omit,//M resourceID := omit,//M @@ -1761,14 +2912,37 @@ module OneM2M_Templates { choice := omit//O } + template Delivery_optional m_contentDelivery_allOmit := { + + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + stateTag := omit,//M + source := omit,//M + target := omit,//M + lifespan := omit,//M + eventCat := omit,//M + deliveryMetaData := omit,//M + aggregatedRequest := omit,//M + choice := omit//O + + }; + template Container_optional mw_contentContainer_rc1 modifies mw_contentContainerBase := { choice := omit //O } template XSD.AnyURI mw_contentContainer_rc2 := ?; - template Container_optional mw_contentContainer_rc3 modifies mw_contentContainerBase := { - choice := omit //O + template Resource mw_contentContainer_rc3 := { + choice := {container := ?}, + uRI := ? } template Container_optional mw_contentContainer_rc4 modifies mw_contentContainerBase := { @@ -1807,32 +2981,91 @@ module OneM2M_Templates { } - template Notification mw_contentNotificationAllOmit := { - notificationEvent := omit, + template Container_optional mw_contentContainer_rc8 modifies m_contentContainer_allOmit := { + choice := {childResource_list := ?} //O + } + + template Notification m_contentNotification_allOmit := { + notificationEvent:= omit, verificationRequest := omit, subscriptionDeletion := omit, subscriptionReference := omit, creator := omit, notificationForwardingURI := omit }; + + template Notification mw_contentNotification_any := { + notificationEvent := *, + verificationRequest := *, + subscriptionDeletion := *, + subscriptionReference := *, + creator := *, + notificationForwardingURI := * + }; + template Notification mw_contentNotificationBase := { notificationEvent := *,//O verificationRequest := *,//O subscriptionDeletion := *,//O - subscriptionReference := ?,//M + subscriptionReference := *,//M //TODO Put it back to ? subscriptionReference is mandatory creator := *,//O notificationForwardingURI := *//O }; + + template Notification mw_contentNotificationVerification modifies mw_contentNotificationBase := { + verificationRequest := true, + creator := ? + } - template Notification mw_contentNotification (in template Representation p_representation) modifies mw_contentNotificationBase := { + template Notification mw_contentNotification (in template (present) Representation p_representation) modifies mw_contentNotificationBase := { notificationEvent := { representation := p_representation, operationMonitor := *, notificationEventType := ? } }; + + template Node_optional m_contentNode_allOmit := { + + resourceName := omit, + resourceType := omit, + resourceID := omit, + parentID := omit, + creationTime := omit, + lastModifiedTime := omit, + labels := omit, + accessControlPolicyIDs := omit, + expirationTime := omit, + announceTo := omit, + announcedAttribute := omit, + nodeID := omit, + hostedCSELink := omit, + choice := omit + + }; + + template CSEBase_optional mw_contentCSEBaseBase := { + resourceName := ?,//M + resourceType := ?,//M + resourceID := ?,//M + parentID := ?,//M + creationTime := ?,//M + lastModifiedTime := ?,//M + labels := *,//O + accessControlPolicyIDs := *,//O + cseType := *,//O + cSE_ID := ?,//M + supportedResourceType := ?,//M + pointOfAccess := ?,//M + nodeLink := *,//O + choice := *//O + }; + + template CSEBase_optional mw_contentCSEBase_rc1 modifies mw_contentCSEBaseBase := { + choice := omit //O + } }//end group responseContent @@ -1840,104 +3073,186 @@ module OneM2M_Templates { group SpecialContents { template (value) AE_update_invalid m_contentUpdateAe_invalid := { - labels := omit, - accessControlPolicyIDs := omit, - creationTime := omit, - expirationTime := omit, - announceTo := omit, - announcedAttribute := omit, - appName := omit, - pointOfAccess := omit, - ontologyRef := omit, - requestReachability := omit + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + expirationCounter := omit,//Invalid attribute + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + announceTo := omit,//O + announcedAttribute := omit,//O + appName := omit,//O + app_ID := omit,//M + aE_ID := omit,//M + pointOfAccess := omit,//O + ontologyRef := omit,//O + nodeLink := omit,//O + requestReachability := omit,//M + contentSerialization := omit,//O + choice := omit//O }; template (value) ACP_update_invalid m_contentUpdateAcp_invalid := { - labels := omit, - expirationTime := omit, - creationTime := omit, - expirationCounter := omit, - announceTo := omit, - announcedAttribute := omit, - privileges := omit, - selfPrivileges := omit + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + expirationCounter := omit,//Invalid attribute + labels := omit,//O + expirationTime := omit,//M + announceTo := omit,//O + announcedAttribute := omit,//M + privileges := omit,//M + selfPrivileges := omit,//M + choice := omit//O }; template (value) Group_update_invalid m_contentUpdateGroup_invalid := { - labels := omit, - accessControlPolicyIDs := omit, - creationTime := omit, - expirationCounter := omit, - expirationTime := omit, - announceTo := omit, - announcedAttribute := omit, - maxNrOfMembers := omit, - memberIDs := omit, - membersAccessControlPolicyIDs := omit, - groupName := omit + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + expirationCounter := omit,//Invalid attribute + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + announceTo := omit,//O + announcedAttribute := omit,//M + creator := omit,//O + memberType := omit,//M + currentNrOfMembers := omit,//M + maxNrOfMembers := omit,//M + memberIDs := omit,//M + membersAccessControlPolicyIDs := omit,//O + memberTypeValidated := omit,//M + consistencyStrategy := omit,//O + groupName := omit,//O + choice := omit//O }; template (value) PollingChannel_update_invalid m_contentUpdatePollingChannel_invalid := { - labels := omit, - accessControlPolicyIDs := omit, - creationTime := omit, - expirationCounter := omit, - expirationTime := omit, - pollingChannelURI := omit + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + expirationCounter := omit,//Invalid attribute + labels := omit,//O + expirationTime := omit//M }; template (value) Schedule_update_invalid m_contentUpdateSchedule_invalid := { - labels := omit, - creationTime := omit, - expirationCounter := omit, - expirationTime := omit, - announceTo := omit, - announcedAttribute := omit, - scheduleElement := omit + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + expirationCounter := omit,//Invalid attribute + labels := omit,//O + expirationTime := omit,//M + announceTo := omit,//O + announcedAttribute := omit,//M + scheduleElement := omit,//M + choice := omit//O }; template (value) Subscription_update_invalid m_contentUpdateSubscription_invalid := { - labels := omit, - accessControlPolicyIDs := omit, - creationTime := omit, - maxNrOfInstances := omit, - expirationTime := omit, - eventNotificationCriteria := omit, - expirationCounter := omit, - notificationURI := omit, - groupID := omit, - notificationForwardingURI := omit, - batchNotify := omit, - rateLimit := omit, - pendingNotification := omit, - notificationStoragePriority := omit, - latestNotify := omit, - notificationContentType := omit, - notificationEventCat := omit + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + maxNrOfInstances := omit,//Invalid attribute + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + eventNotificationCriteria := omit,//O + expirationCounter := omit,//O + notificationURI := omit,//M + groupID := omit,//O + notificationForwardingURI := omit,//O + batchNotify := omit,//O + rateLimit := omit,//O + preSubscriptionNotify := omit,//O + pendingNotification := omit,//O + notificationStoragePriority := omit,//O + latestNotify := omit,//O + notificationContentType := omit,//M + notificationEventCat := omit,//O + creator := omit,//O + subscriberURI := omit,//O + choice := omit//O }; template (value) Container_update_invalid m_contentUpdateContainer_invalid := { - labels := omit, - accessControlPolicyIDs := omit, - creationTime := omit, - expirationCounter := omit, - expirationTime := omit, - announceTo := omit, - announcedAttribute := omit, - maxNrOfInstances := omit, - maxByteSize := omit, - maxInstanceAge := omit, - locationID := omit, - ontologyRef := omit + resourceName := omit,//M + resourceType := omit,//M + resourceID := omit,//M + parentID := omit,//M + creationTime := omit,//M + lastModifiedTime := omit,//M + expirationCounter := omit,//Invalid attribute + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//M + announceTo := omit,//O + announcedAttribute := omit,//M + stateTag := omit,//M + creator := omit,//M + maxNrOfInstances := omit,//O + maxByteSize := omit,//O + maxInstanceAge := omit,//O + currentNrOfInstances := omit,//M + currentByteSize := omit,//M + locationID := omit,//O + ontologyRef := omit,//O + choice := omit//O }; }//end group SpecialContents group ResponsePrimitives { - template ResponsePrimitive mw_responsePrimitive(ResponseStatusCode p_statusCode) := { + + /** + * @desc Base template for sending ResponsePrimitive + * @param p_statusCode Status code + * @param p_requestId Request ID of the corresponding request + */ + template (value) ResponsePrimitive m_responsePrimitive(in ResponseStatusCode p_statusCode, in RequestID p_requestId, in template (omit) PrimitiveContent p_content := omit) := { + responseStatusCode := p_statusCode, + requestIdentifier := p_requestId, + primitiveContent := p_content, + to_ := omit, + from_ := omit, + originatingTimestamp := omit, + resultExpirationTimestamp := omit, + eventCategory := omit + }; + + /** + * @desc Base template for sending ResponsePrimitive + * @param p_statusCode Status code + * @param p_requestId Request ID of the corresponding request + */ + template (value) ResponsePrimitive m_responsePrimitive_content(in ResponseStatusCode p_statusCode, in RequestID p_requestId, in template (value) PrimitiveContent p_content) modifies m_responsePrimitive := { + primitiveContent := p_content + } + + template ResponsePrimitive mw_responsePrimitive(in template (present) ResponseStatusCode p_statusCode, in template PrimitiveContent p_content := *) := { responseStatusCode := p_statusCode, requestIdentifier := ?, - primitiveContent := *, + primitiveContent := p_content, to_ := *, from_ := *, originatingTimestamp := *, @@ -1978,22 +3293,30 @@ module OneM2M_Templates { eventCategory := * }; - group Notify{ + template ResponsePrimitive mw_responseDiscovery := { + responseStatusCode := int2000, + requestIdentifier := ?, + primitiveContent := {uRIList := ?}, + to_ := *, + from_ := *, + originatingTimestamp := *, + resultExpirationTimestamp := *, + eventCategory := * + }; - template ResponsePrimitive m_responseNotification(ResponseStatusCode p_statusCode, in template(omit) PrimitiveContent p_notification := omit) := { - responseStatusCode := p_statusCode, - requestIdentifier := "m_responseNotification" & f_rnd(1, 1000000), - primitiveContent := p_notification, - to_ := omit, - from_ := omit, - originatingTimestamp := omit, - resultExpirationTimestamp := omit, - eventCategory := omit - }; - - } + template ResponsePrimitive m_responseNotification(ResponseStatusCode p_statusCode, in template(omit) PrimitiveContent p_notification := omit) := { + responseStatusCode := p_statusCode, + requestIdentifier := testcasename() & "-m_responseNotification" & f_rnd(1, 1000000), + primitiveContent := p_notification, + to_ := omit, + from_ := omit, + originatingTimestamp := omit, + resultExpirationTimestamp := omit, + eventCategory := omit + }; }//end group ResponsePrimitives } // end of module + \ No newline at end of file diff --git a/LibOneM2M/OneM2M_TestSystem.ttcn b/LibOneM2M/OneM2M_TestSystem.ttcn index 3b93a2d083c81f4d1bf47e0c9dde21ab36a5f165..6c2d7d5edc5935584dccf1673575314527030cb8 100644 --- a/LibOneM2M/OneM2M_TestSystem.ttcn +++ b/LibOneM2M/OneM2M_TestSystem.ttcn @@ -6,48 +6,33 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_TestSystem.ttcn $ - * $Id: OneM2M_TestSystem.ttcn 175 2016-11-22 12:39:39Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_TestSystem.ttcn $ + * $Id: OneM2M_TestSystem.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Test System module for oneM2M * */ module OneM2M_TestSystem { import from OneM2M_Types all; - import from OneM2M_TypesAndValues all; - import from LibCommon_Time {modulepar all}; - import from XSD all; - - /* Ports */ - /** - * @desc Port to transport oneM2M primitives - */ - type port OneM2MPort message { - in - MsgIn; - out - MsgOut; - } - - /** - * @desc Port to transport Adaptor Control primitives - */ - type port AdapterControlPort message { - in - AcResponsePrimitive; - out - AcRequestPrimitive; - } + import from LibCommon_Time all; + import from OneM2M_Ports all; + import from OneM2M_Pixits all; - /* Components */ +/* *************************************** + * Test System Components + * *************************************** + */ type component Tester { port AdapterControlPort acPort; //timers timer tc_ac := PX_TAC; timer tc_wait; //global variables + var Configurations vc_config; var MyResourcesList vc_resourcesList; var IntegerList vc_resourcesIndexToBeDeleted := {}; + var PrimitiveScope vc_primitiveScope := PX_PRIMITIVE_SCOPE; + var AddressingMethod vc_addressingMethod := PX_ADDRESSING_METHOD; } type component CseTester extends Tester { @@ -56,6 +41,7 @@ module OneM2M_TestSystem { //global variables var AE_optional vc_aeAux;//TODO To be removed + var RemoteCSE_optional vc_remoteCSEAux;//TODO To be removed var AccessControlPolicy_optional vc_acpAux; var integer vc_acpAuxIndex := -1; @@ -80,54 +66,7 @@ module OneM2M_TestSystem { - /* Primitives */ - /** - * @desc Type for the oneM2M primitives exchange - * @member primitive oneM2M primitive - * @member host IP Address of the destination - * @member xmlNamespace XML Namespace to be used - * @member protocolBinding Protocol binding to be used - * @member serialization Serialization to be used - * @member nullFields Fields that are to be included in the oneM2M primitive but empty, i.e. <labels></labels> - */ - type record MsgOut { - union { - RequestPrimitive requestPrimitive, - ResponsePrimitive responsePrimitive - } primitive, - charstring host optional, - charstring xmlNamespace optional, - charstring protocolBinding optional, - charstring serialization optional, - AttributeList_1 nullFields optional - } - - /** - * @desc Type for the oneM2M primitives exchange - * @member primitive oneM2M primitive - */ - type record MsgIn { - union { - RequestPrimitive requestPrimitive, - ResponsePrimitive responsePrimitive - } primitive - } - - type record AcRequestPrimitive { - charstring event, - anytype data - } - with { - encode "adapter"; - } - type record AcResponsePrimitive { - charstring event, - anytype data - } - with { - encode "adapter"; - } }// end of module with { diff --git a/LibOneM2M/OneM2M_Types.ttcn b/LibOneM2M/OneM2M_Types.ttcn index 99343413fd7a29afc0c0ea87f0d4206894831d4e..ce10a29f869b62a12f66d20d472d4a2a7866e4e7 100644 --- a/LibOneM2M/OneM2M_Types.ttcn +++ b/LibOneM2M/OneM2M_Types.ttcn @@ -6,4115 +6,5202 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Types.ttcn $ - * $Id: OneM2M_Types.ttcn 175 2016-11-22 12:39:39Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_Types.ttcn $ + * $Id: OneM2M_Types.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Test System module for oneM2M * */ - module OneM2M_Types { -import from XSD all; - - -type record AccessControlPolicy -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - SetOfAcrs privileges, - SetOfAcrs selfPrivileges, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record AccessControlPolicyAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime, - XSD.AnyURI link, - SetOfAcrs privileges, - SetOfAcrs selfPrivileges, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record SetOfAcrs -{ - record of AccessControlRule accessControlRule_list -} -with { - variant "name as uncapitalized"; - variant (accessControlRule_list) "untagged"; - variant (accessControlRule_list[-]) "name as 'accessControlRule'"; -}; - - -type record AccessControlRule -{ - ListOfURIs accessControlOriginators, - AccessControlOperations accessControlOperations, - record of record { - record of ScheduleEntry accessControlWindow_list, - record { - record length(1 .. infinity) of Ipv4 ipv4Addresses optional,//TODO - record length(1 .. infinity) of Ipv6 ipv6Addresses optional//TODO - } accessControlIpAddresses optional, - LocationRegion accessControlLocationRegion optional - } accessControlContexts_list -} -with { - variant "name as uncapitalized"; - variant (accessControlContexts_list) "untagged"; - variant (accessControlContexts_list[-]) "name as 'accessControlContexts'"; - variant (accessControlContexts_list[-].accessControlWindow_list) "untagged"; - variant (accessControlContexts_list[-].accessControlWindow_list[-]) "name as 'accessControlWindow'"; - variant (accessControlContexts_list[-].accessControlIpAddresses.ipv4Addresses) "list"; - variant (accessControlContexts_list[-].accessControlIpAddresses.ipv6Addresses) "list"; -}; - - -type record LocationRegion -{ - union { - record length(1 .. infinity) of CountryCode countryCode, - record length(3) of XSD.Float circRegion - } choice -} -with { - variant "name as uncapitalized"; - variant (choice) "untagged"; - variant (choice.countryCode) "list"; - variant (choice.circRegion) "list"; -}; - - - - -type XSD.String CountryCode (pattern "[A-Z]#(2)") -with { - variant "name as uncapitalized"; -}; - + import from XSD all; - -type XSD.Token Ipv4 (pattern "[0-9A-Fa-f]#(8)(/([0-9]|[1-2][0-9]|3[0-2]))#(0,1)") -with { - variant "name as uncapitalized"; -}; + type record AccessControlPolicy + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional,//TODO To be put as optional + SetOfAcrs privileges, + SetOfAcrs selfPrivileges, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; -type XSD.Token Ipv6 (pattern "::(/0)#(0,1)") -with { - variant "name as uncapitalized"; -}; - - -type record ActiveCmdhPolicy -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.ID activeCmdhPolicyLink -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; -}; - - -type record AE -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - XSD.String appName optional, - XSD.String app_ID, - XSD.ID aE_ID, - PoaList pointOfAccess optional, - XSD.AnyURI ontologyRef optional, - XSD.AnyURI nodeLink optional, - XSD.Boolean requestReachability, - Serializations contentSerialization optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Container container, - Group group_, - AccessControlPolicy accessControlPolicy, - Subscription subscription, - PollingChannel pollingChannel, - Schedule schedule - } choice_list - } choice optional -} -with { - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (app_ID) "name as 'App-ID'"; - variant (aE_ID) "name as 'AE-ID'"; - //variant (requestReachability) "text 'true' as '1'"; - //variant (requestReachability) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; - variant (choice.choice_list[-].group_) "name as 'group'"; -}; - - -type record AEAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - XSD.String appName optional, - XSD.String app_ID optional, - XSD.ID aE_ID optional, - PoaList pointOfAccess optional, - XSD.AnyURI ontologyRef optional, - XSD.AnyURI nodeLink optional, - XSD.Boolean requestReachability optional, - Serializations contentSerialization optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Container container, - ContainerAnnc containerAnnc, - Group group_, - GroupAnnc groupAnnc, - AccessControlPolicy accessControlPolicy, - AccessControlPolicyAnnc accessControlPolicyAnnc, - Subscription subscription, - ScheduleAnnc scheduleAnnc - } choice_list - } choice optional -} -with { - variant "element"; - variant (resourceName) "attribute"; - variant (app_ID) "name as 'App-ID'"; - variant (aE_ID) "name as 'AE-ID'"; - //variant (requestReachability) "text 'true' as '1'"; - //variant (requestReachability) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; - variant (choice.choice_list[-].group_) "name as 'group'"; -}; - - -type record AreaNwkDeviceInfo -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String devID, - XSD.String devType, - XSD.AnyURI areaNwkId, - XSD.NonNegativeInteger sleepInterval optional, - XSD.NonNegativeInteger sleepDuration optional, - XSD.String devStatus optional, - ListOfURIs listOfNeighbors, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record AreaNwkDeviceInfoAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String devID optional, - XSD.String devType optional, - XSD.AnyURI areaNwkId optional, - XSD.NonNegativeInteger sleepInterval optional, - XSD.NonNegativeInteger sleepDuration optional, - XSD.String devStatus optional, - ListOfURIs listOfNeighbors optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record AreaNwkInfo -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String areaNwkType, - ListOfURIs listOfDevices, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record AreaNwkInfoAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String areaNwkType optional, - ListOfURIs listOfDevices optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record Battery -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.UnsignedInt batteryLevel, - BatteryStatus batteryStatus, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record BatteryAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.UnsignedInt batteryLevel optional, - BatteryStatus batteryStatus optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record CmdhBuffer -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - ListOfEventCatWithDef applicableEventCategory, - XSD.NonNegativeInteger maxBufferSize, - XSD.PositiveInteger storagePriority (1 .. !11) -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; -}; - - -type record CmdhDefaults -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - record length(2 .. infinity) of MgmtLinkRef mgmtLink_list -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (mgmtLink_list) "untagged"; - variant (mgmtLink_list[-]) "name as 'mgmtLink'"; -}; - - -type record CmdhDefEcValue -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.PositiveInteger order, - EventCat defEcValue, - ListOfM2MID requestOrigin, - XSD.AnyType requestContext optional, - XSD.Boolean requestContextNotification optional, - XSD.AnyType requestCharacteristics optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - //variant (requestContextNotification) "text 'true' as '1'"; - //variant (requestContextNotification) "text 'false' as '0'"; -}; - - -type record CmdhEcDefParamValues -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - ListOfEventCatWithDef applicableEventCategory, - XSD.Long defaultRequestExpTime, - XSD.Long defaultResultExpTime, - XSD.Long defaultOpExecTime, - XSD.Long defaultRespPersistence, - XSD.Boolean defaultDelAggregation -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - //variant (defaultDelAggregation) "text 'true' as '1'"; - //variant (defaultDelAggregation) "text 'false' as '0'"; -}; - - -type record CmdhLimits -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.PositiveInteger order, - ListOfM2MID requestOrigin, - XSD.AnyType requestContext, - XSD.Boolean requestContextNotification optional, - XSD.AnyType requestCharacteristics, - ListOfEventCat limitsEventCategory, - ListOfMinMax limitsRequestExpTime, - ListOfMinMax limitsResultExpTime, - ListOfMinMax limitsOpExecTime, - ListOfMinMax limitsRespPersistence, - enumerated { - x0, - x1, - x0_1 - } limitsDelAggregation -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - //variant (requestContextNotification) "text 'true' as '1'"; - //variant (requestContextNotification) "text 'false' as '0'"; - variant (limitsDelAggregation) "text 'x0' as '0'"; - variant (limitsDelAggregation) "text 'x0_1' as '0 1'"; - variant (limitsDelAggregation) "text 'x1' as '1'"; -}; - - -type record CmdhNetworkAccessRules -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - ListOfEventCatWithDef applicableEventCategories, - record of MgmtLinkRef mgmtLink_list -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (mgmtLink_list) "untagged"; - variant (mgmtLink_list[-]) "name as 'mgmtLink'"; -}; - - -type record CmdhNwAccessRule -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - ListOfM2MID targetNetwork, - XSD.NonNegativeInteger minReqVolume, - BackOffParameters backOffParameters, - XSD.AnyType otherConditions, - MgmtLinkRef mgmtLink -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; -}; - - -type record CmdhPolicy -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String cmdhPolicyName, - record length(4 .. infinity) of MgmtLinkRef mgmtLink_list -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (mgmtLink_list) "untagged"; - variant (mgmtLink_list[-]) "name as 'mgmtLink'"; -}; + type record AccessControlPolicyAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime, + XSD.AnyURI link, + SetOfAcrs privileges, + SetOfAcrs selfPrivileges, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + type record SetOfAcrs + { + record of AccessControlRule accessControlRule_list + } + with { + variant "name as uncapitalized"; + variant (accessControlRule_list) "untagged"; + variant (accessControlRule_list[-]) "name as 'accessControlRule'"; + }; + type record AccessControlRule + { + ListOfURIs accessControlOriginators, + AccessControlOperations accessControlOperations, + record of record { + record of ScheduleEntry accessControlWindow_list, + record { + record length(1 .. infinity) of Ipv4 ipv4Addresses optional,//TODO It must be optional, + record length(1 .. infinity) of Ipv6 ipv6Addresses optional//TODO It must be optional + } accessControlIpAddresses optional, + LocationRegion accessControlLocationRegion optional + } accessControlContexts_list + } + with { + variant "name as uncapitalized"; + variant (accessControlContexts_list) "untagged"; + variant (accessControlContexts_list[-]) "name as 'accessControlContexts'"; + variant (accessControlContexts_list[-].accessControlWindow_list) "untagged"; + variant (accessControlContexts_list[-].accessControlWindow_list[-]) "name as 'accessControlWindow'"; + variant (accessControlContexts_list[-].accessControlIpAddresses.ipv4Addresses) "list"; + variant (accessControlContexts_list[-].accessControlIpAddresses.ipv6Addresses) "list"; + }; + type record LocationRegion + { + union { + record length(1 .. infinity) of CountryCode countryCode, + record length(3) of XSD.Float circRegion + } choice + } + with { + variant "name as uncapitalized"; + variant (choice) "untagged"; + variant (choice.countryCode) "list"; + variant (choice.circRegion) "list"; + }; -type XSD.AnyURI ID; -type XSD.Token NodeID -with { - variant "name as uncapitalized"; -}; + type XSD.String CountryCode (pattern "[A-Z]#(2)") + with { + variant "name as uncapitalized"; + }; -type XSD.Token DeviceID (pattern "urn:meid:[\dABCDEFabcdef]#(14)") -with { - variant "name as uncapitalized"; -}; -type XSD.Token ExternalID -with { - variant "name as uncapitalized"; -}; + type XSD.Token Ipv4 (pattern "[0-9A-Fa-f]#(8)(/([0-9]|[1-2][0-9]|3[0-2]))#(0,1)") + with { + variant "name as uncapitalized"; + }; -type XSD.Token RequestID -with { - variant "name as uncapitalized"; -}; + type XSD.Token Ipv6 (pattern "::(/0)#(0,1)") + with { + variant "name as uncapitalized"; + }; -type XSD.AnyURI NhURI -with { - variant "name as uncapitalized"; -}; + type record ActiveCmdhPolicy + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional,//TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.ID activeCmdhPolicyLink + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; -type record length(1 .. infinity) of XSD.ID AcpType -with { - variant "name as uncapitalized"; - variant "list"; -}; + type record AE + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional,//TODO To be put as optional + XSD.String appName optional, + XSD.String app_ID, + XSD.ID aE_ID, + PoaList pointOfAccess optional, + XSD.AnyURI ontologyRef optional, + XSD.AnyURI nodeLink optional, + XSD.Boolean requestReachability, + Serializations contentSerialization optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Container container, + Group group_, + AccessControlPolicy accessControlPolicy, + Subscription subscription, + PollingChannel pollingChannel, + Schedule schedule + } choice_list + } choice optional + } + with { + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (app_ID) "name as 'App-ID'"; + variant (aE_ID) "name as 'AE-ID'"; + //variant (requestReachability) "text 'true' as '1'"; + //variant (requestReachability) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].group_) "name as 'group'"; + }; -type record length(1 .. infinity) of XSD.Token Labels -with { - variant "name as uncapitalized"; - variant "list"; -}; + type record AEAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + XSD.String appName optional, + XSD.String app_ID optional, + XSD.ID aE_ID optional, + PoaList pointOfAccess optional, + XSD.AnyURI ontologyRef optional, + XSD.AnyURI nodeLink optional, + XSD.Boolean requestReachability optional, + Serializations contentSerialization optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Container container, + ContainerAnnc containerAnnc, + Group group_, + GroupAnnc groupAnnc, + AccessControlPolicy accessControlPolicy, + AccessControlPolicyAnnc accessControlPolicyAnnc, + Subscription subscription, + ScheduleAnnc scheduleAnnc + } choice_list + } choice optional + } + with { + variant "element"; + variant (resourceName) "attribute"; + variant (app_ID) "name as 'App-ID'"; + variant (aE_ID) "name as 'AE-ID'"; + //variant (requestReachability) "text 'true' as '1'"; + //variant (requestReachability) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].group_) "name as 'group'"; + }; -type XSD.UnsignedInt TriggerRecipientID (0 .. 65535) -with { - variant "name as uncapitalized"; -}; + type record AreaNwkDeviceInfo + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional,//TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String devID, + XSD.String devType, + XSD.AnyURI areaNwkId, + XSD.NonNegativeInteger sleepInterval optional, + XSD.NonNegativeInteger sleepDuration optional, + XSD.String devStatus optional, + ListOfURIs listOfNeighbors, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + type record AreaNwkDeviceInfoAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String devID optional, + XSD.String devType optional, + XSD.AnyURI areaNwkId optional, + XSD.NonNegativeInteger sleepInterval optional, + XSD.NonNegativeInteger sleepDuration optional, + XSD.String devStatus optional, + ListOfURIs listOfNeighbors optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; -type record length(1 .. infinity) of XSD.ID ListOfM2MID -with { - variant "name as uncapitalized"; - variant "list"; -}; - + type record AreaNwkInfo + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional,//TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String areaNwkType, + ListOfURIs listOfDevices, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + type record AreaNwkInfoAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String areaNwkType optional, + ListOfURIs listOfDevices optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; -type XSD.Long LongMin_1 (-1 .. infinity) -with { - variant "name as 'longMin-1'"; -}; + type record Battery + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.UnsignedInt batteryLevel, + BatteryStatus batteryStatus, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + type record BatteryAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.UnsignedInt batteryLevel optional, + BatteryStatus batteryStatus optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; -type record length(2) of LongMin_1 ListOfMinMax -with { - variant "name as uncapitalized"; - variant "list"; -}; + type record CmdhBuffer + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + ListOfEventCatWithDef applicableEventCategory, + XSD.NonNegativeInteger maxBufferSize, + XSD.PositiveInteger storagePriority (1 .. !11) + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; + type record CmdhDefaults + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + record length(2 .. infinity) of MgmtLinkRef mgmtLink_list + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (mgmtLink_list) "untagged"; + variant (mgmtLink_list[-]) "name as 'mgmtLink'"; + }; -type record length(3) of XSD.NonNegativeInteger BackOffParameters -with { - variant "name as uncapitalized"; - variant "list"; -}; + type record CmdhDefEcValue + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.PositiveInteger order, + EventCat defEcValue, + ListOfM2MID requestOrigin, + XSD.AnySimpleType requestContext optional,//FIXME Use AnySimpleType instead + XSD.Boolean requestContextNotification optional, + XSD.AnySimpleType requestCharacteristics optional//FIXME Use AnySimpleType instead + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + //variant (requestContextNotification) "text 'true' as '1'"; + //variant (requestContextNotification) "text 'false' as '0'"; + }; + type record CmdhEcDefParamValues + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + ListOfEventCatWithDef applicableEventCategory, + XSD.Long defaultRequestExpTime, + XSD.Long defaultResultExpTime, + XSD.Long defaultOpExecTime, + XSD.Long defaultRespPersistence, + XSD.Boolean defaultDelAggregation + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + //variant (defaultDelAggregation) "text 'true' as '1'"; + //variant (defaultDelAggregation) "text 'false' as '0'"; + }; -type record length(1 .. infinity) of XSD.String PoaList -with { - variant "name as uncapitalized"; - variant "list"; -}; + type record CmdhLimits + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.PositiveInteger order, + ListOfM2MID requestOrigin, + XSD.AnySimpleType requestContext,//FIXME Use AnySimpleType instead + XSD.Boolean requestContextNotification optional, + XSD.AnySimpleType requestCharacteristics,//FIXME Use AnySimpleType instead + ListOfEventCat limitsEventCategory, + ListOfMinMax limitsRequestExpTime, + ListOfMinMax limitsResultExpTime, + ListOfMinMax limitsOpExecTime, + ListOfMinMax limitsRespPersistence, + enumerated { + x0, + x1, + x0_1 + } limitsDelAggregation + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + //variant (requestContextNotification) "text 'true' as '1'"; + //variant (requestContextNotification) "text 'false' as '0'"; + variant (limitsDelAggregation) "text 'x0' as '0'"; + variant (limitsDelAggregation) "text 'x0_1' as '0 1'"; + variant (limitsDelAggregation) "text 'x1' as '1'"; + }; + type record CmdhNetworkAccessRules + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + ListOfEventCatWithDef applicableEventCategories, + record of MgmtLinkRef mgmtLink_list + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (mgmtLink_list) "untagged"; + variant (mgmtLink_list[-]) "name as 'mgmtLink'"; + }; -type XSD.String Timestamp // FIXME(pattern "\d#(4)(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|30|31)T([01]\d|2[0-3])[0-5]\d[0-5]\d(,\d#(1,6))#(0,1)") -with { - variant "name as uncapitalized"; -}; + type record CmdhNwAccessRule + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + ListOfM2MID targetNetwork, + XSD.NonNegativeInteger minReqVolume, + BackOffParameters backOffParameters, + XSD.AnySimpleType otherConditions,//FIXME Use AnySimpleType instead + MgmtLinkRef mgmtLink + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; -type union AbsRelTimestamp -{ - Timestamp alt_, - XSD.Long alt_1 -} -with { - variant "name as uncapitalized"; - variant "useUnion"; - variant (alt_) "name as ''"; - variant (alt_1) "name as ''"; -}; + type record CmdhPolicy + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String cmdhPolicyName, + record length(4 .. infinity) of MgmtLinkRef mgmtLink_list + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (mgmtLink_list) "untagged"; + variant (mgmtLink_list[-]) "name as 'mgmtLink'"; + }; -type XSD.String TypeOfContent (pattern "[\w/!#$\^_.+\q{0, 0, 0, 38}&\-]+") -with { - variant "name as uncapitalized"; -}; -type enumerated PermittedMediaTypes -{ - applicationjson, - applicationxml -} -with { - variant "text 'applicationjson' as 'application/json'"; - variant "text 'applicationxml' as 'application/xml'"; - variant "name as uncapitalized"; -}; + type XSD.AnyURI ID; -type record length(1 .. infinity) of PermittedMediaTypes Serializations -with { - variant "name as uncapitalized"; - variant "list"; -}; + type XSD.Token NodeID + with { + variant "name as uncapitalized"; + }; -type XSD.String ContentInfo // FIXME (pattern "[\w/!#$\^_.+\q{0, 0, 0, 38}&\-]+(:[0-2])#(0,1)") -with { - variant "name as uncapitalized"; -}; + type XSD.Token DeviceID (pattern "urn:meid:[\dABCDEFabcdef]#(14)") + with { + variant "name as uncapitalized"; + }; -type union EventCat -{ - StdEventCats alt_, - XSD.Integer alt_1 (100 .. 999) -} -with { - variant "name as uncapitalized"; - variant "useUnion"; - variant (alt_) "name as ''"; - variant (alt_1) "name as ''"; -}; - - -type union EventCatWithDef -{ - enumerated { - int0(0) - } alt_, - StdEventCats alt_1, - XSD.Integer alt_2 (100 .. 999) -} -with { - variant "name as uncapitalized"; - variant "useUnion"; - variant (alt_) "name as ''"; - variant (alt_) "useNumber"; - variant (alt_1) "name as ''"; - variant (alt_2) "name as 'alt_1'"; - variant (alt_2) "name as ''"; -}; + type XSD.Token ExternalID + with { + variant "name as uncapitalized"; + }; -type record length(1 .. infinity) of EventCat ListOfEventCat -with { - variant "name as uncapitalized"; - variant "list"; -}; + type XSD.Token RequestID + with { + variant "name as uncapitalized"; + }; -type record length(1 .. infinity) of EventCatWithDef ListOfEventCatWithDef -with { - variant "name as uncapitalized"; - variant "list"; -}; + type XSD.AnyURI NhURI + with { + variant "name as uncapitalized"; + }; -type XSD.String ScheduleEntry // FIXME (pattern "(([*]|[1-5]#(0,1)\d([,-][1-5]#(0,1)\d)*)[\q{0,0,0,20}\q{0,0,0,10}\t\r]+)#(2)([*]|((1#(0,1)\d|2[0-3])([,-](1#(0,1)\d|2[0-3]))*))[\q{0,0,0,20}\q{0,0,0,10}\t\r]+([*]|(([1-9]|1\d|2\d|3[01])([,-]([1-9]|1\d|2\d|3[01]))*))[\q{0,0,0,20}\q{0,0,0,10}\t\r]+([*]|(([1-9]|1[0-2])([,-]([1-9]|1[0-2]))*))[\q{0,0,0,20}\q{0,0,0,10}\t\r]+([*]|([0-6]([,-][0-6])*))") -with { - variant "name as uncapitalized"; -}; + type record length(1 .. infinity) of XSD.ID AcpType + with { + variant "name as uncapitalized"; + variant "list"; + }; -type record length(1 .. infinity) of XSD.AnyURI ListOfURIs -with { - variant "name as uncapitalized"; - variant "list"; -}; + type record length(1 .. infinity) of XSD.Token Labels + with { + variant "name as uncapitalized"; + variant "list"; + }; -type record of XSD.NCName AttributeList_1 -with { - variant "name as 'attributeList'"; - variant "list"; -}; + type XSD.UnsignedInt TriggerRecipientID (0 .. 65535) + with { + variant "name as uncapitalized"; + }; -type record length(1 .. infinity) of ResourceType ResourceTypeList -with { - variant "name as uncapitalized"; - variant "list"; -}; -type XSD.String ResourceName (pattern "[a-zA-Z0-9]([a-zA-Z0-9.\-,_]*)") -with { - variant "name as uncapitalized"; -}; + type record length(1 .. infinity) of XSD.ID ListOfM2MID + with { + variant "name as uncapitalized"; + variant "list"; + }; + type XSD.Long LongMin_1 (-1 .. infinity) + with { + variant "name as 'longMin-1'"; + }; -type record DeliveryMetaData -{ - XSD.Boolean tracingOption, - ListOfM2MID tracingInfo optional -} -with { - variant "name as uncapitalized"; - //variant (tracingOption) "text 'true' as '1'"; - //variant (tracingOption) "text 'false' as '0'"; -}; + type record length(2) of LongMin_1 ListOfMinMax + with { + variant "name as uncapitalized"; + variant "list"; + }; -type record AggregatedRequest -{ - record length(1 .. infinity) of record { - Operation operation, - XSD.AnyURI to_, - XSD.ID from_, - RequestID requestIdentifier, - PrimitiveContent primitiveContent optional, - MetaInformation metaInformation optional - } request_list -} -with { - variant "name as uncapitalized"; - variant (request_list) "untagged"; - variant (request_list[-]) "name as 'request'"; - variant (request_list[-].to_) "name as 'to'"; - variant (request_list[-].from_) "name as 'from'"; -}; - - -type record MetaInformation -{ - ResourceType resourceType optional, - XSD.NCName name optional, - Timestamp originatingTimestamp optional, - AbsRelTimestamp requestExpirationTimestamp optional, - AbsRelTimestamp resultExpirationTimestamp optional, - AbsRelTimestamp operationExecutionTime optional, - ResponseTypeInfo responseType optional, - AbsRelTimestamp resultPersistence optional, - ResultContent resultContent optional, - EventCat eventCategory optional, - XSD.Boolean deliveryAggregation optional, - XSD.String groupRequestIdentifier optional, - FilterCriteria filterCriteria optional, - DiscResType discoveryResultType optional -} -with { - variant "name as uncapitalized"; - //variant (deliveryAggregation) "text 'true' as '1'"; - //variant (deliveryAggregation) "text 'false' as '0'"; -}; -type record of anytype Contents; // FIXME added by AMB, necessary for Codec -type record PrimitiveContent -{ - Contents any_1 - //record of XSD.String elem_list -} -with { - variant "name as uncapitalized"; -//variant (elem_list) "untagged"; -//variant (elem_list[-]) "anyElement from 'http://www.onem2m.org/xml/protocols'"; -}; - - -type record FilterCriteria -{ - Timestamp createdBefore optional, - Timestamp createdAfter optional, - Timestamp modifiedSince optional, - Timestamp unmodifiedSince optional, - XSD.PositiveInteger stateTagSmaller optional, - XSD.NonNegativeInteger stateTagBigger optional, - Timestamp expireBefore optional, - Timestamp expireAfter optional, - Labels labels optional, - ResourceTypeList resourceType optional, - XSD.NonNegativeInteger sizeAbove optional, - XSD.PositiveInteger sizeBelow optional, - record of TypeOfContent contentType_list, - record of Attribute attribute_list, - FilterUsage filterUsage optional, - XSD.NonNegativeInteger limit optional -} -with { - variant "name as uncapitalized"; - variant (contentType_list) "untagged"; - variant (contentType_list[-]) "name as 'contentType'"; - variant (attribute_list) "untagged"; - variant (attribute_list[-]) "name as 'attribute'"; -}; - - -type record Attribute -{ - XSD.NCName name, - XSD.AnyType value_ -} -with { - variant "name as uncapitalized"; - variant (value_) "name as 'value'"; -}; + type record length(3) of XSD.NonNegativeInteger BackOffParameters + with { + variant "name as uncapitalized"; + variant "list"; + }; -type record ScheduleEntries -{ - record length(1 .. infinity) of ScheduleEntry scheduleEntry_list -} -with { - variant "name as uncapitalized"; - variant (scheduleEntry_list) "untagged"; - variant (scheduleEntry_list[-]) "name as 'scheduleEntry'"; -}; + type record length(1 .. infinity) of XSD.String PoaList + with { + variant "name as uncapitalized"; + variant "list"; + }; -type record ActionStatus -{ - XSD.AnyURI action_ optional, - Status status optional -} -with { - variant "name as uncapitalized"; - variant (action_) "name as 'action'"; -}; + type XSD.String Timestamp (pattern "\d#(4)(0[1-9]|1[0-2])(0[1-9]|[1-2]\d|30|31)T([01]\d|2[0-3])[0-5]\d[0-5]\d(,\d#(1,6))#(0,1)") + with { + variant "name as uncapitalized"; + }; -type record AnyArgType -{ - XSD.NCName name, - XSD.AnyType value_ -} -with { - variant "name as uncapitalized"; - variant (value_) "name as 'value'"; -}; + type union AbsRelTimestamp + { + Timestamp alt_, + XSD.Long alt_1 + } + with { + variant "name as uncapitalized"; + variant "useUnion"; + variant (alt_) "name as ''"; + variant (alt_1) "name as ''"; + }; -type record ResetArgsType -{ - record of AnyArgType anyArg_list -} -with { - variant "name as uncapitalized"; - variant (anyArg_list) "untagged"; - variant (anyArg_list[-]) "name as 'anyArg'"; -}; + type XSD.String TypeOfContent (pattern "[\w/!#$\^_.+\q{0, 0, 0, 38}&\-]+") + with { + variant "name as uncapitalized"; + }; -type record RebootArgsType -{ - record of AnyArgType anyArg_list -} -with { - variant "name as uncapitalized"; - variant (anyArg_list) "untagged"; - variant (anyArg_list[-]) "name as 'anyArg'"; -}; - - -type record UploadArgsType -{ - XSD.String fileType, - XSD.AnyURI uRL, - XSD.String username, - XSD.String password, - record of AnyArgType anyArg_list -} -with { - variant "name as uncapitalized"; - variant (uRL) "name as capitalized"; - variant (anyArg_list) "untagged"; - variant (anyArg_list[-]) "name as 'anyArg'"; -}; - - -type record DownloadArgsType -{ - XSD.String fileType, - XSD.AnyURI uRL, - XSD.String username, - XSD.String password, - XSD.PositiveInteger filesize, - XSD.String targetFile, - XSD.PositiveInteger delaySeconds, - XSD.AnyURI successURL, - Timestamp startTime, - Timestamp completeTime, - record of AnyArgType anyArg_list -} -with { - variant "name as uncapitalized"; - variant (uRL) "name as capitalized"; - variant (anyArg_list) "untagged"; - variant (anyArg_list[-]) "name as 'anyArg'"; -}; - - -type record SoftwareInstallArgsType -{ - XSD.AnyURI uRL, - XSD.String uUID, - XSD.String username, - XSD.String password, - XSD.String executionEnvRef, - record of AnyArgType anyArg_list -} -with { - variant "name as uncapitalized"; - variant (uRL) "name as capitalized"; - variant (uUID) "name as capitalized"; - variant (anyArg_list) "untagged"; - variant (anyArg_list[-]) "name as 'anyArg'"; -}; - - -type record SoftwareUpdateArgsType -{ - XSD.String uUID, - XSD.String version, - XSD.AnyURI uRL, - XSD.String username, - XSD.String password, - XSD.String executionEnvRef, - record of AnyArgType anyArg_list -} -with { - variant "name as uncapitalized"; - variant (uUID) "name as capitalized"; - variant (uRL) "name as capitalized"; - variant (anyArg_list) "untagged"; - variant (anyArg_list[-]) "name as 'anyArg'"; -}; - - -type record SoftwareUninstallArgsType -{ - XSD.String uUID, - XSD.String version, - XSD.String executionEnvRef, - record of AnyArgType anyArg_list -} -with { - variant "name as uncapitalized"; - variant (uUID) "name as capitalized"; - variant (anyArg_list) "untagged"; - variant (anyArg_list[-]) "name as 'anyArg'"; -}; - - -type record ExecReqArgsListType -{ - union { - record of ResetArgsType reset_list, - record length(1 .. infinity) of RebootArgsType reboot_list, - record length(1 .. infinity) of UploadArgsType upload_list, - record length(1 .. infinity) of DownloadArgsType download_list, - record length(1 .. infinity) of SoftwareInstallArgsType softwareInstall_list, - record length(1 .. infinity) of SoftwareUpdateArgsType softwareUpdate_list, - record length(1 .. infinity) of SoftwareUninstallArgsType softwareUninstall_list - } choice -} -with { - variant "name as uncapitalized"; - variant (choice) "untagged"; - variant (choice.reset_list) "untagged"; - variant (choice.reset_list[-]) "name as 'reset'"; - variant (choice.reboot_list) "untagged"; - variant (choice.reboot_list[-]) "name as 'reboot'"; - variant (choice.upload_list) "untagged"; - variant (choice.upload_list[-]) "name as 'upload'"; - variant (choice.download_list) "untagged"; - variant (choice.download_list[-]) "name as 'download'"; - variant (choice.softwareInstall_list) "untagged"; - variant (choice.softwareInstall_list[-]) "name as 'softwareInstall'"; - variant (choice.softwareUpdate_list) "untagged"; - variant (choice.softwareUpdate_list[-]) "name as 'softwareUpdate'"; - variant (choice.softwareUninstall_list) "untagged"; - variant (choice.softwareUninstall_list[-]) "name as 'softwareUninstall'"; -}; - - -type record MgmtLinkRef -{ - ResourceName name, - MgmtDefinition type_, - XSD.AnyURI base -} -with { - variant "name as uncapitalized"; - variant (name) "attribute"; - variant (type_) "name as 'type'"; - variant (type_) "attribute"; - variant (base) "untagged"; -}; + type enumerated PermittedMediaTypes + { + applicationjson, + applicationxml + } + with { + variant "text 'applicationjson' as 'application/json'"; + variant "text 'applicationxml' as 'application/xml'"; + variant "name as uncapitalized"; + }; -type record ChildResourceRef -{ - ResourceName name, - ResourceType type_, - XSD.AnyURI base -} -with { - variant "name as uncapitalized"; - variant (name) "attribute"; - variant (type_) "name as 'type'"; - variant (type_) "attribute"; - variant (base) "untagged"; -}; - - -type record ResponseTypeInfo -{ - ResponseType responseTypeValue, - record of XSD.AnyURI notificationURI -} -with { - variant "name as uncapitalized"; - variant (notificationURI) "list"; -}; + type record length(1 .. infinity) of PermittedMediaTypes Serializations + with { + variant "name as uncapitalized"; + variant "list"; + }; + type XSD.String ContentInfo //TODO To be fixed (pattern "[\w/!#$\^_.+\q{0, 0, 0, 38}&\-]+(:[0-2])#(0,1)") + with { + variant "name as uncapitalized"; + }; -type record OperationResult -{ - ResponseStatusCode responseStatusCode, - RequestID requestIdentifier, - PrimitiveContent primitiveContent optional, - XSD.AnyURI to_ optional, - XSD.ID from_ optional, - Timestamp originatingTimestamp optional, - AbsRelTimestamp resultExpirationTimestamp optional, - EventCat eventCategory optional -} -with { - variant "name as uncapitalized"; - variant (to_) "name as 'to'"; - variant (from_) "name as 'from'"; -}; + type union EventCat + { + StdEventCats alt_, + XSD.Integer alt_1 (100 .. 999) + } + with { + variant "name as uncapitalized"; + variant "useUnion"; + variant (alt_) "name as ''"; + variant (alt_1) "name as ''"; + }; + type union EventCatWithDef + { + enumerated { + int0(0) + } alt_, + StdEventCats alt_1, + XSD.Integer alt_2 (100 .. 999) + } + with { + variant "name as uncapitalized"; + variant "useUnion"; + variant (alt_) "name as ''"; + variant (alt_) "useNumber"; + variant (alt_1) "name as ''"; + variant (alt_2) "name as 'alt_1'"; + variant (alt_2) "name as ''"; + }; + type record length(1 .. infinity) of EventCat ListOfEventCat + with { + variant "name as uncapitalized"; + variant "list"; + }; -type record Resource_1 -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional -} -with { - variant "name as 'resource'"; - variant (resourceName) "attribute"; -}; - - -type record RegularResource -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime -} -with { - variant "name as uncapitalized"; - variant (resourceName) "attribute"; -}; - - -type record AnnounceableResource -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute -} -with { - variant "name as uncapitalized"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; -}; - - -type record AnnouncedResource -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link -} -with { - variant "name as uncapitalized"; - variant (resourceName) "attribute"; -}; - - -type record AnnounceableSubordinateResource -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute -} -with { - variant "name as uncapitalized"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; -}; - - -type record SubordinateResource -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime -} -with { - variant "name as uncapitalized"; - variant (resourceName) "attribute"; -}; - - -type record AnnouncedSubordinateResource -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime, - XSD.AnyURI link -} -with { - variant "name as uncapitalized"; - variant (resourceName) "attribute"; -}; - - -type record MgmtResource -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional -} -with { - variant "name as uncapitalized"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; -}; - - -type record AnnouncedMgmtResource -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional -} -with { - variant "name as uncapitalized"; - variant (resourceName) "attribute"; -}; - - -type record Container -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - XSD.NonNegativeInteger stateTag, - XSD.ID creator, - XSD.NonNegativeInteger maxNrOfInstances optional, - XSD.NonNegativeInteger maxByteSize optional, - XSD.NonNegativeInteger maxInstanceAge optional, - XSD.NonNegativeInteger currentNrOfInstances, - XSD.NonNegativeInteger currentByteSize, - XSD.AnyURI locationID optional, - XSD.AnyURI ontologyRef optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - ContentInstance contentInstance, - Container container, - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record ContainerAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - XSD.NonNegativeInteger stateTag, - XSD.NonNegativeInteger maxNrOfInstances optional, - XSD.NonNegativeInteger maxByteSize optional, - XSD.NonNegativeInteger maxInstanceAge optional, - XSD.NonNegativeInteger currentNrOfInstances optional, - XSD.NonNegativeInteger currentByteSize optional, - XSD.AnyURI locationID optional, - XSD.AnyURI ontologyRef optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - ContentInstance contentInstance, - ContentInstanceAnnc contentInstanceAnnc, - Container container, - ContainerAnnc containerAnnc, - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record ContentInstance -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - XSD.NonNegativeInteger stateTag, - XSD.ID creator optional, - ContentInfo contentInfo optional, - XSD.NonNegativeInteger contentSize, - XSD.AnyURI ontologyRef optional, - XSD.AnyType content -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; -}; - - -type record ContentInstanceAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime, - XSD.AnyURI link, - XSD.NonNegativeInteger stateTag, - ContentInfo contentInfo optional, - XSD.NonNegativeInteger contentSize optional, - XSD.AnyURI ontologyRef optional, - XSD.AnyType content optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; -}; - - -type record CSEBase -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - CseTypeID cseType optional, - XSD.ID cSE_ID, - record of ResourceType supportedResourceType, - PoaList pointOfAccess, - XSD.AnyURI nodeLink optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - RemoteCSE remoteCSE, - RemoteCSEAnnc remoteCSEAnnc, - Node node, - AE aE, - Container container, - Group group_, - AccessControlPolicy accessControlPolicy, - Subscription subscription, - MgmtCmd mgmtCmd, - LocationPolicy locationPolicy, - StatsConfig statsConfig, - StatsCollect statsCollect, - Request request, - Delivery delivery, - Schedule schedule, - M2mServiceSubscriptionProfile m2mServiceSubscriptionProfile, - ServiceSubscribedAppRule serviceSubscribedAppRule - } choice_list - } choice optional -} -with { - variant "element"; - variant (resourceName) "attribute"; - variant (cSE_ID) "name as 'CSE-ID'"; - variant (supportedResourceType) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; - variant (choice.choice_list[-].aE) "name as capitalized"; - variant (choice.choice_list[-].group_) "name as 'group'"; -}; - - -type record Delivery -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - XSD.NonNegativeInteger stateTag, - XSD.ID source, - XSD.ID target, - Timestamp lifespan, - EventCat eventCat, - DeliveryMetaData deliveryMetaData, - AggregatedRequest aggregatedRequest, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record DeviceCapability -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String capabilityName, - XSD.Boolean attached, - ActionStatus capabilityActionStatus, - XSD.Boolean currentState, - XSD.Boolean enable optional, - XSD.Boolean disable optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - //variant (attached) "text 'true' as '1'"; - //variant (attached) "text 'false' as '0'"; - //variant (currentState) "text 'true' as '1'"; - //variant (currentState) "text 'false' as '0'"; - //variant (enable) "text 'true' as '1'"; - //variant (enable) "text 'false' as '0'"; - //variant (disable) "text 'true' as '1'"; - //variant (disable) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record DeviceCapabilityAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String capabilityName optional, - XSD.Boolean attached optional, - ActionStatus capabilityActionStatus optional, - XSD.Boolean currentState optional, - XSD.Boolean enable optional, - XSD.Boolean disable optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - //variant (attached) "text 'true' as '1'"; - //variant (attached) "text 'false' as '0'"; - //variant (currentState) "text 'true' as '1'"; - //variant (currentState) "text 'false' as '0'"; - //variant (enable) "text 'true' as '1'"; - //variant (enable) "text 'false' as '0'"; - //variant (disable) "text 'true' as '1'"; - //variant (disable) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record DeviceInfo -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String deviceLabel, - XSD.String manufacturer, - XSD.String model, - XSD.String deviceType, - XSD.String fwVersion, - XSD.String swVersion, - XSD.String hwVersion, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record DeviceInfoAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String deviceLabel optional, - XSD.String manufacturer optional, - XSD.String model optional, - XSD.String deviceType optional, - XSD.String fwVersion optional, - XSD.String swVersion optional, - XSD.String hwVersion optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type enumerated ResourceType -{ - int1(1), - int2(2), - int3(3), - int4(4), - int5(5), - int6(6), - int7(7), - int8(8), - int9(9), - int10(10), - int11(11), - int12(12), - int13(13), - int14(14), - int15(15), - int16(16), - int17(17), - int18(18), - int19(19), - int20(20), - int21(21), - int22(22), - int23(23), - int10001(10001), - int10002(10002), - int10003(10003), - int10004(10004), - int10009(10009), - int10010(10010), - int10013(10013), - int10014(10014), - int10016(10016), - int10018(10018) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record length(1 .. infinity) of EventCatWithDef ListOfEventCatWithDef + with { + variant "name as uncapitalized"; + variant "list"; + }; -type enumerated CseTypeID -{ - int1(1), - int2(2), - int3(3) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type XSD.String ScheduleEntry //TODO To be fixed (pattern "(([*]|[1-5]#(0,1)\d([,-][1-5]#(0,1)\d)*)[\q{0,0,0,20}\q{0,0,0,10}\t\r]+)#(2)([*]|((1#(0,1)\d|2[0-3])([,-](1#(0,1)\d|2[0-3]))*))[\q{0,0,0,20}\q{0,0,0,10}\t\r]+([*]|(([1-9]|1\d|2\d|3[01])([,-]([1-9]|1\d|2\d|3[01]))*))[\q{0,0,0,20}\q{0,0,0,10}\t\r]+([*]|(([1-9]|1[0-2])([,-]([1-9]|1[0-2]))*))[\q{0,0,0,20}\q{0,0,0,10}\t\r]+([*]|([0-6]([,-][0-6])*))") + with { + variant "name as uncapitalized"; + }; -type enumerated LocationSource -{ - int1(1), - int2(2), - int3(3) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record length(1 .. infinity) of XSD.AnyURI ListOfURIs + with { + variant "name as uncapitalized"; + variant "list"; + }; -type enumerated StdEventCats -{ - int2(2), - int3(3), - int4(4) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated Operation -{ - int1(1), - int2(2), - int3(3), - int4(4), - int5(5) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record of XSD.NCName AttributeList_1 + with { + variant "name as 'attributeList'"; + variant "list"; + }; -type enumerated ResponseType -{ - int1(1), - int2(2), - int3(3) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated ResultContent -{ - int0(0), - int1(1), - int2(2), - int3(3), - int4(4), - int5(5), - int6(6), - int7(7) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record length(1 .. infinity) of ResourceType ResourceTypeList + with { + variant "name as uncapitalized"; + variant "list"; + }; -type enumerated DiscResType -{ - int1(1), - int2(2) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated ResponseStatusCode -{ - int1000(1000), - int2000(2000), - int2001(2001), - int2002(2002), - int2004(2004), - int4000(4000), - int4004(4004), - int4005(4005), - int4008(4008), - int4101(4101), - int4102(4102), - int4103(4103), - int4104(4104), - int4105(4105), - int4106(4106), - int4107(4107), - int4108(4108), - int4109(4109), - int4110(4110), - int5000(5000), - int5001(5001), - int5103(5103), - int5105(5105), - int5106(5106), - int5203(5203), - int5204(5204), - int5205(5205), - int5206(5206), - int5207(5207), - int5209(5209), - int6003(6003), - int6005(6005), - int6010(6010), - int6020(6020), - int6021(6021), - int6022(6022), - int6023(6023), - int6024(6024), - int6025(6025), - int6026(6026), - int6028(6028), - int6029(6029) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type XSD.String ResourceName (pattern "[a-zA-Z0-9]([a-zA-Z0-9.\-,_]*)") + with { + variant "name as uncapitalized"; + }; -type enumerated RequestStatus -{ - int1(1), - int2(2), - int3(3), - int4(4) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated MemberType -{ - int0(0), - int1(1), - int2(2), - int3(3), - int4(4), - int5(5), - int6(6), - int7(7), - int8(8), - int9(9), - int10(10), - int11(11), - int12(12), - int13(13), - int14(14), - int15(15), - int16(16), - int17(17), - int18(18), - int19(19), - int20(20), - int21(21), - int22(22), - int23(23), - int10001(10001), - int10002(10002), - int10003(10003), - int10004(10004), - int10009(10009), - int10010(10010), - int10013(10013), - int10014(10014), - int10016(10016), - int10018(10018), - int20001(20001), - int20002(20002) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; -type enumerated ConsistencyStrategy -{ - int1(1), - int2(2), - int3(3) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated CmdType -{ - int1(1), - int2(2), - int3(3), - int4(4), - int5(5), - int6(6), - int7(7) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; -type enumerated ExecModeType -{ - int1(1), - int2(2), - int3(3), - int4(4) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated ExecStatusType -{ - int1(1), - int2(2), - int3(3), - int4(4), - int5(5), - int6(6) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated ExecResultType -{ - int0(0), - int1(1), - int2(2), - int3(3), - int4(4), - int5(5), - int6(6), - int7(7), - int8(8), - int9(9), - int10(10), - int11(11), - int12(12), - int13(13), - int14(14), - int15(15), - int16(16), - int19(19), - int20(20), - int21(21), - int22(22), - int23(23), - int24(24), - int25(25), - int26(26), - int27(27), - int28(28), - int29(29), - int30(30), - int31(31) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; -type enumerated PendingNotification -{ - int1(1), - int2(2) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record DeliveryMetaData + { + XSD.Boolean tracingOption, + ListOfM2MID tracingInfo optional + } + with { + variant "name as uncapitalized"; + //variant (tracingOption) "text 'true' as '1'"; + //variant (tracingOption) "text 'false' as '0'"; + }; -type enumerated NotificationContentType -{ - int1(1), - int2(2), - int3(3) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record AggregatedRequest + { + record length(1 .. infinity) of record { + Operation operation, + XSD.AnyURI to_, + XSD.ID from_, + RequestID requestIdentifier, + PrimitiveContent primitiveContent optional, + MetaInformation metaInformation optional + } request_list + } + with { + variant "name as uncapitalized"; + variant (request_list) "untagged"; + variant (request_list[-]) "name as 'request'"; + variant (request_list[-].to_) "name as 'to'"; + variant (request_list[-].from_) "name as 'from'"; + }; -type enumerated NotificationEventType -{ - int1(1), - int2(2), - int3(3), - int4(4) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record MetaInformation + { + ResourceType resourceType optional, + XSD.NCName name optional, + Timestamp originatingTimestamp optional, + AbsRelTimestamp requestExpirationTimestamp optional, + AbsRelTimestamp resultExpirationTimestamp optional, + AbsRelTimestamp operationExecutionTime optional, + ResponseTypeInfo responseType optional, + AbsRelTimestamp resultPersistence optional, + ResultContent resultContent optional, + EventCat eventCategory optional, + XSD.Boolean deliveryAggregation optional, + XSD.String groupRequestIdentifier optional, + FilterCriteria filterCriteria optional, + DiscResType discoveryResultType optional + } + with { + variant "name as uncapitalized"; + //variant (deliveryAggregation) "text 'true' as '1'"; + //variant (deliveryAggregation) "text 'false' as '0'"; + }; -type enumerated Status -{ - int1(1), - int2(2), - int3(3) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated BatteryStatus -{ - int1(1), - int2(2), - int3(3), - int4(4), - int5(5), - int6(6), - int7(7) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated MgmtDefinition -{ - int0(0), - int1001(1001), - int1002(1002), - int1003(1003), - int1004(1004), - int1005(1005), - int1006(1006), - int1007(1007), - int1008(1008), - int1009(1009), - int1010(1010), - int1011(1011), - int1012(1012), - int1013(1013), - int1014(1014), - int1015(1015), - int1016(1016), - int1017(1017), - int1018(1018), - int1019(1019) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated LogTypeId -{ - int1(1), - int2(2), - int3(3), - int4(4), - int5(5) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated LogStatus -{ - int1(1), - int2(2), - int3(3), - int4(4), - int5(5) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; +//TODO Use this type instead type record PrimitiveContent + type union PrimitiveContent { + //TS-0004 - 7.5.2-1 & 7.5.2-2 Common elements to request/response content + //ResourceTypes + AEAnnc_optional aEAnnc, + AE_optional aE, + AccessControlPolicy_optional accessControlPolicy, + AccessControlPolicyAnnc_optional accessControlPolicyAnnc, + ContentInstance_optional contentInstance, + ContentInstanceAnnc_optional contentInstanceAnnc, + Container_optional container, + ContainerAnnc_optional containerAnnc, + Delivery_optional delivery, + CSEBase_optional cSEBase, + Group_optional group_, + GroupAnnc_optional groupAnnc, + LocationPolicy_optional locationPolicy, + LocationPolicyAnnc_optional locationPolicyAnnc, + MgmtResource_optional mgmtResource,//MgmtResource + MgmtCmd_optional mgmtCmd, + AnnouncedMgmtResource_optional announcedMgmtResource,//AnnouncedMgmtResource + Node_optional node, + NodeAnnc_optional nodeAnnc, + PollingChannel_optional pollingChannel, + RemoteCSE_optional remoteCSE, + Schedule_optional schedule, + ScheduleAnnc_optional scheduleAnnc, + StatsConfig_optional statsConfig, + StatsCollect_optional statsCollect, + M2mServiceSubscriptionProfile_optional m2mServiceSubscriptionProfile, + ServiceSubscribedAppRule_optional serviceSubscribedAppRule, + Subscription_optional subscription, + //SecurityInfo + //TS-0004 - 7.5.2-1 Elements used for request content + Notification notification, + AggregatedNotification aggregatedNotification, + AttributeList attributeList, + ResponsePrimitive responsePrimitive, + //TS-0004 - 7.5.2-2 Elements used for response content + Resource resource, + URIList uRIList, + AggregatedResponse aggregatedResponse, + URI uRI, + DebugInfo debugInfo, + //Invalid types + AE_update_invalid aE_update_invalid, + ACP_update_invalid aCP_update_invalid, + Container_update_invalid container_update_invalid, + Group_update_invalid group_update_invalid, + PollingChannel_update_invalid pollingChannel_update_invalid, + Schedule_update_invalid schedule_update_invalid, + Subscription_update_invalid subscription_update_invalid, + LocationPolicy_update_invalid locationPolicy_update_invalid + } + + + + + type record FilterCriteria + { + Timestamp createdBefore optional, + Timestamp createdAfter optional, + Timestamp modifiedSince optional, + Timestamp unmodifiedSince optional, + XSD.PositiveInteger stateTagSmaller optional, + XSD.NonNegativeInteger stateTagBigger optional, + Timestamp expireBefore optional, + Timestamp expireAfter optional, + Labels labels optional, + ResourceTypeList resourceType optional, + XSD.NonNegativeInteger sizeAbove optional, + XSD.PositiveInteger sizeBelow optional, + record of TypeOfContent contentType_list, + record of Attribute attribute_list, + FilterUsage filterUsage optional, + XSD.NonNegativeInteger limit optional + } + with { + variant "name as uncapitalized"; + variant (contentType_list) "untagged"; + variant (contentType_list[-]) "name as 'contentType'"; + variant (attribute_list) "untagged"; + variant (attribute_list[-]) "name as 'attribute'"; + }; -type enumerated EventType -{ - int1(1), - int2(2), - int3(3) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record Attribute + { + XSD.NCName name, + XSD.AnySimpleType value_//FIXME Use AnySimpleType instead + } + with { + variant "name as uncapitalized"; + variant (value_) "name as 'value'"; + }; -type enumerated StatsRuleStatusType -{ - int1(1), - int2(2) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; + type record ScheduleEntries + { + record length(1 .. infinity) of ScheduleEntry scheduleEntry_list + } + with { + variant "name as uncapitalized"; + variant (scheduleEntry_list) "untagged"; + variant (scheduleEntry_list[-]) "name as 'scheduleEntry'"; + }; -type enumerated StatModelType -{ - int1(1) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; -type enumerated EncodingType -{ - int0(0), - int1(1), - int2(2) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - - - -type enumerated AccessControlOperations -{ - int1(1), - int2(2), - int3(3), - int4(4), - int5(5), - int6(6), - int7(7), - int8(8), - int9(9), - int10(10), - int11(11), - int12(12), - int13(13), - int14(14), - int15(15), - int16(16), - int17(17), - int18(18), - int19(19), - int20(20), - int21(21), - int22(22), - int23(23), - int24(24), - int25(25), - int26(26), - int27(27), - int28(28), - int29(29), - int30(30), - int31(31), - int32(32), - int33(33), - int34(34), - int35(35), - int36(36), - int37(37), - int38(38), - int39(39), - int40(40), - int41(41), - int42(42), - int43(43), - int44(44), - int45(45), - int46(46), - int47(47), - int48(48), - int49(49), - int50(50), - int51(51), - int52(52), - int53(53), - int54(54), - int55(55), - int56(56), - int57(57), - int58(58), - int59(59), - int60(60), - int61(61), - int62(62), - int63(63) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type enumerated SRole_ID -{ - x01_001, - x02_001, - x02_002, - x02_003, - x02_004, - x03_001, - x04_001, - x05_001, - x06_001, - x07_001, - x08_001 -} -with { - variant "text 'x01_001' as '01-001'"; - variant "text 'x02_001' as '02-001'"; - variant "text 'x02_002' as '02-002'"; - variant "text 'x02_003' as '02-003'"; - variant "text 'x02_004' as '02-004'"; - variant "text 'x03_001' as '03-001'"; - variant "text 'x04_001' as '04-001'"; - variant "text 'x05_001' as '05-001'"; - variant "text 'x06_001' as '06-001'"; - variant "text 'x07_001' as '07-001'"; - variant "text 'x08_001' as '08-001'"; - variant "name as 'SRole-ID'"; -}; - - -type enumerated FilterUsage -{ - int1(1), - int2(2) -} -with { - variant "useNumber"; - variant "name as uncapitalized"; -}; - - -type record EventConfig -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - XSD.ID creator, - XSD.String eventID, - EventType eventType, - Timestamp eventStart optional, - Timestamp eventEnd optional, - record of Operation operationType, - XSD.NonNegativeInteger dataSize optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (operationType) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record EventLog -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - LogTypeId logTypeId, - XSD.String logData, - LogStatus logStatus, - XSD.Boolean logStart, - XSD.Boolean logStop, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - //variant (logStart) "text 'true' as '1'"; - //variant (logStart) "text 'false' as '0'"; - //variant (logStop) "text 'true' as '1'"; - //variant (logStop) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record EventLogAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - LogTypeId logTypeId optional, - XSD.String logData optional, - LogStatus logStatus optional, - XSD.Boolean logStart optional, - XSD.Boolean logStop optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - //variant (logStart) "text 'true' as '1'"; - //variant (logStart) "text 'false' as '0'"; - //variant (logStop) "text 'true' as '1'"; - //variant (logStop) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record ExecInstance -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ExecStatusType execStatus, - ExecResultType execResult, - XSD.Boolean execDisable optional, - NodeID execTarget, - ExecModeType execMode optional, - XSD.Duration execFrequency optional, - XSD.Duration execDelay optional, - XSD.NonNegativeInteger execNumber optional, - ExecReqArgsListType execReqArgs optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - //variant (execDisable) "text 'true' as '1'"; - //variant (execDisable) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record Firmware -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String version, - XSD.String firmwareName, - XSD.AnyURI uRL, - XSD.Boolean update, - ActionStatus updateStatus, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (uRL) "name as capitalized"; - //variant (update) "text 'true' as '1'"; - //variant (update) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record FirmwareAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String version optional, - XSD.String firmwareName optional, - XSD.AnyURI uRL optional, - XSD.Boolean update optional, - ActionStatus updateStatus optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (uRL) "name as capitalized"; - //variant (update) "text 'true' as '1'"; - //variant (update) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record Group -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - XSD.ID creator optional, - MemberType memberType, - XSD.NonNegativeInteger currentNrOfMembers, - XSD.PositiveInteger maxNrOfMembers, - record of XSD.AnyURI memberIDs, - ListOfURIs membersAccessControlPolicyIDs optional, - XSD.Boolean memberTypeValidated optional, - ConsistencyStrategy consistencyStrategy optional, - XSD.String groupName optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (memberIDs) "list"; - //variant (memberTypeValidated) "text 'true' as '1'"; - //variant (memberTypeValidated) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record GroupAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MemberType memberType optional, - XSD.NonNegativeInteger currentNrOfMembers optional, - XSD.PositiveInteger maxNrOfMembers optional, - record of XSD.AnyURI memberIDs, - ListOfURIs membersAccessControlPolicyIDs optional, - XSD.Boolean memberTypeValidated optional, - ConsistencyStrategy consistencyStrategy optional, - XSD.String groupName optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (memberIDs) "list"; - //variant (memberTypeValidated) "text 'true' as '1'"; - //variant (memberTypeValidated) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record LocationPolicy -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - LocationSource locationSource, - XSD.Duration locationUpdatePeriod optional, - NodeID locationTargetID optional, - XSD.AnyURI locationServer optional, - XSD.AnyURI locationContainerID optional, - XSD.String locationContainerName optional, - XSD.String locationStatus, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record LocationPolicyAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - LocationSource locationSource optional, - XSD.Duration locationUpdatePeriod optional, - NodeID locationTargetID optional, - XSD.AnyURI locationServer optional, - XSD.AnyURI locationContainerID optional, - XSD.String locationContainerName optional, - XSD.String locationStatus optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; -}; - - -type record M2mServiceSubscriptionProfile -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - record of SRole_ID serviceRoles, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - ServiceSubscribedNode serviceSubscribedNode, - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (serviceRoles) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record Memory -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.UnsignedLong memAvailable, - XSD.UnsignedLong memTotal, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record MemoryAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.UnsignedLong memAvailable optional, - XSD.UnsignedLong memTotal optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record MgmtCmd -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - XSD.String description optional, - CmdType cmdType, - ExecReqArgsListType execReqArgs optional, - XSD.Boolean execEnable, - NodeID execTarget, - ExecModeType execMode optional, - XSD.Duration execFrequency optional, - XSD.Duration execDelay optional, - XSD.NonNegativeInteger execNumber optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - ExecInstance execInstance, - Subscription subscription - } choice_list - } choice -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - //variant (execEnable) "text 'true' as '1'"; - //variant (execEnable) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record Node -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - NodeID nodeID, - XSD.ID hostedCSELink optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Memory memory, - Battery battery, - AreaNwkInfo areaNwkInfo, - AreaNwkDeviceInfo areaNwkDeviceInfo, - Firmware firmware, - Software software, - DeviceInfo deviceInfo, + + + + type record ActionStatus + { + XSD.AnyURI action_ optional, + Status status optional + } + with { + variant "name as uncapitalized"; + variant (action_) "name as 'action'"; + }; + + + type record AnyArgType + { + XSD.NCName name, + XSD.AnySimpleType value_//FIXME Use AnySimpleType instead + } + with { + variant "name as uncapitalized"; + variant (value_) "name as 'value'"; + }; + + + type record ResetArgsType + { + record of AnyArgType anyArg_list + } + with { + variant "name as uncapitalized"; + variant (anyArg_list) "untagged"; + variant (anyArg_list[-]) "name as 'anyArg'"; + }; + + + type record RebootArgsType + { + record of AnyArgType anyArg_list + } + with { + variant "name as uncapitalized"; + variant (anyArg_list) "untagged"; + variant (anyArg_list[-]) "name as 'anyArg'"; + }; + + + type record UploadArgsType + { + XSD.String fileType, + XSD.AnyURI uRL, + XSD.String username, + XSD.String password, + record of AnyArgType anyArg_list + } + with { + variant "name as uncapitalized"; + variant (uRL) "name as capitalized"; + variant (anyArg_list) "untagged"; + variant (anyArg_list[-]) "name as 'anyArg'"; + }; + + + type record DownloadArgsType + { + XSD.String fileType, + XSD.AnyURI uRL, + XSD.String username, + XSD.String password, + XSD.PositiveInteger filesize, + XSD.String targetFile, + XSD.PositiveInteger delaySeconds, + XSD.AnyURI successURL, + Timestamp startTime, + Timestamp completeTime, + record of AnyArgType anyArg_list + } + with { + variant "name as uncapitalized"; + variant (uRL) "name as capitalized"; + variant (anyArg_list) "untagged"; + variant (anyArg_list[-]) "name as 'anyArg'"; + }; + + + type record SoftwareInstallArgsType + { + XSD.AnyURI uRL, + XSD.String uUID, + XSD.String username, + XSD.String password, + XSD.String executionEnvRef, + record of AnyArgType anyArg_list + } + with { + variant "name as uncapitalized"; + variant (uRL) "name as capitalized"; + variant (uUID) "name as capitalized"; + variant (anyArg_list) "untagged"; + variant (anyArg_list[-]) "name as 'anyArg'"; + }; + + + type record SoftwareUpdateArgsType + { + XSD.String uUID, + XSD.String version, + XSD.AnyURI uRL, + XSD.String username, + XSD.String password, + XSD.String executionEnvRef, + record of AnyArgType anyArg_list + } + with { + variant "name as uncapitalized"; + variant (uUID) "name as capitalized"; + variant (uRL) "name as capitalized"; + variant (anyArg_list) "untagged"; + variant (anyArg_list[-]) "name as 'anyArg'"; + }; + + + type record SoftwareUninstallArgsType + { + XSD.String uUID, + XSD.String version, + XSD.String executionEnvRef, + record of AnyArgType anyArg_list + } + with { + variant "name as uncapitalized"; + variant (uUID) "name as capitalized"; + variant (anyArg_list) "untagged"; + variant (anyArg_list[-]) "name as 'anyArg'"; + }; + + + type record ExecReqArgsListType + { + union { + record of ResetArgsType reset_list, + record length(1 .. infinity) of RebootArgsType reboot_list, + record length(1 .. infinity) of UploadArgsType upload_list, + record length(1 .. infinity) of DownloadArgsType download_list, + record length(1 .. infinity) of SoftwareInstallArgsType softwareInstall_list, + record length(1 .. infinity) of SoftwareUpdateArgsType softwareUpdate_list, + record length(1 .. infinity) of SoftwareUninstallArgsType softwareUninstall_list + } choice + } + with { + variant "name as uncapitalized"; + variant (choice) "untagged"; + variant (choice.reset_list) "untagged"; + variant (choice.reset_list[-]) "name as 'reset'"; + variant (choice.reboot_list) "untagged"; + variant (choice.reboot_list[-]) "name as 'reboot'"; + variant (choice.upload_list) "untagged"; + variant (choice.upload_list[-]) "name as 'upload'"; + variant (choice.download_list) "untagged"; + variant (choice.download_list[-]) "name as 'download'"; + variant (choice.softwareInstall_list) "untagged"; + variant (choice.softwareInstall_list[-]) "name as 'softwareInstall'"; + variant (choice.softwareUpdate_list) "untagged"; + variant (choice.softwareUpdate_list[-]) "name as 'softwareUpdate'"; + variant (choice.softwareUninstall_list) "untagged"; + variant (choice.softwareUninstall_list[-]) "name as 'softwareUninstall'"; + }; + + + type record MgmtLinkRef + { + ResourceName name, + MgmtDefinition type_, + XSD.AnyURI base + } + with { + variant "name as uncapitalized"; + variant (name) "attribute"; + variant (type_) "name as 'type'"; + variant (type_) "attribute"; + variant (base) "untagged"; + }; + + + + + + + type record ChildResourceRef + { + ResourceName name, + ResourceType type_, + XSD.AnyURI base + } + with { + variant "name as uncapitalized"; + variant (name) "attribute"; + variant (type_) "name as 'type'"; + variant (type_) "attribute"; + variant (base) "untagged"; + }; + + + type record ResponseTypeInfo + { + ResponseType responseTypeValue, + record of XSD.AnyURI notificationURI + } + with { + variant "name as uncapitalized"; + variant (notificationURI) "list"; + }; + + + + + type record OperationResult + { + ResponseStatusCode responseStatusCode, + RequestID requestIdentifier, + PrimitiveContent primitiveContent optional, + XSD.AnyURI to_ optional, + XSD.ID from_ optional, + Timestamp originatingTimestamp optional, + AbsRelTimestamp resultExpirationTimestamp optional, + EventCat eventCategory optional + } + with { + variant "name as uncapitalized"; + variant (to_) "name as 'to'"; + variant (from_) "name as 'from'"; + }; + + + + + + + type record Resource_1 + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional + } + with { + variant "name as 'resource'"; + variant (resourceName) "attribute"; + }; + + + type record RegularResource + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + }; + + + type record AnnounceableResource + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; + + + type record AnnouncedResource + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + }; + + + type record AnnounceableSubordinateResource + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; + + + type record SubordinateResource + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + }; + + + type record AnnouncedSubordinateResource + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime, + XSD.AnyURI link + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + }; + + + type record MgmtResource + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; + + + type record AnnouncedMgmtResource + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + }; + + + type record Container + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + XSD.NonNegativeInteger stateTag, + XSD.ID creator, + XSD.NonNegativeInteger maxNrOfInstances optional, + XSD.NonNegativeInteger maxByteSize optional, + XSD.NonNegativeInteger maxInstanceAge optional, + XSD.NonNegativeInteger currentNrOfInstances, + XSD.NonNegativeInteger currentByteSize, + XSD.AnyURI locationID optional, + XSD.AnyURI ontologyRef optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + ContentInstance contentInstance, + Container container, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record ContainerAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + XSD.NonNegativeInteger stateTag, + XSD.NonNegativeInteger maxNrOfInstances optional, + XSD.NonNegativeInteger maxByteSize optional, + XSD.NonNegativeInteger maxInstanceAge optional, + XSD.NonNegativeInteger currentNrOfInstances optional, + XSD.NonNegativeInteger currentByteSize optional, + XSD.AnyURI locationID optional, + XSD.AnyURI ontologyRef optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + ContentInstance contentInstance, + ContentInstanceAnnc contentInstanceAnnc, + Container container, + ContainerAnnc containerAnnc, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record ContentInstance + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + XSD.NonNegativeInteger stateTag, + XSD.ID creator optional, + ContentInfo contentInfo optional, + XSD.NonNegativeInteger contentSize, + XSD.AnyURI ontologyRef optional, + XSD.AnySimpleType content //FIXME Use AnySimpleType instead + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; + + + type record ContentInstanceAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime, + XSD.AnyURI link, + XSD.NonNegativeInteger stateTag, + ContentInfo contentInfo optional, + XSD.NonNegativeInteger contentSize optional, + XSD.AnyURI ontologyRef optional, + XSD.AnySimpleType content optional //FIXME Use AnySimpleType instead + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + + + type record CSEBase + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + CseTypeID cseType optional, + XSD.ID cSE_ID, + ResourceTypeList_1 supportedResourceType optional,//TODO Remove inline type + PoaList pointOfAccess, + XSD.AnyURI nodeLink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + RemoteCSE remoteCSE, + RemoteCSEAnnc remoteCSEAnnc, + Node node, + AE aE, + Container container, + Group group_, + AccessControlPolicy accessControlPolicy, + Subscription subscription, + MgmtCmd mgmtCmd, + LocationPolicy locationPolicy, + StatsConfig statsConfig, + StatsCollect statsCollect, + Request request, + Delivery delivery, + Schedule schedule, + M2mServiceSubscriptionProfile m2mServiceSubscriptionProfile, + ServiceSubscribedAppRule serviceSubscribedAppRule + } choice_list + } choice optional + } + with { + variant "element"; + variant (resourceName) "attribute"; + variant (cSE_ID) "name as 'CSE-ID'"; + variant (supportedResourceType) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].aE) "name as capitalized"; + variant (choice.choice_list[-].group_) "name as 'group'"; + }; + + + type record Delivery + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + XSD.NonNegativeInteger stateTag, + XSD.ID source, + XSD.ID target, + Timestamp lifespan, + EventCat eventCat, + DeliveryMetaData deliveryMetaData, + AggregatedRequest aggregatedRequest, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record DeviceCapability + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String capabilityName, + XSD.Boolean attached, + ActionStatus capabilityActionStatus, + XSD.Boolean currentState, + XSD.Boolean enable optional, + XSD.Boolean disable optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + //variant (attached) "text 'true' as '1'"; + //variant (attached) "text 'false' as '0'"; + //variant (currentState) "text 'true' as '1'"; + //variant (currentState) "text 'false' as '0'"; + //variant (enable) "text 'true' as '1'"; + //variant (enable) "text 'false' as '0'"; + //variant (disable) "text 'true' as '1'"; + //variant (disable) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record DeviceCapabilityAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String capabilityName optional, + XSD.Boolean attached optional, + ActionStatus capabilityActionStatus optional, + XSD.Boolean currentState optional, + XSD.Boolean enable optional, + XSD.Boolean disable optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + //variant (attached) "text 'true' as '1'"; + //variant (attached) "text 'false' as '0'"; + //variant (currentState) "text 'true' as '1'"; + //variant (currentState) "text 'false' as '0'"; + //variant (enable) "text 'true' as '1'"; + //variant (enable) "text 'false' as '0'"; + //variant (disable) "text 'true' as '1'"; + //variant (disable) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record DeviceInfo + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String deviceLabel, + XSD.String manufacturer, + XSD.String model, + XSD.String deviceType, + XSD.String fwVersion, + XSD.String swVersion, + XSD.String hwVersion, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record DeviceInfoAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String deviceLabel optional, + XSD.String manufacturer optional, + XSD.String model optional, + XSD.String deviceType optional, + XSD.String fwVersion optional, + XSD.String swVersion optional, + XSD.String hwVersion optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type enumerated ResourceType + { + int1(1), + int2(2), + int3(3), + int4(4), + int5(5), + int6(6), + int7(7), + int8(8), + int9(9), + int10(10), + int11(11), + int12(12), + int13(13), + int14(14), + int15(15), + int16(16), + int17(17), + int18(18), + int19(19), + int20(20), + int21(21), + int22(22), + int23(23), + int10001(10001), + int10002(10002), + int10003(10003), + int10004(10004), + int10009(10009), + int10010(10010), + int10013(10013), + int10014(10014), + int10016(10016), + int10018(10018) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated CseTypeID + { + int1(1), + int2(2), + int3(3) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated LocationSource + { + int1(1), + int2(2), + int3(3) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated StdEventCats + { + int2(2), + int3(3), + int4(4) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated Operation + { + int1(1), + int2(2), + int3(3), + int4(4), + int5(5) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated ResponseType + { + int1(1), + int2(2), + int3(3) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated ResultContent + { + int0(0), + int1(1), + int2(2), + int3(3), + int4(4), + int5(5), + int6(6), + int7(7) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated DiscResType + { + int1(1), + int2(2) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated ResponseStatusCode + { + int1000(1000), + int2000(2000), + int2001(2001), + int2002(2002), + int2004(2004), + int4000(4000), + int4004(4004), + int4005(4005), + int4008(4008), + int4101(4101), + int4102(4102), + int4103(4103), + int4104(4104), + int4105(4105), + int4106(4106), + int4107(4107), + int4108(4108), + int4109(4109), + int4110(4110), + int5000(5000), + int5001(5001), + int5103(5103), + int5105(5105), + int5106(5106), + int5203(5203), + int5204(5204), + int5205(5205), + int5206(5206), + int5207(5207), + int5209(5209), + int6003(6003), + int6005(6005), + int6010(6010), + int6020(6020), + int6021(6021), + int6022(6022), + int6023(6023), + int6024(6024), + int6025(6025), + int6026(6026), + int6028(6028), + int6029(6029) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated RequestStatus + { + int1(1), + int2(2), + int3(3), + int4(4) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated MemberType + { + int0(0), + int1(1), + int2(2), + int3(3), + int4(4), + int5(5), + int6(6), + int7(7), + int8(8), + int9(9), + int10(10), + int11(11), + int12(12), + int13(13), + int14(14), + int15(15), + int16(16), + int17(17), + int18(18), + int19(19), + int20(20), + int21(21), + int22(22), + int23(23), + int10001(10001), + int10002(10002), + int10003(10003), + int10004(10004), + int10009(10009), + int10010(10010), + int10013(10013), + int10014(10014), + int10016(10016), + int10018(10018), + int20001(20001), + int20002(20002) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated ConsistencyStrategy + { + int1(1), + int2(2), + int3(3) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated CmdType + { + int1(1), + int2(2), + int3(3), + int4(4), + int5(5), + int6(6), + int7(7) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated ExecModeType + { + int1(1), + int2(2), + int3(3), + int4(4) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated ExecStatusType + { + int1(1), + int2(2), + int3(3), + int4(4), + int5(5), + int6(6) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated ExecResultType + { + int0(0), + int1(1), + int2(2), + int3(3), + int4(4), + int5(5), + int6(6), + int7(7), + int8(8), + int9(9), + int10(10), + int11(11), + int12(12), + int13(13), + int14(14), + int15(15), + int16(16), + int19(19), + int20(20), + int21(21), + int22(22), + int23(23), + int24(24), + int25(25), + int26(26), + int27(27), + int28(28), + int29(29), + int30(30), + int31(31) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated PendingNotification + { + int1(1), + int2(2) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated NotificationContentType + { + int1(1), + int2(2), + int3(3) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated NotificationEventType + { + int1(1), + int2(2), + int3(3), + int4(4) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated Status + { + int1(1), + int2(2), + int3(3) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated BatteryStatus + { + int1(1), + int2(2), + int3(3), + int4(4), + int5(5), + int6(6), + int7(7) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated MgmtDefinition + { + int0(0), + int1001(1001), + int1002(1002), + int1003(1003), + int1004(1004), + int1005(1005), + int1006(1006), + int1007(1007), + int1008(1008), + int1009(1009), + int1010(1010), + int1011(1011), + int1012(1012), + int1013(1013), + int1014(1014), + int1015(1015), + int1016(1016), + int1017(1017), + int1018(1018), + int1019(1019) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated LogTypeId + { + int1(1), + int2(2), + int3(3), + int4(4), + int5(5) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated LogStatus + { + int1(1), + int2(2), + int3(3), + int4(4), + int5(5) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated EventType + { + int1(1), + int2(2), + int3(3) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated StatsRuleStatusType + { + int1(1), + int2(2) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated StatModelType + { + int1(1) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated EncodingType + { + int0(0), + int1(1), + int2(2) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + + + type enumerated AccessControlOperations + { + int1(1), + int2(2), + int3(3), + int4(4), + int5(5), + int6(6), + int7(7), + int8(8), + int9(9), + int10(10), + int11(11), + int12(12), + int13(13), + int14(14), + int15(15), + int16(16), + int17(17), + int18(18), + int19(19), + int20(20), + int21(21), + int22(22), + int23(23), + int24(24), + int25(25), + int26(26), + int27(27), + int28(28), + int29(29), + int30(30), + int31(31), + int32(32), + int33(33), + int34(34), + int35(35), + int36(36), + int37(37), + int38(38), + int39(39), + int40(40), + int41(41), + int42(42), + int43(43), + int44(44), + int45(45), + int46(46), + int47(47), + int48(48), + int49(49), + int50(50), + int51(51), + int52(52), + int53(53), + int54(54), + int55(55), + int56(56), + int57(57), + int58(58), + int59(59), + int60(60), + int61(61), + int62(62), + int63(63) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type enumerated FilterUsage + { + int1(1), + int2(2) + } + with { + variant "useNumber"; + variant "name as uncapitalized"; + }; + + + type record EventConfig + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + XSD.ID creator, + XSD.String eventID, + EventType eventType, + Timestamp eventStart optional, + Timestamp eventEnd optional, + record of Operation operationType, + XSD.NonNegativeInteger dataSize optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (operationType) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record EventLog + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + LogTypeId logTypeId, + XSD.String logData, + LogStatus logStatus, + XSD.Boolean logStart, + XSD.Boolean logStop, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + //variant (logStart) "text 'true' as '1'"; + //variant (logStart) "text 'false' as '0'"; + //variant (logStop) "text 'true' as '1'"; + //variant (logStop) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record EventLogAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + LogTypeId logTypeId optional, + XSD.String logData optional, + LogStatus logStatus optional, + XSD.Boolean logStart optional, + XSD.Boolean logStop optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + //variant (logStart) "text 'true' as '1'"; + //variant (logStart) "text 'false' as '0'"; + //variant (logStop) "text 'true' as '1'"; + //variant (logStop) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record ExecInstance + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ExecStatusType execStatus, + ExecResultType execResult, + XSD.Boolean execDisable optional, + NodeID execTarget, + ExecModeType execMode optional, + XSD.Duration execFrequency optional, + XSD.Duration execDelay optional, + XSD.NonNegativeInteger execNumber optional, + ExecReqArgsListType execReqArgs optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + //variant (execDisable) "text 'true' as '1'"; + //variant (execDisable) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record Firmware + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String version, + XSD.String firmwareName, + XSD.AnyURI uRL, + XSD.Boolean update, + ActionStatus updateStatus, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (uRL) "name as capitalized"; + //variant (update) "text 'true' as '1'"; + //variant (update) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record FirmwareAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String version optional, + XSD.String firmwareName optional, + XSD.AnyURI uRL optional, + XSD.Boolean update optional, + ActionStatus updateStatus optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (uRL) "name as capitalized"; + //variant (update) "text 'true' as '1'"; + //variant (update) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record Group + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + XSD.ID creator optional, + MemberType memberType, + XSD.NonNegativeInteger currentNrOfMembers, + XSD.PositiveInteger maxNrOfMembers, + record of XSD.AnyURI memberIDs, + ListOfURIs membersAccessControlPolicyIDs optional, + XSD.Boolean memberTypeValidated optional, + ConsistencyStrategy consistencyStrategy optional, + XSD.String groupName optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (memberIDs) "list"; + //variant (memberTypeValidated) "text 'true' as '1'"; + //variant (memberTypeValidated) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record GroupAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MemberType memberType optional, + XSD.NonNegativeInteger currentNrOfMembers optional, + XSD.PositiveInteger maxNrOfMembers optional, + record of XSD.AnyURI memberIDs, + ListOfURIs membersAccessControlPolicyIDs optional, + XSD.Boolean memberTypeValidated optional, + ConsistencyStrategy consistencyStrategy optional, + XSD.String groupName optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (memberIDs) "list"; + //variant (memberTypeValidated) "text 'true' as '1'"; + //variant (memberTypeValidated) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record LocationPolicy + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + LocationSource locationSource, + XSD.Duration locationUpdatePeriod optional, + NodeID locationTargetID optional, + XSD.AnyURI locationServer optional, + XSD.AnyURI locationContainerID optional, + XSD.String locationContainerName optional, + XSD.String locationStatus, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record LocationPolicyAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + LocationSource locationSource optional, + XSD.Duration locationUpdatePeriod optional, + NodeID locationTargetID optional, + XSD.AnyURI locationServer optional, + XSD.AnyURI locationContainerID optional, + XSD.String locationContainerName optional, + XSD.String locationStatus optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + + + type record M2mServiceSubscriptionProfile + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + ServiceSubscribedNode serviceSubscribedNode, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record Memory + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.UnsignedLong memAvailable, + XSD.UnsignedLong memTotal, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record MemoryAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.UnsignedLong memAvailable optional, + XSD.UnsignedLong memTotal optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record MgmtCmd + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + XSD.String description optional, + CmdType cmdType, + ExecReqArgsListType execReqArgs optional, + XSD.Boolean execEnable, + NodeID execTarget, + ExecModeType execMode optional, + XSD.Duration execFrequency optional, + XSD.Duration execDelay optional, + XSD.NonNegativeInteger execNumber optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + ExecInstance execInstance, + Subscription subscription + } choice_list + } choice + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + //variant (execEnable) "text 'true' as '1'"; + //variant (execEnable) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record Node + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + NodeID nodeID, + XSD.ID hostedCSELink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Memory memory, + Battery battery, + AreaNwkInfo areaNwkInfo, + AreaNwkDeviceInfo areaNwkDeviceInfo, + Firmware firmware, + Software software, + DeviceInfo deviceInfo, + DeviceCapability deviceCapability, + Reboot reboot, + EventLog eventLog, + CmdhPolicy cmdhPolicy, + ActiveCmdhPolicy activeCmdhPolicy, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record NodeAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + NodeID nodeID, + XSD.ID hostedCSELink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + MemoryAnnc memoryAnnc, + BatteryAnnc batteryAnnc, + AreaNwkInfoAnnc areaNwkInfoAnnc, + AreaNwkDeviceInfoAnnc areaNwkDeviceInfoAnnc, + FirmwareAnnc firmwareAnnc, + SoftwareAnnc softwareAnnc, + DeviceInfoAnnc deviceInfoAnnc, + DeviceCapabilityAnnc deviceCapabilityAnnc, + RebootAnnc rebootAnnc, + EventLogAnnc eventLogAnnc, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type Notification_1 Notification + with { + variant "name as uncapitalized"; + variant "element"; + }; + + + type AggregatedNotification_1 AggregatedNotification + with { + variant "name as uncapitalized"; + variant "element"; + }; + + + type record AggregatedNotification_1 + { + record of Notification notification_list + } + with { + variant "name as 'aggregatedNotification'"; + variant (notification_list) "untagged"; + variant (notification_list[-]) "name as 'notification'"; + }; + +// TODO To be added + type union Representation { + Resource_2 resource, + ResponsePrimitive responsePrimitive + }; + + type record Notification_1 + { + record { + //XSD.AnyType representation optional, + Representation representation optional, + record { + Operation operation optional, + XSD.ID originator optional + } operationMonitor optional, + NotificationEventType notificationEventType optional + } notificationEvent optional, + XSD.Boolean verificationRequest optional, + XSD.Boolean subscriptionDeletion optional, + XSD.AnyURI subscriptionReference optional, + XSD.ID creator optional, + XSD.AnyURI notificationForwardingURI optional + } + with { + variant "name as 'notification'"; + //variant (verificationRequest) "text 'true' as '1'"; + //variant (verificationRequest) "text 'false' as '0'"; + //variant (subscriptionDeletion) "text 'true' as '1'"; + //variant (subscriptionDeletion) "text 'false' as '0'"; + }; + + + type record PollingChannel + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + + + type record Reboot + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.Boolean reboot, + XSD.Boolean factoryReset, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + //variant (reboot) "text 'true' as '1'"; + //variant (reboot) "text 'false' as '0'"; + //variant (factoryReset) "text 'true' as '1'"; + //variant (factoryReset) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record RebootAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.Boolean reboot optional, + XSD.Boolean factoryReset optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + //variant (reboot) "text 'true' as '1'"; + //variant (reboot) "text 'false' as '0'"; + //variant (factoryReset) "text 'true' as '1'"; + //variant (factoryReset) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record RemoteCSE + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + CseTypeID cseType optional, + PoaList pointOfAccess optional, + XSD.AnyURI cSEBase, + XSD.ID cSE_ID, + ExternalID m2M_Ext_ID optional, + TriggerRecipientID trigger_Recipient_ID optional, + XSD.Boolean requestReachability, + XSD.AnyURI nodeLink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Container container, + ContainerAnnc containerAnnc, + Group group_, + GroupAnnc groupAnnc, + AccessControlPolicy accessControlPolicy, + AccessControlPolicyAnnc accessControlPolicyAnnc, + Subscription subscription, + PollingChannel pollingChannel, + Schedule schedule, + NodeAnnc nodeAnnc, + RemoteCSEAnnc remoteCSEAnnc, + AEAnnc aEAnnc, + LocationPolicyAnnc locationPolicyAnnc + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (cSEBase) "name as capitalized"; + variant (cSE_ID) "name as 'CSE-ID'"; + variant (m2M_Ext_ID) "name as 'M2M-Ext-ID'"; + variant (trigger_Recipient_ID) "name as 'Trigger-Recipient-ID'"; + //variant (requestReachability) "text 'true' as '1'"; + //variant (requestReachability) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].group_) "name as 'group'"; + variant (choice.choice_list[-].aEAnnc) "name as capitalized"; + }; + + + type record RemoteCSEAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + CseTypeID cseType optional, + PoaList pointOfAccess optional, + XSD.AnyURI cSEBase optional, + XSD.ID cSE_ID optional, + XSD.Boolean requestReachability optional, + XSD.AnyURI nodeLink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + NodeAnnc nodeAnnc, + Container container, + ContainerAnnc containerAnnc, + Group group_, + GroupAnnc groupAnnc, + AccessControlPolicy accessControlPolicy, + AccessControlPolicyAnnc accessControlPolicyAnnc, + Subscription subscription, + PollingChannel pollingChannel, + ScheduleAnnc scheduleAnnc, + LocationPolicyAnnc locationPolicyAnnc, + RemoteCSEAnnc remoteCSEAnnc, + AEAnnc aEAnnc + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (cSEBase) "name as capitalized"; + variant (cSE_ID) "name as 'CSE-ID'"; + //variant (requestReachability) "text 'true' as '1'"; + //variant (requestReachability) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].group_) "name as 'group'"; + variant (choice.choice_list[-].aEAnnc) "name as capitalized"; + }; + + + type record RequestPrimitive + { + Operation operation, + XSD.AnyURI to_, + XSD.ID from_ optional, + RequestID requestIdentifier, + ResourceType resourceType optional, + PrimitiveContent primitiveContent optional, + XSD.AnySimpleType role optional, + Timestamp originatingTimestamp optional, + AbsRelTimestamp requestExpirationTimestamp optional, + AbsRelTimestamp resultExpirationTimestamp optional, + AbsRelTimestamp operationExecutionTime optional, + ResponseTypeInfo responseType optional, + AbsRelTimestamp resultPersistence optional, + ResultContent resultContent optional, + EventCat eventCategory optional, + XSD.Boolean deliveryAggregation optional, + XSD.String groupRequestIdentifier optional, + FilterCriteria filterCriteria optional, + DiscResType discoveryResultType optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (to_) "name as 'to'"; + variant (from_) "name as 'from'"; + //variant (deliveryAggregation) "text 'true' as '1'"; + //variant (deliveryAggregation) "text 'false' as '0'"; + }; + + + type AttributeList_1 AttributeList + with { + variant "name as uncapitalized"; + variant "element"; + }; + + + type record Request + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + XSD.NonNegativeInteger stateTag, + Operation operation, + XSD.AnyURI target, + XSD.ID originator, + RequestID requestID, + MetaInformation metaInformation, + PrimitiveContent primitiveContent, + RequestStatus requestStatus, + OperationResult operationResult, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record ResponsePrimitive + { + ResponseStatusCode responseStatusCode, + RequestID requestIdentifier, + PrimitiveContent primitiveContent optional, + XSD.ID to_ optional, + XSD.ID from_ optional, + Timestamp originatingTimestamp optional, + AbsRelTimestamp resultExpirationTimestamp optional, + EventCat eventCategory optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (to_) "name as 'to'"; + variant (from_) "name as 'from'"; + }; + + + type ResourceWrapper Resource + with { + variant "name as uncapitalized"; + variant "element"; + }; + + + type ListOfURIs URIList + with { + variant "element"; + }; + + + type XSD.AnyURI URI + with { + variant "element"; + }; + + + type AggregatedResponse_1 AggregatedResponse + with { + variant "name as uncapitalized"; + variant "element"; + }; + + + type XSD.String DebugInfo + with { + variant "name as uncapitalized"; + variant "element"; + }; + + + type record ResourceWrapper + { + union { + AccessControlPolicy accessControlPolicy, + ActiveCmdhPolicy activeCmdhPolicy, + AE aE, + AreaNwkDeviceInfo areaNwkDeviceInfo, + AreaNwkInfo areaNwkInfo, + Battery battery, + CmdhBuffer cmdhBuffer, + CmdhDefaults cmdhDefaults, + CmdhDefEcValue cmdhDefEcValue, + CmdhEcDefParamValues cmdhEcDefParamValues, + CmdhLimits cmdhLimits, + CmdhNetworkAccessRules cmdhNetworkAccessRules, + CmdhNwAccessRule cmdhNwAccessRule, + CmdhPolicy cmdhPolicy, + Container container, + ContentInstance contentInstance, + CSEBase cSEBase, + Delivery delivery, DeviceCapability deviceCapability, - Reboot reboot, + DeviceInfo deviceInfo, + EventConfig eventConfig, EventLog eventLog, - CmdhPolicy cmdhPolicy, - ActiveCmdhPolicy activeCmdhPolicy, - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record NodeAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - NodeID nodeID, - XSD.ID hostedCSELink optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - MemoryAnnc memoryAnnc, - BatteryAnnc batteryAnnc, - AreaNwkInfoAnnc areaNwkInfoAnnc, - AreaNwkDeviceInfoAnnc areaNwkDeviceInfoAnnc, - FirmwareAnnc firmwareAnnc, - SoftwareAnnc softwareAnnc, - DeviceInfoAnnc deviceInfoAnnc, - DeviceCapabilityAnnc deviceCapabilityAnnc, - RebootAnnc rebootAnnc, - EventLogAnnc eventLogAnnc, + ExecInstance execInstance, + Firmware firmware, + Group group_, + LocationPolicy locationPolicy, + M2mServiceSubscriptionProfile m2mServiceSubscriptionProfile, + Memory memory, + MgmtCmd mgmtCmd, + Node node, + Notification notification, + PollingChannel pollingChannel, + Reboot reboot, + RemoteCSE remoteCSE, + Request request, + RequestPrimitive requestPrimitive, + ResponsePrimitive responsePrimitive, + Schedule schedule, + ServiceSubscribedAppRule serviceSubscribedAppRule, + ServiceSubscribedNode serviceSubscribedNode, + Software software, + StatsCollect statsCollect, + StatsConfig statsConfig, Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type Notification_1 Notification -with { - variant "name as uncapitalized"; - variant "element"; -}; + } choice, + XSD.AnyURI uRI + } + with { + variant "name as uncapitalized"; + variant (choice) "untagged"; + variant (choice.aE) "name as capitalized"; + variant (choice.cSEBase) "name as capitalized"; + variant (choice.group_) "name as 'group'"; + variant (uRI) "name as capitalized"; + }; + + + type record AggregatedResponse_1 + { + record of ResponsePrimitive responsePrimitive_list + } + with { + variant "name as 'aggregatedResponse'"; + variant (responsePrimitive_list) "untagged"; + variant (responsePrimitive_list[-]) "name as 'responsePrimitive'"; + }; + + + type record Schedule + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + ScheduleEntries scheduleElement, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + + type record ScheduleAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + Timestamp expirationTime, + XSD.AnyURI link, + ScheduleEntries scheduleElement optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + + + type record ServiceSubscribedAppRule + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfM2MID applicableCredIDs optional, + ListOfM2MID allowedApp_IDs optional, + ListOfM2MID allowedAEs optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (allowedApp_IDs) "name as 'allowedApp-IDs'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record ServiceSubscribedNode + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + NodeID nodeID, + XSD.ID cSE_ID optional, + record of DeviceID deviceIdentifier, + ListOfURIs ruleLinks optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (cSE_ID) "name as 'CSE-ID'"; + variant (deviceIdentifier) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record Software + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, //TODO To be put as optional + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String version, + XSD.String softwareName, + XSD.AnyURI uRL, + XSD.Boolean install, + XSD.Boolean uninstall, + ActionStatus installStatus, + XSD.Boolean activate_ optional, + XSD.Boolean deactivate_ optional, + ActionStatus activeStatus optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (uRL) "name as capitalized"; + //variant (install) "text 'true' as '1'"; + //variant (install) "text 'false' as '0'"; + //variant (uninstall) "text 'true' as '1'"; + //variant (uninstall) "text 'false' as '0'"; + variant (activate_) "name as 'activate'"; + //variant (activate_) "text 'true' as '1'"; + //variant (activate_) "text 'false' as '0'"; + variant (deactivate_) "name as 'deactivate'"; + //variant (deactivate_) "text 'true' as '1'"; + //variant (deactivate_) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record SoftwareAnnc + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs, + Timestamp expirationTime, + XSD.AnyURI link, + MgmtDefinition mgmtDefinition, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional, + XSD.String version optional, + XSD.String softwareName optional, + XSD.AnyURI uRL optional, + XSD.Boolean install optional, + XSD.Boolean uninstall optional, + ActionStatus installStatus optional, + XSD.Boolean activate_ optional, + XSD.Boolean deactivate_ optional, + ActionStatus activeStatus optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (uRL) "name as capitalized"; + //variant (install) "text 'true' as '1'"; + //variant (install) "text 'false' as '0'"; + //variant (uninstall) "text 'true' as '1'"; + //variant (uninstall) "text 'false' as '0'"; + variant (activate_) "name as 'activate'"; + //variant (activate_) "text 'true' as '1'"; + //variant (activate_) "text 'false' as '0'"; + variant (deactivate_) "name as 'deactivate'"; + //variant (deactivate_) "text 'true' as '1'"; + //variant (deactivate_) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; -type AggregatedNotification_1 AggregatedNotification -with { - variant "name as uncapitalized"; - variant "element"; -}; + type record StatsCollect + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + XSD.ID creator, + XSD.String statsCollectID, + XSD.ID collectingEntityID, + XSD.ID collectedEntityID, + StatsRuleStatusType statsRuleStatus, + StatModelType statModel, + ScheduleEntries collectPeriod optional, + XSD.String eventID optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; -type record AggregatedNotification_1 -{ - record of Notification notification_list -} -with { - variant "name as 'aggregatedNotification'"; - variant (notification_list) "untagged"; - variant (notification_list[-]) "name as 'notification'"; -}; - -//FIXME To be added -type union Representation { - anytype resource, - ResponsePrimitive responsePrimitive -}; - -type record Notification_1 -{ - record { - //XSD.AnyType representation optional, To be exchanged by Representation - Representation representation optional, - record { - Operation operation optional, - XSD.ID originator optional - } operationMonitor optional, - NotificationEventType notificationEventType optional - } notificationEvent optional, - XSD.Boolean verificationRequest optional, - XSD.Boolean subscriptionDeletion optional, - XSD.AnyURI subscriptionReference optional, - XSD.ID creator optional, - XSD.AnyURI notificationForwardingURI optional -} -with { - variant "name as 'notification'"; - //variant (verificationRequest) "text 'true' as '1'"; - //variant (verificationRequest) "text 'false' as '0'"; - //variant (subscriptionDeletion) "text 'true' as '1'"; - //variant (subscriptionDeletion) "text 'false' as '0'"; -}; - - -type record PollingChannel -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; -}; - - -type record Reboot -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.Boolean reboot, - XSD.Boolean factoryReset, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - //variant (reboot) "text 'true' as '1'"; - //variant (reboot) "text 'false' as '0'"; - //variant (factoryReset) "text 'true' as '1'"; - //variant (factoryReset) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record RebootAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.Boolean reboot optional, - XSD.Boolean factoryReset optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - //variant (reboot) "text 'true' as '1'"; - //variant (reboot) "text 'false' as '0'"; - //variant (factoryReset) "text 'true' as '1'"; - //variant (factoryReset) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record RemoteCSE -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - CseTypeID cseType optional, - PoaList pointOfAccess optional, - XSD.AnyURI cSEBase, - XSD.ID cSE_ID, - ExternalID m2M_Ext_ID optional, - TriggerRecipientID trigger_Recipient_ID optional, - XSD.Boolean requestReachability, - XSD.AnyURI nodeLink optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Container container, - ContainerAnnc containerAnnc, - Group group_, - GroupAnnc groupAnnc, - AccessControlPolicy accessControlPolicy, - AccessControlPolicyAnnc accessControlPolicyAnnc, - Subscription subscription, - PollingChannel pollingChannel, - Schedule schedule, - NodeAnnc nodeAnnc, - RemoteCSEAnnc remoteCSEAnnc, - AEAnnc aEAnnc, - LocationPolicyAnnc locationPolicyAnnc - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (cSEBase) "name as capitalized"; - variant (cSE_ID) "name as 'CSE-ID'"; - variant (m2M_Ext_ID) "name as 'M2M-Ext-ID'"; - variant (trigger_Recipient_ID) "name as 'Trigger-Recipient-ID'"; - //variant (requestReachability) "text 'true' as '1'"; - //variant (requestReachability) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; - variant (choice.choice_list[-].group_) "name as 'group'"; - variant (choice.choice_list[-].aEAnnc) "name as capitalized"; -}; - - -type record RemoteCSEAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - CseTypeID cseType optional, - PoaList pointOfAccess optional, - XSD.AnyURI cSEBase optional, - XSD.ID cSE_ID optional, - XSD.Boolean requestReachability optional, - XSD.AnyURI nodeLink optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - NodeAnnc nodeAnnc, - Container container, - ContainerAnnc containerAnnc, - Group group_, - GroupAnnc groupAnnc, - AccessControlPolicy accessControlPolicy, - AccessControlPolicyAnnc accessControlPolicyAnnc, - Subscription subscription, - PollingChannel pollingChannel, - ScheduleAnnc scheduleAnnc, - LocationPolicyAnnc locationPolicyAnnc, - RemoteCSEAnnc remoteCSEAnnc, - AEAnnc aEAnnc - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (cSEBase) "name as capitalized"; - variant (cSE_ID) "name as 'CSE-ID'"; - //variant (requestReachability) "text 'true' as '1'"; - //variant (requestReachability) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; - variant (choice.choice_list[-].group_) "name as 'group'"; - variant (choice.choice_list[-].aEAnnc) "name as capitalized"; -}; - - -type record RequestPrimitive -{ - Operation operation, - XSD.AnyURI to_, - XSD.ID from_ optional, - RequestID requestIdentifier, - ResourceType resourceType optional, - PrimitiveContent primitiveContent optional, - XSD.AnyType role optional, - Timestamp originatingTimestamp optional, - AbsRelTimestamp requestExpirationTimestamp optional, - AbsRelTimestamp resultExpirationTimestamp optional, - AbsRelTimestamp operationExecutionTime optional, - ResponseTypeInfo responseType optional, - AbsRelTimestamp resultPersistence optional, - ResultContent resultContent optional, - EventCat eventCategory optional, - XSD.Boolean deliveryAggregation optional, - XSD.String groupRequestIdentifier optional, - FilterCriteria filterCriteria optional, - DiscResType discoveryResultType optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (to_) "name as 'to'"; - variant (from_) "name as 'from'"; - //variant (deliveryAggregation) "text 'true' as '1'"; - //variant (deliveryAggregation) "text 'false' as '0'"; -}; + type record StatsConfig + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + XSD.ID creator, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + EventConfig eventConfig, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; -type AttributeList_1 AttributeList -with { - variant "name as uncapitalized"; - variant "element"; -}; - - -type record Request -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - XSD.NonNegativeInteger stateTag, - Operation operation, - XSD.AnyURI target, - XSD.ID originator, - RequestID requestID, - MetaInformation metaInformation, - PrimitiveContent primitiveContent, - RequestStatus requestStatus, - OperationResult operationResult, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record ResponsePrimitive -{ - ResponseStatusCode responseStatusCode, - RequestID requestIdentifier, - PrimitiveContent primitiveContent optional, - XSD.ID to_ optional, - XSD.ID from_ optional, - Timestamp originatingTimestamp optional, - AbsRelTimestamp resultExpirationTimestamp optional, - EventCat eventCategory optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (to_) "name as 'to'"; - variant (from_) "name as 'from'"; -}; + type record Subscription + { + ResourceName resourceName, + ResourceType resourceType, + XSD.ID resourceID, + NhURI parentID, + Timestamp creationTime, + Timestamp lastModifiedTime, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime, + EventNotificationCriteria eventNotificationCriteria optional, + XSD.PositiveInteger expirationCounter optional, + ListOfURIs notificationURI, + XSD.AnyURI groupID optional, + XSD.AnyURI notificationForwardingURI optional, + BatchNotify batchNotify optional, + RateLimit rateLimit optional, + XSD.PositiveInteger preSubscriptionNotify optional, + PendingNotification pendingNotification optional, + XSD.PositiveInteger notificationStoragePriority optional, + XSD.Boolean latestNotify optional, + NotificationContentType notificationContentType, + EventCat notificationEventCat optional, + XSD.ID creator optional, + XSD.AnyURI subscriberURI optional, + union { + ChildResourceRef childResource, + Schedule schedule + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + //variant (latestNotify) "text 'true' as '1'"; + //variant (latestNotify) "text 'false' as '0'"; + variant (choice) "untagged"; + }; -type ResourceWrapper Resource -with { - variant "name as uncapitalized"; - variant "element"; -}; + type record EventNotificationCriteria + { + Timestamp createdBefore optional, + Timestamp createdAfter optional, + Timestamp modifiedSince optional, + Timestamp unmodifiedSince optional, + XSD.PositiveInteger stateTagSmaller optional, + XSD.NonNegativeInteger stateTagBigger optional, + Timestamp expireBefore optional, + Timestamp expireAfter optional, + XSD.NonNegativeInteger sizeAbove optional, + XSD.PositiveInteger sizeBelow optional, + record length(0 .. 5) of Operation operationMonitor_list, + AttributeList_1 attribute optional, + record length(0 .. 4) of NotificationEventType notificationEventType_list + } + with { + variant "name as uncapitalized"; + variant (operationMonitor_list) "untagged"; + variant (operationMonitor_list[-]) "name as 'operationMonitor'"; + variant (notificationEventType_list) "untagged"; + variant (notificationEventType_list[-]) "name as 'notificationEventType'"; + }; -type ListOfURIs URIList -with { - variant "element"; -}; + type record BatchNotify + { + XSD.NonNegativeInteger number, + XSD.Duration duration + } + with { + variant "name as uncapitalized"; + }; -type XSD.AnyURI URI -with { - variant "element"; -}; + type record RateLimit + { + XSD.NonNegativeInteger maxNrOfNotify optional, + XSD.Duration timeWindow optional + } + with { + variant "name as uncapitalized"; + }; + + /* ****************************************** + * oneM2M Abstract Service Primitives + * ****************************************** + */ + /** + * @desc Type for the oneM2M primitives exchange + * @member primitive oneM2M primitive + * @member host IP Address of the destination + * @member xmlNamespace XML Namespace to be used + * @member protocolBinding Protocol binding to be used + * @member serialization Serialization to be used + * @member forcedFields Attributes that need to be processed differently by the test adapter: + * - empty fields (for instance, for attribute deletion), i.e. <labels></labels> -> value_ to be omitted + * - invalid values, i.e. <maxNrOfInstances>-1</maxNrOfInstances> + */ + type record MsgOut { + union { + RequestPrimitive requestPrimitive, + ResponsePrimitive responsePrimitive + } primitive, + charstring host optional, + charstring xmlNamespace optional, + charstring protocolBinding optional, + charstring serialization optional, + AttributeAux_list forcedFields optional + } + with { + encode "" + } + + /** + * @desc Type for the oneM2M primitives exchange + * @member primitive oneM2M primitive + */ + type record MsgIn { + union { + RequestPrimitive requestPrimitive, + ResponsePrimitive responsePrimitive + } primitive + } + with { + encode "" + } + + type record AcRequestPrimitive { + charstring event, + anytype data + } + with { + encode "adapter"; + } + + type record AcResponsePrimitive { + charstring event, + anytype data + } + with { + encode "adapter"; + } + + type record AttributeAux { + XSD.NCName name, + charstring value_ optional + }; + + type record of AttributeAux AttributeAux_list; -type AggregatedResponse_1 AggregatedResponse -with { - variant "name as uncapitalized"; - variant "element"; -}; +/* Additional types */ +group optionalResourceTypes { + + type record AccessControlPolicy_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + SetOfAcrs privileges optional, + SetOfAcrs selfPrivileges optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; -type XSD.String DebugInfo -with { - variant "name as uncapitalized"; - variant "element"; -}; - - -type record ResourceWrapper -{ - union { - AccessControlPolicy accessControlPolicy, - ActiveCmdhPolicy activeCmdhPolicy, - AE aE, - AreaNwkDeviceInfo areaNwkDeviceInfo, - AreaNwkInfo areaNwkInfo, - Battery battery, - CmdhBuffer cmdhBuffer, - CmdhDefaults cmdhDefaults, - CmdhDefEcValue cmdhDefEcValue, - CmdhEcDefParamValues cmdhEcDefParamValues, - CmdhLimits cmdhLimits, - CmdhNetworkAccessRules cmdhNetworkAccessRules, - CmdhNwAccessRule cmdhNwAccessRule, - CmdhPolicy cmdhPolicy, - Container container, - ContentInstance contentInstance, - CSEBase cSEBase, - Delivery delivery, - DeviceCapability deviceCapability, - DeviceInfo deviceInfo, - EventConfig eventConfig, - EventLog eventLog, - ExecInstance execInstance, - Firmware firmware, - Group group_, - LocationPolicy locationPolicy, - M2mServiceSubscriptionProfile m2mServiceSubscriptionProfile, - Memory memory, - MgmtCmd mgmtCmd, - Node node, - Notification notification, - PollingChannel pollingChannel, - Reboot reboot, - RemoteCSE remoteCSE, - Request request, - RequestPrimitive requestPrimitive, - ResponsePrimitive responsePrimitive, - Schedule schedule, - ServiceSubscribedAppRule serviceSubscribedAppRule, - ServiceSubscribedNode serviceSubscribedNode, - Software software, - StatsCollect statsCollect, - StatsConfig statsConfig, - Subscription subscription - } choice, - XSD.AnyURI uRI -} -with { - variant "name as uncapitalized"; - variant (choice) "untagged"; - variant (choice.aE) "name as capitalized"; - variant (choice.cSEBase) "name as capitalized"; - variant (choice.group_) "name as 'group'"; - variant (uRI) "name as capitalized"; -}; - - -type record AggregatedResponse_1 -{ - record of ResponsePrimitive responsePrimitive_list -} -with { - variant "name as 'aggregatedResponse'"; - variant (responsePrimitive_list) "untagged"; - variant (responsePrimitive_list[-]) "name as 'responsePrimitive'"; -}; - - -type record Schedule -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - ScheduleEntries scheduleElement, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record ScheduleAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - Timestamp expirationTime, - XSD.AnyURI link, - ScheduleEntries scheduleElement optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; -}; - - -type record ServiceSubscribedAppRule -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfM2MID applicableCredIDs optional, - ListOfM2MID allowedApp_IDs optional, - ListOfM2MID allowedAEs optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (allowedApp_IDs) "name as 'allowedApp-IDs'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record ServiceSubscribedNode -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - NodeID nodeID, - XSD.ID cSE_ID optional, - record of DeviceID deviceIdentifier, - ListOfURIs ruleLinks optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (cSE_ID) "name as 'CSE-ID'"; - variant (deviceIdentifier) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record Software -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String version, - XSD.String softwareName, - XSD.AnyURI uRL, - XSD.Boolean install, - XSD.Boolean uninstall, - ActionStatus installStatus, - XSD.Boolean activate_ optional, - XSD.Boolean deactivate_ optional, - ActionStatus activeStatus optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - variant (uRL) "name as capitalized"; - //variant (install) "text 'true' as '1'"; - //variant (install) "text 'false' as '0'"; - //variant (uninstall) "text 'true' as '1'"; - //variant (uninstall) "text 'false' as '0'"; - variant (activate_) "name as 'activate'"; - //variant (activate_) "text 'true' as '1'"; - //variant (activate_) "text 'false' as '0'"; - variant (deactivate_) "name as 'deactivate'"; - //variant (deactivate_) "text 'true' as '1'"; - //variant (deactivate_) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record SoftwareAnnc -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs, - Timestamp expirationTime, - XSD.AnyURI link, - MgmtDefinition mgmtDefinition, - ListOfURIs objectIDs optional, - ListOfURIs objectPaths optional, - XSD.String description optional, - XSD.String version optional, - XSD.String softwareName optional, - XSD.AnyURI uRL optional, - XSD.Boolean install optional, - XSD.Boolean uninstall optional, - ActionStatus installStatus optional, - XSD.Boolean activate_ optional, - XSD.Boolean deactivate_ optional, - ActionStatus activeStatus optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (uRL) "name as capitalized"; - //variant (install) "text 'true' as '1'"; - //variant (install) "text 'false' as '0'"; - //variant (uninstall) "text 'true' as '1'"; - //variant (uninstall) "text 'false' as '0'"; - variant (activate_) "name as 'activate'"; - //variant (activate_) "text 'true' as '1'"; - //variant (activate_) "text 'false' as '0'"; - variant (deactivate_) "name as 'deactivate'"; - //variant (deactivate_) "text 'true' as '1'"; - //variant (deactivate_) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record StatsCollect -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - XSD.ID creator, - XSD.String statsCollectID, - XSD.ID collectingEntityID, - XSD.ID collectedEntityID, - StatsRuleStatusType statsRuleStatus, - StatModelType statModel, - ScheduleEntries collectPeriod optional, - XSD.String eventID optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; -}; - - -type record StatsConfig -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - XSD.ID creator, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - EventConfig eventConfig, - Subscription subscription - } choice_list - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; -}; - - -type record Subscription -{ - ResourceName resourceName, - ResourceType resourceType, - XSD.ID resourceID, - NhURI parentID, - Timestamp creationTime, - Timestamp lastModifiedTime, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime, - EventNotificationCriteria eventNotificationCriteria optional, - XSD.PositiveInteger expirationCounter optional, - ListOfURIs notificationURI, - XSD.AnyURI groupID optional, - XSD.AnyURI notificationForwardingURI optional, - BatchNotify batchNotify optional, - RateLimit rateLimit optional, - XSD.PositiveInteger preSubscriptionNotify optional, - PendingNotification pendingNotification optional, - XSD.PositiveInteger notificationStoragePriority optional, - XSD.Boolean latestNotify optional, - NotificationContentType notificationContentType, - EventCat notificationEventCat optional, - XSD.ID creator optional, - XSD.AnyURI subscriberURI optional, - union { - ChildResourceRef childResource, - Schedule schedule - } choice optional -} -with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - //variant (latestNotify) "text 'true' as '1'"; - //variant (latestNotify) "text 'false' as '0'"; - variant (choice) "untagged"; -}; - - -type record EventNotificationCriteria -{ - Timestamp createdBefore optional, - Timestamp createdAfter optional, - Timestamp modifiedSince optional, - Timestamp unmodifiedSince optional, - XSD.PositiveInteger stateTagSmaller optional, - XSD.NonNegativeInteger stateTagBigger optional, - Timestamp expireBefore optional, - Timestamp expireAfter optional, - XSD.NonNegativeInteger sizeAbove optional, - XSD.PositiveInteger sizeBelow optional, - record length(0 .. 5) of Operation operationMonitor_list, - AttributeList_1 attribute optional, - record length(0 .. 4) of NotificationEventType notificationEventType_list -} -with { - variant "name as uncapitalized"; - variant (operationMonitor_list) "untagged"; - variant (operationMonitor_list[-]) "name as 'operationMonitor'"; - variant (notificationEventType_list) "untagged"; - variant (notificationEventType_list[-]) "name as 'notificationEventType'"; -}; - - -type record BatchNotify -{ - XSD.NonNegativeInteger number, - XSD.Duration duration -} -with { - variant "name as uncapitalized"; -}; + type record AccessControlPolicyAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + SetOfAcrs privileges optional, + SetOfAcrs selfPrivileges optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + type record AE_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + XSD.String appName optional, + XSD.String app_ID optional, + XSD.ID aE_ID optional, + PoaList pointOfAccess optional, + XSD.AnyURI ontologyRef optional, + XSD.AnyURI nodeLink optional, + XSD.Boolean requestReachability optional, + Serializations contentSerialization optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Container container, + Group group_, + AccessControlPolicy accessControlPolicy, + Subscription subscription, + PollingChannel pollingChannel, + Schedule schedule + } choice_list + } choice optional + } + with { + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (app_ID) "name as 'App-ID'"; + variant (aE_ID) "name as 'AE-ID'"; + //variant (requestReachability) "text 'true' as '1'"; + //variant (requestReachability) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].group_) "name as 'group'"; + }; + + type record AEAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + XSD.String appName optional, + XSD.String app_ID optional, + XSD.ID aE_ID optional, + PoaList pointOfAccess optional, + XSD.AnyURI ontologyRef optional, + XSD.AnyURI nodeLink optional, + XSD.Boolean requestReachability optional, + Serializations contentSerialization optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Container container, + ContainerAnnc containerAnnc, + Group group_, + GroupAnnc groupAnnc, + AccessControlPolicy accessControlPolicy, + AccessControlPolicyAnnc accessControlPolicyAnnc, + Subscription subscription, + ScheduleAnnc scheduleAnnc + } choice_list + } choice optional + } + with { + variant "element"; + variant (resourceName) "attribute"; + variant (app_ID) "name as 'App-ID'"; + variant (aE_ID) "name as 'AE-ID'"; + //variant (requestReachability) "text 'true' as '1'"; + //variant (requestReachability) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].group_) "name as 'group'"; + }; + + type record MgmtResource_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + MgmtDefinition mgmtDefinition optional, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; + + type record AnnouncedMgmtResource_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + MgmtDefinition mgmtDefinition optional, + ListOfURIs objectIDs optional, + ListOfURIs objectPaths optional, + XSD.String description optional + } + with { + variant "name as uncapitalized"; + variant (resourceName) "attribute"; + }; + + type record Container_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + XSD.NonNegativeInteger stateTag optional, + XSD.ID creator optional, + XSD.NonNegativeInteger maxNrOfInstances optional, + XSD.NonNegativeInteger maxByteSize optional, + XSD.NonNegativeInteger maxInstanceAge optional, + XSD.NonNegativeInteger currentNrOfInstances optional, + XSD.NonNegativeInteger currentByteSize optional, + XSD.AnyURI locationID optional, + XSD.AnyURI ontologyRef optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + ContentInstance contentInstance, + Container container, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record ContainerAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + XSD.NonNegativeInteger stateTag optional, + XSD.NonNegativeInteger maxNrOfInstances optional, + XSD.NonNegativeInteger maxByteSize optional, + XSD.NonNegativeInteger maxInstanceAge optional, + XSD.NonNegativeInteger currentNrOfInstances optional, + XSD.NonNegativeInteger currentByteSize optional, + XSD.AnyURI locationID optional, + XSD.AnyURI ontologyRef optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + ContentInstance contentInstance, + ContentInstanceAnnc contentInstanceAnnc, + Container container, + ContainerAnnc containerAnnc, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record ContentInstance_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + XSD.NonNegativeInteger stateTag optional, + XSD.ID creator optional, + ContentInfo contentInfo optional, + XSD.NonNegativeInteger contentSize optional, + XSD.AnyURI ontologyRef optional, + XSD.AnySimpleType content optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + }; + + type record ContentInstanceAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + XSD.NonNegativeInteger stateTag optional, + ContentInfo contentInfo optional, + XSD.NonNegativeInteger contentSize optional, + XSD.AnyURI ontologyRef optional, + XSD.AnySimpleType content optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + + type record CSEBase_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + CseTypeID cseType optional, + XSD.ID cSE_ID optional, + ResourceTypeList_1 supportedResourceType optional, + PoaList pointOfAccess optional, + XSD.AnyURI nodeLink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + RemoteCSE remoteCSE, + RemoteCSEAnnc remoteCSEAnnc, + Node node, + AE aE, + Container container, + Group group_, + AccessControlPolicy accessControlPolicy, + Subscription subscription, + MgmtCmd mgmtCmd, + LocationPolicy locationPolicy, + StatsConfig statsConfig, + StatsCollect statsCollect, + Request request, + Delivery delivery, + Schedule schedule, + M2mServiceSubscriptionProfile m2mServiceSubscriptionProfile, + ServiceSubscribedAppRule serviceSubscribedAppRule + } choice_list + } choice optional + } + with { + variant "element"; + variant (resourceName) "attribute"; + variant (cSE_ID) "name as 'CSE-ID'"; + variant (supportedResourceType) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].aE) "name as capitalized"; + variant (choice.choice_list[-].group_) "name as 'group'"; + }; + + type record Delivery_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.NonNegativeInteger stateTag optional, + XSD.ID source optional, + XSD.ID target optional, + Timestamp lifespan optional, + EventCat eventCat optional, + DeliveryMetaData deliveryMetaData optional, + AggregatedRequest aggregatedRequest optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record Group_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + XSD.ID creator optional, + MemberType memberType optional, + XSD.NonNegativeInteger currentNrOfMembers optional, + XSD.PositiveInteger maxNrOfMembers optional, + ListOfURIs memberIDs optional, + ListOfURIs membersAccessControlPolicyIDs optional, + XSD.Boolean memberTypeValidated optional, + ConsistencyStrategy consistencyStrategy optional, + XSD.String groupName optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (memberIDs) "list"; + //variant (memberTypeValidated) "text 'true' as '1'"; + //variant (memberTypeValidated) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + type record GroupAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + MemberType memberType optional, + XSD.NonNegativeInteger currentNrOfMembers optional, + XSD.PositiveInteger maxNrOfMembers optional, + ListOfURIs memberIDs optional, + ListOfURIs membersAccessControlPolicyIDs optional, + XSD.Boolean memberTypeValidated optional, + ConsistencyStrategy consistencyStrategy optional, + XSD.String groupName optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (memberIDs) "list"; + //variant (memberTypeValidated) "text 'true' as '1'"; + //variant (memberTypeValidated) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + type record LocationPolicy_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + LocationSource locationSource optional, + XSD.Duration locationUpdatePeriod optional, + NodeID locationTargetID optional, + XSD.AnyURI locationServer optional, + XSD.AnyURI locationContainerID optional, + XSD.String locationContainerName optional, + XSD.String locationStatus optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record LocationPolicyAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + LocationSource locationSource optional, + XSD.Duration locationUpdatePeriod optional, + NodeID locationTargetID optional, + XSD.AnyURI locationServer optional, + XSD.AnyURI locationContainerID optional, + XSD.String locationContainerName optional, + XSD.String locationStatus optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + + type record M2mServiceSubscriptionProfile_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + ServiceSubscribedNode serviceSubscribedNode, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record MgmtCmd_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.String description optional, + CmdType cmdType optional, + ExecReqArgsListType execReqArgs optional, + XSD.Boolean execEnable optional, + NodeID execTarget optional, + ExecModeType execMode optional, + XSD.Duration execFrequency optional, + XSD.Duration execDelay optional, + XSD.NonNegativeInteger execNumber optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + ExecInstance execInstance, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + //variant (execEnable) "text 'true' as '1'"; + //variant (execEnable) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record Node_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + NodeID nodeID optional, + XSD.ID hostedCSELink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Memory memory, + Battery battery, + AreaNwkInfo areaNwkInfo, + AreaNwkDeviceInfo areaNwkDeviceInfo, + Firmware firmware, + Software software, + DeviceInfo deviceInfo, + DeviceCapability deviceCapability, + Reboot reboot, + EventLog eventLog, + CmdhPolicy cmdhPolicy, + ActiveCmdhPolicy activeCmdhPolicy, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record NodeAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + NodeID nodeID optional, + XSD.ID hostedCSELink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + MemoryAnnc memoryAnnc, + BatteryAnnc batteryAnnc, + AreaNwkInfoAnnc areaNwkInfoAnnc, + AreaNwkDeviceInfoAnnc areaNwkDeviceInfoAnnc, + FirmwareAnnc firmwareAnnc, + SoftwareAnnc softwareAnnc, + DeviceInfoAnnc deviceInfoAnnc, + DeviceCapabilityAnnc deviceCapabilityAnnc, + RebootAnnc rebootAnnc, + EventLogAnnc eventLogAnnc, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record PollingChannel_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + Timestamp expirationTime optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + + type record RemoteCSE_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + CseTypeID cseType optional, + PoaList pointOfAccess optional, + XSD.AnyURI cSEBase optional, + XSD.ID cSE_ID optional, + ExternalID m2M_Ext_ID optional, + TriggerRecipientID trigger_Recipient_ID optional, + XSD.Boolean requestReachability optional, + XSD.AnyURI nodeLink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Container container, + ContainerAnnc containerAnnc, + Group group_, + GroupAnnc groupAnnc, + AccessControlPolicy accessControlPolicy, + AccessControlPolicyAnnc accessControlPolicyAnnc, + Subscription subscription, + PollingChannel pollingChannel, + Schedule schedule, + NodeAnnc nodeAnnc, + RemoteCSEAnnc remoteCSEAnnc, + AEAnnc aEAnnc, + LocationPolicyAnnc locationPolicyAnnc + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (cSEBase) "name as capitalized"; + variant (cSE_ID) "name as 'CSE-ID'"; + variant (m2M_Ext_ID) "name as 'M2M-Ext-ID'"; + variant (trigger_Recipient_ID) "name as 'Trigger-Recipient-ID'"; + //variant (requestReachability) "text 'true' as '1'"; + //variant (requestReachability) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].group_) "name as 'group'"; + variant (choice.choice_list[-].aEAnnc) "name as capitalized"; + }; + + type record RemoteCSEAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + CseTypeID cseType optional, + PoaList pointOfAccess optional, + XSD.AnyURI cSEBase optional, + XSD.ID cSE_ID optional, + XSD.Boolean requestReachability optional, + XSD.AnyURI nodeLink optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + NodeAnnc nodeAnnc, + Container container, + ContainerAnnc containerAnnc, + Group group_, + GroupAnnc groupAnnc, + AccessControlPolicy accessControlPolicy, + AccessControlPolicyAnnc accessControlPolicyAnnc, + Subscription subscription, + PollingChannel pollingChannel, + ScheduleAnnc scheduleAnnc, + LocationPolicyAnnc locationPolicyAnnc, + RemoteCSEAnnc remoteCSEAnnc, + AEAnnc aEAnnc + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (cSEBase) "name as capitalized"; + variant (cSE_ID) "name as 'CSE-ID'"; + //variant (requestReachability) "text 'true' as '1'"; + //variant (requestReachability) "text 'false' as '0'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + variant (choice.choice_list[-].group_) "name as 'group'"; + variant (choice.choice_list[-].aEAnnc) "name as capitalized"; + }; + + type record Schedule_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + Timestamp expirationTime optional, + ListOfURIs announceTo optional, + record length(1 .. infinity) of XSD.NCName announcedAttribute optional, + ScheduleEntries scheduleElement optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (announcedAttribute) "list"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + + type record ScheduleAnnc_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + Timestamp expirationTime optional, + XSD.AnyURI link optional, + ScheduleEntries scheduleElement optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + }; + + type record ServiceSubscribedAppRule_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + ListOfM2MID applicableCredIDs optional, + ListOfM2MID allowedApp_IDs optional, + ListOfM2MID allowedAEs optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (allowedApp_IDs) "name as 'allowedApp-IDs'"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + type record StatsCollect_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.ID creator optional, + XSD.String statsCollectID optional, + XSD.ID collectingEntityID optional, + XSD.ID collectedEntityID optional, + StatsRuleStatusType statsRuleStatus optional, + StatModelType statModel optional, + ScheduleEntries collectPeriod optional, + XSD.String eventID optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of Subscription subscription_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.subscription_list) "untagged"; + variant (choice.subscription_list[-]) "name as 'subscription'"; + }; + + + type record StatsConfig_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + XSD.ID creator optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + EventConfig eventConfig, + Subscription subscription + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (choice) "untagged"; + variant (choice.childResource_list) "untagged"; + variant (choice.childResource_list[-]) "name as 'childResource'"; + variant (choice.choice_list) "untagged"; + variant (choice.choice_list[-]) "untagged"; + }; + type record Subscription_optional + { + ResourceName resourceName optional, + ResourceType resourceType optional, + XSD.ID resourceID optional, + NhURI parentID optional, + Timestamp creationTime optional, + Timestamp lastModifiedTime optional, + Labels labels optional, + AcpType accessControlPolicyIDs optional, + Timestamp expirationTime optional, + EventNotificationCriteria eventNotificationCriteria optional, + XSD.PositiveInteger expirationCounter optional, + ListOfURIs notificationURI optional, + XSD.AnyURI groupID optional, + XSD.AnyURI notificationForwardingURI optional, + BatchNotify batchNotify optional, + RateLimit rateLimit optional, + XSD.PositiveInteger preSubscriptionNotify optional, + PendingNotification pendingNotification optional, + XSD.PositiveInteger notificationStoragePriority optional, + XSD.Boolean latestNotify optional, + NotificationContentType notificationContentType optional, + EventCat notificationEventCat optional, + XSD.ID creator optional, + XSD.AnyURI subscriberURI optional, + union { + ChildResourceRef childResource, + Schedule schedule + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + //variant (latestNotify) "text 'true' as '1'"; + //variant (latestNotify) "text 'false' as '0'"; + variant (choice) "untagged"; + }; -type record RateLimit -{ - XSD.NonNegativeInteger maxNrOfNotify optional, - XSD.Duration timeWindow optional + } -with { - variant "name as uncapitalized"; -}; - -/* Additional types */ - -group optionalResourceTypes { - - //Added by @Naum - type record AEAnnc_optional - { - XSD.NCName resourceName optional, - ResourceType resourceType optional, - XSD.ID resourceID optional, - NhURI parentID optional, - Timestamp creationTime optional, - Timestamp lastModifiedTime optional, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime optional, - XSD.AnyURI link optional, - XSD.String appName optional, - XSD.String app_ID optional, - XSD.ID aE_ID optional, - PoaList pointOfAccess optional, - XSD.AnyURI ontologyRef optional, - XSD.AnyURI nodeLink optional, - XSD.Boolean requestReachability optional, - Serializations contentSerialization optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - Container container, - ContainerAnnc containerAnnc, - Group group_, - GroupAnnc groupAnnc, - AccessControlPolicy accessControlPolicy, - AccessControlPolicyAnnc accessControlPolicyAnnc, - Subscription subscription, - ScheduleAnnc scheduleAnnc - } choice_list - } choice optional - } - with { - variant "element"; - variant (resourceName) "attribute"; - variant (app_ID) "name as 'App-ID'"; - variant (aE_ID) "name as 'AE-ID'"; - //variant (requestReachability) "text 'true' as '1'"; - //variant (requestReachability) "text 'false' as '0'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; - variant (choice.choice_list[-].group_) "name as 'group'"; - }; - - type record AE_optional - { - XSD.NCName resourceName optional, + +group invalidTypes { + + type record AE_update_invalid + { + ResourceName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, + XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for AE Labels labels optional, AcpType accessControlPolicyIDs optional, Timestamp expirationTime optional, @@ -4155,15 +5242,15 @@ group optionalResourceTypes { variant (choice.choice_list[-]) "untagged"; variant (choice.choice_list[-].group_) "name as 'group'"; }; - - type record AccessControlPolicy_optional - { - XSD.NCName resourceName optional, + + type record ACP_update_invalid { + ResourceName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, + XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for ACP Labels labels optional, Timestamp expirationTime optional, ListOfURIs announceTo optional, @@ -4185,42 +5272,17 @@ group optionalResourceTypes { variant (choice.childResource_list[-]) "name as 'childResource'"; variant (choice.subscription_list) "untagged"; variant (choice.subscription_list[-]) "name as 'subscription'"; - }; - - type record ContentInstance_optional - { - XSD.NCName resourceName optional, - ResourceType resourceType optional, - XSD.ID resourceID optional, - NhURI parentID optional, - Timestamp creationTime optional, - Timestamp lastModifiedTime optional, - Labels labels optional, - Timestamp expirationTime optional, - ListOfURIs announceTo optional, - record length(1 .. infinity) of XSD.NCName announcedAttribute optional, - XSD.NonNegativeInteger stateTag optional, - XSD.ID creator optional, - ContentInfo contentInfo optional, - XSD.NonNegativeInteger contentSize optional, - XSD.AnyURI ontologyRef optional, - XSD.AnyType content optional - } - with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; - }; + }; - type record Container_optional - { - XSD.NCName resourceName optional, + type record Container_update_invalid { + + ResourceName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, + XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for Container Labels labels optional, AcpType accessControlPolicyIDs optional, Timestamp expirationTime optional, @@ -4254,70 +5316,17 @@ group optionalResourceTypes { variant (choice.childResource_list[-]) "name as 'childResource'"; variant (choice.choice_list) "untagged"; variant (choice.choice_list[-]) "untagged"; - }; - - - //added by @Naum - type record CSEBase_optional - { - XSD.NCName resourceName optional, - ResourceType resourceType optional, - XSD.ID resourceID optional, - NhURI parentID optional, - Timestamp creationTime optional, - Timestamp lastModifiedTime optional, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - CseTypeID cseType optional, - XSD.ID cSE_ID optional, - record of ResourceType supportedResourceType optional, - PoaList pointOfAccess optional, - XSD.AnyURI nodeLink optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of union { - RemoteCSE remoteCSE, - Node node, - AE aE, - Container container, - Group group_, - AccessControlPolicy accessControlPolicy, - Subscription subscription, - MgmtCmd mgmtCmd, - LocationPolicy locationPolicy, - StatsConfig statsConfig, - StatsCollect statsCollect, - Request request, - Delivery delivery, - Schedule schedule, - M2mServiceSubscriptionProfile m2mServiceSubscriptionProfile, - ServiceSubscribedAppRule serviceSubscribedAppRule - } choice_list - } choice optional - } - with { - variant "element"; - variant (resourceName) "attribute"; - variant (cSE_ID) "name as 'CSE-ID'"; - variant (supportedResourceType) "list"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.choice_list) "untagged"; - variant (choice.choice_list[-]) "untagged"; - variant (choice.choice_list[-].aE) "name as capitalized"; - variant (choice.choice_list[-].group_) "name as 'group'"; - }; - - - type record Group_optional + }; + + type record Group_update_invalid { - XSD.NCName resourceName optional, + ResourceName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, + XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for Group Labels labels optional, AcpType accessControlPolicyIDs optional, Timestamp expirationTime optional, @@ -4325,7 +5334,7 @@ group optionalResourceTypes { record length(1 .. infinity) of XSD.NCName announcedAttribute optional, XSD.ID creator optional, MemberType memberType optional, - XSD.PositiveInteger currentNrOfMembers optional, + XSD.NonNegativeInteger currentNrOfMembers optional, XSD.PositiveInteger maxNrOfMembers optional, ListOfURIs memberIDs optional, ListOfURIs membersAccessControlPolicyIDs optional, @@ -4342,6 +5351,7 @@ group optionalResourceTypes { variant "element"; variant (resourceName) "attribute"; variant (announcedAttribute) "list"; + variant (memberIDs) "list"; //variant (memberTypeValidated) "text 'true' as '1'"; //variant (memberTypeValidated) "text 'false' as '0'"; variant (choice) "untagged"; @@ -4350,15 +5360,16 @@ group optionalResourceTypes { variant (choice.subscription_list) "untagged"; variant (choice.subscription_list[-]) "name as 'subscription'"; }; - - type record PollingChannel_optional + + type record PollingChannel_update_invalid { - XSD.NCName resourceName optional, + ResourceName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, + XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for PollingChannel Labels labels optional, Timestamp expirationTime optional } @@ -4366,16 +5377,17 @@ group optionalResourceTypes { variant "name as uncapitalized"; variant "element"; variant (resourceName) "attribute"; - }; + }; - type record Schedule_optional + type record Schedule_update_invalid { - XSD.NCName resourceName optional, + ResourceName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, + XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for Schedule Labels labels optional, Timestamp expirationTime optional, ListOfURIs announceTo optional, @@ -4398,48 +5410,17 @@ group optionalResourceTypes { variant (choice.childResource_list[-]) "name as 'childResource'"; variant (choice.choice_list) "untagged"; variant (choice.choice_list[-]) "untagged"; - }; - - //Added by @Naum - type record ServiceSubscribedAppRule_optional - { - XSD.NCName resourceName optional, - ResourceType resourceType optional, - XSD.ID resourceID optional, - NhURI parentID optional, - Timestamp creationTime optional, - Timestamp lastModifiedTime optional, - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime optional, - ListOfM2MID applicableCredIDs optional, - ListOfM2MID allowedApp_IDs optional, - ListOfM2MID allowedAEs optional, - union { - record length(1 .. infinity) of ChildResourceRef childResource_list, - record length(1 .. infinity) of Subscription subscription_list - } choice optional - } - with { - variant "name as uncapitalized"; - variant "element"; - variant (resourceName) "attribute"; - variant (allowedApp_IDs) "name as 'allowedApp-IDs'"; - variant (choice) "untagged"; - variant (choice.childResource_list) "untagged"; - variant (choice.childResource_list[-]) "name as 'childResource'"; - variant (choice.subscription_list) "untagged"; - variant (choice.subscription_list[-]) "name as 'subscription'"; - }; - - type record Subscription_optional + }; + + type record Subscription_update_invalid { - XSD.NCName resourceName optional, + ResourceName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, + XSD.NonNegativeInteger maxNrOfInstances optional,//Invalid field, non existing for Subscription Labels labels optional, AcpType accessControlPolicyIDs optional, Timestamp expirationTime optional, @@ -4471,16 +5452,16 @@ group optionalResourceTypes { //variant (latestNotify) "text 'false' as '0'"; variant (choice) "untagged"; }; - - //@Martin - type record LocationPolicy_optional - { - XSD.NCName resourceName optional, + + type record LocationPolicy_update_invalid + { + ResourceName resourceName optional, ResourceType resourceType optional, XSD.ID resourceID optional, NhURI parentID optional, Timestamp creationTime optional, Timestamp lastModifiedTime optional, + XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for Schedule Labels labels optional, AcpType accessControlPolicyIDs optional, Timestamp expirationTime optional, @@ -4499,170 +5480,93 @@ group optionalResourceTypes { Subscription subscription } choice_list } choice optional - -} + } with { variant "name as uncapitalized"; variant "element"; variant (resourceName) "attribute"; - variant (announcedAttribute) "list"; + variant (announcedAttribute) "list"; variant (choice) "untagged"; variant (choice.childResource_list) "untagged"; variant (choice.childResource_list[-]) "name as 'childResource'"; variant (choice.choice_list) "untagged"; variant (choice.choice_list[-]) "untagged"; }; - -} - -group invalidTypes { - - type record AE_update_invalid { - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp creationTime optional,//Invalid field to be used for BI tests - Timestamp expirationTime optional, - ListOfURIs announceTo optional, - record of XSD.Token announcedAttribute optional, - XSD.String appName optional, - PoaList pointOfAccess optional, - XSD.AnyURI ontologyRef optional, - XSD.Boolean requestReachability optional - }; - - type record ACP_update_invalid { - Labels labels optional, - Timestamp expirationTime optional, - Timestamp creationTime optional,//Invalid field to be used for BI tests - XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for ACP - ListOfURIs announceTo optional, - record of XSD.Token announcedAttribute optional, - SetOfAcrs privileges optional, - SetOfAcrs selfPrivileges optional - } - - - type record Container_update_invalid { - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp creationTime optional,//Invalid field to be used for BI tests (RO attributes) - XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for Container - Timestamp expirationTime optional, - ListOfURIs announceTo optional, - record of XSD.Token announcedAttribute optional, - XSD.NonNegativeInteger maxNrOfInstances optional, - XSD.NonNegativeInteger maxByteSize optional, - XSD.NonNegativeInteger maxInstanceAge optional, - XSD.AnyURI locationID optional, - XSD.AnyURI ontologyRef optional - } - - //TODO To double check - type record ContentInstance_update_invalid { - Labels labels optional, - Timestamp creationTime optional,//Invalid field to be used for BI tests - ListOfURIs announceTo optional, - ContentInfo contentInfo optional, - XSD.NonNegativeInteger contentSize optional, - XSD.AnyURI ontologyRef optional, - XSD.AnyType content_ optional - } - - type record Group_update_invalid { - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp creationTime optional,//Invalid field to be used for BI tests - XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for Group - Timestamp expirationTime optional, - ListOfURIs announceTo optional, - record of XSD.Token announcedAttribute optional, - XSD.NonNegativeInteger maxNrOfMembers optional, - ListOfURIs memberIDs optional, - ListOfURIs membersAccessControlPolicyIDs optional, - XSD.String groupName optional - } - - type record PollingChannel_update_invalid { - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp creationTime optional,//Invalid field to be used for BI tests - XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for PollingChannel - Timestamp expirationTime optional, - XSD.AnyURI pollingChannelURI optional //TODO: To be double checked - } - - type record Schedule_update_invalid { - Labels labels optional, - Timestamp creationTime optional,//Invalid field to be used for BI tests - XSD.PositiveInteger expirationCounter optional,//Invalid field, non existing for Schedule - Timestamp expirationTime optional, - ListOfURIs announceTo optional, - record of XSD.Token announcedAttribute optional, - ScheduleEntries scheduleElement optional - } - - type record Subscription_update_invalid { - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp creationTime optional,//Invalid field to be used for BI tests - XSD.NonNegativeInteger maxNrOfInstances optional,//Invalid field, non existing for Subscription - Timestamp expirationTime optional, - EventNotificationCriteria eventNotificationCriteria optional, - XSD.PositiveInteger expirationCounter optional, - ListOfURIs notificationURI optional, - XSD.AnyURI groupID optional, - XSD.AnyURI notificationForwardingURI optional, - BatchNotify batchNotify optional, - RateLimit rateLimit optional, - PendingNotification pendingNotification optional, - XSD.PositiveInteger notificationStoragePriority optional, - XSD.Boolean latestNotify optional, - NotificationContentType notificationContentType optional, - EventCat notificationEventCat optional - } - - //@Martin - type record LocationPolicy_update_invalid { - Timestamp creationTime optional,//invalid field to be used for BI tests - Timestamp lastModifiedTime optional,//invalid field to be used for BI tests - Labels labels optional, - AcpType accessControlPolicyIDs optional, - Timestamp expirationTime optional, - LocationSource locationSource optional,//invalid field to be used for BI tests - XSD.Duration locationUpdatePeriod optional, - NodeID locationTargetID optional,//invalid field to be used for BI tests - XSD.AnyURI locationServer optional,//invalid field to be used for BI tests - XSD.AnyURI locationContainerID optional,//invalid field to be used for BI tests - XSD.String locationContainerName optional, - XSD.String locationStatus optional//invalid field to be used for BI tests - } }//end group invalidTypes - group otherTypes { +group OtherTypes { - type NhURI ParentID; + type enumerated Configurations { + e_cf01, + e_cf02, + e_cf03, + e_cf04 + }; + + type NhURI ParentID; - type record MyResource { - integer parentIndex, - PrimitiveContent resource - }; + type record MyResource { + integer parentIndex, + ResourceType resourceType, + PrimitiveContent resource + }; - type record of MyResource MyResourcesList; + type record of MyResource MyResourcesList; - type record of integer IntegerList; + type record of integer IntegerList; - type enumerated AddressingFormat { - e_cseRelative, - e_spRelative, - e_absolute - } + type enumerated PrimitiveScope { + e_cseRelative, + e_spRelative, + e_absolute + } + + type enumerated AddressingMethod { + e_nonHierarchical, + e_hierarchical + } + + type union Resource_2 { + //ResourceTypes + AEAnnc_optional aEAnnc, + AE_optional aE, + AccessControlPolicy_optional accessControlPolicy, + AccessControlPolicyAnnc_optional accessControlPolicyAnnc, + ContentInstance_optional contentInstance, + ContentInstanceAnnc_optional contentInstanceAnnc, + Container_optional container, + ContainerAnnc_optional containerAnnc, + CSEBase_optional cSEBase, + Group_optional group_, + GroupAnnc_optional groupAnnc, + LocationPolicy_optional locationPolicy, + LocationPolicyAnnc_optional locationPolicyAnnc, + MgmtResource_optional mgmtResource,//MgmtResource + AnnouncedMgmtResource_optional announcedMgmtResource,//AnnouncedMgmtResource + Node_optional node, + NodeAnnc_optional nodeAnnc, + PollingChannel_optional pollingChannel, + RemoteCSE_optional remoteCSE, + Schedule_optional schedule, + ScheduleAnnc_optional scheduleAnnc, + StatsConfig_optional statsConfig, + StatsCollect_optional statsCollect, + M2mServiceSubscriptionProfile_optional m2mServiceSubscriptionProfile, + ServiceSubscribedAppRule_optional serviceSubscribedAppRule, + Subscription_optional subscription } + with { + variant "untagged"; + } + + type record of ResourceType ResourceTypeList_1; +} } with { encode "XML"; variant "namespace as 'http://www.onem2m.org/xml/protocols' prefix 'm2m'"; variant "controlNamespace 'http://www.w3.org/2001/XMLSchema-instance' prefix 'xsi'"; - extension "anytype AggregatedResponse, AggregatedNotification,Notification, ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, ContentInstance_update_invalid, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid, LocationPolicy_optional, LocationPolicy_update_invalid" + extension "anytype AggregatedResponse, AggregatedNotification,Notification, ServiceSubscribedAppRule_optional, charstring, AnyURI, AttributeList, AE, AccessControlPolicy, AccessControlPolicy_optional, ACP_update_invalid, AE_optional, AE_update_invalid,AEAnnc_optional, Container_optional, CSEBase_optional, Container_update_invalid, ContentInstance_optional, Group_optional, Group_update_invalid, Schedule_optional, Schedule_update_invalid, Subscription_optional, Subscription_update_invalid, PollingChannel_optional, PollingChannel_update_invalid, LocationPolicy_optional, LocationPolicy_update_invalid" } diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index 52810978d0316b774bccb4cec5347ff64fb69ae2..44fb2540f026b1249b6dbadbf111b0f993913b6a 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -6,23 +6,43 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $ - * $Id: OneM2M_TypesAndValues.ttcn 175 2016-11-22 12:39:39Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/OneM2M_TypesAndValues.ttcn $ + * $Id: OneM2M_TypesAndValues.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Module containing types and values for oneM2M * */ module OneM2M_TypesAndValues { import from XSD all; - import from OneM2M_Types all; - /* Constants */ - const charstring c_uri_cse := "/~/in-cse/"; - const charstring c_cse_name := "in-cse"; + /* Constants */ const XSD.String c_defaultResourceName := "MyResource"; - const charstring c_aeAuxName := "MyAe"; + const XSD.String c_defaultGroupResourceName := "MyGroupResource"; + const XSD.String c_defaultAccessControlPolicyResourceName := "MyAccessControlPolicyResource"; + const XSD.String c_defaultScheduleResourceName := "MyScheduleResource"; + const XSD.String c_defaultPollingChannelResourceName := "MyPollingChannelResource"; + const XSD.String c_defaultSubscriptionResourceName := "MySubscriptionResource"; + const XSD.String c_defaultContentInstanceResourceName := "MyContentInstanceResource"; + const XSD.String c_defaultContainerResourceName := "MyContainerResource"; + const XSD.String c_defaultDeliveryResourceName := "MyDeliveryResource"; + const XSD.String c_defaultRemoteCSEResourceName := "MyRemoteCSEResource"; + const XSD.String c_defaultMgmtObjResourceName := "MyMgmtObjResource"; + const XSD.String c_defaultMgmtCmdResourceName := "MyMgmtCmdResource"; + const XSD.String c_defaultAeResourceName := "MyAeResource"; + const XSD.String c_defaultLocationPolicyResourceName := "MyLocationPolicyResource"; + const XSD.String c_defaultNodeResourceName := "MyNodeResource"; + const XSD.String c_defaultNodeID := "MyNodeId"; + const XSD.String c_defaultRequestResourceName := "MyRequestResource"; + const XSD.String c_defaultStatsConfigResourceName := "MyStatsConfigResource"; + const XSD.String c_defaultStatsCollectResourceName := "MyStatsCollectResource"; + const XSD.String c_defaultm2mServiceSubscriptionProfileResourceName := "Mym2mServiceSubscriptionProfileResource"; + const XSD.String c_defaultServiceSubscribedAppRuleResourceName := "MyServiceSubscribedAppRuleResource"; + const XSD.ID c_aeAuxName := "MyAe"; const XSD.String c_acpAuxName := "MyAcp"; const charstring c_invalid_location_update_period := "-PT30M10S" ;//duration set to invalid value (minus value) + const XSD.ID c_resourceShortNameLatest := "la"; //<latest> + const XSD.ID c_resourceShortNameOldest := "ol"; //<oldest> + const XSD.ID c_resourceShortNameFanOutPoint := "fopt"; //<fanOutPoint> //AccessControlOperations const XSD.Integer c_C := 1; @@ -87,11 +107,7 @@ module OneM2M_TypesAndValues { const XSD.Integer c_UDNDi := 60; const XSD.Integer c_CUDNDi := 61; const XSD.Integer c_RUDNDi := 62; - const XSD.Integer c_CRUDNDi := 63; + const XSD.Integer c_CRUDNDi := 63; - type NhURI ParentID; - type record length(0 .. infinity) of RequestPrimitive RequestPrimitiveList; - type record length(1 .. infinity) of RequestPrimitiveList RequestPrimitiveMatrix; - } // end of module diff --git a/LibOneM2M/UsefulTtcn3Types.ttcn b/LibOneM2M/UsefulTtcn3Types.ttcn index 0935f967b87ec150dbd845bdf8667d6969a271a8..11a0b0ce30b86afc81f19705dcc739e7e16a6095 100644 --- a/LibOneM2M/UsefulTtcn3Types.ttcn +++ b/LibOneM2M/UsefulTtcn3Types.ttcn @@ -6,7 +6,7 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/UsefulTtcn3Types.ttcn $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/UsefulTtcn3Types.ttcn $ * $Id: UsefulTtcn3Types.ttcn 173 2016-11-22 08:10:48Z reinaortega $ * @desc Test System module for oneM2M * diff --git a/LibOneM2M/XSD.ttcn b/LibOneM2M/XSD.ttcn index dca4429fca06f597e52b475c0fdd35e06973a076..4aeeeea6d605bdf6637592f32cd3de29cb71d9e3 100644 --- a/LibOneM2M/XSD.ttcn +++ b/LibOneM2M/XSD.ttcn @@ -6,8 +6,8 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/XSD.ttcn $ - * $Id: XSD.ttcn 120 2016-09-20 14:48:51Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/LibOneM2M/XSD.ttcn $ + * $Id: XSD.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Test System module for oneM2M * */ @@ -53,9 +53,9 @@ type record AnyType } with { variant "XSD:anyType"; -//variant "embedValues"; -//variant (attr) "anyAttributes"; -//variant (elem_list) "anyElement"; +variant "embedValues"; +variant (attr) "anyAttributes"; +variant (elem_list) "anyElement"; }; // String types diff --git a/OneM2M_TestControl.ttcn b/OneM2M_TestControl.ttcn index 2306a3087e348a23d76a30de3a5cbb1ffb8865e9..6c0860ad9f3cf4c0bc9466f4d3c00a967b6a6b6c 100644 --- a/OneM2M_TestControl.ttcn +++ b/OneM2M_TestControl.ttcn @@ -6,8 +6,8 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_TestControl.ttcn $ - * $Id: OneM2M_TestControl.ttcn 97 2016-06-01 15:38:10Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_TestControl.ttcn $ + * $Id: OneM2M_TestControl.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Test control module for oneM2M * */ @@ -17,7 +17,339 @@ module OneM2M_TestControl { import from OneM2M_Testcases all; control { - + execute(TC_CSE_GEN_CRE_001_CSR()); + execute(TC_CSE_GEN_CRE_001_SPR()); + execute(TC_CSE_GEN_CRE_001_ABS()); + execute(TC_CSE_GEN_RET_001_CSR()); + execute(TC_CSE_GEN_RET_001_SPR()); + execute(TC_CSE_GEN_RET_001_ABS()); + execute(TC_CSE_GEN_UPD_001_CSR()); + execute(TC_CSE_GEN_UPD_001_SPR()); + execute(TC_CSE_GEN_UPD_001_ABS()); + execute(TC_CSE_GEN_DEL_001_CSR()); + execute(TC_CSE_GEN_DEL_001_SPR()); + execute(TC_CSE_GEN_DEL_001_ABS()); + execute(TC_CSE_REG_CRE_001()); + execute(TC_CSE_REG_CRE_002()); + execute(TC_CSE_REG_CRE_004()); + execute(TC_CSE_REG_CRE_005()); + execute(TC_CSE_REG_CRE_008()); + execute(TC_CSE_REG_CRE_009()); + execute(TC_CSE_REG_CRE_010()); + execute(TC_CSE_REG_CRE_016_LBL()); + execute(TC_CSE_REG_CRE_016_CST()); + execute(TC_CSE_REG_CRE_016_POA()); + execute(TC_CSE_REG_CRE_016_NL()); + execute(TC_CSE_REG_CRE_018()); + execute(TC_CSE_REG_CRE_022()); + execute(TC_CSE_REG_CRE_023()); + execute(TC_CSE_REG_CRE_024()); + execute(TC_CSE_REG_CRE_026()); + execute(TC_CSE_REG_RET_001()); + execute(TC_CSE_REG_RET_005()); + execute(TC_CSE_REG_RET_008()); + execute(TC_CSE_REG_UPD_001()); + execute(TC_CSE_REG_DEL_001()); + + execute(TC_CSE_DMR_CRE_001_CNT_CB()); + execute(TC_CSE_DMR_CRE_001_CNT_AE()); + execute(TC_CSE_DMR_CRE_001_CNT_CNT()); + execute(TC_CSE_DMR_CRE_001_GRP_CB()); + execute(TC_CSE_DMR_CRE_001_GRP_AE()); + execute(TC_CSE_DMR_CRE_001_ACP_CB()); + execute(TC_CSE_DMR_CRE_001_ACP_AE()); + execute(TC_CSE_DMR_CRE_001_SCH_CB()); + execute(TC_CSE_DMR_CRE_001_SCH_AE()); + execute(TC_CSE_DMR_CRE_001_SCH_SUB()); + execute(TC_CSE_DMR_CRE_001_PCH_AE()); + execute(TC_CSE_DMR_CRE_001_SUB_CB()); + execute(TC_CSE_DMR_CRE_001_SUB_AE()); + execute(TC_CSE_DMR_CRE_001_SUB_CNT()); + execute(TC_CSE_DMR_CRE_001_SUB_ACP()); + execute(TC_CSE_DMR_CRE_001_SUB_SCH()); + execute(TC_CSE_DMR_CRE_001_SUB_GRP()); + execute(TC_CSE_DMR_CRE_001_NOD_CB()); + execute(TC_CSE_DMR_CRE_001_MGC_CB()); + execute(TC_CSE_DMR_CRE_001_LCP_CB()); + execute(TC_CSE_DMR_CRE_001_STCG_CB()); + execute(TC_CSE_DMR_CRE_001_STCL_CB()); + execute(TC_CSE_DMR_CRE_001_MSSP_CB()); + execute(TC_CSE_DMR_CRE_001_ASAR_CB()); + execute(TC_CSE_DMR_CRE_001_CIN_CNT()); + execute(TC_CSE_DMR_CRE_002_CNT()); + execute(TC_CSE_DMR_CRE_002_GRP()); + execute(TC_CSE_DMR_CRE_002_ACP()); + execute(TC_CSE_DMR_CRE_002_SCH()); + execute(TC_CSE_DMR_CRE_002_PCH()); + execute(TC_CSE_DMR_CRE_002_SUB()); + execute(TC_CSE_DMR_CRE_003_CNT()); + execute(TC_CSE_DMR_CRE_003_GRP()); + execute(TC_CSE_DMR_CRE_003_ACP()); + execute(TC_CSE_DMR_CRE_003_SCH()); + execute(TC_CSE_DMR_CRE_003_PCH()); + execute(TC_CSE_DMR_CRE_003_SUB()); + execute(TC_CSE_DMR_CRE_004_CNT()); + execute(TC_CSE_DMR_CRE_004_GRP()); + execute(TC_CSE_DMR_CRE_004_ACP()); + execute(TC_CSE_DMR_CRE_004_SCH()); + execute(TC_CSE_DMR_CRE_004_PCH()); + execute(TC_CSE_DMR_CRE_004_SUB()); + execute(TC_CSE_DMR_RET_001_CNT()); + execute(TC_CSE_DMR_RET_001_GRP()); + execute(TC_CSE_DMR_RET_001_ACP()); + execute(TC_CSE_DMR_RET_001_SCH()); + execute(TC_CSE_DMR_RET_001_PCH()); + execute(TC_CSE_DMR_RET_001_SUB()); + execute(TC_CSE_DMR_RET_001_CIN()); + execute(TC_CSE_DMR_RET_002()); + execute(TC_CSE_DMR_RET_003_CNT()); + execute(TC_CSE_DMR_RET_003_GRP()); + execute(TC_CSE_DMR_RET_003_ACP()); + execute(TC_CSE_DMR_RET_003_SCH()); + execute(TC_CSE_DMR_RET_003_PCH()); + execute(TC_CSE_DMR_RET_003_SUB()); + execute(TC_CSE_DMR_RET_004_CNT()); + execute(TC_CSE_DMR_RET_004_GRP()); + execute(TC_CSE_DMR_RET_004_ACP()); + execute(TC_CSE_DMR_RET_004_SCH()); + execute(TC_CSE_DMR_RET_004_PCH()); + execute(TC_CSE_DMR_RET_004_SUB()); + execute(TC_CSE_DMR_RET_005_CNT()); + execute(TC_CSE_DMR_RET_005_GRP()); + execute(TC_CSE_DMR_RET_005_ACP()); + execute(TC_CSE_DMR_RET_005_SCH()); + execute(TC_CSE_DMR_RET_005_PCH()); + execute(TC_CSE_DMR_RET_005_SUB()); + execute(TC_CSE_DMR_RET_006_CNT()); + execute(TC_CSE_DMR_RET_006_GRP()); + execute(TC_CSE_DMR_RET_006_ACP()); + execute(TC_CSE_DMR_RET_006_SCH()); + execute(TC_CSE_DMR_RET_006_PCH()); + execute(TC_CSE_DMR_RET_006_SUB()); + execute(TC_CSE_DMR_RET_007_CNT_LBL()); + execute(TC_CSE_DMR_RET_007_GRP_LBL()); + execute(TC_CSE_DMR_RET_007_ACP_LBL()); + execute(TC_CSE_DMR_RET_007_SCH_LBL()); + execute(TC_CSE_DMR_RET_007_PCH_LBL()); + execute(TC_CSE_DMR_RET_007_SUB_LBL()); + execute(TC_CSE_DMR_RET_008_CNT_AT()); + execute(TC_CSE_DMR_RET_008_GRP_AT()); + execute(TC_CSE_DMR_RET_008_ACP_AT()); + execute(TC_CSE_DMR_RET_008_SCH_AT()); + execute(TC_CSE_DMR_RET_008_PCH_AT()); + execute(TC_CSE_DMR_RET_008_SUB_AT()); + execute(TC_CSE_DMR_RET_020_RCN_0()); + execute(TC_CSE_DMR_RET_020_RCN_2()); + execute(TC_CSE_DMR_RET_020_RCN_3()); + execute(TC_CSE_DMR_RET_021_CNT()); + execute(TC_CSE_DMR_RET_021_GRP()); + execute(TC_CSE_DMR_RET_021_ACP()); + execute(TC_CSE_DMR_RET_021_SCH()); + execute(TC_CSE_DMR_RET_021_PCH()); + execute(TC_CSE_DMR_RET_021_SUB()); + execute(TC_CSE_DMR_RET_022_CNT()); + execute(TC_CSE_DMR_RET_022_GRP()); + execute(TC_CSE_DMR_RET_022_ACP()); + execute(TC_CSE_DMR_RET_022_SCH()); + execute(TC_CSE_DMR_RET_022_PCH()); + execute(TC_CSE_DMR_RET_022_SUB()); + execute(TC_CSE_DMR_RET_023_CNT()); + execute(TC_CSE_DMR_RET_023_GRP()); + execute(TC_CSE_DMR_RET_023_ACP()); + execute(TC_CSE_DMR_RET_023_SCH()); + execute(TC_CSE_DMR_RET_023_PCH()); + execute(TC_CSE_DMR_RET_023_SUB()); + execute(TC_CSE_DMR_RET_024_CNT()); + execute(TC_CSE_DMR_RET_024_GRP()); + execute(TC_CSE_DMR_RET_024_ACP()); + execute(TC_CSE_DMR_RET_024_SCH()); + execute(TC_CSE_DMR_RET_024_PCH()); + execute(TC_CSE_DMR_RET_024_SUB()); + execute(TC_CSE_DMR_UPD_001_CNT_LBL()); + execute(TC_CSE_DMR_UPD_001_GRP_LBL()); + execute(TC_CSE_DMR_UPD_001_ACP_LBL()); + execute(TC_CSE_DMR_UPD_001_SCH_LBL()); + execute(TC_CSE_DMR_UPD_001_PCH_LBL()); + execute(TC_CSE_DMR_UPD_001_SUB_LBL()); + execute(TC_CSE_DMR_UPD_002_CNT_LBL()); + execute(TC_CSE_DMR_UPD_002_GRP_LBL()); + execute(TC_CSE_DMR_UPD_002_ACP_LBL()); + execute(TC_CSE_DMR_UPD_002_SCH_LBL()); + execute(TC_CSE_DMR_UPD_002_PCH_LBL()); + execute(TC_CSE_DMR_UPD_002_SUB_LBL()); + execute(TC_CSE_DMR_UPD_003_CNT_LBL()); + execute(TC_CSE_DMR_UPD_003_GRP_LBL()); + execute(TC_CSE_DMR_UPD_003_ACP_LBL()); + execute(TC_CSE_DMR_UPD_003_SCH_LBL()); + execute(TC_CSE_DMR_UPD_003_PCH_LBL()); + execute(TC_CSE_DMR_UPD_003_SUB_LBL()); + execute(TC_CSE_DMR_UPD_004_CNT_ET_MNI_LBL()); + execute(TC_CSE_DMR_UPD_004_GRP_ET_GN_LBL()); + execute(TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL()); + execute(TC_CSE_DMR_UPD_004_SCH_SE_AT_LBL()); + execute(TC_CSE_DMR_UPD_004_PCH_LBL_ACP_LBL()); + execute(TC_CSE_DMR_UPD_004_SUB_ET_LBL_EXC()); + execute(TC_CSE_DMR_UPD_005_CNT_EXC()); + execute(TC_CSE_DMR_UPD_005_GRP_EXC()); + execute(TC_CSE_DMR_UPD_005_ACP_EXC()); + execute(TC_CSE_DMR_UPD_005_SCH_EXC()); + execute(TC_CSE_DMR_UPD_005_PCH_EXC()); + execute(TC_CSE_DMR_UPD_005_SUB_MNI()); + execute(TC_CSE_DMR_UPD_006_CNT_LBL()); + execute(TC_CSE_DMR_UPD_006_GRP_LBL()); + execute(TC_CSE_DMR_UPD_006_ACP_LBL()); + execute(TC_CSE_DMR_UPD_006_SCH_LBL()); + execute(TC_CSE_DMR_UPD_006_PCH_LBL()); + execute(TC_CSE_DMR_UPD_006_SUB_LBL()); + execute(TC_CSE_DMR_UPD_007_CNT_CT()); + execute(TC_CSE_DMR_UPD_007_GRP_CT()); + execute(TC_CSE_DMR_UPD_007_ACP_CT()); + execute(TC_CSE_DMR_UPD_007_SCH_CT()); + execute(TC_CSE_DMR_UPD_007_PCH_CT()); + execute(TC_CSE_DMR_UPD_007_SUB_CT()); + execute(TC_CSE_DMR_UPD_008_CNT_ET()); + execute(TC_CSE_DMR_UPD_008_GRP_ET()); + execute(TC_CSE_DMR_UPD_008_ACP_ET()); + execute(TC_CSE_DMR_UPD_008_SCH_ET()); + execute(TC_CSE_DMR_UPD_008_PCH_ET()); + execute(TC_CSE_DMR_UPD_008_SUB_ET()); + execute(TC_CSE_DMR_UPD_010()); + execute(TC_CSE_DMR_DEL_001_CNT()); + execute(TC_CSE_DMR_DEL_001_GRP()); + execute(TC_CSE_DMR_DEL_001_ACP()); + execute(TC_CSE_DMR_DEL_001_SCH()); + execute(TC_CSE_DMR_DEL_001_PCH()); + execute(TC_CSE_DMR_DEL_001_SUB()); + execute(TC_CSE_DMR_DEL_001_CIN()); + execute(TC_CSE_DMR_DEL_002_CNT()); + execute(TC_CSE_DMR_DEL_002_GRP()); + execute(TC_CSE_DMR_DEL_002_ACP()); + execute(TC_CSE_DMR_DEL_002_SCH()); + execute(TC_CSE_DMR_DEL_002_PCH()); + execute(TC_CSE_DMR_DEL_002_SUB()); + execute(TC_CSE_DMR_DEL_003()); + execute(TC_CSE_DMR_DEL_004_CNT()); + execute(TC_CSE_DMR_DEL_004_GRP()); + execute(TC_CSE_DMR_DEL_004_ACP()); + execute(TC_CSE_DMR_DEL_004_SCH()); + execute(TC_CSE_DMR_DEL_004_PCH()); + execute(TC_CSE_DMR_DEL_004_SUB()); + execute(TC_CSE_DMR_DEL_005()); + execute(TC_CSE_DMR_DEL_007()); + execute(TC_CSE_DMR_DEL_008()); + execute(TC_CSE_DMR_DEL_009()); + execute(TC_CSE_DMR_DEL_010()); + execute(TC_CSE_LOC_BV_001()); + execute(TC_CSE_LOC_BV_002()); + execute(TC_CSE_LOC_BO_003()); + execute(TC_CSE_LOC_BO_004()); + execute(TC_CSE_LOC_BI_005()); + execute(TC_CSE_LOC_BV_006()); + execute(TC_CSE_LOC_BV_007()); + execute(TC_CSE_LOC_BV_008()); + execute(TC_CSE_LOC_BV_009_01()); + execute(TC_CSE_LOC_BV_009_02()); + execute(TC_CSE_LOC_BV_009_03()); + //execute(TC_CSE_LOC_BV_007()); + //execute(TC_CSE_LOC_BV_008()); + execute(TC_CSE_LOC_BV_012()); + execute(TC_CSE_LOC_BV_013()); + execute(TC_CSE_GMG_CRE_001()); + execute(TC_CSE_GMG_CRE_002()); + execute(TC_CSE_GMG_CRE_003()); + execute(TC_CSE_GMG_CRE_004()); + execute(TC_CSE_GMG_CRE_005()); + execute(TC_CSE_GMG_CRE_006()); + execute(TC_CSE_GMG_CRE_007()); + execute(TC_CSE_GMG_CRE_008_CRE()); + execute(TC_CSE_GMG_CRE_008_UPD()); + execute(TC_CSE_GMG_CRE_008_RET()); + execute(TC_CSE_GMG_CRE_008_DEL()); + execute(TC_CSE_GMG_CRE_009()); + execute(TC_CSE_GMG_UPD_001()); + execute(TC_CSE_GMG_UPD_002()); + execute(TC_CSE_GMG_UPD_003()); + execute(TC_CSE_GMG_UPD_004()); + execute(TC_CSE_GMG_UPD_005()); + execute(TC_CSE_GMG_UPD_006()); + execute(TC_CSE_GMG_UPD_007()); + execute(TC_CSE_GMG_UPD_008()); + execute(TC_CSE_GMG_UPD_009()); + execute(TC_CSE_GMG_UPD_010()); + execute(TC_CSE_GMG_RET_001()); + execute(TC_CSE_GMG_001_CRE()); + execute(TC_CSE_GMG_001_UPD()); + execute(TC_CSE_GMG_001_RET()); + execute(TC_CSE_GMG_001_DEL()); + execute(TC_CSE_GMG_002_CRE()); + execute(TC_CSE_GMG_002_UPD()); + execute(TC_CSE_GMG_002_RET()); + execute(TC_CSE_GMG_002_DEL()); + execute(TC_CSE_GMG_003_CRE()); + execute(TC_CSE_GMG_003_UPD()); + execute(TC_CSE_GMG_003_RET()); + execute(TC_CSE_GMG_003_DEL()); + execute(TC_CSE_GMG_004_CRE()); + execute(TC_CSE_GMG_004_UPD()); + execute(TC_CSE_GMG_004_RET()); + execute(TC_CSE_GMG_004_DEL()); + execute(TC_CSE_DIS_001()); + execute(TC_CSE_DIS_003()); + execute(TC_CSE_DIS_004()); + execute(TC_CSE_DIS_005()); + execute(TC_CSE_DIS_006()); + execute(TC_CSE_DIS_007()); + execute(TC_CSE_SUB_CRE_001_SUB()); + execute(TC_CSE_SUB_CRE_001_CIN()); + execute(TC_CSE_SUB_CRE_002()); + execute(TC_CSE_SUB_CRE_003()); + execute(TC_CSE_SUB_CRE_004()); + execute(TC_CSE_SUB_CRE_005()); + execute(TC_CSE_SUB_NTF_001()); + execute(TC_CSE_SUB_NTF_002()); + execute(TC_CSE_SUB_NTF_003()); + execute(TC_CSE_SUB_UPD_001()); + execute(TC_CSE_SUB_UPD_002()); + execute(TC_CSE_SUB_UPD_003()); + execute(TC_CSE_SUB_UPD_004()); + execute(TC_CSE_SUB_UPD_005()); + execute(TC_CSE_SUB_UPD_006()); + execute(TC_CSE_SUB_UPD_007()); + execute(TC_CSE_SUB_UPD_008()); + execute(TC_CSE_SUB_UPD_009()); + execute(TC_CSE_SUB_DEL_001()); + execute(TC_CSE_SUB_DEL_002()); + execute(TC_CSE_SUB_DEL_003()); + + execute(TC_CSE_SEC_ACP_001_CRE()); + execute(TC_CSE_SEC_ACP_001_UPD()); + execute(TC_CSE_SEC_ACP_001_RET()); + execute(TC_CSE_SEC_ACP_001_DEL()); + execute(TC_CSE_SEC_ACP_002_CRE()); + execute(TC_CSE_SEC_ACP_002_UPD()); + execute(TC_CSE_SEC_ACP_002_RET()); + execute(TC_CSE_SEC_ACP_002_DEL()); + execute(TC_CSE_SEC_ACP_003_CRE()); + execute(TC_CSE_SEC_ACP_003_UPD()); + execute(TC_CSE_SEC_ACP_003_RET()); + execute(TC_CSE_SEC_ACP_003_DEL()); + execute(TC_CSE_SEC_ACP_004_CRE()); + execute(TC_CSE_SEC_ACP_004_UPD()); + execute(TC_CSE_SEC_ACP_004_RET()); + execute(TC_CSE_SEC_ACP_004_DEL()); + execute(TC_CSE_SEC_ACP_011_CRE()); + execute(TC_CSE_SEC_ACP_011_UPD()); + execute(TC_CSE_SEC_ACP_011_RET()); + execute(TC_CSE_SEC_ACP_011_DEL()); + execute(TC_CSE_SEC_ACP_012_CRE()); + execute(TC_CSE_SEC_ACP_012_UPD()); + execute(TC_CSE_SEC_ACP_012_RET()); + execute(TC_CSE_SEC_ACP_012_DEL()); + execute(TC_CSE_SEC_ACP_CRE_001()); + execute(TC_CSE_SEC_ACP_CRE_002()); + execute(TC_CSE_SEC_ACP_UPD_001()); + execute(TC_CSE_SEC_ACP_UPD_002()); } } // end of module + diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index 0405b6b4396105bf2b32c45582c3c311752c5305..49bc2deeea9177f35386b53d43c96683425fb99b 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -6,8 +6,8 @@ * All rights reserved. * * @author ETSI - * @version $URL: https://forge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_Testcases.ttcn $ - * $Id: OneM2M_Testcases.ttcn 183 2016-11-25 13:31:34Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/branches/Release1/ttcn/OneM2M_Testcases.ttcn $ + * $Id: OneM2M_Testcases.ttcn 347 2017-08-11 08:48:20Z reinaortega $ * @desc Module containing test cases for oneM2M * */ @@ -20,7 +20,6 @@ module OneM2M_Testcases { import from OneM2M_Pixits all; import from OneM2M_Pics all; import from OneM2M_Functions all; - import from LibCommon_Time all; import from XSD all; @@ -29,66 +28,41 @@ module OneM2M_Testcases { group helpingTestCases {//These are not part of the test suite, just for verification purposes - testcase TC_DELETE_AE() runs on CseTester system CseSystem { - - timer t_ac := 5.0; - map(self:mcaPort, system:mcaPort); - - mcaPort.send(m_request(m_deleteRequest(PX_URI_CSE & PX_CSE_NAME & "/" & PX_RESOURCE_TO_BE_DELETED))); - t_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - t_ac.stop; - log("Postamble: Resource deleted"); - setverdict(pass); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - t_ac.stop; - log("Postamble: Error while deleting resource"); - setverdict(fail); - } - [] mcaPort.receive { - t_ac.stop; - log("Postamble: Unexpected message received"); - setverdict(inconc); - } - [] t_ac.timeout { - log("Postamble: No answer while deleting resource"); - setverdict(inconc); - } - } - - unmap(self:mcaPort, system:mcaPort); - stop; - } - testcase TC_DELETE_RESOURCES() runs on CseTester system CseSystem { timer t_ac := 5.0; var integer i; + var XSD.ID v_resourceAddress; + var RequestPrimitive v_request; map(self:mcaPort, system:mcaPort); for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) { - mcaPort.send(m_request(m_delete(PX_URI_CSE & "/" & PX_CSE_NAME & "/" & PX_RESOURCES_TO_BE_DELETED[i]))); + + v_resourceAddress := f_getResourceAddress() & "/" & PX_RESOURCES_TO_BE_DELETED[i]; + + v_request := valueof(m_deleteRequest(v_resourceAddress)); + + mcaPort.send(m_request(v_request)); + t_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { t_ac.stop; - log("Postamble: Resource deleted"); + log(__SCOPE__ & ":Resource deleted"); setverdict(pass); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { t_ac.stop; - log("Postamble: Error while deleting resource"); + log(__SCOPE__ & ":Error while deleting resource"); setverdict(fail); } [] mcaPort.receive { t_ac.stop; - log("Postamble: Unexpected message received"); + log(__SCOPE__ & ":Unexpected message received"); setverdict(inconc); } [] t_ac.timeout { - log("Postamble: No answer while deleting resource"); + log(__SCOPE__ & ":No answer while deleting resource"); setverdict(inconc); } } @@ -104,1465 +78,1132 @@ module OneM2M_Testcases { group CSE { - group Registration { - - testcase TC_CSE_REG_BV_001() runs on CseTester system CseSystem { - - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_cseBaseIndex := -1; - var integer v_resourceIndex := -1; - var ResourceType v_resourceType := int2; - - // Test component configuration - f_cf01Up(); - - //Preambule - v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"C-AE-ID-STEM"});//c_CRUDNDi); - - //Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, omit)); - - v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); - - mcaPort.send(m_request(v_request)); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": AE successfuly created."); + group Generic { + + group Create { + group g_CSE_GEN_CRE_001 { + + /** + * @desc Check that the IUT accepts the creation of a resource using unstructured resource identifier + * + */ + testcase TC_CSE_GEN_CRE_001_CSR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_CRE_001(e_cseRelative); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + + testcase TC_CSE_GEN_CRE_001_SPR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_CRE_001(e_spRelative); } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating AE"); + + testcase TC_CSE_GEN_CRE_001_ABS() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_CRE_001(e_absolute); } - } - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); + function f_CSE_GEN_CRE_001(in PrimitiveScope p_primitiveScope) runs on CseTester { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - testcase TC_CSE_REG_BV_002() runs on CseTester system CseSystem { - - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_cseBaseIndex := -1; - var ResourceType v_resourceType := int2; - - // Test component configuration - f_cf01Up(); - - //Preambule - v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"C-AE-ID-STEM"});//c_CRUDNDi); + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + vc_addressingMethod := e_nonHierarchical; + vc_primitiveScope := p_primitiveScope; + v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource created using non-hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating container resource using non-hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + vc_addressingMethod := PX_ADDRESSING_METHOD; + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_CRE_001 - //Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); - - v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); + + } // end of group g_CSE_GEN_CRE_001 + + group g_CSE_GEN_CRE_002 { - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": AE successfuly created."); + /** + * @desc Check that the IUT accepts the creation of a resource using structured resource identifier + * + */ + testcase TC_CSE_GEN_CRE_002_CSR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_CRE_002(e_cseRelative); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + + testcase TC_CSE_GEN_CRE_002_SPR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_CRE_002(e_spRelative); } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating AE"); + + testcase TC_CSE_GEN_CRE_002_ABS() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_CRE_002(e_absolute); } - } - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); + function f_CSE_GEN_CRE_002(in PrimitiveScope p_primitiveScope) runs on CseTester { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - testcase TC_CSE_REG_BV_003() runs on CseTester system CseSystem { - - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_cseBaseIndex := -1; - var ResourceType v_resourceType := int2; - - // Test component configuration - f_cf01Up(); + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + vc_addressingMethod := e_hierarchical; + vc_primitiveScope := p_primitiveScope; + v_request := f_getCreateRequestPrimitive(int3, m_createContainerBase, v_resourceIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource created using hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating container resource using hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + vc_addressingMethod := PX_ADDRESSING_METHOD; + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_CRE_002 - //Preambule - v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule(omit);//c_CRUDNDi); - - // Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, omit)); - - v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": AE creation rejected."); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating AE"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); + } // end of group g_CSE_GEN_CRE_002 - // Tear down - f_cf01Down(); - - } - - testcase TC_CSE_REG_BV_004() runs on CseTester system CseSystem { - - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_cseBaseIndex := -1; - var ResourceType v_resourceType := int2; - - // Test component configuration - f_cf01Up(); - - //Preambule - v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule(omit);//c_CRUDNDi); - - //Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); - - v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": AE creation rejected."); + } // end of group Create + + group Retrieve { + group g_CSE_GEN_RET_001 { + + /** + * @desc Check that the IUT accepts the retrieval of a <container> resource using unstructured resource identifier + * + */ + testcase TC_CSE_GEN_RET_001_CSR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_RET_001(e_cseRelative); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + + testcase TC_CSE_GEN_RET_001_SPR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_RET_001(e_spRelative); } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating AE"); + + testcase TC_CSE_GEN_RET_001_ABS() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_RET_001(e_absolute); } - } - // Postamble - f_cse_postamble_deleteResources(); + function f_CSE_GEN_RET_001(in PrimitiveScope p_primitiveScope) runs on CseTester { + + // Local variables + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - // Tear down - f_cf01Down(); + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - } - - testcase TC_CSE_REG_BV_005() runs on CseTester system CseSystem { - - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_cseBaseIndex := -1; - var ResourceType v_resourceType := int2; - - // Test component configuration - f_cf02Up(); - - //Preambule - v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi); - - //Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); - - v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - - alt { - [] mccPort.receive(mw_request(mw_createAEannc(omit, omit, "APP_ID"))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": AE creation redirected."); - } - [] mccPort.receive { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating AE"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating AE"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); + // Test Body + //Force usage of Non-Hierarchical addressing method + vc_addressingMethod := e_nonHierarchical; + vc_primitiveScope := p_primitiveScope; + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource retrieved using non-hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using non-hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + vc_addressingMethod := PX_ADDRESSING_METHOD; + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + f_cse_postamble_deleteResources(); - } - - testcase TC_CSE_REG_BV_006() runs on CseTester system CseSystem { - - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var ResourceType v_resourceType := int2; - - // Test control + // Tear down + f_cf01Down(); - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAeWithId("C-AE-ID-STEM");//c_CRUDNDi); + }//end f_CSE_GEN_RET_001 - //Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); - - v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_aeIndex); - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": AE creation rejected."); + } // end of group g_CSE_GEN_RET_001 + + group g_CSE_GEN_RET_002 { + + /** + * @desc Check that the IUT accepts the retrieval of a <container> resource using structured resource identifier + * + */ + testcase TC_CSE_GEN_RET_002_CSR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_RET_002(e_cseRelative); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + + testcase TC_CSE_GEN_RET_002_SPR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_RET_002(e_spRelative); } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating AE"); + + testcase TC_CSE_GEN_RET_002_ABS() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_RET_002(e_absolute); } - } - // Postamble - f_cse_postamble_deleteResources(); + function f_CSE_GEN_RET_002(in PrimitiveScope p_primitiveScope) runs on CseTester { + + // Local variables + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - // Tear down - f_cf01Down(); - - } + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + vc_addressingMethod := e_hierarchical; + vc_primitiveScope := p_primitiveScope; + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))));tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource retrieved using hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving container resource using hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + vc_addressingMethod := PX_ADDRESSING_METHOD; + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_RET_002 + + } // end of group g_CSE_GEN_RET_002 + + } // end of group Retrieve - testcase TC_CSE_REG_BV_007() runs on CseTester system CseSystem { - - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_cseBaseIndex := -1; - var ResourceType v_resourceType := int2; - - // Test component configuration - f_cf02Up(); - - //Preambule - v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi); - - //Test Body - v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); - - v_request := f_getUpdateRequestPrimitive(v_resourceType,v_cseBaseIndex, v_request); - - mcaPort.send(m_request(v_request)); - tc_ac.start; + group Update { + group g_CSE_GEN_UPD_001 { - alt { - [] mccPort.receive(mw_request(mw_createAEannc(omit, omit, "APP_ID"))) { - tc_ac.stop; - setverdict(pass, testcasename() & ": AE creation redirected."); + /** + * @desc Check that the IUT accepts the update of a <container> resource using unstructured resource identifier + * + */ + testcase TC_CSE_GEN_UPD_001_CSR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_UPD_001(e_cseRelative); } - [] mccPort.receive { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating AE"); + + testcase TC_CSE_GEN_UPD_001_SPR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_UPD_001(e_spRelative); } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating AE"); + + testcase TC_CSE_GEN_UPD_001_ABS() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_UPD_001(e_absolute); } - } - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); + function f_CSE_GEN_UPD_001(in PrimitiveScope p_primitiveScope) runs on CseTester { + + // Local variables + var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - } - - }//end Registration - - group Data_Management_and_Repository { - - group g_CSE_DMR_BV_001 { + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - testcase TC_CSE_DMR_BV_001_01() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_BV_001(int3, m_createContainerBase);//Container - } - - testcase TC_CSE_DMR_BV_001_02() runs on CseTester system CseSystem { - // Local variables + // Test Body + //Force usage of Non-Hierarchical addressing method + vc_addressingMethod := e_nonHierarchical; + vc_primitiveScope := p_primitiveScope; - f_CSE_DMR_BV_001(int9, m_createGroupBase);//Group - } + v_updateRequest.primitiveContent.container.labels := {"MyLabel"}; + + v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest); + + mcaPort.send(m_request(v_updateRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource updated using non-hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating container resource using non-hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); + } + } + + // Postamble + vc_addressingMethod := PX_ADDRESSING_METHOD; + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + f_cse_postamble_deleteResources(); - testcase TC_CSE_DMR_BV_001_03() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_BV_001(int1, m_createAcpBase);//AccessControlPolicy - } + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_UPD_001 - testcase TC_CSE_DMR_BV_001_04() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_BV_001(int18, m_createScheduleBase);//Schedule - } - - testcase TC_CSE_DMR_BV_001_05() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_BV_001(int15, m_createPollingChannelBase);//PollingChannel - } + } // end of group g_CSE_GEN_UPD_001 + + group g_CSE_GEN_UPD_002 { + + /** + * @desc Check that the IUT accepts the update of a <container> resource using structured resource identifier + * + */ + testcase TC_CSE_GEN_UPD_002_CSR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_UPD_002(e_cseRelative); + } + + testcase TC_CSE_GEN_UPD_002_SPR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_UPD_002(e_spRelative); + } - testcase TC_CSE_DMR_BV_001_06() runs on CseTester system CseSystem { + testcase TC_CSE_GEN_UPD_002_ABS() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_BV_001(int23, m_createSubscriptionBase);//Subscription + + f_CSE_GEN_UPD_002(e_absolute); } - - function f_CSE_DMR_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + function f_CSE_GEN_UPD_002(in PrimitiveScope p_primitiveScope) runs on CseTester { - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control + // Local variables + var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } - // Test component configuration - f_cf01Up(); + // Test component configuration + f_cf01Up(); - // Test adapter configuration + // Test adapter configuration - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int0;//Nothing - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - if(ispresent(v_response.primitive.responsePrimitive.primitiveContent)){ - setverdict(fail, testcasename() & ": Providing content when RC set to 0"); - } else { - setverdict(pass, testcasename() & ": No content provided with RC set to 0"); + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + //Force usage of Non-Hierarchical addressing method + vc_addressingMethod := e_hierarchical; + vc_primitiveScope := p_primitiveScope; + + v_updateRequest.primitiveContent.container.labels := {"MyLabel"}; + + v_updateRequest := f_getUpdateRequestPrimitive(int3, v_resourceIndex, v_updateRequest); + + mcaPort.send(m_request(v_updateRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource updated using hierarchical addressing method"); } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating container resource using hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); + } + } - // Postamble - f_cse_postamble_deleteResources(); + // Postamble + vc_addressingMethod := PX_ADDRESSING_METHOD; + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + f_cse_postamble_deleteResources(); - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_BV_001 + // Tear down + f_cf01Down(); - } // end g_CSE_DMR_BV_001 + }//end f_CSE_GEN_UPD_002 + + + } // end of group g_CSE_GEN_UPD_002 + + } // end of group Update - group g_CSE_DMR_BV_002 { - - testcase TC_CSE_DMR_BV_002_01() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; - - f_CSE_DMR_BV_002(int3, m_createContainerBase, v_contentResponse);//Container - } + group Delete { + group g_CSE_GEN_DEL_001 { - testcase TC_CSE_DMR_BV_002_02() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc1; + /** + * @desc Check that the IUT accepts the deletion of a <container> resource using unstructured resource identifier + * + */ + testcase TC_CSE_GEN_DEL_001_CSR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_DEL_001(e_cseRelative); + } + + testcase TC_CSE_GEN_DEL_001_SPR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_DEL_001(e_spRelative); + } - f_CSE_DMR_BV_002(int9, m_createGroupBase, v_contentResponse);//Group - } + testcase TC_CSE_GEN_DEL_001_ABS() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_DEL_001(e_absolute); + } + + function f_CSE_GEN_DEL_001(in PrimitiveScope p_primitiveScope) runs on CseTester { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + if(not(PICS_UNSTRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Unstructured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - testcase TC_CSE_DMR_BV_002_03() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc1; + // Test Body + //Force usage of Non-Hierarchical addressing method + vc_addressingMethod := e_nonHierarchical; + vc_primitiveScope := p_primitiveScope; - f_CSE_DMR_BV_002(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy - } - - testcase TC_CSE_DMR_BV_002_04() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource deleted using non-hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting container resource using non-hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + // Postamble + vc_addressingMethod := PX_ADDRESSING_METHOD; + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + f_cse_postamble_deleteResources(); - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc1; + // Tear down + f_cf01Down(); + + }//end f_CSE_GEN_DEL_001 + + + } // end of group g_CSE_GEN_DEL_001 + + group g_CSE_GEN_DEL_002 { + + /** + * @desc Check that the IUT accepts the deletion of a <container> resource using structured resource identifier + * + */ + testcase TC_CSE_GEN_DEL_002_CSR() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_DEL_002(e_cseRelative); + } + + testcase TC_CSE_GEN_DEL_002_SPR() runs on CseTester system CseSystem { + // Local variables - f_CSE_DMR_BV_002(int18, m_createScheduleBase, v_contentResponse);//Schedule - } + f_CSE_GEN_DEL_002(e_spRelative); + } - testcase TC_CSE_DMR_BV_002_05() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; + testcase TC_CSE_GEN_DEL_002_ABS() runs on CseTester system CseSystem { + // Local variables + + f_CSE_GEN_DEL_002(e_absolute); + } + + function f_CSE_GEN_DEL_002(in PrimitiveScope p_primitiveScope) runs on CseTester { + + // Local variables + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + if(not(PICS_STRUCTURED_CSE_RELATIVE_RESOURCE_ID_FORMAT)) { + setverdict(inconc, __SCOPE__ & ": Structured-CSE-Relative-Resource-ID format support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME - - f_CSE_DMR_BV_002(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel - } + v_resourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - testcase TC_CSE_DMR_BV_002_06() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; + // Test Body + //Force usage of Non-Hierarchical addressing method + vc_addressingMethod := e_hierarchical; + vc_primitiveScope := p_primitiveScope; + + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource deleted using hierarchical addressing method"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting container resource using hierarchical addressing method"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + // Postamble + vc_addressingMethod := PX_ADDRESSING_METHOD; + vc_primitiveScope := PX_PRIMITIVE_SCOPE; + f_cse_postamble_deleteResources(); - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc1; - - f_CSE_DMR_BV_002(int23, m_createSubscriptionBase, v_contentResponse);//Subscription - } - - function f_CSE_DMR_BV_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + // Tear down + f_cf01Down(); - // Local variables + }//end f_CSE_GEN_DEL_002 + + + } // end of group g_CSE_GEN_DEL_002 + + } // end of group Delete + + } // end of group Generic + + group Registration { + + group Create{ + + /** + * @desc Check that the IUT accepts an AE registration (allowed App-ID, C-AE-ID-STEM not provided by AE) + * + */ + testcase TC_CSE_REG_CRE_001() runs on CseTester system CseSystem { + var MsgIn v_response; var RequestPrimitive v_request; - - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control - + var integer v_cseBaseIndex := -1; + var ResourceType v_resourceType := int2; + // Test component configuration f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + //Preamble + v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"C-AE-ID-STEM"});//c_CRUDNDi); + + //Test Body + v_request := valueof(m_createAe(PX_APP_ID, omit, omit)); + + v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int1;//Attributes mcaPort.send(m_request(v_request)); + tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": No child resources provided with RC set to 1"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { tc_ac.stop; - setverdict(fail, testcasename() & ": Child resources provided with RC set to 1"); + setverdict(pass, __SCOPE__ & ": AE successfully created."); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); + setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } - + // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); - - }//end f_CSE_DMR_BV_002 - - } // end g_CSE_DMR_BV_002 - - group g_CSE_DMR_BV_003 { - - testcase TC_CSE_DMR_BV_003_01() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AnyURI := mw_contentContainer_rc2; - - f_CSE_DMR_BV_003(int3, m_createContainerBase, v_contentResponse);//Container - } - - testcase TC_CSE_DMR_BV_003_02() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AnyURI := mw_contentGroup_rc2; - - f_CSE_DMR_BV_003(int9, m_createGroupBase, v_contentResponse);//Group - } - - testcase TC_CSE_DMR_BV_003_03() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AnyURI := mw_contentAcp_rc2; - - f_CSE_DMR_BV_003(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy - } - - testcase TC_CSE_DMR_BV_003_04() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AnyURI := mw_contentSchedule_rc2; - f_CSE_DMR_BV_003(int18, m_createScheduleBase, v_contentResponse);//Schedule - } - - testcase TC_CSE_DMR_BV_003_05() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME - - f_CSE_DMR_BV_003(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel - } - - testcase TC_CSE_DMR_BV_003_06() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AnyURI := mw_contentSubscription_rc2; - - f_CSE_DMR_BV_003(int23, m_createSubscriptionBase, v_contentResponse);//Subscription } - - function f_CSE_DMR_BV_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { - - // Local variables + + /** + * @desc Check that the IUT sends a registration CREATE Request with the value of the attribute ATTRIBUTE_NAME of the AE resource + * + */ + testcase TC_CSE_REG_CRE_002() runs on CseTester system CseSystem { + var MsgIn v_response; var RequestPrimitive v_request; - - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control - + var integer v_cseBaseIndex := -1; + var ResourceType v_resourceType := int2; + // Test component configuration f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + //Preambule + v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"C-AE-ID-STEM"});//c_CRUDNDi); - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int2;//Attributes + //Test Body + v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); + + v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Only hierarchical address provided with RC set to 2"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { tc_ac.stop; - setverdict(fail, testcasename() & ": Not only hierarchical address provided with RC set to 2"); + setverdict(pass, __SCOPE__ & ": AE successfully created."); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value v_response{ tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); + setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } - + // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); - - }//end f_CSE_DMR_BV_003 - - } // end g_CSE_DMR_BV_003 - - group g_CSE_DMR_BV_004 { - - testcase TC_CSE_DMR_BV_004_01() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc3; - - f_CSE_DMR_BV_004(int3, m_createContainerBase, v_contentResponse);//Container - } - - testcase TC_CSE_DMR_BV_004_02() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc3; - - f_CSE_DMR_BV_004(int9, m_createGroupBase, v_contentResponse);//Group - } - - testcase TC_CSE_DMR_BV_004_03() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc3; - - f_CSE_DMR_BV_004(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy - } - - testcase TC_CSE_DMR_BV_004_04() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc3; - - f_CSE_DMR_BV_004(int18, m_createScheduleBase, v_contentResponse);//Schedule - } - - testcase TC_CSE_DMR_BV_004_05() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME - f_CSE_DMR_BV_004(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel - } - - testcase TC_CSE_DMR_BV_004_06() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc3; - - f_CSE_DMR_BV_004(int23, m_createSubscriptionBase, v_contentResponse);//Subscription } - - function f_CSE_DMR_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { - - // Local variables + + /** + * @desc Check that the IUT rejects an AE registration (allowed App-ID, not allowed C-AE-ID-STEM provided by AE) + * + */ + testcase TC_CSE_REG_CRE_004() runs on CseTester system CseSystem { + var MsgIn v_response; var RequestPrimitive v_request; - - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control - + var integer v_cseBaseIndex := -1; + var ResourceType v_resourceType := int2; + // Test component configuration f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int3;//Hierarchical address and attributes + + //Preambule + v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule(-);//c_CRUDNDi); + + //Test Body + v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); + + v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": No child resources provided with RC set to 1"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { tc_ac.stop; - setverdict(fail, testcasename() & ": Child resources provided with RC set to 1"); + setverdict(pass, __SCOPE__ & ": AE creation rejected."); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); + setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } - + // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); - - }//end f_CSE_DMR_BV_004 - - } // end g_CSE_DMR_BV_004 - - group g_CSE_DMR_BV_005 { - - testcase TC_CSE_DMR_BV_005_01() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc4; - - f_CSE_DMR_BV_005(int3, m_createContainerBase, v_contentResponse);//Container - } - - testcase TC_CSE_DMR_BV_005_02() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc4; - - f_CSE_DMR_BV_005(int9, m_createGroupBase, v_contentResponse);//Group - } - - testcase TC_CSE_DMR_BV_005_03() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc4; - - f_CSE_DMR_BV_005(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy - } - - testcase TC_CSE_DMR_BV_005_04() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc4; - - f_CSE_DMR_BV_005(int18, m_createScheduleBase, v_contentResponse);//Schedule - } - - testcase TC_CSE_DMR_BV_005_05() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME - f_CSE_DMR_BV_005(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel - } - - testcase TC_CSE_DMR_BV_005_06() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc4; - - f_CSE_DMR_BV_005(int23, m_createSubscriptionBase, v_contentResponse);//Subscription } - - function f_CSE_DMR_BV_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { - - // Local variables - var MsgIn v_response; + + /** + * @desc Check that the IUT accepts an AE registration (allowed App-ID, S-AE-ID-STEM not provided by AE) + * + */ + testcase TC_CSE_REG_CRE_005() runs on CseTester system CseSystem { + var RequestPrimitive v_request; - - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control - + var integer v_cseBaseIndex := -1; + var ResourceType v_resourceType := int2; + // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int1;//Attributes + f_cf02Up(); + + //Preambule + v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi); + + //Test Body + v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); + + v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); + mcaPort.send(m_request(v_request)); tc_ac.start; + alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": No child resources provided with RC set to 1"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mccPort.receive(mw_request(mw_createAEAnnc(-, -, -))) { tc_ac.stop; - setverdict(fail, testcasename() & ": Child resources provided with RC set to 1"); + setverdict(pass, __SCOPE__ & ": AE creation redirected."); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mccPort.receive { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); + setverdict(fail, __SCOPE__ & ": Error while creating AE"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } - + // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); - - }//end f_CSE_DMR_BV_005 - - } // end g_CSE_DMR_BV_005 - - group g_CSE_DMR_BV_006 { - - testcase TC_CSE_DMR_BV_006_01() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc5; - - f_CSE_DMR_BV_006(int3, m_createContainerBase, v_contentResponse);//Container - } - - testcase TC_CSE_DMR_BV_006_02() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc5; - - f_CSE_DMR_BV_006(int9, m_createGroupBase, v_contentResponse);//Group - } - - testcase TC_CSE_DMR_BV_006_03() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc5; - - f_CSE_DMR_BV_006(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy - } - - testcase TC_CSE_DMR_BV_006_04() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc5; - - f_CSE_DMR_BV_006(int18, m_createScheduleBase, v_contentResponse);//Schedule - } - - testcase TC_CSE_DMR_BV_006_05() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME - f_CSE_DMR_BV_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel - } - - testcase TC_CSE_DMR_BV_006_06() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc5; - - f_CSE_DMR_BV_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription } - function f_CSE_DMR_BV_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { - - // Local variables - var MsgIn v_response; + /** + * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), transfer request to the IN-CSE + * + */ + testcase TC_CSE_REG_CRE_008() runs on CseTester system CseSystem { + var RequestPrimitive v_request; - - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control - + var integer v_cseBaseIndex := -1; + var ResourceType v_resourceType := int2; + // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int1;//Attributes + f_cf02Up(); + + //Preambule + v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi); + + //Test Body + v_request := valueof(m_createAe(PX_APP_ID, omit, "S-AE-ID-STEM")); + + v_request := f_getUpdateRequestPrimitive(v_resourceType,v_cseBaseIndex, v_request); + mcaPort.send(m_request(v_request)); tc_ac.start; + alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": No child resources provided with RC set to 1"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mccPort.receive(mw_request(mw_createAEAnnc("/S", "CSE_ID", -))) { tc_ac.stop; - setverdict(fail, testcasename() & ": Child resources provided with RC set to 1"); + setverdict(pass, __SCOPE__ & ": AE creation redirected."); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mccPort.receive { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); + setverdict(fail, __SCOPE__ & ": Error while creating AE"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } - + // Postamble f_cse_postamble_deleteResources(); // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_BV_006 - - } // end g_CSE_DMR_BV_006 - - group g_CSE_DMR_BV_007 { - - testcase TC_CSE_DMR_BV_007_01() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc6; - - f_CSE_DMR_BV_007(int3, m_createContainerBase, v_contentResponse);//Container - } - - testcase TC_CSE_DMR_BV_007_02() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc6; - - f_CSE_DMR_BV_007(int9, m_createGroupBase, v_contentResponse);//Group - } - - testcase TC_CSE_DMR_BV_007_03() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc6; - - f_CSE_DMR_BV_007(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy - } - - testcase TC_CSE_DMR_BV_007_04() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc6; - - f_CSE_DMR_BV_007(int18, m_createScheduleBase, v_contentResponse);//Schedule - } - - testcase TC_CSE_DMR_BV_007_05() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase;//FIXME + f_cf02Down(); - f_CSE_DMR_BV_007(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel - } - - testcase TC_CSE_DMR_BV_007_06() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc6; - - f_CSE_DMR_BV_007(int23, m_createSubscriptionBase, v_contentResponse);//Subscription } - - function f_CSE_DMR_BV_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { - - // Local variables + + /** + * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), communication between MN-CSE and IN-CSE + * + */ + testcase TC_CSE_REG_CRE_009() runs on CseTester system CseSystem { + var MsgIn v_response; var RequestPrimitive v_request; - - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - - // Test control - + var integer v_aeAnncIndex := -1; + var ResourceType v_resourceType := int2; + // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); - v_request.resultContent := int1;//Attributes - mcaPort.send(m_request(v_request)); + f_cf02Up(); + + //Preambule + v_aeAnncIndex := f_cse_preamble_registerAe();//TODO TestSystem acting as MN. It should register AeAnnc into the IUT (IN) via mcc + f_cse_deleteResource(v_aeAnncIndex); //to deregister the AE + + //Test Body + v_request := valueof(m_updateAEAnnc(-, -, -, "APP-ID", -)); //TODO to double check all parameters + + v_request := f_getUpdateRequestPrimitive(v_resourceType,v_aeAnncIndex, v_request);//TODO + + mccPort.send(m_request(v_request)); tc_ac.start; + alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": No child resources provided with RC set to 1"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Child resources provided with RC set to 1"); + setverdict(pass, __SCOPE__ & ": AE creation redirected."); + //continue to test the content } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mccPort.receive { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); + setverdict(fail, __SCOPE__ & ": Error while creating AE"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } } - + + //v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + // Postamble f_cse_postamble_deleteResources(); // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_BV_007 - - } // end g_CSE_DMR_BV_007 + f_cf02Down(); - group Create { + } - group g_CSE_DMR_CRE_BV_001 { - - testcase TC_CSE_DMR_CRE_BV_001_01() runs on CseTester system CseSystem { - // Local variables - var template RequestPrimitive v_createRequest := m_createContainerBase; - var ResponsePrimitive v_responsePrimitive; - var integer v_sizeResourceTypeList; - var integer i; - var RequestPrimitiveMatrix v_requestPrimitivematrix; - var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;//TODO useless but need to be initialized see if we can remove it - - v_requestPrimitivematrix := { - {}, - {valueof(m_createAeAux(omit,omit))}, - {valueof(m_createContainerBase)} + /** + * @desc Check that the IUT accepts an AE re-registration (allowed M2M-SP-assigned AE-ID, S-AE-ID-STEM provided by AE), transfer response to the AE + * + */ + testcase TC_CSE_REG_CRE_010() runs on CseTester system CseSystem { + + var MsgIn v_response; + var ResponsePrimitive v_request; + var integer v_cseBaseIndex := -1; + + // Test component configuration + f_cf02Up(); + + //Preambule + v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule({"S"});//c_CRUDNDi); + + //Test Body + v_request := valueof(m_responsePrimitive(int2001, "To_be_defined", {aEAnnc := m_contentCreateAEAnnc({"Credential-ID:None"}, omit, PX_APP_ID, "/CSE_ID/S-AE-ID-STEM")})); + + mccPort.send(m_response(v_request)); + tc_ac.start; + + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": AE creation success."); + //continue to test the content } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); - - v_createRequest.primitiveContent.any_1[0].Container_optional.resourceName := omit; - - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int3, v_createRequest, v_requestPrimitivematrix[i], v_notifyHandler); - log(v_responsePrimitive); - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } - } - } - } - - testcase TC_CSE_DMR_CRE_BV_001_02() runs on CseTester system CseSystem { - // Local variables - var template RequestPrimitive v_createRequest := m_createGroupBase; - var ResponsePrimitive v_responsePrimitive; - var RequestPrimitiveMatrix v_requestPrimitivematrix; - var integer v_sizeResourceTypeList; - var integer i; - var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; - - //CSEBase int5, remoteCSE int16, AE int2 - v_requestPrimitivematrix := { - {}, - {valueof(m_createAeAux(omit,omit))} + [] mcaPort.receive { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating AE"); } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); - - v_createRequest.primitiveContent.any_1[0].Group_optional.resourceName := omit; - - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int3, v_createRequest, v_requestPrimitivematrix[i],v_notifyHandler); - log(v_responsePrimitive); - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } - } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); } - } + } + + // Postamble + f_cse_postamble_deleteResources(); - testcase TC_CSE_DMR_CRE_BV_001_03() runs on CseTester system CseSystem { - // Local variables - var template RequestPrimitive v_createRequest := m_createAcpBase; - var ResponsePrimitive v_responsePrimitive; - var integer v_sizeResourceTypeList; - var integer i; - var RequestPrimitiveMatrix v_requestPrimitivematrix; - var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; - - //CSEBase int5, remoteCSE int16, AE int2 - v_requestPrimitivematrix := { - {}, - {valueof(m_createAeAux(omit,omit))} - } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); + // Tear down + f_cf02Down(); - v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName := omit; - - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int1, v_createRequest, v_requestPrimitivematrix[i], v_notifyHandler);//AccessControlPolicy - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } - } - } - } + } //end TC_CSE_REG_CRE_010 - testcase TC_CSE_DMR_CRE_BV_001_04() runs on CseTester system CseSystem { + group g_CSE_REG_CRE_016{ + + /** + * @desc Check that the IUT accepts a create request of <remoteCSE> resource with OPTIONAL_ATTRIBUTE. + * + */ + testcase TC_CSE_REG_CRE_016_LBL() runs on CseTester system CseSystem { // Local variables - var template RequestPrimitive v_createRequest := m_createScheduleBase; - var ResponsePrimitive v_responsePrimitive; - var integer v_sizeResourceTypeList; - var integer i; - var RequestPrimitiveMatrix v_requestPrimitivematrix; - var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; + const AttributeAux c_optionalAttribute := {"labels", omit}; -// CSEBase int5, remoteCSE int16, AE int2, subscription int23 - v_requestPrimitivematrix := { - {}, - {valueof(m_createAeAux(omit,omit))}, - {valueof(m_createSubscriptionBase)} - } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); + v_createRequest.primitiveContent.remoteCSE.labels := {"MyLabel"}; - v_createRequest.primitiveContent.any_1[0].Schedule_optional.resourceName := omit; - - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int18, v_createRequest, v_requestPrimitivematrix[i], v_notifyHandler);//Schedule + f_CSE_REG_CRE_016(v_createRequest, c_optionalAttribute); - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } - } - } } - testcase TC_CSE_DMR_CRE_BV_001_05() runs on CseTester system CseSystem { + testcase TC_CSE_REG_CRE_016_CST() runs on CseTester system CseSystem { // Local variables - var template RequestPrimitive v_createRequest := m_createPollingChannelBase; - var ResponsePrimitive v_responsePrimitive; - var integer v_sizeResourceTypeList; - var integer i; - var RequestPrimitiveMatrix v_requestPrimitivematrix; - var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; + const AttributeAux c_optionalAttribute := {"cseType", omit}; - //remoteCSE int16, AE int2 - v_requestPrimitivematrix := { - {valueof(m_createAeAux(omit,omit))} - } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); + v_createRequest.primitiveContent.remoteCSE.cseType := int1; - v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.resourceName := omit; - - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int15, v_createRequest, v_requestPrimitivematrix[i], v_notifyHandler);//PollingChannel - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } - } - } + f_CSE_REG_CRE_016(v_createRequest, c_optionalAttribute); + } - testcase TC_CSE_DMR_CRE_BV_001_06() runs on CseTester system CseSystem { + testcase TC_CSE_REG_CRE_016_POA() runs on CseTester system CseSystem { // Local variables - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var ResponsePrimitive v_responsePrimitive; - var integer v_sizeResourceTypeList; - var integer i; - var RequestPrimitiveMatrix v_requestPrimitivematrix; - var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; - - //accessControlPolicy int1, CSEBase int5, remoteCSE int16, AE int2, container int, schedule int, locationPolicy int, delivery int, request int, group int, mgmtCmd int, - // node int, m2mServiceSubscriptionProfile int, statsConfig int, statsCollect int, serviceSubscribedAppRule int + var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; + const AttributeAux c_optionalAttribute := {"pointOfAccess", omit}; - // mgmtObj int, execInstance int, serviceSubscribedNode int, pollingChannelURI int (doesn't exist in Release2), eventConfig int, - v_requestPrimitivematrix := { - {}, - {valueof(m_createAeAux(omit,omit))}, - {valueof(m_createContainerBase)}, - {valueof(m_createAcpBase)}, - {valueof(m_createScheduleBase)}, - {valueof(m_createGroupBase)} - //{m_createLocationPolicy(int1,omit,omit,omit,omit)} - //{m_createServiceSubscribedAppRule()} //TODO set correct parameters - } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); - - v_createRequest.primitiveContent.any_1[0].Subscription_optional.resourceName := omit; + v_createRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; + + f_CSE_REG_CRE_016(v_createRequest, c_optionalAttribute); - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest, v_requestPrimitivematrix[i], v_notifyHandler);//Subscription - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } - } - } } - function f_CSE_DMR_CRE_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in RequestPrimitiveList p_requestPrimitiveList, in CseTester p_notifyHandler) runs on CseTester return ResponsePrimitive { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_sizeResourceTypeList := lengthof(p_requestPrimitiveList); - var integer i; - var integer v_parentIndex := -1; - var integer v_resourceIndex := -1; - var integer v_ae2Index := -1; - var PoaList v_poaList := {"http://" & PX_TESTER_ADDRESS & "/"}; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - if(match(int23, p_requestPrimitiveList[i].resourceType)){ - v_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", v_poaList), -1); // AE2 is registred - p_requestPrimitiveList[i].primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)}; - p_notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(v_parentIndex))); - } - v_parentIndex := f_cse_createResource(p_requestPrimitiveList[i].resourceType, p_requestPrimitiveList[i], v_parentIndex); - } - - // Test Body - - if(match(int23, p_requestPrimitive.resourceType)){ - v_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", v_poaList), -1); // AE2 is registred - p_requestPrimitive.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)}; - p_notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(v_parentIndex))); - } - - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly"); - v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_parentIndex); - if (v_sizeResourceTypeList == 0){ - vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_resourceIndex}; - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - vc_resourcesIndexToBeDeleted := {}; - - // Tear down - //notifyHandler.stop; - f_cf01Down(); - - - return v_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_CRE_BV_001 - - } // end g_CSE_DMR_CRE_BV_001 - - - group g_CSE_DMR_CRE_BV_002 { - - testcase TC_CSE_DMR_CRE_BV_002_01() runs on CseTester system CseSystem { + testcase TC_CSE_REG_CRE_016_NL() runs on CseTester system CseSystem { // Local variables - var ResponsePrimitive v_responsePrimitive; - - v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int3, m_createContainerBase);//container - - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } else { - if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.resourceName != c_defaultResourceName){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not correct"); - } - } - } - } + var template RequestPrimitive v_createRequest := m_createRemoteCSEBase; + const AttributeAux c_optionalAttribute := {"nodeLink", omit}; - testcase TC_CSE_DMR_CRE_BV_002_02() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - - v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int9, m_createGroupBase);//group - - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } else { - if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.resourceName != c_defaultResourceName){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not correct"); - } - } - } - } - - testcase TC_CSE_DMR_CRE_BV_002_03() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - - v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int1, m_createAcpBase );//accessControlPolicy - - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } else { - if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.resourceName != c_defaultResourceName){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not correct"); - } - } - } - } + v_createRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; - testcase TC_CSE_DMR_CRE_BV_002_04() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - - v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int18, m_createScheduleBase);//Schedule - - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } else { - if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.resourceName != c_defaultResourceName){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not correct"); - } - } - } - } - testcase TC_CSE_DMR_CRE_BV_002_05() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - - v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int15, m_createPollingChannelBase);//Pollingchannel + f_CSE_REG_CRE_016(v_createRequest, c_optionalAttribute); - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } else { - if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.resourceName != c_defaultResourceName){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not correct"); - } - } - } } - testcase TC_CSE_DMR_CRE_BV_002_06() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - - v_responsePrimitive := f_CSE_DMR_CRE_BV_002(int23, m_createSubscriptionBase);//Subscription - - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } else { - if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.resourceName != c_defaultResourceName){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not correct"); - } - } - } - } + function f_CSE_REG_CRE_016(template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseTester { - function f_CSE_DMR_CRE_BV_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester return ResponsePrimitive{//system CseSystem { MRO system keyword not supported on functions in Titan - // Local variables var MsgIn v_response; var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; + var ResourceType v_resourceType := int16; //remoteCSE // Test control - + // Test component configuration - f_cf01Up(); - + f_cf04Up(); + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); - + // Test Body - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); - - mcaPort.send(m_request(v_request)); + v_request := f_getCreateRequestPrimitive(v_resourceType, p_requestPrimitive, -1); + + mccPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfuly"); + setverdict(pass, __SCOPE__ & ": Accepted creation for resource type remoteCSE containing attribute " & p_optionalAttribute.name); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mccPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted creation for resource type remoteCSE without containing attribute " & p_optionalAttribute.name); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": Rejected creation of resource type remoteCSE containing attribute" & p_optionalAttribute.name); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); } } @@ -1570,703 +1211,996 @@ module OneM2M_Testcases { f_cse_postamble_deleteResources(); // Tear down - f_cf01Down(); - - return v_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_CRE_BV_002 - + f_cf04Down(); + + }//end f_CSE_REG_CRE_BV_016 - }// end group g_CSE_DMR_CRE_BV_002 - - group g_CSE_DMR_CRE_BV_003 { + }// end group g_CSE_REG_CRE_BV_016 + + /** + * @desc Check that the IUT rejects an AE registration (not allowed App-ID) + * + */ + testcase TC_CSE_REG_CRE_018() runs on CseTester system CseSystem { + + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_cseBaseIndex := -1; + var ResourceType v_resourceType := int2; + + // Test component configuration + f_cf01Up(); - testcase TC_CSE_DMR_CRE_BV_003_01() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_003(int3, m_createContainerBase);//container - } - - testcase TC_CSE_DMR_CRE_BV_003_02() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_003(int9, m_createGroupBase);//group - } + //Preambule + v_cseBaseIndex := f_cse_preamble_createServiceSubscribedAppRule(-);//c_CRUDNDi); + + // Test Body + v_request := valueof(m_createAe(PX_APP_ID, omit, omit)); + + v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_cseBaseIndex); - testcase TC_CSE_DMR_CRE_BV_003_03() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_003(int1, m_createAcpBase);//accessControlPolicy - } - - testcase TC_CSE_DMR_CRE_BV_003_04() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_003(int18, m_createScheduleBase);//Schedule - } - testcase TC_CSE_DMR_CRE_BV_003_05() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_003(int15, m_createPollingChannelBase);//Pollingchannel - } - - testcase TC_CSE_DMR_CRE_BV_003_06() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_003(int23, m_createSubscriptionBase);//Subscription - } + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": AE creation rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); - - function f_CSE_DMR_CRE_BV_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {//system CseSystem { MRO system keyword not supported on functions in Titan - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + // Tear down + f_cf01Down(); - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - v_request.requestIdentifier := "Existing resource"; - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4105))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource already exists"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating an already existing resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Creating a resource that already exists"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_CRE_BV_003 - - }// end group g_CSE_DMR_CRE_BV_003 + } - group g_CSE_DMR_CRE_BV_004 { - - testcase TC_CSE_DMR_CRE_BV_004_01() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_004(int3, m_createContainerBase);//container - } + /** + * @desc Check that the IUT accepts an create request of <remoteCSE> resource with attributes multiplicity equals to 1. + * + */ + testcase TC_CSE_REG_CRE_022() runs on CseTester system CseSystem { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase); + var ResourceType v_resourceType := int16; //remoteCSE + + // Test control - testcase TC_CSE_DMR_CRE_BV_004_02() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_004(int9, m_createGroupBase);//group - } - - testcase TC_CSE_DMR_CRE_BV_004_03() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_004(int1, m_createAcpBase);//accessControlPolicy - } + // Test component configuration + f_cf04Up(); - testcase TC_CSE_DMR_CRE_BV_004_04() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_004(int18, m_createScheduleBase);//Schedule - } - testcase TC_CSE_DMR_CRE_BV_004_05() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_004(int15, m_createPollingChannelBase);//Pollingchannel - } - - testcase TC_CSE_DMR_CRE_BV_004_06() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_CRE_BV_004(int23, m_createSubscriptionBase);//Subscription - } - + // Test adapter configuration + + // Preamble - function f_CSE_DMR_CRE_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {//system CseSystem { MRO system keyword not supported on functions in Titan - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_acpAuxIndex := -1; - var integer v_aeIndex := -1; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; + // Test Body + v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1); + + mccPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully"); } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - if (p_resourceType != int23) { - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) - } else { - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int60);//c_UDNDi); - } - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -); - - // Test Body - if(p_resourceType == int15) { - v_request := valueof(m_createPollingChannel(f_getResourceAddress(v_aeIndex), PX_AE_ID_STEM, omit)); - } else { - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code in the response"); } - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Access denied to create a resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating a resource without privileges"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Resource created without creation privileges"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_CRE_BV_004 - - }// end group g_CSE_DMR_CRE_BV_004 - - - }//end group Create + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); + } + } - group Retrieve { - - group g_CSE_DMR_RET_BV_001 { - - testcase TC_CSE_DMR_RET_BV_001_01() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; - - v_responsePrimitive := f_CSE_DMR_RET_BV_001(int3, m_createContainerBase, v_contentResponse);//Container - - } + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf04Down(); - testcase TC_CSE_DMR_RET_BV_001_02() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_rc1; - - v_responsePrimitive := f_CSE_DMR_RET_BV_001(int9, m_createGroupBase, v_contentResponse);//Group - - } - - testcase TC_CSE_DMR_RET_BV_001_03() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc1; - - v_responsePrimitive := f_CSE_DMR_RET_BV_001(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy - - } + }//end TC_CSE_REG_CRE_022 - testcase TC_CSE_DMR_RET_BV_001_04() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_rc1; - - v_responsePrimitive := f_CSE_DMR_RET_BV_001(int18, m_createScheduleBase, v_contentResponse);//Schedule - - } - - testcase TC_CSE_DMR_RET_BV_001_05() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannelBase; - - v_responsePrimitive := f_CSE_DMR_RET_BV_001(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel - - } - - testcase TC_CSE_DMR_RET_BV_001_06() runs on CseTester system CseSystem { - // Local variables - var ResponsePrimitive v_responsePrimitive; - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc1; - - v_responsePrimitive := f_CSE_DMR_RET_BV_001(int23, m_createSubscriptionBase, v_contentResponse);//Subscription - - } + /** + * @desc Check that the IUT accepts an create request of <remoteCSE> resource with attributes multiplicity equals to 1 without the preconfigured CSE-ID + * + */ + testcase TC_CSE_REG_CRE_023() runs on CseTester system CseSystem { - function f_CSE_DMR_RET_BV_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester return ResponsePrimitive { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Response OK for retrieving"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - return v_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_RET_BV_001 - - } // end g_CSE_DMR_RET_BV_001 + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var RequestPrimitive v_createRequestPrimitive := valueof(m_createRemoteCSEBase); + var ResourceType v_resourceType := int16; //remoteCSE + + // Test control + + // Test component configuration + f_cf04Up(); + + // Test adapter configuration + + // Preamble + + // Test Body + v_request := f_getCreateRequestPrimitive(v_resourceType, v_createRequestPrimitive, -1); + + mccPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mccPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type remoteCSE created successfully"); + } + [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type remoteCSE"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type remoteCSE"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf04Down(); + + }//end TC_CSE_REG_CRE_023 - group g_CSE_DMR_RET_BO_002 { - - testcase TC_CSE_DMR_RET_BO_002() runs on CseTester system CseSystem{ - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - - var integer v_aeIndex := -1; - var XSD.ID v_resourceId := "nonexisting"; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration + /** + * @desc Check that the IUT rejects the create request of <CSEBase> resource. + * + */ + testcase TC_CSE_REG_CRE_024() runs on CseTester system CseSystem { - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - // Test Body - if(PX_UNSTRUCTURED and (PX_ADDRESSING_FORMAT == e_cseRelative)) { - mcaPort.send(m_request(m_retrieveResource(v_resourceId, f_getOriginator(v_aeIndex)))); - } else { - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_aeIndex) & "/" & v_resourceId, f_getOriginator(v_aeIndex)))); + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var ResourceType v_resourceType := int5; //CSEBase + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + v_request := f_getCreateRequestPrimitive(v_resourceType, m_createCSEBaseBase, v_aeIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": CSEBase creation rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating CSEBase"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource not found"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_BO_002 - - } // end g_CSE_DMR_RET_BO_002 + // Tear down + f_cf01Down(); + + }//end TC_CSE_REG_CRE_024 - group g_CSE_DMR_RET_BO_003 { + /** + * @desc Check that the IUT rejects registration of already registered AE (C-AE-ID-STEM provided by AE) + * + */ + testcase TC_CSE_REG_CRE_026() runs on CseTester system CseSystem { + + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var ResourceType v_resourceType := int2; - testcase TC_CSE_DMR_RET_BO_003_01() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_RET_BO_003(int3, m_createContainerBase);//Container - } - - testcase TC_CSE_DMR_RET_BO_003_02() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_RET_BO_003(int9, m_createGroupBase);//Group - } + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAeWithId("C-AE-ID-STEM");//c_CRUDNDi); - testcase TC_CSE_DMR_RET_BO_003_03() runs on CseTester system CseSystem { - // Local variables - var template RequestPrimitive v_requestPrimitive := m_createAcpBase; - - v_requestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61; + //Test Body + v_request := valueof(m_createAe(PX_APP_ID, omit, "C-AE-ID-STEM")); + + v_request := f_getCreateRequestPrimitive(v_resourceType, v_request, v_aeIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4105))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": AE creation rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4105))) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating AE with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating AE"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); - f_CSE_DMR_RET_BO_003(int1, v_requestPrimitive);//AccessControlPolicy - } + // Tear down + f_cf01Down(); - testcase TC_CSE_DMR_RET_BO_003_04() runs on CseTester system CseSystem { - // Local variables + } + + + + } //end group Create + + group Retrieve{ + + /** + * @desc Check that the IUT accepts an retrieval request of <CSEBase> resource and responds with all attributes that have multiplicity equals to 1. + * + */ + testcase TC_CSE_REG_RET_001() runs on CseTester system CseSystem { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var template PrimitiveContent v_contentResponse; + + // Test control - f_CSE_DMR_RET_BO_003(int18, m_createScheduleBase);//Schedule - } - - testcase TC_CSE_DMR_RET_BO_003_05() runs on CseTester system CseSystem { - // Local variables + // Test component configuration + f_cf01Up(); - f_CSE_DMR_RET_BO_003(int15, m_createPollingChannelBase);//PollingChannel - } + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - testcase TC_CSE_DMR_RET_BO_003_06() runs on CseTester system CseSystem { - // Local variables + // Test Body + v_contentResponse.cSEBase := mw_contentCSEBase_rc1; + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex)))); - f_CSE_DMR_RET_BO_003(int23, m_createSubscriptionBase);//Subscription + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } - - function f_CSE_DMR_RET_BO_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { - - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var XSD.ID v_acpId; - var integer v_aeIndex := -1; - var integer v_acpAuxIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - log(testcasename() & ":AccessControlPolicy support is required for executing this test case"); - stop; + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> 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__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + 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(); + + }//end TC_CSE_REG_RET_001 + + /** + * @desc Check that if the IUT is IN-CSE, it accepts an retrieval request of <CSEBase> resource and returns the cseType attribute. cseType Attribute is mandatory for IN-CSE + * + */ + testcase TC_CSE_REG_RET_005() runs on CseTester system CseSystem { - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, -);//c_CRUDNDi) - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//c_CRUDNDi; - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var template PrimitiveContent v_contentResponse; + + // Test control + if(not(PICS_IN_CSE)) { + setverdict(inconc, __SCOPE__ & ": IUT shall be IN-CSE to run this test case"); + stop; + } - f_cse_updateAcpAuxResource(int61); //c_CUDNDi - - // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + // Test component configuration + f_cf01Up(); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving attributes from resource without having privileges"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Retrieving attributes from resource without having privileges"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + v_contentResponse.cSEBase := mw_contentCSEBase_rc1; + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { + tc_ac.stop; + if (ispresent(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType)){ + if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType==int1){ + setverdict(pass, __SCOPE__ & ": cseType attribute is set to 1 (IN_CSE)"); + }else{ + setverdict(fail, __SCOPE__ & ": Error, cseType attribute is set to " & int2str(enum2int(v_response.primitive.responsePrimitive.primitiveContent.cSEBase.cseType))); + } + }else{ + setverdict(fail, __SCOPE__ & ": Error, cseType attribute is not present"); } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_BO_003 - - } // end g_CSE_DMR_RET_BO_003 + + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> 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__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + 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(); + + }//end TC_CSE_REG_RET_BV_005 - group g_CSE_DMR_RET_BV_004 { + /** + * @desc Check that the IUT accepts a retrieval request of <CSEBase> resource and responds with supportedResourceTypes attribute containing a list of the supported resources and pointOfAccess containing the list of physical addresses to be used by Registree to connect to this CSE (e.g. IP address, FQDN). + * + */ + testcase TC_CSE_REG_RET_008() runs on CseTester system CseSystem { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var template PrimitiveContent v_contentResponse; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + v_contentResponse.cSEBase := mw_contentCSEBase_rc1; + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { + tc_ac.stop; + + if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.supportedResourceType == PX_SRT) { + setverdict(pass, __SCOPE__ & ": supportedResourceTypes attribute is set according to PX_SRT"); + }else{ + setverdict(fail, __SCOPE__ & ": supportedResourceTypes attribute is not set according to PX_SRT"); + } + + if (v_response.primitive.responsePrimitive.primitiveContent.cSEBase.pointOfAccess==PX_POA){ + setverdict(pass, __SCOPE__ & ": supportedResourceTypes attribute is set according to PX_POA"); + }else{ + setverdict(fail, __SCOPE__ & ": supportedResourceTypes attribute is not set according to PX_POA"); + } + + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> 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__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + 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(); + + }//end TC_CSE_REG_RET_008 + + } //end group Retrieve + + group Update{ + + /** + * @desc Check that the IUT rejects the update request of <CSEBase> resource. + * + */ + testcase TC_CSE_REG_UPD_001() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateCSEBaseBase; + const integer c_cseBaseIndex := -1; + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + v_updateRequest.primitiveContent.cSEBase.labels := v_labels_1; + v_request := f_getUpdateRequestPrimitive(int5, c_cseBaseIndex, v_updateRequest); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": CSEBase update rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating CSEBase"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_REG_UPD_BI_001 + + }// end group Update + + group Delete{ + + /** + * @desc Check that the IUT rejects the delete request of <CSEBase> resource. + * + */ + testcase TC_CSE_REG_DEL_001() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + v_request := valueof(m_deleteRequest(f_getResourceAddress())); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": CSEBase deletion rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4005))) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting CSEBase with status code " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting CSEBase"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_REG_DEL_BI_001 + + }// end group Delete + + }//end Registration + + group Data_Management_and_Repository { + + group Create { + + group g_CSE_DMR_CRE_001 { - testcase TC_CSE_DMR_RET_BV_004_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource on the TARGET_RESOURCE_ADDRESS of type PARENT_RESOURCE_TYPE with resource name not provided + * + */ + testcase TC_CSE_DMR_CRE_001_CNT_CB() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit; - v_contentResponse.any_1[0].Container_optional.parentID := ?; - - f_CSE_DMR_RET_BV_004(int3, m_createContainerBase, v_contentResponse);//Container + var template RequestPrimitive v_createRequest := m_createContainerBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive;//TODO useless but need to be initialized see if we can remove it + + v_createRequest.primitiveContent.container.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int3, v_createRequest, -, v_notifyHandler); //Container + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - - testcase TC_CSE_DMR_RET_BV_004_02() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_001_CNT_AE() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_createRequest := m_createContainerBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.container.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int3, v_createRequest, m_createAeAux(omit,omit),v_notifyHandler);//Container + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit; - v_contentResponse.any_1[0].Group_optional.parentID := ?; - - f_CSE_DMR_RET_BV_004(int9, m_createGroupBase, v_contentResponse);//Group + testcase TC_CSE_DMR_CRE_001_CNT_CNT() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createContainerBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.container.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_001(int3, v_createRequest, m_createContainerBase, v_notifyHandler);//Container + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - testcase TC_CSE_DMR_RET_BV_004_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_001_GRP_CB() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit; - v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?; - - f_CSE_DMR_RET_BV_004(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + var template RequestPrimitive v_createRequest := m_createGroupBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.group_.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_001(int9, v_createRequest, -, v_notifyHandler);//Group + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - - testcase TC_CSE_DMR_RET_BV_004_04() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_001_GRP_AE() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit; - v_contentResponse.any_1[0].Schedule_optional.parentID := ?; - - f_CSE_DMR_RET_BV_004(int18, m_createScheduleBase,v_contentResponse);//Schedule - } + var template RequestPrimitive v_createRequest := m_createGroupBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.group_.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_001(int9, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Group + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } - testcase TC_CSE_DMR_RET_BV_004_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_001_ACP_CB() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit; - v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?; - - f_CSE_DMR_RET_BV_004(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel + var template RequestPrimitive v_createRequest := m_createAcpBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.accessControlPolicy.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_001(int1, v_createRequest, -, v_notifyHandler);//AccessControlPolicy + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - testcase TC_CSE_DMR_RET_BV_004_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_001_ACP_AE() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit; - v_contentResponse.any_1[0].Subscription_optional.parentID := ?; - - f_CSE_DMR_RET_BV_004(int23, m_createSubscriptionBase, v_contentResponse);//Subscription - } + var template RequestPrimitive v_createRequest := m_createAcpBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.accessControlPolicy.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_001(int1, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//AccessControlPolicy + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } - function f_CSE_DMR_RET_BV_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { - + testcase TC_CSE_DMR_CRE_001_SCH_CB() runs on CseTester system CseSystem { // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + v_createRequest.primitiveContent.schedule.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int18, v_createRequest, -, v_notifyHandler);//Schedule - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - - // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_resourceIndex)))); + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_001_SCH_AE() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.schedule.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int18, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Schedule - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Requested attribute retrieved successfuly"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, not only requested attribute retrieved"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource attribute"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute"); + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } } - } - - // Postamble - f_cse_postamble_deleteResources(); - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_RET_BV_004 - - } // end g_CSE_DMR_RET_BV_004 + } - group g_CSE_DMR_RET_BV_005 { + testcase TC_CSE_DMR_CRE_001_SCH_SUB() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.schedule.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int18, v_createRequest, m_createSubscriptionBase, v_notifyHandler);//Schedule + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - testcase TC_CSE_DMR_RET_BV_005_01() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_001_PCH_AE() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_createRequest := m_createPollingChannelBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + + v_createRequest.primitiveContent.pollingChannel.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_001(int15, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//PollingChannel + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.pollingChannel.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_001_SUB_CB() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.subscription.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, -, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit; - v_contentResponse.any_1[0].Container_optional.parentID := ?; - - f_CSE_DMR_RET_BV_005(int3, m_createContainerBase, v_contentResponse);//Container } + + testcase TC_CSE_DMR_CRE_001_SUB_AE() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.subscription.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_001_SUB_CNT() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.subscription.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createContainerBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } - testcase TC_CSE_DMR_RET_BV_005_02() runs on CseTester system CseSystem { + } + + testcase TC_CSE_DMR_CRE_001_SUB_ACP() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.subscription.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createAcpBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit; - v_contentResponse.any_1[0].Group_optional.parentID := ?; - - f_CSE_DMR_RET_BV_005(int9, m_createGroupBase, v_contentResponse);//Group + testcase TC_CSE_DMR_CRE_001_SUB_SCH() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.subscription.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createScheduleBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } } - testcase TC_CSE_DMR_RET_BV_005_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_001_SUB_GRP() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.subscription.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int23, v_createRequest, m_createGroupBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit; - v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?; - - f_CSE_DMR_RET_BV_005(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + testcase TC_CSE_DMR_CRE_001_NOD_CB() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createNodeBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.node.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_001(int14, v_createRequest, -, v_notifyHandler);//Node + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.node.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - - testcase TC_CSE_DMR_RET_BV_005_04() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_001_MGC_CB() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_createRequest := m_createMgmtCmdBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.mgmtResource.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int12, v_createRequest, -, v_notifyHandler);//Management Command + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.mgmtResource.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit; - v_contentResponse.any_1[0].Schedule_optional.parentID := ?; - - f_CSE_DMR_RET_BV_005(int18, m_createScheduleBase, v_contentResponse);//Schedule + testcase TC_CSE_DMR_CRE_001_LCP_CB() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createLocationPolicyBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.locationPolicy.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int10, v_createRequest, -, v_notifyHandler);//Location Policy + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.locationPolicy.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - testcase TC_CSE_DMR_RET_BV_005_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_001_STCG_CB() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_createRequest := m_createStatsConfigBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.statsConfig.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int22, v_createRequest, -, v_notifyHandler);//Stats Config + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.statsConfig.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit; - v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?; - - f_CSE_DMR_RET_BV_005(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel + testcase TC_CSE_DMR_CRE_001_STCL_CB() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createStatsCollectBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.statsCollect.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_001(int21, v_createRequest, -, v_notifyHandler);//Stats Collect + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.statsCollect.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + } - testcase TC_CSE_DMR_RET_BV_005_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_001_MSSP_CB() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_createRequest := m_createM2mServiceSubscriptionProfileBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.m2mServiceSubscriptionProfile.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int11, v_createRequest, -, v_notifyHandler);//Subscription Profile + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.m2mServiceSubscriptionProfile.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit; - v_contentResponse.any_1[0].Subscription_optional.parentID := ?; - - f_CSE_DMR_RET_BV_005(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + testcase TC_CSE_DMR_CRE_001_ASAR_CB() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createServiceSubscribedAppRuleBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.serviceSubscribedAppRule.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int19, v_createRequest, -, v_notifyHandler);//Service Subscribed App + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.serviceSubscribedAppRule.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_001_CIN_CNT() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createContentInstanceBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.contentInstance.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_001(int4, v_createRequest, m_createContainerBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } } + } - function f_CSE_DMR_RET_BV_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + function f_CSE_DMR_CRE_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in template (omit) RequestPrimitive p_parentRequestPrimitive := omit, in CseTester p_notifyHandler) runs on CseTester return ResponsePrimitive { // Local variables var MsgIn v_response; var RequestPrimitive v_request; - var integer v_aeIndex := -1; + var integer v_parentIndex := -1; var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; var integer v_ae2Index := -1; + var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"}; // Test control @@ -2276,212 +2210,289 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(ispresent(p_parentRequestPrimitive)) { + if(match(int23, p_parentRequestPrimitive.resourceType)){ + v_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", v_poaList), -1); // AE2 is registred + p_parentRequestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; + p_notifyHandler.start(f_cse_notifyProcedure_subscriptionVerificationHandler(v_parentIndex)); + } + v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex); + } // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_resourceIndex)))); - + + if(match(int23, p_requestPrimitive.resourceType)){ + v_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", v_poaList), -1); // AE2 is registred + p_requestPrimitive.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; + p_notifyHandler.start(f_cse_notifyProcedure_subscriptionVerificationHandler(v_parentIndex)); + } + + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Requested attribute retrieved successfuly"); + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, not only requested attribute retrieved"); - } + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource attribute"); + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } + + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if (f_isResourcePresent(v_resourceIndex)){ + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); - + vc_resourcesIndexToBeDeleted := {}; + // Tear down + //notifyHandler.stop; f_cf01Down(); + + + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_CRE_001 - }//end f_CSE_DMR_RET_BV_005 - - } // end g_CSE_DMR_RET_BV_005 + } // end g_CSE_DMR_CRE_001 + - group g_CSE_DMR_RET_BV_006 { + group g_CSE_DMR_CRE_002 { - - testcase TC_CSE_DMR_RET_BV_006_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with a non-existing resource name provided by AE + * + */ + testcase TC_CSE_DMR_CRE_002_CNT() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_allOmit; - v_contentResponse.any_1[0].Container_optional.parentID := ?; - v_contentResponse.any_1[0].Container_optional.creationTime := ?; + var ResponsePrimitive v_responsePrimitive; - f_CSE_DMR_RET_BV_006(int3, m_createContainerBase, v_contentResponse);//Container - } - - testcase TC_CSE_DMR_RET_BV_006_02() runs on CseTester system CseSystem { - // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Group_optional := mw_contentGroup_allOmit; - v_contentResponse.any_1[0].Group_optional.parentID := ?; - v_contentResponse.any_1[0].Group_optional.creationTime := ?; - - f_CSE_DMR_RET_BV_006(int9, m_createGroupBase, v_contentResponse);//Group + v_responsePrimitive := f_CSE_DMR_CRE_002(int3, m_createContainerBase);//container + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.container.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } else { + if(v_responsePrimitive.primitiveContent.container.resourceName != c_defaultContainerResourceName){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); + } + } + } } - - testcase TC_CSE_DMR_RET_BV_006_03() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_002_GRP() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; + var ResponsePrimitive v_responsePrimitive; + + v_responsePrimitive := f_CSE_DMR_CRE_002(int9, m_createGroupBase);//group + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.group_.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } else { + if(v_responsePrimitive.primitiveContent.group_.resourceName != c_defaultGroupResourceName){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); + } + } + } + } - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_allOmit; - v_contentResponse.any_1[0].AccessControlPolicy_optional.parentID := ?; - v_contentResponse.any_1[0].AccessControlPolicy_optional.creationTime := ?; - - f_CSE_DMR_RET_BV_006(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + testcase TC_CSE_DMR_CRE_002_ACP() runs on CseTester system CseSystem { + // Local variables + var ResponsePrimitive v_responsePrimitive; + + v_responsePrimitive := f_CSE_DMR_CRE_002(int1, m_createAcpBase );//accessControlPolicy + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } else { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.resourceName != c_defaultAccessControlPolicyResourceName){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); + } + } + } } - - testcase TC_CSE_DMR_RET_BV_006_04() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_002_SCH() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Schedule_optional := mw_contentSchedule_allOmit; - v_contentResponse.any_1[0].Schedule_optional.parentID := ?; - v_contentResponse.any_1[0].Schedule_optional.creationTime := ?; - - f_CSE_DMR_RET_BV_006(int18, m_createScheduleBase, v_contentResponse);//Schedule + var ResponsePrimitive v_responsePrimitive; + + v_responsePrimitive := f_CSE_DMR_CRE_002(int18, m_createScheduleBase);//Schedule + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.schedule.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } else { + if(v_responsePrimitive.primitiveContent.schedule.resourceName != c_defaultScheduleResourceName){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); + } + } + } } - - testcase TC_CSE_DMR_RET_BV_006_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_002_PCH() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].PollingChannel_optional := mw_contentPollingChannel_allOmit; - v_contentResponse.any_1[0].PollingChannel_optional.parentID := ?; - v_contentResponse.any_1[0].PollingChannel_optional.creationTime := ?; - - f_CSE_DMR_RET_BV_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel + var ResponsePrimitive v_responsePrimitive; + + v_responsePrimitive := f_CSE_DMR_CRE_002(int15, m_createPollingChannelBase);//Pollingchannel + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.pollingChannel.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } else { + if(v_responsePrimitive.primitiveContent.pollingChannel.resourceName != c_defaultPollingChannelResourceName){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); + } + } + } } - testcase TC_CSE_DMR_RET_BV_006_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_002_SUB() runs on CseTester system CseSystem { // Local variables - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].Subscription_optional := mw_contentSubscription_allOmit; - v_contentResponse.any_1[0].Subscription_optional.parentID := ?; - v_contentResponse.any_1[0].Subscription_optional.creationTime := ?; - - f_CSE_DMR_RET_BV_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + var ResponsePrimitive v_responsePrimitive; + + v_responsePrimitive := f_CSE_DMR_CRE_002(int23, m_createSubscriptionBase);//Subscription + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription.resourceName)){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not provided"); + } else { + if(v_responsePrimitive.primitiveContent.subscription.resourceName != c_defaultSubscriptionResourceName){ + setverdict(fail, __SCOPE__, ": Error, resourceName attribute not correct"); + } + } } - + } - function f_CSE_DMR_RET_BV_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { - + function f_CSE_DMR_CRE_002(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester return ResponsePrimitive{//system CseSystem { MRO system keyword not supported on functions in Titan + // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - + var integer v_resourceIndex := -1; + // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - + // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , - {"parentID", "creationTime"}, f_getOriginator(v_resourceIndex)))); - + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Requested attributes retrieved successfuly"); + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, not only requested attributes retrieved"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource attributes"); + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource attributes"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } - + + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)){ + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); - - }//end f_CSE_DMR_RET_BV_006 - - } // end g_CSE_DMR_RET_BV_006 + + return v_response.primitive.responsePrimitive; - group g_CSE_DMR_RET_BO_007 { + }//end f_CSE_DMR_CRE_002 - testcase TC_CSE_DMR_RET_BO_007_01() runs on CseTester system CseSystem { + }// end group g_CSE_DMR_CRE_002 + + group g_CSE_DMR_CRE_003 { + + /** + * @desc Check that the IUT rejects the creation of a RESOURCE_TYPE resource with an existing resource name provided by AE + * + */ + testcase TC_CSE_DMR_CRE_003_CNT() runs on CseTester system CseSystem { // Local variables - f_CSE_DMR_RET_BO_007(int3, m_createContainerBase);//Container + f_CSE_DMR_CRE_003(int3, m_createContainerBase);//container } - testcase TC_CSE_DMR_RET_BO_007_02() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_003_GRP() runs on CseTester system CseSystem { // Local variables - f_CSE_DMR_RET_BO_007(int9, m_createGroupBase);//Group + f_CSE_DMR_CRE_003(int9, m_createGroupBase);//group } - testcase TC_CSE_DMR_RET_BO_007_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_003_ACP() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_RET_BO_007(int1, m_createAcpBase);//AccessControlPolicy + + f_CSE_DMR_CRE_003(int1, m_createAcpBase);//accessControlPolicy } - - testcase TC_CSE_DMR_RET_BO_007_04() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_003_SCH() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_RET_BO_007(int18, m_createScheduleBase);//Schedule + + f_CSE_DMR_CRE_003(int18, m_createScheduleBase);//Schedule } - - testcase TC_CSE_DMR_RET_BO_007_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_003_PCH() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_RET_BO_007(int15, m_createPollingChannelBase);//PollingChannel + + f_CSE_DMR_CRE_003(int15, m_createPollingChannelBase);//Pollingchannel } - testcase TC_CSE_DMR_RET_BO_007_06() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_RET_BO_007(int23, m_createSubscriptionBase);//Subscription - } - + testcase TC_CSE_DMR_CRE_003_SUB() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_CRE_003(int23, m_createSubscriptionBase);//Subscription + } - function f_CSE_DMR_RET_BO_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + function f_CSE_DMR_CRE_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {//system CseSystem { MRO system keyword not supported on functions in Titan // Local variables var MsgIn v_response; @@ -2490,1029 +2501,789 @@ module OneM2M_Testcases { var integer v_resourceIndex := -1; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - + // Test control // Test component configuration - f_cf01Up(); + f_cf01Up(); // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), - {"lbl"}, f_getOriginator(v_resourceIndex)))); - + v_request.requestIdentifier := "Existing resource"; + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4105))) -> value v_response { tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource already exists"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving non existing resource attribute"); + setverdict(fail, __SCOPE__ & ": Error while creating an already existing resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error : attribute was retrieved while it doesn't exist"); + setverdict(fail, __SCOPE__ & ": Creating a resource that already exists"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource attribute"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); - }//end f_CSE_DMR_RET_BO_007 + }//end f_CSE_DMR_CRE_003 - } // end g_CSE_DMR_RET_BO_007 + }// end group g_CSE_DMR_CRE_003 - group g_CSE_DMR_RET_BO_008 { - + group g_CSE_DMR_CRE_004 { - testcase TC_CSE_DMR_RET_BO_008_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT rejects the creation of a RESOURCE_TYPE resource when AE has no privileges + * + */ + testcase TC_CSE_DMR_CRE_004_CNT() runs on CseTester system CseSystem { // Local variables - f_CSE_DMR_RET_BO_008(int3, m_createContainerBase);//Container + f_CSE_DMR_CRE_004(int3, m_createContainerBase);//container } - testcase TC_CSE_DMR_RET_BO_008_02() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_004_GRP() runs on CseTester system CseSystem { // Local variables - f_CSE_DMR_RET_BO_008(int9, m_createGroupBase);//Group + f_CSE_DMR_CRE_004(int9, m_createGroupBase);//group } - testcase TC_CSE_DMR_RET_BO_008_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_004_ACP() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_RET_BO_008(int1, m_createAcpBase);//AccessControlPolicy + + f_CSE_DMR_CRE_004(int1, m_createAcpBase);//accessControlPolicy } - - testcase TC_CSE_DMR_RET_BO_008_04() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_004_SCH() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_RET_BO_008(int18, m_createScheduleBase);//Schedule + + f_CSE_DMR_CRE_004(int18, m_createScheduleBase);//Schedule } - - testcase TC_CSE_DMR_RET_BO_008_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_004_PCH() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_RET_BO_008(int15, m_createPollingChannelBase);//PollingChannel + + f_CSE_DMR_CRE_004(int15, m_createPollingChannelBase);//Pollingchannel } - testcase TC_CSE_DMR_RET_BO_008_06() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_RET_BO_008(int23, m_createSubscriptionBase);//Subscription - } - + testcase TC_CSE_DMR_CRE_004_SUB() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_CRE_004(int23, m_createSubscriptionBase);//Subscription + } - function f_CSE_DMR_RET_BO_008(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + function f_CSE_DMR_CRE_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester {//system CseSystem { MRO system keyword not supported on functions in Titan // Local variables var MsgIn v_response; var RequestPrimitive v_request; + var integer v_acpAuxIndex := -1; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } // Test component configuration - f_cf01Up(); + f_cf01Up(); // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + if (p_resourceType != int23) { + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) + } else { + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int60);//c_UDNDi); + } + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -); - v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); - // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), - {"lbl", "at"}, f_getOriginator(v_resourceIndex)))); - + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to create a resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving non existing resource attributes"); + setverdict(fail, __SCOPE__ & ": Error while creating a resource without privileges"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error : attribute was retrieved while it doesn't exist"); + setverdict(fail, __SCOPE__ & ": Resource created without creation privileges"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource attributes"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); - }//end f_CSE_DMR_RET_BO_008 + }//end f_CSE_DMR_CRE_004 - } // end f_CSE_DMR_RET_BO_008 - - }//end group Retrieve + }// end group g_CSE_DMR_CRE_004 + + group g_CSE_DMR_CRE_005 { - group Update { - group g_CSE_DMR_UPD_BV_001 { - - testcase TC_CSE_DMR_UPD_BV_001_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT rejects the CREATE Request of container resource when the RW ATTRIBUTE is provided with an invalid value + * + */ + testcase TC_CSE_DMR_CRE_005_MNI() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2:= {"VALUE_2"}; - var ResponsePrimitive v_responsePrimitive; - var template RequestPrimitive v_createRequest := m_createContainerBase; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - - v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int3, v_createRequest, v_updateRequest);//Container + var AttributeAux v_invalidAttribute; + v_createRequest.primitiveContent.container.maxNrOfInstances := 0; + v_invalidAttribute := {name := "maxNrOfInstances", value_ := "-1"}; - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels != v_labels_2){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } + f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute); } - - testcase TC_CSE_DMR_UPD_BV_001_02() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_005_MBS() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"VALUE_2"}; - var template RequestPrimitive v_createRequest := m_createGroupBase; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int9, v_createRequest, v_updateRequest);//Group + var template RequestPrimitive v_createRequest := m_createContainerBase; + var AttributeAux v_invalidAttribute; - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels != v_labels_2){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } + v_createRequest.primitiveContent.container.maxByteSize := 0; + v_invalidAttribute := {name := "maxByteSize", value_ := "-1"}; + + f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute); + } - testcase TC_CSE_DMR_UPD_BV_001_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_005_MIA() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"VALUE_2"}; - var template RequestPrimitive v_createRequest := m_createAcpBase; - var template RequestPrimitive v_updateRequest := m_updateAcpBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int1, v_createRequest, v_updateRequest);//ACP + var template RequestPrimitive v_createRequest := m_createContainerBase; + var AttributeAux v_invalidAttribute; - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy)) { - if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels != v_labels_2){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } + v_createRequest.primitiveContent.container.maxInstanceAge := 0; + v_invalidAttribute := {name := "maxInstanceAge", value_ := "-1"}; + + f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute); } - testcase TC_CSE_DMR_UPD_BV_001_04() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"VALUE_2"}; - var template RequestPrimitive v_createRequest := m_createScheduleBase; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int18, v_createRequest, v_updateRequest);//Schedule - - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels != v_labels_2){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } - - } - - testcase TC_CSE_DMR_UPD_BV_001_05() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"VALUE_2"}; - var template RequestPrimitive v_createRequest := m_createPollingChannelBase; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int15, v_createRequest, v_updateRequest);//PollingChannel - - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels != v_labels_2){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } - } - - testcase TC_CSE_DMR_UPD_BV_001_06() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"VALUE_2"}; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_2; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_001(int23, v_createRequest, v_updateRequest);//Subscription - - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels != v_labels_2){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } - - } - - function f_CSE_DMR_UPD_BV_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester return ResponsePrimitive{ + function f_CSE_DMR_CRE_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_invalidAttribute) runs on CseTester { - // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - // Test control + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + + // Test control - // Test component configuration - f_cf01Up(); + // Test component configuration + f_cf01Up(); - // Test adapter configuration + // Test adapter configuration - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfuly"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + mcaPort.send(m_request(v_request, {p_invalidAttribute})); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Creation rejected for resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute " & p_invalidAttribute.name); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Accepted creation of resource type " & int2str(enum2int(p_resourceType)) & " containing an invalid value for attribute" & p_invalidAttribute.name); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); + } + } - // Postamble - f_cse_postamble_deleteResources(); + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } - // Tear down - f_cf01Down(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_CRE_005 - return v_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_UPD_BV_001 - - } // end g_CSE_DMR_UPD_BV_001 + }// end group g_CSE_DMR_CRE_005 - group g_CSE_DMR_UPD_BV_002 { + group g_CSE_DMR_CRE_006 { - testcase TC_CSE_DMR_UPD_BV_002_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT returns a default value to RW ATTRIBUTE in the response of a <container> CREATE Request where no a RW ATTRIBUTE is provided by AE + * + */ + testcase TC_CSE_DMR_CRE_006_MNI() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; - - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int3, m_createContainerBase, v_updateRequest);//Container + + v_responsePrimitive := f_CSE_DMR_CRE_006(int3, v_createRequest); if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels != v_labels_1){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } + if(not ispresent(v_responsePrimitive.primitiveContent.container.maxNrOfInstances)){ + setverdict(fail, __SCOPE__, ": Error, maxNrOfInstances attribute not provided"); + } + } } - - testcase TC_CSE_DMR_UPD_BV_002_02() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_006_MBS() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; - - v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1; - v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int9, m_createGroupBase, v_updateRequest);//Group + v_responsePrimitive := f_CSE_DMR_CRE_006(int3, v_createRequest); if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels != v_labels_1){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } + if(not ispresent(v_responsePrimitive.primitiveContent.container.maxByteSize)){ + setverdict(fail, __SCOPE__, ": Error, maxByteSize attribute not provided"); + } + } + } - testcase TC_CSE_DMR_UPD_BV_002_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_006_MIA() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var template RequestPrimitive v_createRequest := m_createContainerBase; var ResponsePrimitive v_responsePrimitive; - - v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int1, m_createAcpBase,v_updateRequest);//AccessControlPolicy + + v_responsePrimitive := f_CSE_DMR_CRE_006(int3, v_createRequest); if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels != v_labels_1){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } + if(not ispresent(v_responsePrimitive.primitiveContent.container.maxInstanceAge)){ + setverdict(fail, __SCOPE__, ": Error, maxInstanceAge attribute not provided"); + } + } } - testcase TC_CSE_DMR_UPD_BV_002_04() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; - var ResponsePrimitive v_responsePrimitive; - - v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int18, m_createScheduleBase,v_updateRequest);//Schedule + function f_CSE_DMR_CRE_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels != v_labels_1){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType))); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_aeIndex); } - } - } - } - - testcase TC_CSE_DMR_UPD_BV_002_05() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - var ResponsePrimitive v_responsePrimitive; - - v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int15, m_createPollingChannelBase,v_updateRequest);//PollingChannel - - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels != v_labels_1){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } + [] 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__ & ": Creation rejected of resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)){ + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } - } - } - - testcase TC_CSE_DMR_UPD_BV_002_06() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; - var ResponsePrimitive v_responsePrimitive; - - v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1; + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); - v_responsePrimitive := f_CSE_DMR_UPD_BV_002(int23, m_createSubscriptionBase,v_updateRequest);//Subscription + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_CRE_006 - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) { - if(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels != v_labels_1){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - } - } - } - } + }// end group g_CSE_DMR_CRE_006 + + group g_CSE_DMR_CRE_007 { - function f_CSE_DMR_UPD_BV_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester return ResponsePrimitive { - + /** + * @desc Check that the IUT responds with error when the newly created <contentInstance> results in that the field value of attribute currentNrOfInstances exceeds the field value of maxNrOfInstances in the parent container resource. + * + */ + testcase TC_CSE_DMR_CRE_007() runs on CseTester system CseSystem { // Local variables + var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - + var integer v_containerIndex := -1; + const integer c_maxNumberOfInstances := 0; // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - + v_createRequest.primitiveContent.container.maxNrOfInstances := c_maxNumberOfInstances; + + v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); + // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); - + v_request := f_getCreateRequestPrimitive(int4, m_createContentInstance(f_getResourceAddress(v_containerIndex), "MyValue"), v_containerIndex); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfuly"); + setverdict(pass, __SCOPE__ & ": Maximun number of instances exceeded"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum number of instances"); + } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } } - + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); + + }//end TC_CSE_DMR_CRE_007 - return v_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_UPD_BV_002 - - } // end g_CSE_DMR_UPD_BV_002 + }// end group g_CSE_DMR_CRE_007 - group g_CSE_DMR_UPD_BV_003 { + group g_CSE_DMR_CRE_008 { - testcase TC_CSE_DMR_UPD_BV_003_01() runs on CseTester system CseSystem { + /** + * @desc Checks that the IUT accepts a newly created contentInstance when the currentByteSize exceeds the field value set in maxByteSize in the parent container resource by removing enough of the oldest <contentInstance> resources to allow the creation of the new <contentInstance> resource. + * + */ + testcase TC_CSE_DMR_CRE_008() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var AttributeList v_nullFields; - var ResponsePrimitive v_responsePrimitive; var template RequestPrimitive v_createRequest := m_createContainerBase; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - - v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2; - - v_nullFields := {"labels"}; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int3, v_createRequest, v_updateRequest, v_nullFields);//Container + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + const integer c_maxByteSize := 0; + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) { - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels)){ - if(not(match(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels,{""}))) { - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly"); - } - } - } + v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize; + + v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); + + // Test Body + v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Maximun byte size exceeded"); } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response"); + } + + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum byte size"); + + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); + } + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); } - } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_CRE_008 + + }// end group g_CSE_DMR_CRE_008 - testcase TC_CSE_DMR_UPD_BV_003_02() runs on CseTester system CseSystem { + group g_CSE_DMR_CRE_009 { + + /** + * @desc Check that the IUT increaments and then copies the field value of attribute stateTag in parent container resource when contentInstance resource is created as the direct child of the parent container + * + */ + testcase TC_CSE_DMR_CRE_009() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var AttributeList v_nullFields; - var ResponsePrimitive v_responsePrimitive; - var template RequestPrimitive v_createRequest := m_createGroupBase; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - - v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2; - - v_nullFields := {"labels"}; + var template RequestPrimitive v_createRequest := m_createContainerBase; + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex := -1; + var template PrimitiveContent v_contentResponse; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int9, v_createRequest, v_updateRequest, v_nullFields);//Group + v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) { - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } - } - } - } + v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); - testcase TC_CSE_DMR_UPD_BV_003_03() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var AttributeList v_nullFields; - var ResponsePrimitive v_responsePrimitive; - var template RequestPrimitive v_createRequest := m_createAcpBase; - var template RequestPrimitive v_updateRequest := m_updateAcpBase; - - v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2; + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); - v_nullFields := {"labels"}; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int1, v_createRequest, v_updateRequest, v_nullFields);//AccessControlPolicy + v_contentResponse.container := mw_contentContainerBase; - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) { - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); + if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == vc_resourcesList[v_containerIndex].resource.container.stateTag + 1) { + setverdict(pass, __SCOPE__ & ": stateTag attribute increased after creation of contentInstance resource"); + } else { + setverdict(fail, __SCOPE__ & ": stateTag attribute not incremented correctly after creation of contentInstance resource"); } } - } - } - - testcase TC_CSE_DMR_UPD_BV_003_04() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var AttributeList v_nullFields; - var ResponsePrimitive v_responsePrimitive; - var template RequestPrimitive v_createRequest := m_createScheduleBase; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; - - v_createRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2; - - v_nullFields := {"labels"}; + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> 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__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + 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(); - v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int18, v_createRequest, v_updateRequest, v_nullFields);//Schedule + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_CRE_009 - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) { - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } - } - } - } + }// end group g_CSE_DMR_CRE_009 + + group g_CSE_DMR_CRE_010 { - testcase TC_CSE_DMR_UPD_BV_003_05() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT rejects the CREATE Request of a container resource named “la†as a direct child of a container resource + * + */ + testcase TC_CSE_DMR_CRE_010() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var AttributeList v_nullFields; - var ResponsePrimitive v_responsePrimitive; - var template RequestPrimitive v_createRequest := m_createPollingChannelBase; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - - v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2; + var template RequestPrimitive v_createRequest := m_createContainerBase; + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; - v_nullFields := {"labels"}; + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int15, v_createRequest, v_updateRequest, v_nullFields);//PollingChannel + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameLatest; - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) { - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } + v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'la'"); + + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'la' with wrong ResponseStatusCode"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'la'"); + + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); } - } - - testcase TC_CSE_DMR_UPD_BV_003_06() runs on CseTester system CseSystem { - // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var AttributeList v_nullFields; - var ResponsePrimitive v_responsePrimitive; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; - - v_createRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1; - v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_2; - - v_nullFields := {"labels"}; + + // Postamble + f_cse_postamble_deleteResources(); - v_responsePrimitive := f_CSE_DMR_UPD_BV_003(int23, v_createRequest, v_updateRequest, v_nullFields);//Subscription + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_CRE_010 - if(getverdict == pass){ - //Check attribute 1 - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) { - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } - } - } - } + }// end group g_CSE_DMR_CRE_010 + + group g_CSE_DMR_CRE_011 { - function f_CSE_DMR_UPD_BV_003(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on CseTester return ResponsePrimitive { - + /** + * @desc Check that the IUT rejects the CREATE Request of a container resource named “ol†as a direct child of a container resource + * + */ + testcase TC_CSE_DMR_CRE_011() runs on CseTester system CseSystem { // Local variables + var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - + var integer v_containerIndex := -1; + // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + v_createRequest.primitiveContent.container.resourceName := c_resourceShortNameOldest; - mcaPort.send(m_request(v_request, p_nullFields)); + v_request := f_getCreateRequestPrimitive(int3, v_createRequest, v_containerIndex); + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfuly"); + setverdict(pass, __SCOPE__ & ": Not allowed to create a contentInstance resource named 'ol'"); + } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": Rejected creation of contentInstance named 'ol' with wrong ResponseStatusCode"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance named 'ol'"); + } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } } - + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); + + }//end TC_CSE_DMR_CRE_011 - return v_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_UPD_BV_003 - - } // end g_CSE_DMR_UPD_BV_003 + }// end group g_CSE_DMR_CRE_011 - group g_CSE_DMR_UPD_BV_004 { + group g_CSE_DMR_CRE_012 { - testcase TC_CSE_DMR_UPD_BV_004_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT returns successfully after a CREATE request an empty content of created resource when the ResultContent set to 0 (Nothing) + * + */ + testcase TC_CSE_DMR_CRE_012_CNT() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var template RequestPrimitive v_createRequest := m_createContainerBase; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var ResponsePrimitive v_responsePrimitive; - var AttributeList_1 v_nullFields; - - v_createRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1;//Attribute 3 - v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime := "20301231T012345";//Attribute 1 - v_updateRequest.primitiveContent.any_1[0].Container_optional.maxNrOfInstances := 5;//Attribute 2 - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_2;//Attribute 3 - - v_nullFields := {"labels"}; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int3, v_createRequest, v_updateRequest, v_nullFields);//Container - - if(getverdict == pass){ - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Container_optional)) { - //Check attribute 1 - if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.expirationTime != valueof(v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime)){ - setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly") - } - //Check attribute 2 - if(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.any_1[0].Container_optional.maxNrOfInstances)){ - setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly") - } - //Check attribute 3 - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Container_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } - } - } + + f_CSE_DMR_CRE_012(int3, m_createContainerBase);//Container } - testcase TC_CSE_DMR_UPD_BV_004_02() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_012_GRP() runs on CseTester system CseSystem { // Local variables - var XSD.String v_groupName_1 := "VALUE_1"; - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - - var AttributeList_1 v_nullFields; - var template RequestPrimitive v_createRequest := m_createGroupBase; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1;//Attribute 3 - v_updateRequest.primitiveContent.any_1[0].Group_optional.expirationTime := "20301231T012345";//Attribute 1 - v_updateRequest.primitiveContent.any_1[0].Group_optional.groupName:= v_groupName_1;//Attribute 2 - v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_2;//Attribute 3 - - v_nullFields := {"labels"}; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int9, v_createRequest, v_updateRequest, v_nullFields);//Group - if(getverdict == pass){ - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Group_optional)) { - //Check attribute 1 - if(not match(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.groupName, valueof(v_updateRequest.primitiveContent.any_1[0].Group_optional.groupName))){ - setverdict(fail, testcasename() & ": Error: groupName attribute not updated correctly") - } - //Check attribute 2 - if(not match(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.expirationTime, valueof(v_updateRequest.primitiveContent.any_1[0].Group_optional.expirationTime))){ - setverdict(fail, testcasename() & ": Error: expirationTime attribute not updated correctly") - } - //Check attribute 3 - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Group_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } - } - } + f_CSE_DMR_CRE_012(int9, m_createGroupBase);//Group } - testcase TC_CSE_DMR_UPD_BV_004_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_012_ACP() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var SetOfAcrs v_privileges_2 := { // - accessControlRule_list := { - { - accessControlOriginators := {"admin:admin"}, - accessControlOperations := int61, - accessControlContexts_list := {} - } - } - } - var AttributeList_1 v_nullFields; - var template RequestPrimitive v_createRequest := m_createAcpBase;// privileges set by default to 63 for * - var template RequestPrimitive v_updateRequest := m_updateAcpBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1;//Attribute 3 - v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges := v_privileges_2; //Attribute 1 - v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo := {PX_URI_CSE};//Attribute 2 - v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_2;//Attribute 3 - - v_nullFields := {"labels"}; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int1, v_createRequest, v_updateRequest, v_nullFields);//AccessControlPolicy - - if(getverdict == pass){ - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional)) { - //Check attribute 1 - if(not match(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges, valueof(v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges))){ - setverdict(fail, testcasename() & ": Error: Privileges attribute not updated correctly") - } - //Check attribute 2 - if(not match(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo, valueof(v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.announceTo))){ - setverdict(fail, testcasename() & ": Error: Announce_to attribute not updated correctly") - } - //Check attribute 3 - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } - } - } + + f_CSE_DMR_CRE_012(int1, m_createAcpBase);//AccessControlPolicy } - testcase TC_CSE_DMR_UPD_BV_004_04() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_012_SCH() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var AttributeList_1 v_nullFields; - var template RequestPrimitive v_createRequest := m_createScheduleBase; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement := {{"0,0,0 1 2,1,1,*"}};//Attribute 1 - v_updateRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement := {{"1,1,1 1 2,1,1,*"}}; //Attribute 1 - v_updateRequest.primitiveContent.any_1[0].Schedule_optional.announceTo := {PX_URI_CSE};//Attribute 2 - v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_2;//Attribute 3 - - v_nullFields := {"labels"}; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int18, v_createRequest, v_updateRequest, v_nullFields);//Schedule - - if(getverdict == pass){ - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional)) { - //Check attribute 1 - if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.scheduleElement != valueof(v_updateRequest.primitiveContent.any_1[0].Schedule_optional.scheduleElement)){ - setverdict(fail, testcasename() & ": Error: Expiration Time attribute not updated correctly") - } - //Check attribute 2 - if(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.announceTo != valueof(v_updateRequest.primitiveContent.any_1[0].Schedule_optional.announceTo)){ - setverdict(fail, testcasename() & ": Error: MaxNrOfInstances attribute not updated correctly") - } - //Check attribute 3 - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Schedule_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } - } - } + + f_CSE_DMR_CRE_012(int18, m_createScheduleBase);//Schedule } - testcase TC_CSE_DMR_UPD_BV_004_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_012_PCH() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var Labels v_labels_2 := {"To be deleted"}; - var AcpType v_acp := {"ACP_ID"}; - var AttributeList_1 v_nullFields; - var template RequestPrimitive v_createRequest := m_createPollingChannelBase; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1;//Attribute 3 - //No Attribute 1 - //v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs := v_acp;//Attribute 2 TODO Find another alternative for Attribute 2 - v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_2;//Attribute 3 - - v_nullFields := {"labels"}; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int15, v_createRequest, v_updateRequest, v_nullFields);//PollingChannel - - if(getverdict == pass){ - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional)) { - //Check attribute 1 - - //Check attribute 2 TODO once another alternative is found, activate this checking - /*if(not match(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.accessControlPolicyIDs))){ - setverdict(fail, testcasename() & ": Error: ACPI attribute not added correctly") - }*/ - //Check attribute 3 - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].PollingChannel_optional.labels)){ - setverdict(fail, testcasename() & ": Error: Labels attribute not deleted correctly") - } - } - } - } + + f_CSE_DMR_CRE_012(int15, m_createPollingChannelBase);//PollingChannel } - testcase TC_CSE_DMR_UPD_BV_004_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_012_SUB() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var AttributeList_1 v_nullFields; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest.primitiveContent.any_1[0].Subscription_optional.expirationCounter := 10;//Attribute 3 - v_updateRequest.primitiveContent.any_1[0].Subscription_optional.expirationTime := "20301231T012345";//Attribute 1 - v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1;//Attribute 2 - v_updateRequest.primitiveContent.any_1[0].Subscription_optional.expirationCounter := 5;//Attribute 3 - - v_nullFields := {"expirationCounter"}; - - v_responsePrimitive := f_CSE_DMR_UPD_BV_004(int23, v_createRequest, v_updateRequest, v_nullFields);//Subscription - if(getverdict == pass){ - if(ispresent(v_responsePrimitive.primitiveContent)) { - if(ischosen(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional)) { - //Check attribute 1 - if(not match(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.labels, valueof(v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels))){ - setverdict(fail, testcasename() & ": Error: Labels attribute not updated correctly") - } - //Check attribute 2 - if(not match(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.expirationTime, valueof(v_updateRequest.primitiveContent.any_1[0].Subscription_optional.expirationTime))){ - setverdict(fail, testcasename() & ": Error: expirationTime attribute not updated correctly") - } - //Check attribute 3 - if(ispresent(v_responsePrimitive.primitiveContent.any_1[0].Subscription_optional.expirationCounter)){ - setverdict(fail, testcasename() & ": Error: expirationCounter attribute not deleted correctly") - } - } - } - } + f_CSE_DMR_CRE_012(int23, m_createSubscriptionBase);//Subscription } - - function f_CSE_DMR_UPD_BV_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on CseTester return ResponsePrimitive { + + function f_CSE_DMR_CRE_012(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - + // Test control // Test component configuration @@ -3522,122 +3293,113 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - + // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + v_request.resultContent := int0;//Attributes - mcaPort.send(m_request(v_request, p_nullFields)); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, omit))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No content provided with RC set to 0"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(omit))) -> 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(pass, testcasename() & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfuly"); + setverdict(fail, __SCOPE__ & ": Content provided with RC set to 0"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); - - return v_response.primitive.responsePrimitive; - - }//end f_CSE_DMR_UPD_BV_004 - } // end g_CSE_DMR_UPD_BV_004 - - group g_CSE_DMR_UPD_BI_005{ + }//end f_CSE_DMR_CRE_012 + + } // end g_CSE_DMR_CRE_012 + + group g_CSE_DMR_CRE_013 { - testcase TC_CSE_DMR_UPD_BI_005_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT returns successfully after a CREATE request only hierarchichal address of the created resource when the Result Content is set to 2 (hierarchical address) + * + */ + testcase TC_CSE_DMR_CRE_013_CNT() runs on CseTester system CseSystem { // Local variables - var XSD.PositiveInteger v_expirationCounter := 1; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - - v_updateRequest.primitiveContent.any_1 := {{Container_update_invalid := m_contentUpdateContainer_invalid}}; - - v_updateRequest.primitiveContent.any_1[0].Container_update_invalid.expirationCounter := v_expirationCounter; - - f_CSE_DMR_UPD_BI_005(int3, m_createContainerBase, v_updateRequest);//Container + var template PrimitiveContent v_contentResponse; + + v_contentResponse.uRI := mw_contentContainer_rc2; + + f_CSE_DMR_CRE_013(int3, m_createContainerBase, v_contentResponse);//Container } - testcase TC_CSE_DMR_UPD_BI_005_02() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_013_GRP() runs on CseTester system CseSystem { // Local variables - var XSD.PositiveInteger v_expirationCounter := 1; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - - v_updateRequest.primitiveContent.any_1 := {{Group_update_invalid := m_contentUpdateGroup_invalid}}; - - v_updateRequest.primitiveContent.any_1[0].Group_update_invalid.expirationCounter := v_expirationCounter; - - f_CSE_DMR_UPD_BI_005(int9, m_createGroupBase, v_updateRequest);//Group + var template PrimitiveContent v_contentResponse; + + v_contentResponse.uRI := mw_contentGroup_rc2; + + f_CSE_DMR_CRE_013(int9, m_createGroupBase, v_contentResponse);//Group } - testcase TC_CSE_DMR_UPD_BI_005_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_013_ACP() runs on CseTester system CseSystem { // Local variables - var XSD.PositiveInteger v_expirationCounter := 1; - var template RequestPrimitive v_updateRequest := m_updateAcpBase; - - v_updateRequest.primitiveContent.any_1 := {{ACP_update_invalid := m_contentUpdateAcp_invalid}}; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.uRI := mw_contentAcp_rc2; - v_updateRequest.primitiveContent.any_1[0].ACP_update_invalid.expirationCounter := v_expirationCounter; - - f_CSE_DMR_UPD_BI_005(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy + f_CSE_DMR_CRE_013(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy } - testcase TC_CSE_DMR_UPD_BI_005_04() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_013_SCH() runs on CseTester system CseSystem { // Local variables - var XSD.PositiveInteger v_expirationCounter := 1; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.uRI := mw_contentSchedule_rc2; - v_updateRequest.primitiveContent.any_1 := {{Schedule_update_invalid := m_contentUpdateSchedule_invalid}}; - - v_updateRequest.primitiveContent.any_1[0].Schedule_update_invalid.expirationCounter := v_expirationCounter; - - f_CSE_DMR_UPD_BI_005(int18, m_createScheduleBase, v_updateRequest);//Schedule + f_CSE_DMR_CRE_013(int18, m_createScheduleBase, v_contentResponse);//Schedule } - testcase TC_CSE_DMR_UPD_BI_005_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_013_PCH() runs on CseTester system CseSystem { // Local variables - var XSD.PositiveInteger v_expirationCounter := 1; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - - v_updateRequest.primitiveContent.any_1 := {{PollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}}; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.uRI := mw_contentPollingChannel_rc2; - v_updateRequest.primitiveContent.any_1[0].PollingChannel_update_invalid.expirationCounter := v_expirationCounter; - - f_CSE_DMR_UPD_BI_005(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel + f_CSE_DMR_CRE_013(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel } - testcase TC_CSE_DMR_UPD_BI_005_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_013_SUB() runs on CseTester system CseSystem { // Local variables - var XSD.NonNegativeInteger v_maxNrOfInstances := 5; - var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.uRI := mw_contentSubscription_rc2; - v_updateRequest.primitiveContent.any_1 := {{Subscription_update_invalid := m_contentUpdateSubscription_invalid}}; - - v_updateRequest.primitiveContent.any_1[0].Subscription_update_invalid.maxNrOfInstances := v_maxNrOfInstances; - - f_CSE_DMR_UPD_BI_005(int23, m_createSubscriptionBase, v_updateRequest);//Subscription + f_CSE_DMR_CRE_013(int23, m_createSubscriptionBase, v_contentResponse);//Subscription } - - function f_CSE_DMR_UPD_BI_005(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester { + + function f_CSE_DMR_CRE_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var CseTester v_notifyHandler; // Test control @@ -3648,123 +3410,121 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_aeIndex, p_updateRequestPrimitive); - v_request.to_ := v_request.to_ & "/" & c_defaultResourceName; + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + v_request.resultContent := int2;//Attributes mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found"); + if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRI)) { + setverdict(pass, __SCOPE__ & ": Response returning correctly only the hierarchical address of the created resource"); + } else { + setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format"); + } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 2"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); - - }//end f_CSE_DMR_UPD_BI_005 - } // end g_CSE_DMR_UPD_BI_005 - - group g_CSE_DMR_UPD_BO_006{ + }//end f_CSE_DMR_CRE_013 + + } // end g_CSE_DMR_CRE_013 + + group g_CSE_DMR_CRE_014 { - testcase TC_CSE_DMR_UPD_BO_006_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT returns successfully after a CREATE request only attributes and hierarchichal address of the created resource when Result Content is set 3 (attributes and hierarchichal address) + * + */ + testcase TC_CSE_DMR_CRE_014_CNT() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - - f_CSE_DMR_UPD_BO_006(int3, m_createContainerBase, v_updateRequest);//Container + var template PrimitiveContent v_contentResponse; + + v_contentResponse.resource := mw_contentContainer_rc3; + + f_CSE_DMR_CRE_014(int3, m_createContainerBase, v_contentResponse);//Container } - testcase TC_CSE_DMR_UPD_BO_006_02() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_014_GRP() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - - v_updateRequest.primitiveContent.any_1[0].Group_optional.labels := v_labels_1; - - f_CSE_DMR_UPD_BO_006(int9, m_createGroupBase, v_updateRequest);//Group + var template PrimitiveContent v_contentResponse; + + v_contentResponse.resource := mw_contentGroup_rc3; + + f_CSE_DMR_CRE_014(int9, m_createGroupBase, v_contentResponse);//Group } - testcase TC_CSE_DMR_UPD_BO_006_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_014_ACP() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateAcpBase; - var template RequestPrimitive v_requestPrimitive := m_createAcpBase; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.resource := mw_contentAcp_rc3; - v_requestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list[0].accessControlOperations := int59; - - v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.labels := v_labels_1; - - f_CSE_DMR_UPD_BO_006(int1, v_requestPrimitive, v_updateRequest);//AccessControlPolicy + f_CSE_DMR_CRE_014(int1, m_createAcpBase,v_contentResponse);//AccessControlPolicy } - testcase TC_CSE_DMR_UPD_BO_006_04() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_014_SCH() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; - - v_updateRequest.primitiveContent.any_1[0].Schedule_optional.labels := v_labels_1; - - f_CSE_DMR_UPD_BO_006(int18, m_createScheduleBase, v_updateRequest);//Schedule + var template PrimitiveContent v_contentResponse; + + v_contentResponse.resource := mw_contentSchedule_rc3; + + f_CSE_DMR_CRE_014(int18, m_createScheduleBase, v_contentResponse);//Schedule } - testcase TC_CSE_DMR_UPD_BO_006_05() runs on CseTester system CseSystem { - // Local variable - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - - v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.labels := v_labels_1; - - f_CSE_DMR_UPD_BO_006(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel + testcase TC_CSE_DMR_CRE_014_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.resource := mw_contentPollingChannel_rc3; + + f_CSE_DMR_CRE_014(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel } - testcase TC_CSE_DMR_UPD_BO_006_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_014_SUB() runs on CseTester system CseSystem { // Local variables - var Labels v_labels_1 := {"VALUE_1"}; - var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; - - v_updateRequest.primitiveContent.any_1[0].Subscription_optional.labels := v_labels_1; - - f_CSE_DMR_UPD_BO_006(int23, m_createSubscriptionBase, v_updateRequest);//Subscription - } + var template PrimitiveContent v_contentResponse; - function f_CSE_DMR_UPD_BO_006(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester { + v_contentResponse.resource := mw_contentSubscription_rc3; + + f_CSE_DMR_CRE_014(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + } + + function f_CSE_DMR_CRE_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { // Local variables var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_acpAuxIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; var integer v_ae2Index := -1; - + var CseTester v_notifyHandler; + // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } // Test component configuration f_cf01Up(); @@ -3772,1146 +3532,9501 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int59);//c_CRDNDi) - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi); + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_aeIndex); + v_request.resultContent := int3;//Attributes + Hierarchichal Address mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, p_contentResponse))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Access denied to update attributes from resource type " & int2str(enum2int(p_resourceType))); + if(f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.resource.uRI)) { + setverdict(pass, __SCOPE__ & ": Response returning correctly the hierarchical address of the created resource and resource representation"); + } else { + setverdict(fail, __SCOPE__ & ": Response returning the address of the created resource with wrong format"); + } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating attributes from resource without having privileges"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong content provided with RC set to 3"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Updating attributes from resource without having privileges"); + setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); - - }//end f_CSE_DMR_UPD_BO_006 - } // end g_CSE_DMR_UPD_BO_006 - + }//end f_CSE_DMR_CRE_014 + + } // end g_CSE_DMR_CRE_014 - group g_CSE_DMR_UPD_BO_007{ + group g_CSE_DMR_CRE_015 { - testcase TC_CSE_DMR_UPD_BO_007_01() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute OPTIONAL_ATTRIBUTE provided + * + */ + testcase TC_CSE_DMR_CRE_015_CNT_ACPI() runs on CseTester system CseSystem { // Local variables - var Timestamp v_creationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - - v_updateRequest.primitiveContent.any_1 := {{Container_update_invalid := m_contentUpdateContainer_invalid}}; - v_updateRequest.primitiveContent.any_1[0].Container_update_invalid.creationTime := v_creationTime; + var template RequestPrimitive v_createRequest := m_createContainerBase; + const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit}; + + v_createRequest.primitiveContent.container.accessControlPolicyIDs := {"NotInitialized"}; - f_CSE_DMR_UPD_BO_007(int3, m_createContainerBase, v_updateRequest);//Container + f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute); } - - testcase TC_CSE_DMR_UPD_BO_007_02() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_015_CNT_ET() runs on CseTester system CseSystem { // Local variables - var Timestamp v_creationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - - v_updateRequest.primitiveContent.any_1 := {{Group_update_invalid := m_contentUpdateGroup_invalid}}; - v_updateRequest.primitiveContent.any_1[0].Group_update_invalid.creationTime := v_creationTime; + var template RequestPrimitive v_createRequest := m_createContainerBase; + const AttributeAux c_optionalAttribute := {"expirationTime", omit}; - f_CSE_DMR_UPD_BO_007(int9, m_createGroupBase, v_updateRequest);//Group + v_createRequest.primitiveContent.container.expirationTime := "20301231T012345"; + + f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute); + } - testcase TC_CSE_DMR_UPD_BO_007_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_015_CNT_LBL() runs on CseTester system CseSystem { // Local variables - var Timestamp v_creationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateAcpBase; - - v_updateRequest.primitiveContent.any_1 := {{ACP_update_invalid := m_contentUpdateAcp_invalid}}; - v_updateRequest.primitiveContent.any_1[0].ACP_update_invalid.creationTime := v_creationTime; - - f_CSE_DMR_UPD_BO_007(int1, m_createAcpBase, v_updateRequest);//AccessControlPolicy + var template RequestPrimitive v_createRequest := m_createContainerBase; + const AttributeAux c_optionalAttribute := {"labels", omit}; + + v_createRequest.primitiveContent.container.labels := {"MyLabel"}; + + f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute); + } - - testcase TC_CSE_DMR_UPD_BO_007_04() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_015_CNT_MNI() runs on CseTester system CseSystem { // Local variables - var Timestamp v_creationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; - - v_updateRequest.primitiveContent.any_1 := {{Schedule_update_invalid := m_contentUpdateSchedule_invalid}}; - v_updateRequest.primitiveContent.any_1[0].Schedule_update_invalid.creationTime := v_creationTime; - - f_CSE_DMR_UPD_BO_007(int18, m_createScheduleBase, v_updateRequest);//Schedule + var template RequestPrimitive v_createRequest := m_createContainerBase; + const AttributeAux c_optionalAttribute := {"maxNrOfInstances", omit}; + + v_createRequest.primitiveContent.container.maxNrOfInstances := 0; + + f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute); + } - testcase TC_CSE_DMR_UPD_BO_007_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_015_CNT_MBS() runs on CseTester system CseSystem { // Local variables - var Timestamp v_creationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - - v_updateRequest.primitiveContent.any_1 := {{PollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}}; - v_updateRequest.primitiveContent.any_1[0].PollingChannel_update_invalid.creationTime := v_creationTime; - - f_CSE_DMR_UPD_BO_007(int15, m_createPollingChannelBase, v_updateRequest);//PollingChannel + var template RequestPrimitive v_createRequest := m_createContainerBase; + const AttributeAux c_optionalAttribute := {"maxByteSize", omit}; + + v_createRequest.primitiveContent.container.maxByteSize := 0; + + f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute); + } - testcase TC_CSE_DMR_UPD_BO_007_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_015_CNT_MIA() runs on CseTester system CseSystem { // Local variables - var Timestamp v_creationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; - - v_updateRequest.primitiveContent.any_1 := {{Subscription_update_invalid := m_contentUpdateSubscription_invalid}}; - v_updateRequest.primitiveContent.any_1[0].Subscription_update_invalid.creationTime := v_creationTime; - - f_CSE_DMR_UPD_BO_007(int23, m_createSubscriptionBase, v_updateRequest);//Subscription - } + var template RequestPrimitive v_createRequest := m_createContainerBase; + const AttributeAux c_optionalAttribute := {"maxInstanceAge", omit}; + + v_createRequest.primitiveContent.container.maxInstanceAge := 0; + + f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute); + + } - function f_CSE_DMR_UPD_BO_007(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester { - + testcase TC_CSE_DMR_CRE_015_CNT_OR() runs on CseTester system CseSystem { // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + var template RequestPrimitive v_createRequest := m_createContainerBase; + const AttributeAux c_optionalAttribute := {"ontologyRef", omit}; - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + v_createRequest.primitiveContent.container.ontologyRef := "MyOntologyRef"; - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + f_CSE_DMR_CRE_015(int3, v_createRequest, c_optionalAttribute); - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Operation not allowed. RO attribute from resource type " & int2str(enum2int(p_resourceType)) ); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating RO attribute"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Updating RO attribute from resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - // Postamble - f_cse_postamble_deleteResources(); + } + + testcase TC_CSE_DMR_CRE_015_CIN_ET() runs on CseTester system CseSystem {//TODO + // Local variables + var template RequestPrimitive v_createRequest := m_createContentInstanceBase; + const AttributeAux c_optionalAttribute := {"expirationTime", omit}; - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_UPD_BO_007 - - } // end g_CSE_DMR_UPD_BO_007 - - group g_CSE_DMR_UPD_BO_008{ + v_createRequest.primitiveContent.contentInstance.expirationTime := "20301231T012345"; + + f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute); + } - testcase TC_CSE_DMR_UPD_BO_008_01() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_015_CIN_LBL() runs on CseTester system CseSystem {//TODO // Local variables - var Timestamp v_expirationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var AttributeList_1 v_nullFields; + var template RequestPrimitive v_createRequest := m_createContentInstanceBase; + const AttributeAux c_optionalAttribute := {"labels", omit}; - v_nullFields := {"expirationTime"}; - - v_updateRequest.primitiveContent.any_1[0].Container_optional.expirationTime := v_expirationTime; + v_createRequest.primitiveContent.contentInstance.labels := {"MyLabel"}; - f_CSE_DMR_UPD_BO_008(int3, m_createContainerBase, v_updateRequest, v_nullFields);//Container + f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute); + } - - testcase TC_CSE_DMR_UPD_BO_008_02() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_015_CIN_CR() runs on CseTester system CseSystem {//TODO // Local variables - var Timestamp v_expirationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - var AttributeList_1 v_nullFields; - - v_nullFields := {"expirationTime"}; + var template RequestPrimitive v_createRequest := m_createContentInstanceBase; + const AttributeAux c_optionalAttribute := {"creator", omit}; + + v_createRequest.primitiveContent.contentInstance.creator := "MyCreator"; - v_updateRequest.primitiveContent.any_1[0].Group_optional.expirationTime := v_expirationTime; + f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute); - f_CSE_DMR_UPD_BO_008(int9, m_createGroupBase, v_updateRequest, v_nullFields);//Group } - testcase TC_CSE_DMR_UPD_BO_008_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_015_CIN_CNF() runs on CseTester system CseSystem {//TODO // Local variables - var Timestamp v_expirationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateAcpBase; - var AttributeList_1 v_nullFields; - - v_nullFields := {"expirationTime"}; + var template RequestPrimitive v_createRequest := m_createContentInstanceBase; + const AttributeAux c_optionalAttribute := {"contentInfo", omit}; + + v_createRequest.primitiveContent.contentInstance.contentInfo := "MyContentInfo"; + + f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute); - v_updateRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.expirationTime := v_expirationTime; - - f_CSE_DMR_UPD_BO_008(int1, m_createAcpBase, v_updateRequest, v_nullFields);//AccessControlPolicy } - - testcase TC_CSE_DMR_UPD_BO_008_04() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_015_CIN_OR() runs on CseTester system CseSystem {//TODO // Local variables - var Timestamp v_expirationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateScheduleBase; - var AttributeList_1 v_nullFields; - - v_nullFields := {"expirationTime"}; + var template RequestPrimitive v_createRequest := m_createContentInstanceBase; + const AttributeAux c_optionalAttribute := {"ontologyRef", omit}; + + v_createRequest.primitiveContent.contentInstance.ontologyRef := "MyOntologyRef"; + + f_CSE_DMR_CRE_015(int4, v_createRequest, c_optionalAttribute); - v_updateRequest.primitiveContent.any_1[0].Schedule_optional.expirationTime := v_expirationTime; - - f_CSE_DMR_UPD_BO_008(int18, m_createScheduleBase, v_updateRequest, v_nullFields);//Schedule } - testcase TC_CSE_DMR_UPD_BO_008_05() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_015_ACP_ET() runs on CseTester system CseSystem { // Local variables - var Timestamp v_expirationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; - var AttributeList_1 v_nullFields; - - v_nullFields := {"expirationTime"}; + var template RequestPrimitive v_createRequest := m_createAcpBase; + const AttributeAux c_optionalAttribute := {"expirationTime", omit}; + + v_createRequest.primitiveContent.accessControlPolicy.expirationTime := "20301231T012345"; + + f_CSE_DMR_CRE_015(int1, v_createRequest, c_optionalAttribute); - v_updateRequest.primitiveContent.any_1[0].PollingChannel_optional.expirationTime := v_expirationTime; - - f_CSE_DMR_UPD_BO_008(int15, m_createPollingChannelBase, v_updateRequest, v_nullFields);//PollingChannel } - testcase TC_CSE_DMR_UPD_BO_008_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_015_ACP_LBL() runs on CseTester system CseSystem { // Local variables - var Timestamp v_expirationTime := "20001231T012345"; - var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; - var AttributeList_1 v_nullFields; - - v_nullFields := {"expirationTime"}; + var template RequestPrimitive v_createRequest := m_createAcpBase; + const AttributeAux c_optionalAttribute := {"labels", omit}; - v_updateRequest.primitiveContent.any_1[0].Subscription_optional.expirationTime := v_expirationTime; - - f_CSE_DMR_UPD_BO_008(int23, m_createSubscriptionBase, v_updateRequest, v_nullFields);//Subscription - } + v_createRequest.primitiveContent.accessControlPolicy.labels := {"MyLabel"}; + + f_CSE_DMR_CRE_015(int1, v_createRequest, c_optionalAttribute); + + } - function f_CSE_DMR_UPD_BO_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeList_1 p_nullFields := omit) runs on CseTester { - + testcase TC_CSE_DMR_CRE_015_SUB_ACPI() runs on CseTester system CseSystem { // Local variables - var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"accessControlPolicyIDs", omit}; - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := {"NotInitialized"}; - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + } + + testcase TC_CSE_DMR_CRE_015_SUB_ET() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"expirationTime", omit}; - mcaPort.send(m_request(v_request,p_nullFields)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Operation not allowed. Mandatory RW attribute from resource type " & int2str(enum2int(p_resourceType)) ); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting mandatory RW attribute"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Deleting a mandatory RW attribute from resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); - } - } - - // Postamble - f_cse_postamble_deleteResources(); + v_createRequest.primitiveContent.subscription.expirationTime := "20301231T012345"; - // Tear down - f_cf01Down(); - - }//end f_CSE_DMR_UPD_BO_008 - - } // end g_CSE_DMR_UPD_BO_008 - - group g_CSE_DMR_UPD_BV_009{ - - testcase TC_CSE_DMR_UPD_BV_009() runs on CseTester system CseSystem { - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - if(ispresent(vc_resourcesList[v_containerIndex].resource.any_1[0].Container_optional.stateTag)) { - - v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequest); - f_cse_updateResource(v_updateRequest); - - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); - + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_LBL() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"labels", omit}; + + v_createRequest.primitiveContent.subscription.labels := {"MyLabel"}; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_ENC() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"eventNotificationCriteria", omit}; + + v_createRequest.primitiveContent.subscription.eventNotificationCriteria := valueof(m_eventNotificationCriteria({int1}, -)); + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_EXC() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"expirationCounter", omit}; + + v_createRequest.primitiveContent.subscription.expirationCounter := 1; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_GPI() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"groupID", omit}; + + v_createRequest.primitiveContent.subscription.groupID := "MyGroupID"; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_NFU() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"notificationForwardingURI", omit}; + + v_createRequest.primitiveContent.subscription.notificationForwardingURI := "MyForwardingURI"; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_BN() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"batchNotify", omit}; + + v_createRequest.primitiveContent.subscription.batchNotify := {0, "PT1S"}; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_RL() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"rateLimit", omit}; + + v_createRequest.primitiveContent.subscription.rateLimit := {0, omit}; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_PSN() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"preSubscriptionNotify", omit}; + + v_createRequest.primitiveContent.subscription.preSubscriptionNotify := 1; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_PN() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"pendingNotification", omit}; + + v_createRequest.primitiveContent.subscription.pendingNotification := int1; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + } + + testcase TC_CSE_DMR_CRE_015_SUB_NSP() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"notificationStoragePriority", omit}; + + v_createRequest.primitiveContent.subscription.notificationStoragePriority := 1; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_LN() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"latestNotify", omit}; + + v_createRequest.primitiveContent.subscription.latestNotify := true; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_NCT() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"notificationContentType", omit}; + + v_createRequest.primitiveContent.subscription.notificationContentType := int1; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_NEC() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"notificationEventCat", omit}; + + v_createRequest.primitiveContent.subscription.notificationEventCat := {alt_1 := 100}; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_CR() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"creator", omit}; + + v_createRequest.primitiveContent.subscription.creator := "MyCreator"; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + testcase TC_CSE_DMR_CRE_015_SUB_SU() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + const AttributeAux c_optionalAttribute := {"subscriberURI", omit}; + + v_createRequest.primitiveContent.subscription.subscriberURI := "MySubscriberURI"; + + f_CSE_DMR_CRE_015(int23, v_createRequest, c_optionalAttribute); + + } + + function f_CSE_DMR_CRE_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, in AttributeAux p_optionalAttribute) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_containerIndex := -1; + var integer v_parentIndex := -1; + var integer v_acpAuxIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs"; + var integer v_resourceIndex := -1; + + // Test control + if(match(c_accessControlPolicyIDs,p_optionalAttribute.name)) { + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + if (match(c_accessControlPolicyIDs, p_optionalAttribute.name)) { + v_acpAuxIndex := f_cse_preamble_createAcpAux();//c_CRUDNDi) + } + + v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_parentIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + + if(p_resourceType == int4) { + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); + v_parentIndex := v_containerIndex; + } + + // Test Body + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & p_optionalAttribute.name); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, p_resourceType, v_parentIndex); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> 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; - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Container_optional.stateTag == 1) { //(Create and Delete) - setverdict(pass, testcasename() & ": The stateTag attribute is incremented"); - } - else{ - setverdict(fail, testcasename() & ": Error the stateTag attribute is not incremented"); - } + setverdict(fail, __SCOPE__ & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " with incorrect attributes"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource attributes"); + setverdict(fail, __SCOPE__ & ": Rejected creation of resource type " & int2str(enum2int(p_resourceType))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource attributes"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } + + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_CRE_015 + + }// end group g_CSE_DMR_CRE_015 - }//end if - else{ - setverdict(fail, testcasename() & ": Error the stateTag attribute is empty"); - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end TC_CSE_DMR_UPD_BV_009 + group g_CSE_DMR_CRE_016 { - } // end group g_CSE_DMR_UPD_BV_009 - - }//end group Update - - group Delete { - - group g_CSE_DMR_DEL_BV_001{ + /** + * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute announceTo provided + * + */ + testcase TC_CSE_DMR_CRE_016_ACP() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createAcpBase; + + v_createRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()}; + + f_CSE_DMR_CRE_016(int1, v_createRequest, mw_createAccessControlPolicyAnnc);//AccessControlPolicy + } - testcase TC_CSE_DMR_DEL_BV_001_01() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_016_CNT() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_001(int3, m_createContainerBase);//Container - - if(getverdict == pass){ - //check if "MyRessource" container resource isn't present in the IUT (for exemple attempt to update the resource) - }; - }; - - testcase TC_CSE_DMR_DEL_BV_001_02() runs on CseTester system CseSystem { + var template RequestPrimitive v_createRequest := m_createContainerBase; + + v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()}; + + f_CSE_DMR_CRE_016(int3, v_createRequest, mw_createContainerAnncBase);//Container + } + + testcase TC_CSE_DMR_CRE_016_CIN() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_001(int9, m_createGroupBase);//Group - }; - - testcase TC_CSE_DMR_DEL_BV_001_03() runs on CseTester system CseSystem { + var template RequestPrimitive v_createRequest := m_createContentInstanceBase; + + v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()}; + + f_CSE_DMR_CRE_016(int4, v_createRequest, mw_createContentInstanceAnncBase);//ContentInstance + } + + testcase TC_CSE_DMR_CRE_016_GRP() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_001(int1, m_createAcpBase);//AccessControlPolicy - }; - - testcase TC_CSE_DMR_DEL_BV_001_04() runs on CseTester system CseSystem { + var template RequestPrimitive v_createRequest := m_createGroupBase; + + v_createRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()}; + + f_CSE_DMR_CRE_016(int9, v_createRequest, mw_createGroupAnncBase);//Group + } + + testcase TC_CSE_DMR_CRE_016_LCP() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_001(int18, m_createScheduleBase);//Schedule - }; - - testcase TC_CSE_DMR_DEL_BV_001_05() runs on CseTester system CseSystem { + var template RequestPrimitive v_createRequest := m_createLocationPolicy(int1, omit, omit, omit, omit); + + v_createRequest.primitiveContent.locationPolicy.announceTo := {f_getAnnouncementTargetPoA()}; + + f_CSE_DMR_CRE_016(int10, v_createRequest, mw_createLocationPolicyAnncBase);//LocationPolicy + } + + testcase TC_CSE_DMR_CRE_016_MGO() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_001(int15, m_createPollingChannelBase);//PollingChannel - }; - - testcase TC_CSE_DMR_DEL_BV_001_06() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_DEL_BV_001(int23, m_createSubscriptionBase);//Subscription - }; - - - - function f_CSE_DMR_DEL_BV_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on CseTester { + var template RequestPrimitive v_createRequest := m_createMgmtObjBase; + + v_createRequest.primitiveContent.mgmtResource.announceTo := {f_getAnnouncementTargetPoA()}; + + f_CSE_DMR_CRE_016(int13, v_createRequest, mw_createMgmtObjAnncBase);//MgmtObj + } + + testcase TC_CSE_DMR_CRE_016_NOD() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createNodeBase; + + v_createRequest.primitiveContent.node.announceTo := {f_getAnnouncementTargetPoA()}; + + f_CSE_DMR_CRE_016(int14, v_createRequest, mw_createNodeAnnc);//Node + } + + testcase TC_CSE_DMR_CRE_016_SCH() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createScheduleBase; + + v_createRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()}; + + f_CSE_DMR_CRE_016(int18, v_createRequest, mw_createScheduleAnncBase);//Schedule + } + + function f_CSE_DMR_CRE_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on CseTester { + // Local variables var MsgIn v_response; var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - + var integer v_parentIndex := -1; + var integer v_containerIndex := -1; + // Test control - + // Test component configuration - f_cf01Up(); - + f_cf02Up(); + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) + v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - + if(p_resourceType == int4) { + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); + v_parentIndex := v_containerIndex; + } + // Test Body - v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); - + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mccPort.receive(mw_request(p_requestAnnc)) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource" & int2str(enum2int(p_resourceType)) & " deleted successfuly"); + setverdict(pass, __SCOPE__ & ": Correct CREATE request for the resource announced variant"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mccPort.receive(mw_request(?)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": Wrong CREATE request received"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } - + // Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - - };//end f_CSE_DMR_DEL_BV_001 - - };//end of group g_CSE_DMR_DEL_BV_001 - - group g_CSE_DMR_DEL_BV_002{ - - testcase TC_CSE_DMR_DEL_BV_002_01() runs on CseTester system CseSystem { + f_cf02Down(); + + }//end f_CSE_DMR_CRE_016 + + } // end g_CSE_DMR_CRE_016 + + group g_CSE_DMR_CRE_017 { + + /** + * @desc Check that the IUT accepts the creation of a RESOURCE_TYPE resource with the optional attribute announcedAttribute provided + * + */ + testcase TC_CSE_DMR_CRE_017_CNT() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_002(int3, m_createContainerBase);//Container - }; - - testcase TC_CSE_DMR_DEL_BV_002_02() runs on CseTester system CseSystem { + var template RequestPrimitive v_createRequest := m_createContainerBase; + var RequestPrimitive v_requestPrimitive; + var XSD.NonNegativeInteger maxByteSize := 512; //Correct value? Shall be indicated in TP? + + v_createRequest.primitiveContent.container.announceTo := {f_getAnnouncementTargetPoA()}; + v_createRequest.primitiveContent.container.maxByteSize := maxByteSize; + v_createRequest.primitiveContent.container.announcedAttribute := {"maxByteSize"}; //Correct value? Shall be indicated in TP? + + v_requestPrimitive := f_CSE_DMR_CRE_017(int3, v_createRequest, mw_createContainerAnncBase());//Container + + if(getverdict == pass){ + //Check if maxByteSize attribute has been announced + if (ispresent(v_requestPrimitive.primitiveContent.containerAnnc.maxByteSize)){ + if(v_requestPrimitive.primitiveContent.containerAnnc.maxByteSize != maxByteSize){ + setverdict(fail, __SCOPE__ & ": Error: Value of maxByteSize has not been announced successfully"); + }else{ + setverdict(pass, __SCOPE__ & ": Value of maxByteSize has been announced successfully"); + } + }else{ + setverdict(fail, __SCOPE__ & ": Error: maxByteSize has not been announced"); + } + } + } + + testcase TC_CSE_DMR_CRE_017_CIN() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_002(int9, m_createGroupBase);//Group - }; - - testcase TC_CSE_DMR_DEL_BV_002_03() runs on CseTester system CseSystem { + var template RequestPrimitive v_createRequest := m_createContentInstanceBase; + var RequestPrimitive v_requestPrimitive; + var XSD.NonNegativeInteger v_contentSize := 512; //Correct value? Shall be indicated in TP? + + v_createRequest.primitiveContent.contentInstance.announceTo := {f_getAnnouncementTargetPoA()}; + v_createRequest.primitiveContent.contentInstance.contentSize := v_contentSize; + v_createRequest.primitiveContent.contentInstance.announcedAttribute := {"contentSize"}; //Correct value? Shall be indicated in TP? + + v_requestPrimitive := f_CSE_DMR_CRE_017(int4, v_createRequest, mw_createContentInstanceAnncBase());//ContentInstance + + if(getverdict == pass){ + //Check if contentSize attribute has been announced + if (ispresent(v_requestPrimitive.primitiveContent.contentInstanceAnnc.contentSize)){ + if(v_requestPrimitive.primitiveContent.contentInstanceAnnc.contentSize != v_contentSize){ + setverdict(fail, __SCOPE__ & ": Error: Value of contentSize has not been announced successfully"); + }else{ + setverdict(pass, __SCOPE__ & ": Value of contentSize has been announced successfully"); + } + }else{ + setverdict(fail, __SCOPE__ & ": Error: contentSize has not been announced"); + } + } + } + + testcase TC_CSE_DMR_CRE_017_GRP() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_002(int1, m_createAcpBase);//AccessControlPolicy - }; - - testcase TC_CSE_DMR_DEL_BV_002_04() runs on CseTester system CseSystem { + var template RequestPrimitive v_createRequest := m_createGroupBase; + var RequestPrimitive v_requestPrimitive; + var XSD.PositiveInteger maxNrOfMembers := 10; //Correct value? Shall be indicated in TP? + + v_createRequest.primitiveContent.group_.announceTo := {f_getAnnouncementTargetPoA()}; + v_createRequest.primitiveContent.group_.maxNrOfMembers := maxNrOfMembers; + v_createRequest.primitiveContent.group_.announcedAttribute := {"maxNrOfMembers"}; //Correct value? Shall be indicated in TP? + + v_requestPrimitive := f_CSE_DMR_CRE_017(int9, v_createRequest, mw_createGroupAnncBase());//Group + + if(getverdict == pass){ + //Check if maxNrOfMembers attribute has been announced + if (ispresent(v_requestPrimitive.primitiveContent.groupAnnc.maxNrOfMembers)){ + if(v_requestPrimitive.primitiveContent.groupAnnc.maxNrOfMembers != maxNrOfMembers){ + setverdict(fail, __SCOPE__ & ": Error: Value of maxNrOfMembers has not been announced successfully"); + }else{ + setverdict(pass, __SCOPE__ & ": Value of maxNrOfMembers has been announced successfully"); + } + }else{ + setverdict(fail, __SCOPE__ & ": Error: maxNrOfMembers has not been announced"); + } + } + } + + testcase TC_CSE_DMR_CRE_017_LCP() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_002(int18, m_createScheduleBase);//Schedule - }; - - testcase TC_CSE_DMR_DEL_BV_002_05() runs on CseTester system CseSystem { + var template RequestPrimitive v_createRequest := m_createLocationPolicy(int1, omit, omit, omit, omit); + var RequestPrimitive v_requestPrimitive; + var LocationSource locationSource := int1;//Network-based //Correct value? Shall be indicated in TP? + + v_createRequest.primitiveContent.locationPolicy.announceTo := {f_getAnnouncementTargetPoA()}; + v_createRequest.primitiveContent.locationPolicy.locationSource := locationSource; + v_createRequest.primitiveContent.locationPolicy.announcedAttribute := {"locationSource"}; //Correct value? Shall be indicated in TP? + + v_requestPrimitive := f_CSE_DMR_CRE_017(int10, v_createRequest, mw_createLocationPolicyAnncBase());//LocationPolicy + + if(getverdict == pass){ + //Check if locationSource attribute has been announced + if (ispresent(v_requestPrimitive.primitiveContent.locationPolicyAnnc.locationSource)){ + if(v_requestPrimitive.primitiveContent.locationPolicyAnnc.locationSource != locationSource){ + setverdict(fail, __SCOPE__ & ": Error: Value of locationSource has not been announced successfully"); + }else{ + setverdict(pass, __SCOPE__ & ": Value of locationSource has been announced successfully"); + } + }else{ + setverdict(fail, __SCOPE__ & ": Error: locationSource has not been announced"); + } + } + } + + testcase TC_CSE_DMR_CRE_017_MGO() runs on CseTester system CseSystem { // Local variables - - f_CSE_DMR_DEL_BV_002(int15, m_createPollingChannelBase);//PollingChannel - }; - - testcase TC_CSE_DMR_DEL_BV_002_06() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_DEL_BV_002(int23, m_createSubscriptionBase);//Subscription - }; - - - function f_CSE_DMR_DEL_BV_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on CseTester { + var template RequestPrimitive v_createRequest := m_createMgmtObjBase; + var RequestPrimitive v_requestPrimitive; + var XSD.String description := "Description of mgmtObj"; //Correct value? Shall be indicated in TP? + + v_createRequest.primitiveContent.mgmtResource.announceTo := {f_getAnnouncementTargetPoA()}; + v_createRequest.primitiveContent.mgmtResource.description := description; + v_createRequest.primitiveContent.mgmtResource.announcedAttribute := {"description"}; //Correct value? Shall be indicated in TP? + + v_requestPrimitive := f_CSE_DMR_CRE_017(int13, v_createRequest, mw_createMgmtObjAnncBase());//MgmtObj + + if(getverdict == pass){ + //Check if description attribute has been announced + if (ispresent(v_requestPrimitive.primitiveContent.announcedMgmtResource.description)){ + if(v_requestPrimitive.primitiveContent.announcedMgmtResource.description != description){ + setverdict(fail, __SCOPE__ & ": Error: Value of description has not been announced successfully"); + }else{ + setverdict(pass, __SCOPE__ & ": Value of description has been announced successfully"); + } + }else{ + setverdict(fail, __SCOPE__ & ": Error: description has not been announced"); + } + } + } + + testcase TC_CSE_DMR_CRE_017_NOD() runs on CseTester system CseSystem { // Local variables - var MsgIn v_response; + var template RequestPrimitive v_createRequest := m_createNodeBase; + var RequestPrimitive v_requestPrimitive; + + v_createRequest.primitiveContent.node.announceTo := {f_getAnnouncementTargetPoA()}; + + //TODO node to be done. hostedCSELink attribute (OA) to be added!!! + + v_requestPrimitive := f_CSE_DMR_CRE_017(int14, v_createRequest, mw_createNodeAnnc);//Node + } + + testcase TC_CSE_DMR_CRE_017_SCH() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var RequestPrimitive v_requestPrimitive; + var ScheduleEntries scheduleElement := {{"0,0,0 1 2,1,1,*"}}; + + v_createRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()}; + v_createRequest.primitiveContent.schedule.scheduleElement := scheduleElement; //Correct value? Shall be indicated in TP? + v_createRequest.primitiveContent.schedule.announcedAttribute := {"scheduleElement"}; //Correct value? Shall be indicated in TP? + + v_requestPrimitive := f_CSE_DMR_CRE_017(int18, v_createRequest, mw_createScheduleAnncBase());//Schedule + + if(getverdict == pass){ + //Check if scheduleElement attribute has been announced + if (ispresent(v_requestPrimitive.primitiveContent.scheduleAnnc.scheduleElement)){ + if(v_requestPrimitive.primitiveContent.scheduleAnnc.scheduleElement != scheduleElement){ + setverdict(fail, __SCOPE__ & ": Error: Value of scheduleElement has not been announced successfully"); + }else{ + setverdict(pass, __SCOPE__ & ": Value of scheduleElement has been announced successfully"); + } + }else{ + setverdict(fail, __SCOPE__ & ": Error: scheduleElement has not been announced"); + } + } + } + + function f_CSE_DMR_CRE_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template (present) RequestPrimitive p_requestAnnc) runs on CseTester return RequestPrimitive{ + + // Local variables + var MsgIn v_anncRequest; var RequestPrimitive v_request; - var RequestPrimitive v_updateRequest; - var integer v_acpAuxIndex := -1; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); - var AccessControlRule v_accessControlRule_2; - var SetOfAcrs v_setOfArcs; - + var integer v_parentIndex := -1; + var integer v_containerIndex := -1; + // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - + // Test component configuration - f_cf01Up(); - + f_cf02Up(); + // Test adapter configuration - + // Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-,-);//c_CRDNDi); - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRUNDi); - v_accessControlRule_2 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int55)); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); - - if (p_resourceType == int1){ - p_createRequestPrimitive.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; - } - else{ - f_setAcpId(p_createRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}); - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, vc_acpAuxIndex, v_updateRequest); - - mcaPort.send(m_request(v_updateRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type int1 (Acp) updated successfuly"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type int1 (Acp)"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type int1 (Acp)"); - } - } + v_parentIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(p_resourceType == int4) { + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_parentIndex); + v_parentIndex := v_containerIndex; } - - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - + // Test Body - v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); - v_request.from_ := f_getResourceAddress(v_aeIndex); - + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, v_parentIndex); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + [] mccPort.receive(mw_request(p_requestAnnc)) -> value v_anncRequest { tc_ac.stop; - setverdict(pass, testcasename() & ": Access denied to delete the resource " & int2str(enum2int(p_resourceType))); + setverdict(pass, __SCOPE__ & ": Correct CREATE request for the resource announced variant"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error resource deleted without having privileges"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mccPort.receive(mw_request(?)) -> value v_anncRequest { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting a resource "); + setverdict(fail, __SCOPE__ & ": Wrong CREATE request received"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } - + // Postamble - mcaPort.send(m_request(valueof(m_deleteRequest(f_getResourceAddress(v_aeIndex))))); - // We are forced to delete the Ae because the delete request in the postamble_deleteResources is sent by Ae itself, witch doesn't have privileges - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - log("Postamble: AE Resource deleted"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - log("Postamble: Error while deleting resource"); - } - [] tc_ac.timeout { - log("Postamble: No answer while deleting resource"); - } - } f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - - };//end f_CSE_DMR_DEL_BV_002 - - };//end of group g_CSE_DMR_DEL_BV_002 - - group g_CSE_DMR_DEL_BV_003{ - - testcase TC_CSE_DMR_DEL_BV_003_01() runs on CseTester system CseSystem { - + f_cf02Down(); + + return v_anncRequest.primitive.requestPrimitive; + + }//end f_CSE_DMR_CRE_017 + + } // end g_CSE_DMR_CRE_017 + + group g_CSE_DMR_CRE_020{ + + /** + * @desc Check that the IUT rejects the CREATE Request of a contentInstance resource with error “NOT_ACCEPTABLE†when contentSize exceeds maxByteSize + * + */ + testcase TC_CSE_DMR_CRE_020() runs on CseTester system CseSystem { // Local variables + var template RequestPrimitive v_createRequest := m_createContainerBase; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var charstring c_falseAdressResource := "NoExistingResource"; - + var integer v_containerIndex := -1; + const integer c_maxByteSize := 0; // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize; + + v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); + // Test Body - v_request := valueof(m_deleteRequest(f_getResourceAddress(v_aeIndex) & "/" & c_falseAdressResource)); - + v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Unexisting resource cannot be deleted"); + setverdict(pass, __SCOPE__ & ": Maximum byte size exceeded"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting non existing resource"); + setverdict(fail, __SCOPE__ & ": Bad responseStatusCode in response"); } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting non existing resource"); + setverdict(fail, __SCOPE__ & ": Accepted creation of contentInstance exceding maximum byte size"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } - } - + } + // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); - - };//end f_CSE_DMR_DEL_BV_003 - };//end of group g_CSE_DMR_DEL_BV_003 - - group g_CSE_DMR_DEL_BV_004{ - - testcase TC_CSE_DMR_DEL_BV_004_01() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_DEL_BV_004(int3, m_createContainerBase, int3, m_createContainerBase);//Container - }; - - testcase TC_CSE_DMR_DEL_BV_004_02() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_DEL_BV_004(int9, m_createGroupBase, int23, m_createSubscriptionBase);//Group - }; - - testcase TC_CSE_DMR_DEL_BV_004_03() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_DEL_BV_004(int1, m_createAcpBase, int23, m_createSubscriptionBase);//AccessControlPolicy - }; - - testcase TC_CSE_DMR_DEL_BV_004_04() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_DEL_BV_004(int18, m_createScheduleBase, int23, m_createSubscriptionBase);//Schedule - }; - - testcase TC_CSE_DMR_DEL_BV_004_05() runs on CseTester system CseSystem { - // Local variables - // don't exist pollingChannel's child resource - //f_CSE_DMR_DEL_BV_004(int15, m_createPollingChannelBase, int23, m_createSubscriptionBase);//PollingChannel TODO ResourceType needed is PollingChannelURI - }; - - testcase TC_CSE_DMR_DEL_BV_004_06() runs on CseTester system CseSystem { - // Local variables - - f_CSE_DMR_DEL_BV_004(int23, m_createSubscriptionBase, int18, m_createScheduleBase);//Subscription - }; - - - function f_CSE_DMR_DEL_BV_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_createRequestPrimitiveChildResource) runs on CseTester { + + }//end TC_CSE_DMR_CRE_020 + + }// end group g_CSE_DMR_CRE_020 + + group g_CSE_DMR_CRE_021{ + + /** + * @desc Check that the IUT updates the currentByteSize attribute in a <container> parent resource when a new <contentInstance> resource is created. + * + */ + testcase TC_CSE_DMR_CRE_021() runs on CseTester system CseSystem { // Local variables + var template RequestPrimitive v_createRequest; var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var integer v_childResourceIndex := -1; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex := -1; + const integer c_maxByteSize := 512; // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_createRequest.primitiveContent.container.maxByteSize := c_maxByteSize; - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + v_createRequest := m_createContainerBase; + + v_containerIndex := f_cse_createResource(int3, v_createRequest, v_aeIndex); - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); - + + v_contentInstanceIndex := f_cse_createResource(int4, v_createRequest, v_containerIndex); + // Test Body - v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); - + v_request := f_getCreateRequestPrimitive(int4, m_createContentInstanceBase, v_containerIndex); //Default content: "AnyValue" (8 bytes length) + mcaPort.send(m_request(v_request)); tc_ac.start; alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": ContentInstance resource created"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ":Resource type " & int2str(enum2int(p_resourceType)) & " delete successfuly"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": Error when creating contentInstance resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type 4"); } - } - - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); - + } + + //Check currentByteSize + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); + tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Error while retrieving non existing resource"); + if(v_response.primitive.responsePrimitive.primitiveContent.container.currentByteSize == 8) { //Default content: "AnyValue" (8 bytes length) + setverdict(pass, __SCOPE__ & ": CurrentByteSize attribute in content resource is incremented successfully"); + } + else{ + setverdict(fail, __SCOPE__ & ": CurrentByteSize attribute in content resource not incremented successfully"); + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving non existing resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving non existing resource"); + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } - } - + } + // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); - - };//end f_CSE_DMR_DEL_BV_004 - };//end of group g_CSE_DMR_DEL_BV_004 + + }//end TC_CSE_DMR_CRE_021 - group g_CSE_DMR_DEL_BV_005{ + }// end group g_CSE_DMR_CRE_021 + + }//end group Create + + group Retrieve { + + group g_CSE_DMR_RET_001 { + + /** + * @desc Check that the IUT returns successfully the TARGET_RESOURCE_ADDRESS resource + * + */ + testcase TC_CSE_DMR_RET_001_CNT() runs on CseTester system CseSystem { + // Local variables + var ResponsePrimitive v_responsePrimitive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := mw_contentContainer_rc1; + + v_responsePrimitive := f_CSE_DMR_RET_001(int3, m_createContainerBase, v_contentResponse);//Container + + } - testcase TC_CSE_DMR_DEL_BV_005_01() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_RET_001_GRP() runs on CseTester system CseSystem { // Local variables - f_CSE_DMR_DEL_BV_005(int3, m_createContainerBase, int3, m_createContainerBase);//Container + var ResponsePrimitive v_responsePrimitive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := mw_contentGroup_rc1; + + v_responsePrimitive := f_CSE_DMR_RET_001(int9, m_createGroupBase, v_contentResponse);//Group + } - - function f_CSE_DMR_DEL_BV_005(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_createRequestPrimitiveChildResource) runs on CseTester { + + testcase TC_CSE_DMR_RET_001_ACP() runs on CseTester system CseSystem { + // Local variables + var ResponsePrimitive v_responsePrimitive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; + + v_responsePrimitive := f_CSE_DMR_RET_001(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + + } + + testcase TC_CSE_DMR_RET_001_SCH() runs on CseTester system CseSystem { + // Local variables + var ResponsePrimitive v_responsePrimitive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := mw_contentSchedule_rc1; + + v_responsePrimitive := f_CSE_DMR_RET_001(int18, m_createScheduleBase, v_contentResponse);//Schedule + + } + + testcase TC_CSE_DMR_RET_001_PCH() runs on CseTester system CseSystem { + // Local variables + var ResponsePrimitive v_responsePrimitive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := mw_contentPollingChannelBase; + + v_responsePrimitive := f_CSE_DMR_RET_001(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel + + } + + testcase TC_CSE_DMR_RET_001_SUB() runs on CseTester system CseSystem { + // Local variables + var ResponsePrimitive v_responsePrimitive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := mw_contentSubscription_rc1; + + v_responsePrimitive := f_CSE_DMR_RET_001(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + + } + + testcase TC_CSE_DMR_RET_001_CIN() runs on CseTester system CseSystem { + // Local variables + var ResponsePrimitive v_responsePrimitive; + var template PrimitiveContent v_contentResponse; + + v_contentResponse.contentInstance := mw_contentContentInstance_rc1; + + v_responsePrimitive := f_CSE_DMR_RET_001(int4, m_createContentInstanceBase, v_contentResponse);//ContentInstance + + } + + function f_CSE_DMR_RET_001(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester return ResponsePrimitive { + // Local variables var MsgIn v_response; - var RequestPrimitive v_request; var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_parentIndex := -1; var integer v_resourceIndex := -1; - var integer v_childResourceIndex := -1; - + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); - - if(ispresent(vc_resourcesList[v_resourceIndex].resource.any_1[0].Container_optional.stateTag)) { - - v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); - - // Test Body - v_request := valueof(m_deleteRequest(f_getResourceAddress(v_childResourceIndex))); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource type " & int2str(enum2int(p_resourceType)) & " delete successfuly"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting resource type " & int2str(enum2int(p_resourceType))); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); - } + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + if(p_resourceType == int4) { //ContentInstance + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + v_parentIndex := v_containerIndex; + }else{ + v_parentIndex := v_aeIndex; + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); } - - - - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Container_optional.stateTag == 2) { //(Create and Delete) - setverdict(pass, testcasename() & ": The stateTag attribute is incremented"); - } - else{ - setverdict(fail, testcasename() & ": Error the stateTag attribute is not incremented"); - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource attributes"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource attributes"); - } - } - - }//end if - else{ - setverdict(fail, testcasename() & ": Error the stateTag attribute is empty"); + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + 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(); + + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_RET_001 + + } // end g_CSE_DMR_RET_001 + + group g_CSE_DMR_RET_002 { + + /** + * @desc Check that the IUT responds with an error when the AE tries to retrieve the resource TARGET_RESOURCE_ADDRESS which does not exist + * + */ + testcase TC_CSE_DMR_RET_002() runs on CseTester system CseSystem{ + + // Local variables + var MsgIn v_response; + + var integer v_aeIndex := -1; + var XSD.ID v_resourceId := "nonExistingId"; + var XSD.ID v_resourceName := "nonExistingName"; + var XSD.ID v_targetResourceAddress; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + if((vc_addressingMethod == e_nonHierarchical) and (vc_primitiveScope == e_cseRelative)) { + v_targetResourceAddress := v_resourceId; + } else if (vc_addressingMethod == e_nonHierarchical) { + v_targetResourceAddress := f_getResourceAddress() & "/" & v_resourceId; + } else { + v_targetResourceAddress := f_getResourceAddress(v_aeIndex) & "/" & v_resourceName; } - + + mcaPort.send(m_request(m_retrieveResource(v_targetResourceAddress, f_getOriginator(v_aeIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource not found"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + 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(); - - }//end f_CSE_DMR_DEL_BV_005 - } // end group g_CSE_DMR_DEL_BV_005 + + }//end f_CSE_DMR_RET_002 + + } // end g_CSE_DMR_RET_002 - }//end group Delete - - }//end group Data_Management_and_Repository - - //@Martin - group Location { - - group g_CSE_LOC_BV_001{ - - testcase TC_CSE_LOC_BV_001() runs on CseTester system CseSystem { - - var integer v_aeAuxIndex := -1; - var RequestPrimitive v_request; - var MsgIn v_response; - var LocationSource v_locationSource := int1;//Network-based - - //Test component configuration - f_cf01Up(); - - //Preamble - v_aeAuxIndex := f_cse_preamble_registerAe(); - - //Set requestPrimitive - v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, omit, omit, omit), v_aeAuxIndex); - - //Test Body - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt{ - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { //BAD REQUEST - tc_ac.stop; - setverdict(pass, testcasename() & "Resource <locationPolicy> create request is rejected due to invalid request body message!!"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while handling an invalid locationPolicy resource create request with response status code:" & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Created a locationPolicy resource for an invalid create request with response status code:" & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": Timeout due to no response received from requested server!"); - } - - } - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }// end testcase TC_CSE_LOC_BV_001 - }//end group g_CSE_LOC_BV_001 - - - group g_CSE_LOC_BV_002{ - testcase TC_CSE_LOC_BV_002() runs on CseTester system CseSystem { - - var integer v_aeAuxIndex := -1; - var LocationSource v_locationSource := int1;//Network-based - var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; - var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; - var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; - var RequestPrimitive v_request; - var MsgIn v_response; - - //Test component configuration - f_cf01Up(); - - //Preamble - v_aeAuxIndex := f_cse_preamble_registerAe(); - - //Set requestPrimitive - v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeAuxIndex); - - // Test Body - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Resource locationPolicy is created successfuly with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + group g_CSE_DMR_RET_003 { + + /** + * @desc Check that the IUT responds with an error when the AE tries to retrieve a resource TARGET_RESOURCE_ADDRESS under AE without having privileges for the RETRIEVE operation + * + */ + testcase TC_CSE_DMR_RET_003_CNT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_003(int3, m_createContainerBase);//Container } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); + + testcase TC_CSE_DMR_RET_003_GRP() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_003(int9, m_createGroupBase);//Group } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); + + testcase TC_CSE_DMR_RET_003_ACP() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_requestPrimitive := m_createAcpBase; + + v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61; + + f_CSE_DMR_RET_003(int1, v_requestPrimitive);//AccessControlPolicy } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - }// end testcase TC_CSE_LOC_BV_002 - - }//end group g_CSE_LOC_BV_002 + testcase TC_CSE_DMR_RET_003_SCH() runs on CseTester system CseSystem { + // Local variables - - group g_CSE_LOC_BO_001{ - - testcase TC_CSE_LOC_BO_001() runs on CseTester system CseSystem {//the originator has no privileges to create a locationPolicy resource!! - - var integer v_aeAuxIndex := -1; - var integer v_acpAuxIndex := -1; - var LocationSource v_locationSource := int1;//Network-based - var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; - var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; - var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; - var RequestPrimitive v_request; - var MsgIn v_response; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - //Test component configuration - f_cf01Up(); - - //Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) //No resource creation privilege - - v_aeAuxIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -); - - //Set requestPrimitive - v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource,omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeAuxIndex); - - // Test Body - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Access denied to create a resource including locationPolicy!"); + f_CSE_DMR_RET_003(int18, m_createScheduleBase);//Schedule } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT failed to check the access privilege of originator!"); + + testcase TC_CSE_DMR_RET_003_PCH() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_003(int15, m_createPollingChannelBase);//PollingChannel } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); + + testcase TC_CSE_DMR_RET_003_SUB() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_003(int23, m_createSubscriptionBase);//Subscription } - } + + function f_CSE_DMR_RET_003(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpAuxIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, -);//c_CRUDNDi) + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//c_CRUDNDi; + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + f_cse_updateAcpAuxResource(int61); //c_CUDNDi + + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - - } // end testcase TC_CSE_LOC_BO_001 - - }//end group g_CSE_LOC_BO_001 - - group g_CSE_LOC_BO_002{ - testcase TC_CSE_LOC_BO_002() runs on CseTester system CseSystem { - - var integer v_aeAuxIndex := -1; - var LocationSource v_locationSource := int1;//Netwok-based - var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; - var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; - var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; - var RequestPrimitive v_request; - var MsgIn v_response; - - //Test component configuration - f_cf01Up(); - - //Preamble - v_aeAuxIndex := f_cse_preamble_registerAe(); - - //Set requestPrimitive - v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeAuxIndex); - - // Test Body - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": The targeted resource is not found!!"); + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_003 + + } // end g_CSE_DMR_RET_003 + + group g_CSE_DMR_RET_004 { + + /** + * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“To†option) + * + */ + testcase TC_CSE_DMR_RET_004_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := m_contentContainer_allOmit; + v_contentResponse.container.parentID := ?; + + f_CSE_DMR_RET_004(int3, m_createContainerBase, v_contentResponse);//Container } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error occurrs with response status code: "& int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT created a locationPolicy resource under a non-existed parent resource!"); + + testcase TC_CSE_DMR_RET_004_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := m_contentGroup_allOmit; + v_contentResponse.group_.parentID := ?; + + f_CSE_DMR_RET_004(int9, m_createGroupBase, v_contentResponse);//Group } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); + + testcase TC_CSE_DMR_RET_004_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; + v_contentResponse.accessControlPolicy.parentID := ?; + + f_CSE_DMR_RET_004(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - }// end testcase TC_CSE_LOC_BO_002 - - }//end group g_CSE_LOC_BO_002 - - - group g_CSE_LOC_BI_001{ - - testcase TC_CSE_LOC_BI_001() runs on CseTester system CseSystem {//reject an invalid update request with invalid attribtue locationUpdatePeriod - - var integer v_aeAuxIndex := -1; - var integer v_locPolicyResourceIndex := -1; - var LocationSource v_locationSource := int1;//Netwok-based - var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; - var XSD.Duration locationUpdatePeriod_invalid := c_invalid_location_update_period; - var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; - var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; - var RequestPrimitive v_request; - var RequestPrimitive v_locpolicy_request_preamble; - var MsgIn v_response; - - //Test component configuration - f_cf01Up(); - - //Preamble - register AE - v_aeAuxIndex := f_cse_preamble_registerAe(); - //Preamble - create a valid locationPolicy resource for later update use - v_locpolicy_request_preamble:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); - v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex); - - //Set requestPrimitive - v_request := f_getUpdateRequestPrimitive(int10, v_locPolicyResourceIndex, m_updateLocationPolicy(f_getResourceAddress(v_locPolicyResourceIndex), omit, locationUpdatePeriod_invalid)); - - // Test Body - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Update locationPolicy resource is rejected!!"); + testcase TC_CSE_DMR_RET_004_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := m_contentSchedule_allOmit; + v_contentResponse.schedule.parentID := ?; + + f_CSE_DMR_RET_004(int18, m_createScheduleBase,v_contentResponse);//Schedule } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error occurrs with response status code: "& int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT failed to handle an invalid locationPolicy update request"); + + testcase TC_CSE_DMR_RET_004_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit; + v_contentResponse.pollingChannel.parentID := ?; + + f_CSE_DMR_RET_004(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); + + testcase TC_CSE_DMR_RET_004_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := m_contentSubscription_allOmit; + v_contentResponse.subscription.parentID := ?; + + f_CSE_DMR_RET_004(int23, m_createSubscriptionBase, v_contentResponse);//Subscription } - } + + function f_CSE_DMR_RET_004(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + + // Local variables + var MsgIn v_response; + var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Error, not only requested attribute retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_004 + + } // end g_CSE_DMR_RET_004 + + group g_CSE_DMR_RET_005 { + + /** + * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“Content†option) + * + */ + testcase TC_CSE_DMR_RET_005_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := m_contentContainer_allOmit; + v_contentResponse.container.parentID := ?; + + f_CSE_DMR_RET_005(int3, m_createContainerBase, v_contentResponse);//Container + } + + testcase TC_CSE_DMR_RET_005_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := m_contentGroup_allOmit; + v_contentResponse.group_.parentID := ?; + + f_CSE_DMR_RET_005(int9, m_createGroupBase, v_contentResponse);//Group + } + + testcase TC_CSE_DMR_RET_005_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; + v_contentResponse.accessControlPolicy.parentID := ?; + + f_CSE_DMR_RET_005(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_005_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := m_contentSchedule_allOmit; + v_contentResponse.schedule.parentID := ?; + + f_CSE_DMR_RET_005(int18, m_createScheduleBase, v_contentResponse);//Schedule + } + + testcase TC_CSE_DMR_RET_005_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit; + v_contentResponse.pollingChannel.parentID := ?; + + f_CSE_DMR_RET_005(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel + } + + testcase TC_CSE_DMR_RET_005_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := m_contentSubscription_allOmit; + v_contentResponse.subscription.parentID := ?; + + f_CSE_DMR_RET_005(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + } + + + function f_CSE_DMR_RET_005(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Error, not only requested attribute retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_005 + + } // end g_CSE_DMR_RET_005 + + group g_CSE_DMR_RET_006 { + + /** + * @desc Check that the IUT returns successfully multiple attributes of TARGET_RESOURCE_ADDRESS resource + * + */ + testcase TC_CSE_DMR_RET_006_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := m_contentContainer_allOmit; + v_contentResponse.container.parentID := ?; + v_contentResponse.container.creationTime := ?; + + f_CSE_DMR_RET_006(int3, m_createContainerBase, v_contentResponse);//Container + } + + testcase TC_CSE_DMR_RET_006_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := m_contentGroup_allOmit; + v_contentResponse.group_.parentID := ?; + v_contentResponse.group_.creationTime := ?; + + f_CSE_DMR_RET_006(int9, m_createGroupBase, v_contentResponse);//Group + } + + testcase TC_CSE_DMR_RET_006_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; + v_contentResponse.accessControlPolicy.parentID := ?; + v_contentResponse.accessControlPolicy.creationTime := ?; + + f_CSE_DMR_RET_006(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_006_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := m_contentSchedule_allOmit; + v_contentResponse.schedule.parentID := ?; + v_contentResponse.schedule.creationTime := ?; + + f_CSE_DMR_RET_006(int18, m_createScheduleBase, v_contentResponse);//Schedule + } + + testcase TC_CSE_DMR_RET_006_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := m_contentPollingChannel_allOmit; + v_contentResponse.pollingChannel.parentID := ?; + v_contentResponse.pollingChannel.creationTime := ?; + + f_CSE_DMR_RET_006(int15, m_createPollingChannelBase, v_contentResponse);//PollingChannel + } + + testcase TC_CSE_DMR_RET_006_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := m_contentSubscription_allOmit; + v_contentResponse.subscription.parentID := ?; + v_contentResponse.subscription.creationTime := ?; + + f_CSE_DMR_RET_006(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + } + + + function f_CSE_DMR_RET_006(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , + {"pi", "ct"}, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Error, not only requested attributes retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_006 + + } // end g_CSE_DMR_RET_006 + + group g_CSE_DMR_RET_007 { + + /** + * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“single†attribute case) + * + */ + testcase TC_CSE_DMR_RET_007_CNT_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_007(int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_007_GRP_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_007(int9, m_createGroupBase);//Group + } + + testcase TC_CSE_DMR_RET_007_ACP_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_007(int1, m_createAcpBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_007_SCH_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_007(int18, m_createScheduleBase);//Schedule + } + + testcase TC_CSE_DMR_RET_007_PCH_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_007(int15, m_createPollingChannelBase);//PollingChannel + } + + testcase TC_CSE_DMR_RET_007_SUB_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_007(int23, m_createSubscriptionBase);//Subscription + } + + + function f_CSE_DMR_RET_007(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), + {"lbl"}, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error : attribute was retrieved while it doesn't exist"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_007 + + } // end g_CSE_DMR_RET_007 + + group g_CSE_DMR_RET_008 { + + /** + * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attributes of the TARGET_RESOURCE_ADDRESS resource (“multiple†attributes case) + * + */ + testcase TC_CSE_DMR_RET_008_CNT_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_008(int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_008_GRP_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_008(int9, m_createGroupBase);//Group + } + + testcase TC_CSE_DMR_RET_008_ACP_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_008(int1, m_createAcpBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_008_SCH_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_008(int18, m_createScheduleBase);//Schedule + } + + testcase TC_CSE_DMR_RET_008_PCH_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_008(int15, m_createPollingChannelBase);//PollingChannel + } + + testcase TC_CSE_DMR_RET_008_SUB_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_008(int23, m_createSubscriptionBase);//Subscription + } + + + function f_CSE_DMR_RET_008(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), + {"lbl", "at"}, f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error : attribute was retrieved while it doesn't exist"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_008 + + } // end f_CSE_DMR_RET_008 + + group g_CSE_DMR_RET_009{ + + /** + * @desc Check that the IUT rejects the RETRIEVE Request of a latest resource target to a container resource that has no direct child contentInstance resources. + * + */ + testcase TC_CSE_DMR_RET_009() runs on CseTester system CseSystem { + // Local variables + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))){ + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource not found"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + 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(); + + }//end TC_CSE_DMR_RET_009 + + } // end group g_CSE_DMR_RET_009 + + group g_CSE_DMR_RET_010{ + + /** + * @desc Check that the IUT accepts the RETRIEVE Request of the oldest contentInstance target to a <container> resource + * + */ + testcase TC_CSE_DMR_RET_010() runs on CseTester system CseSystem { + // Local variables + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex1 := -1; + var integer v_contentInstanceIndex2 := -1; + var template PrimitiveContent v_contentResponse; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_contentInstanceIndex1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); + + v_contentInstanceIndex2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); + + v_contentResponse.contentInstance := mw_contentContentInstanceBase; + v_contentResponse.contentInstance.resourceName := vc_resourcesList[v_contentInstanceIndex1].resource.contentInstance.resourceName; + + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": resourceName attribute of <oldest> resource retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, resourceName attribute of <oldest> resource value not expected"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving <oldest> resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving <oldest> resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_RET_010 + + } // end group g_CSE_DMR_RET_010 + + group g_CSE_DMR_RET_011{ + + /** + * @desc Check that the IUT rejects the RETRIEVE Request of a oldest resource target to a container resource that has no direct child contentInstance resources. + * + */ + testcase TC_CSE_DMR_RET_011() runs on CseTester system CseSystem { + // Local variables + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))){ + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource not found"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + 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(); + + }//end TC_CSE_DMR_RET_011 + + } // end group g_CSE_DMR_RET_011 + + group g_CSE_DMR_RET_012{ + + /** + * @desc Check that the IUT accepts the RETRIEVE Request of the latest contentInstance target to a <container> resource7 + * + */ + testcase TC_CSE_DMR_RET_012() runs on CseTester system CseSystem { + // Local variables + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex1 := -1; + var integer v_contentInstanceIndex2 := -1; + var template PrimitiveContent v_contentResponse; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_contentInstanceIndex1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); + + v_contentInstanceIndex2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); + + v_contentResponse.contentInstance := mw_contentContentInstanceBase; + v_contentResponse.contentInstance.resourceName := vc_resourcesList[v_contentInstanceIndex2].resource.contentInstance.resourceName; + + + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))){ + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": resourceName attribute of <latest> resource retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, retrieved contentInstance with incorrect attributes"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving <latest> resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving <latest> resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_RET_012 + + } // end group g_CSE_DMR_RET_012 + + group g_CSE_DMR_RET_013 { + + /** + * @desc Check that the IUT returns successfully the TARGET_RESOURCE_ADDRESS resource under CSEBase + * + */ + testcase TC_CSE_DMR_RET_013_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; + + f_CSE_DMR_RET_013(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + + } + + testcase TC_CSE_DMR_RET_013_AE() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.aE := mw_contentAeBase; + + f_CSE_DMR_RET_013(int2, m_createAe(PX_APP_ID), v_contentResponse);//AE + + } + + testcase TC_CSE_DMR_RET_013_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := mw_contentContainer_rc1; + + f_CSE_DMR_RET_013(int3, m_createContainerBase, v_contentResponse);//Container + + } + + testcase TC_CSE_DMR_RET_013_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := mw_contentGroup_rc1; + + f_CSE_DMR_RET_013(int9, m_createGroupBase, v_contentResponse);//Group + + } + + testcase TC_CSE_DMR_RET_013_CSR() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; + + f_CSE_DMR_RET_013(int16, m_createRemoteCSEBase, v_contentResponse);//RemoteCSE + + } + + testcase TC_CSE_DMR_RET_013_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := mw_contentSchedule_rc1; + + f_CSE_DMR_RET_013(int18, m_createScheduleBase, v_contentResponse);//Schedule + + } + + testcase TC_CSE_DMR_RET_013_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := mw_contentSubscription_rc1; + + f_CSE_DMR_RET_013(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + + } + + function f_CSE_DMR_RET_013(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + } else { //ResourceType = RemoteCSE + + v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive); + + } + + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Response OK for retrieving"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Error, resource elements provided not matching expected resource elements"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + 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_cf02Down(); + + }//end f_CSE_DMR_RET_013 + + } // end g_CSE_DMR_RET_013 + + group g_CSE_DMR_RET_014 { + + /** + * @desc Check that the IUT responds with an error when the AE tries to retrieve a resource TARGET_RESOURCE_ADDRESS under CSEBase without having privileges for the RETRIEVE operation + * + */ + testcase TC_CSE_DMR_RET_014_ACP() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_requestPrimitive := m_createAcpBase; + + v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int61; + + f_CSE_DMR_RET_014(int1, v_requestPrimitive);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_014_AE() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_014(int2, m_createPollingChannelBase);//AE + } + + testcase TC_CSE_DMR_RET_014_CNT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_014(int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_014_GRP() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_014(int9, m_createGroupBase);//Group + } + + testcase TC_CSE_DMR_RET_014_SCH() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_014(int18, m_createScheduleBase);//Schedule + } + + testcase TC_CSE_DMR_RET_014_SUB() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_014(int23, m_createSubscriptionBase);//Subscription + } + + function f_CSE_DMR_RET_014(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpAuxIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, -);//c_CRUDNDi) + + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi; + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + p_requestPrimitive := f_setAcpId( p_requestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + f_cse_updateAcpAuxResource(int61); //c_CUDNDi + + // Test Body + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to retrieve attributes from resource type " & int2str(enum2int(p_resourceType))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving attributes from resource without having privileges"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Retrieving attributes from resource without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_014 + + } // end g_CSE_DMR_RET_014 + + group g_CSE_DMR_RET_015 { + + /** + * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“To†option) under CSEBase + * + */ + testcase TC_CSE_DMR_RET_015_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; + v_contentResponse.accessControlPolicy.parentID := ?; + + f_CSE_DMR_RET_015(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_015_AE() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.aE := m_contentAe_allOmit; + v_contentResponse.aE.parentID := ?; + + f_CSE_DMR_RET_015(int2, m_createAe(PX_APP_ID), v_contentResponse);//AE + } + + testcase TC_CSE_DMR_RET_015_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := m_contentContainer_allOmit; + v_contentResponse.container.parentID := ?; + + f_CSE_DMR_RET_015(int3, m_createContainerBase, v_contentResponse);//Container + } + + testcase TC_CSE_DMR_RET_015_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := m_contentGroup_allOmit; + v_contentResponse.group_.parentID := ?; + + f_CSE_DMR_RET_015(int9, m_createGroupBase, v_contentResponse);//Group + } + + testcase TC_CSE_DMR_RET_015_CSR() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit; + v_contentResponse.remoteCSE.parentID := ?; + + f_CSE_DMR_RET_015(int16, m_createRemoteCSEBase, v_contentResponse);//RemoteCSE + } + + testcase TC_CSE_DMR_RET_015_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := m_contentSchedule_allOmit; + v_contentResponse.schedule.parentID := ?; + + f_CSE_DMR_RET_015(int18, m_createScheduleBase,v_contentResponse);//Schedule + } + + testcase TC_CSE_DMR_RET_015_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := m_contentSubscription_allOmit; + v_contentResponse.subscription.parentID := ?; + + f_CSE_DMR_RET_015(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + } + + function f_CSE_DMR_RET_015(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + + // Local variables + var MsgIn v_response; + var XSD.String v_attribute := "#pi";//Attribute parentId to be retrieved + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + } else { + v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive); + } + + // Test Body + mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Error, not only requested attribute retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + }//end f_CSE_DMR_RET_015 + + } // end g_CSE_DMR_RET_015 + + group g_CSE_DMR_RET_016 { + + /** + * @desc Check that the IUT returns successfully the ATTRIBUTE of TARGET_RESOURCE_ADDRESS resource (“Content†option) under CSEBase + * + */ + testcase TC_CSE_DMR_RET_016_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; + v_contentResponse.accessControlPolicy.parentID := ?; + + f_CSE_DMR_RET_016(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_016_AE() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.aE := m_contentAe_allOmit; + v_contentResponse.aE.parentID := ?; + + f_CSE_DMR_RET_016(int2, m_createAe(PX_APP_ID), v_contentResponse);//AE + } + + testcase TC_CSE_DMR_RET_016_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := m_contentContainer_allOmit; + v_contentResponse.container.parentID := ?; + + f_CSE_DMR_RET_016(int3, m_createContainerBase, v_contentResponse);//Container + } + + testcase TC_CSE_DMR_RET_016_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := m_contentGroup_allOmit; + v_contentResponse.group_.parentID := ?; + + f_CSE_DMR_RET_016(int9, m_createGroupBase, v_contentResponse);//Group + } + + testcase TC_CSE_DMR_RET_016_CSR() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit; + v_contentResponse.remoteCSE.parentID := ?; + + f_CSE_DMR_RET_016(int16, m_createRemoteCSEBase, v_contentResponse);//RemoteCSE + } + + testcase TC_CSE_DMR_RET_016_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := m_contentSchedule_allOmit; + v_contentResponse.schedule.parentID := ?; + + f_CSE_DMR_RET_016(int18, m_createScheduleBase, v_contentResponse);//Schedule + } + + testcase TC_CSE_DMR_RET_016_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := m_contentSubscription_allOmit; + v_contentResponse.subscription.parentID := ?; + + f_CSE_DMR_RET_016(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + } + + + function f_CSE_DMR_RET_016(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + }else{ + v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive); + } + + mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attribute retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Error, not only requested attribute retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + }//end f_CSE_DMR_RET_016 + + } // end g_CSE_DMR_RET_016 + + group g_CSE_DMR_RET_017 { + + /** + * @desc Check that the IUT returns successfully multiple attributes of TARGET_RESOURCE_ADDRESS resource under CSEBase + * + */ + testcase TC_CSE_DMR_RET_017_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := m_contentAcp_allOmit; + v_contentResponse.accessControlPolicy.parentID := ?; + v_contentResponse.accessControlPolicy.creationTime := ?; + + f_CSE_DMR_RET_017(int1, m_createAcpBase, v_contentResponse);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_017_AE() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.aE := m_contentAe_allOmit; + v_contentResponse.aE.parentID := ?; + v_contentResponse.aE.creationTime := ?; + + f_CSE_DMR_RET_017(int2, m_createAe(PX_APP_ID), v_contentResponse);//AE + } + + testcase TC_CSE_DMR_RET_017_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := m_contentContainer_allOmit; + v_contentResponse.container.parentID := ?; + v_contentResponse.container.creationTime := ?; + + f_CSE_DMR_RET_017(int3, m_createContainerBase, v_contentResponse);//Container + } + + /*testcase TC_CSE_DMR_RET_017_DLV() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.delivery := m_contentDelivery_allOmit; + v_contentResponse.delivery.parentID := ?; + v_contentResponse.delivery.creationTime := ?; + + f_CSE_DMR_RET_017(int6, m_createDeliveryBase, v_contentResponse);//Delivery + }*/ + + testcase TC_CSE_DMR_RET_017_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := m_contentGroup_allOmit; + v_contentResponse.group_.parentID := ?; + v_contentResponse.group_.creationTime := ?; + + f_CSE_DMR_RET_017(int9, m_createGroupBase, v_contentResponse);//Group + } + + testcase TC_CSE_DMR_RET_017_LCP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.locationPolicy := m_contentLocationPolicy_allOmit; + v_contentResponse.locationPolicy.parentID := ?; + v_contentResponse.locationPolicy.creationTime := ?; + + f_CSE_DMR_RET_017(int10, m_createLocationPolicyBase, v_contentResponse);//LocationPolicy + } + + testcase TC_CSE_DMR_RET_017_MGC() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.mgmtCmd := m_contentMgmtCmd_allOmit; + v_contentResponse.mgmtCmd.parentID := ?; + v_contentResponse.mgmtCmd.creationTime := ?; + + f_CSE_DMR_RET_017(int12, m_createMgmtCmdBase, v_contentResponse);//MgmtCmd + } + + testcase TC_CSE_DMR_RET_017_NOD() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.node := m_contentNode_allOmit; + v_contentResponse.node.parentID := ?; + v_contentResponse.node.creationTime := ?; + + f_CSE_DMR_RET_017(int14, m_createNodeBase, v_contentResponse);//Node + } + + testcase TC_CSE_DMR_RET_017_CSR() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.remoteCSE := m_contentRemoteCSE_allOmit; + v_contentResponse.remoteCSE.parentID := ?; + v_contentResponse.remoteCSE.creationTime := ?; + + f_CSE_DMR_RET_017(int16, m_createRemoteCSEBase, v_contentResponse);//RemoteCSE + } + + testcase TC_CSE_DMR_RET_017_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := m_contentSchedule_allOmit; + v_contentResponse.schedule.parentID := ?; + v_contentResponse.schedule.creationTime := ?; + + f_CSE_DMR_RET_017(int18, m_createScheduleBase, v_contentResponse);//Schedule + } + + testcase TC_CSE_DMR_RET_017_STCL() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.statsCollect := m_contentStatsCollect_allOmit; + v_contentResponse.statsCollect.parentID := ?; + v_contentResponse.statsCollect.creationTime := ?; + + f_CSE_DMR_RET_017(int21, m_createStatsCollectBase, v_contentResponse);//StatsCollect + } + + testcase TC_CSE_DMR_RET_017_STCG() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.statsConfig := m_contentStatsConfig_allOmit; + v_contentResponse.statsConfig.parentID := ?; + v_contentResponse.statsConfig.creationTime := ?; + + f_CSE_DMR_RET_017(int22, m_createStatsConfigBase, v_contentResponse);//StatsConfig + } + + testcase TC_CSE_DMR_RET_017_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := m_contentSubscription_allOmit; + v_contentResponse.subscription.parentID := ?; + v_contentResponse.subscription.creationTime := ?; + + f_CSE_DMR_RET_017(int23, m_createSubscriptionBase, v_contentResponse);//Subscription + } + + + function f_CSE_DMR_RET_017(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + }else{ + v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive); + } + + mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , + {"pi", "ct"}, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Requested attributes retrieved successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Error, not only requested attributes retrieved"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + }//end f_CSE_DMR_RET_017 + + } // end g_CSE_DMR_RET_017 + + group g_CSE_DMR_RET_018 { + + /** + * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“single†attribute case) under CSEBase + * + */ + testcase TC_CSE_DMR_RET_018_ACP_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_018(int1, m_createAcpBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_018_AE_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_018(int2, m_createAe(PX_APP_ID));//AE + } + + testcase TC_CSE_DMR_RET_018_CNT_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_018(int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_018_GRP_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_018(int9, m_createGroupBase);//Group + } + + testcase TC_CSE_DMR_RET_018_CSR_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_018(int16, m_createRemoteCSEBase);//RemoteCSE + } + + testcase TC_CSE_DMR_RET_018_SCH_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_018(int18, m_createScheduleBase);//Schedule + } + + testcase TC_CSE_DMR_RET_018_SUB_LBL() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_018(int23, m_createSubscriptionBase);//Subscription + } + + + function f_CSE_DMR_RET_018(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + }else{ + v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive); + } + + mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), + {"lbl"}, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error : attribute was retrieved while it doesn't exist"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attribute"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + }//end f_CSE_DMR_RET_018 + + } // end g_CSE_DMR_RET_018 + + group g_CSE_DMR_RET_019 { + + /** + * @desc Check that the IUT responds with an error when the AE tries to retrieve a non-existing attribute of the TARGET_RESOURCE_ADDRESS resource (“multiple†attributes case) under CSEBase + * + */ + testcase TC_CSE_DMR_RET_019_ACP_LBL_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_019(int1, m_createAcpBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_019_AE_LBL_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_019(int2, m_createAe(PX_APP_ID));//AE + } + + testcase TC_CSE_DMR_RET_019_CNT_LBL_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_019(int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_019_GRP_LBL_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_019(int9, m_createGroupBase);//Group + } + + testcase TC_CSE_DMR_RET_019_CSR_LBL_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_019(int16, m_createRemoteCSEBase);//RemoteCSE + } + + testcase TC_CSE_DMR_RET_019_SCH_LBL_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_019(int18, m_createScheduleBase);//Schedule + } + + testcase TC_CSE_DMR_RET_019_SUB_LBL_AT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_RET_019(int23, m_createSubscriptionBase);//Subscription + } + + + function f_CSE_DMR_RET_019(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive);//under the CSEBase resource + + }else{ + v_resourceIndex := f_cse_registerRemoteCse(p_requestPrimitive); + } + + mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), + {"lbl", "at"}, f_getOriginator(v_aeIndex))));//from AE ID + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Retrieved attribute does not exist"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error : attribute was retrieved while it doesn't exist"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + }//end f_CSE_DMR_RET_019 + + } // end f_CSE_DMR_RET_019 + + group g_CSE_DMR_RET_020 { + + /** + * @desc Check that the IUT rejects a RETRIEVE Request target to TARGET_RESOURCE_ADDRESS resource when the Result Content set to RESULT_CONTENT + * + */ + testcase TC_CSE_DMR_RET_020_RCN_0() runs on CseTester system CseSystem { + // Local variables + f_CSE_DMR_RET_020(int3, m_createContainerBase, int0);//ResultContent = 0 (nothing) + } + + testcase TC_CSE_DMR_RET_020_RCN_2() runs on CseTester system CseSystem { + // Local variables + f_CSE_DMR_RET_020(int3, m_createContainerBase, int2);//ResultContent = 2 (hierarchical address) + } + + testcase TC_CSE_DMR_RET_020_RCN_3() runs on CseTester system CseSystem { + // Local variables + f_CSE_DMR_RET_020(int3, m_createContainerBase, int3);//ResultContent = 3 (attributes and hierarchichal address) + } + + function f_CSE_DMR_RET_020(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, ResultContent p_resultContent) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + // Test Body + v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := p_resultContent; + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Request successfully rejected"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + 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__ & ": Error, Result content set to " & int2str(enum2int(p_resultContent)) & " is impossible for a retrieve request "); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_RET_020 + + } // end g_CSE_DMR_RET_020 + + group g_CSE_DMR_RET_021 { + + /** + * @desc Check that the IUT returns successfully only attributes of TARGET_RESOURCE_ADDRESS resource when the Result Content is set to 1 (attributes) + * + */ + testcase TC_CSE_DMR_RET_021_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := mw_contentContainer_rc1; + + f_CSE_DMR_RET_021(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_021_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := mw_contentGroup_rc1; + + f_CSE_DMR_RET_021(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group + } + + testcase TC_CSE_DMR_RET_021_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; + + f_CSE_DMR_RET_021(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_021_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := mw_contentSchedule_rc1; + + f_CSE_DMR_RET_021(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule + } + + testcase TC_CSE_DMR_RET_021_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := mw_contentPollingChannelBase; + + f_CSE_DMR_RET_021(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel + } + + testcase TC_CSE_DMR_RET_021_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := mw_contentSubscription_rc1; + + f_CSE_DMR_RET_021(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription + } + + function f_CSE_DMR_RET_021(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int1;//Attributes + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] 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(); + + }//end f_CSE_DMR_RET_021 + + } // end g_CSE_DMR_RET_021 + + + group g_CSE_DMR_RET_022 { + + /** + * @desc Check that the IUT returns successfully a list all discovered resource addresses + * + */ + testcase TC_CSE_DMR_RET_022_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := mw_contentContainer_rc4; + + f_CSE_DMR_RET_022(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_022_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := mw_contentGroup_rc4; + + f_CSE_DMR_RET_022(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group + } + + testcase TC_CSE_DMR_RET_022_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc4; + + f_CSE_DMR_RET_022(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_022_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := mw_contentSchedule_rc4; + + f_CSE_DMR_RET_022(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule + } + + testcase TC_CSE_DMR_RET_022_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := mw_contentPollingChannelBase; + + f_CSE_DMR_RET_022(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel + } + + testcase TC_CSE_DMR_RET_022_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := mw_contentSubscription_rc4; + + f_CSE_DMR_RET_022(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription + } + + function f_CSE_DMR_RET_022(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int4;//Attributes and child resources + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] 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(); + + }//end f_CSE_DMR_RET_022 + + } // end g_CSE_DMR_RET_022 + + group g_CSE_DMR_RET_023 { + + /** + * @desc Check that the IUT returns successfully only attributes and child resource references of TARGET_RESOURCE_ADDRESS resource when the Result Content is set to 5 (attributes and child resource references) + * + */ + testcase TC_CSE_DMR_RET_023_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := mw_contentContainer_rc5; + + f_CSE_DMR_RET_023(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_023_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := mw_contentGroup_rc5; + + f_CSE_DMR_RET_023(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group + } + + testcase TC_CSE_DMR_RET_023_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc5; + + f_CSE_DMR_RET_023(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_023_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := mw_contentSchedule_rc5; + + f_CSE_DMR_RET_023(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule + } + + testcase TC_CSE_DMR_RET_023_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := mw_contentPollingChannelBase; + + f_CSE_DMR_RET_023(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel + } + + testcase TC_CSE_DMR_RET_023_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := mw_contentSubscription_rc5; + + f_CSE_DMR_RET_023(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription + } + + function f_CSE_DMR_RET_023(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int5;//attributes and child resource references + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] 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(); + + }//end f_CSE_DMR_RET_023 + + } // end g_CSE_DMR_RET_023 + + group g_CSE_DMR_RET_024 { + + /** + * @desc Check that the IUT returns successfully only child resource references of TARGET_RESOURCE_ADDRESS resource when Result Content is set to 6 (child resource references) + * + */ + testcase TC_CSE_DMR_RET_024_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := mw_contentContainer_rc6; + + f_CSE_DMR_RET_024(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_024_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := mw_contentGroup_rc6; + + f_CSE_DMR_RET_024(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group + } + + testcase TC_CSE_DMR_RET_024_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc6; + + f_CSE_DMR_RET_024(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_024_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := mw_contentSchedule_rc6; + + f_CSE_DMR_RET_024(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule + } + + testcase TC_CSE_DMR_RET_024_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := mw_contentPollingChannelBase; + + f_CSE_DMR_RET_024(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel + } + + testcase TC_CSE_DMR_RET_024_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := mw_contentSubscription_rc6; + + f_CSE_DMR_RET_024(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription + } + + function f_CSE_DMR_RET_024(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int6;//Child resource references + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] 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(); + + }//end f_CSE_DMR_RET_024 + + } // end g_CSE_DMR_RET_024 + + group g_CSE_DMR_RET_025 { + + /** + * @desc Check that the IUT returns successfully only child resources of TARGET_RESOURCE_ADDRESS resource when Result Content is set to 8 (child resources) + * + */ + testcase TC_CSE_DMR_RET_025_CNT() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.container := mw_contentContainer_rc8; + + f_CSE_DMR_RET_025(int3, m_createContainerBase, v_contentResponse, int3, m_createContainerBase);//Container + } + + testcase TC_CSE_DMR_RET_025_GRP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.group_ := mw_contentGroup_rc8; + + f_CSE_DMR_RET_025(int9, m_createGroupBase, v_contentResponse, int23, m_createSubscriptionBase);//Group + } + + testcase TC_CSE_DMR_RET_025_ACP() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc8; + + f_CSE_DMR_RET_025(int1, m_createAcpBase,v_contentResponse, int23, m_createSubscriptionBase);//AccessControlPolicy + } + + testcase TC_CSE_DMR_RET_025_SCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.schedule := mw_contentSchedule_rc8; + + f_CSE_DMR_RET_025(int18, m_createScheduleBase, v_contentResponse, int23, m_createSubscriptionBase);//Schedule + } + + testcase TC_CSE_DMR_RET_025_PCH() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.pollingChannel := mw_contentPollingChannelBase; + + f_CSE_DMR_RET_025(int15, m_createPollingChannelBase, v_contentResponse, omit, omit);//PollingChannel + } + + testcase TC_CSE_DMR_RET_025_SUB() runs on CseTester system CseSystem { + // Local variables + var template PrimitiveContent v_contentResponse; + + v_contentResponse.subscription := mw_contentSubscription_rc8; + + f_CSE_DMR_RET_025(int23, m_createSubscriptionBase, v_contentResponse, int18, m_createScheduleBase);//Subscription + } + + function f_CSE_DMR_RET_025(ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, template ResourceType p_childResourceType, template RequestPrimitive p_childRequestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if(isvalue(p_childResourceType)) { + if(valueof(p_childResourceType) == int23) { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_childRequestPrimitive, valueof(p_childResourceType)); + } else { + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_requestPrimitive, valueof(p_resourceType)); + } + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); + + if(p_resourceType != int15) { + v_childResourceIndex := f_cse_createResource(valueof(p_childResourceType), p_childRequestPrimitive, v_resourceIndex); + } + + // Test Body + v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request.resultContent := int6;//Child resource references + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": No child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(p_contentResponse))) -> 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__ & ": Child resources provided with RC set to " & int2str(enum2int(v_request.resultContent))); + } + [] 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(); + + }//end f_CSE_DMR_RET_025 + + } // end g_CSE_DMR_RET_025 + + }//end group Retrieve + + group Update { + group g_CSE_DMR_UPD_001 { + + /** + * @desc Check that the IUT updates successfully the value of the attribute ATTRIBUTE_NAME of the TARGET_RESOURCE_ADDRESS resource + * + */ + testcase TC_CSE_DMR_UPD_001_CNT_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2:= {"VALUE_2"}; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.container.labels := v_labels_1; + v_updateRequest.primitiveContent.container.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_001(int3, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Container + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_001_GRP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"VALUE_2"}; + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.group_.labels := v_labels_1; + v_updateRequest.primitiveContent.group_.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_001(int9, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Group + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_001_ACP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"VALUE_2"}; + var template RequestPrimitive v_createRequest := m_createAcpBase; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_001(int1, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//ACP + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + } + + testcase TC_CSE_DMR_UPD_001_SCH_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"VALUE_2"}; + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.schedule.labels := v_labels_1; + v_updateRequest.primitiveContent.schedule.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_001(int18, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Schedule + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.schedule)) { + if(v_responsePrimitive.primitiveContent.schedule.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.schedule)) { + if(v_primitiveContentRetrieveResource.schedule.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + } + + testcase TC_CSE_DMR_UPD_001_PCH_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"VALUE_2"}; + var template RequestPrimitive v_createRequest := m_createPollingChannelBase; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1; + v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_001(int15, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//PollingChannel + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) { + if(v_responsePrimitive.primitiveContent.pollingChannel.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { + if(v_primitiveContentRetrieveResource.pollingChannel.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_001_SUB_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"VALUE_2"}; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.subscription.labels := v_labels_1; + v_updateRequest.primitiveContent.subscription.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_001(int23, v_createRequest, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + } + + function f_CSE_DMR_UPD_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive{ + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated 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 updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkCseTesterStatus(); + + //Used to check that the resource has been updated + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_001 + + } // end g_CSE_DMR_UPD_001 + + group g_CSE_DMR_UPD_002 { + + /** + * @desc Check that the IUT adds successfully the attribute ATTRIBUTE_NAME to the TARGET_RESOURCE_ADDRESS resource + * + */ + testcase TC_CSE_DMR_UPD_002_CNT_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.labels := v_labels_1; + + v_responsePrimitive := f_CSE_DMR_UPD_002(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_002_GRP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.labels := v_labels_1; + + v_responsePrimitive := f_CSE_DMR_UPD_002(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_002_ACP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; + + v_responsePrimitive := f_CSE_DMR_UPD_002(int1, m_createAcpBase,v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_002_SCH_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.schedule.labels := v_labels_1; + + v_responsePrimitive := f_CSE_DMR_UPD_002(int18, m_createScheduleBase,v_updateRequest, v_primitiveContentRetrieveResource);//Schedule + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.schedule)) { + if(v_responsePrimitive.primitiveContent.schedule.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.schedule)) { + if(v_primitiveContentRetrieveResource.schedule.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_002_PCH_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_1; + + v_responsePrimitive := f_CSE_DMR_UPD_002(int15, m_createPollingChannelBase,v_updateRequest, v_primitiveContentRetrieveResource);//PollingChannel + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) { + if(v_responsePrimitive.primitiveContent.pollingChannel.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { + if(v_primitiveContentRetrieveResource.pollingChannel.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_002_SUB_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.labels := v_labels_1; + + v_responsePrimitive := f_CSE_DMR_UPD_002(int23, m_createSubscriptionBase,v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.labels != v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + function f_CSE_DMR_UPD_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated 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 updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + //Used to check that the resource has been updated + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_002 + + } // end g_CSE_DMR_UPD_002 + + group g_CSE_DMR_UPD_003 { + + /** + * @desc Check that the IUT deletes successfully the attribute ATTRIBUTE_NAME from the TARGET_RESOURCE_ADDRESS resource + * + */ + testcase TC_CSE_DMR_UPD_003_CNT_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var AttributeAux_list v_nullFields; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.container.labels := v_labels_1; + v_updateRequest.primitiveContent.container.labels := v_labels_2; + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_003(int3, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Container + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(ispresent(v_responsePrimitive.primitiveContent.container.labels)){ + if(not(match(v_responsePrimitive.primitiveContent.container.labels,{""}))) { + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly"); + } + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(ispresent(v_primitiveContentRetrieveResource.container.labels)) { + if(not(match(v_primitiveContentRetrieveResource.container.labels,{""}))){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_003_GRP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var AttributeAux_list v_nullFields; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.group_.labels := v_labels_1; + v_updateRequest.primitiveContent.group_.labels := v_labels_2; + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_003(int9, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Group + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(ispresent(v_responsePrimitive.primitiveContent.group_.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(ispresent(v_primitiveContentRetrieveResource.group_.labels)) { + if(not(match(v_primitiveContentRetrieveResource.group_.labels,{""}))){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_003_ACP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var AttributeAux_list v_nullFields; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createRequest := m_createAcpBase; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2; + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_003(int1, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//AccessControlPolicy + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(ispresent(v_primitiveContentRetrieveResource.accessControlPolicy.labels)) { + if(not(match(v_primitiveContentRetrieveResource.accessControlPolicy.labels,{""}))){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_003_SCH_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var AttributeAux_list v_nullFields; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.schedule.labels := v_labels_1; + v_updateRequest.primitiveContent.schedule.labels := v_labels_2; + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_003(int18, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Schedule + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.schedule)) { + if(ispresent(v_responsePrimitive.primitiveContent.schedule.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.schedule)) { + if(ispresent(v_primitiveContentRetrieveResource.schedule.labels)) { + if(not(match(v_primitiveContentRetrieveResource.schedule.labels,{""}))){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_003_PCH_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var AttributeAux_list v_nullFields; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createRequest := m_createPollingChannelBase; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1; + v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2; + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_003(int15, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//PollingChannel + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) { + if(ispresent(v_responsePrimitive.primitiveContent.pollingChannel.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { + if(ispresent(v_primitiveContentRetrieveResource.pollingChannel.labels)) { + if(not(match(v_primitiveContentRetrieveResource.pollingChannel.labels,{""}))){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_003_SUB_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var AttributeAux_list v_nullFields; + var ResponsePrimitive v_responsePrimitive; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.subscription.labels := v_labels_1; + v_updateRequest.primitiveContent.subscription.labels := v_labels_2; + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_003(int23, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(ispresent(v_responsePrimitive.primitiveContent.subscription.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(ispresent(v_primitiveContentRetrieveResource.subscription.labels)) { + if(not(match(v_primitiveContentRetrieveResource.subscription.labels,{""}))){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + } + + function f_CSE_DMR_UPD_003(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + //f_match2PrimitiveContent(vc_resourcesList[v_resourceIndex].resource, p_createRequestPrimitive.primitiveContent); TODO fix the match problem + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request, p_nullFields)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated 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 updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_003 + + } // end g_CSE_DMR_UPD_003 + + group g_CSE_DMR_UPD_004 { + + /** + * @desc Check that the IUT updates the value of the attribute ATTRIBUTE_NAME_1, and creates the ATTRIBUTE_NAME_2 and deletes the ATTRIBUTE_NAME_3 of the TARGET_RESOURCE_ADDRESS resource + * + */ + testcase TC_CSE_DMR_UPD_004_CNT_ET_MNI_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var AttributeAux_list v_nullFields; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.container.labels := v_labels_1;//Attribute 3 + v_updateRequest.primitiveContent.container.expirationTime := "20301231T012345";//Attribute 1 + v_updateRequest.primitiveContent.container.maxNrOfInstances := 5;//Attribute 2 + v_updateRequest.primitiveContent.container.labels := v_labels_2;//Attribute 3 + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_004(int3, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Container + + if(getverdict == pass){ + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + //Check attribute 1 + if(v_responsePrimitive.primitiveContent.container.expirationTime != valueof(v_updateRequest.primitiveContent.container.expirationTime)){ + setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly") + } + //Check attribute 2 + if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.container.maxNrOfInstances)){ + setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_responsePrimitive.primitiveContent.container.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + //Check attribute 1 + if(v_primitiveContentRetrieveResource.container.expirationTime != valueof(v_updateRequest.primitiveContent.container.expirationTime)){ + setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly") + } + //Check attribute 2 + if(v_primitiveContentRetrieveResource.container.maxNrOfInstances != valueof(v_updateRequest.primitiveContent.container.maxNrOfInstances)){ + setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_primitiveContentRetrieveResource.container.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_004_GRP_ET_GN_LBL() runs on CseTester system CseSystem { + // Local variables + var XSD.String v_groupName_1 := "VALUE_1"; + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + + var AttributeAux_list v_nullFields; + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.group_.labels := v_labels_1;//Attribute 3 + v_updateRequest.primitiveContent.group_.expirationTime := "20301231T012345";//Attribute 1 + v_updateRequest.primitiveContent.group_.groupName:= v_groupName_1;//Attribute 2 + v_updateRequest.primitiveContent.group_.labels := v_labels_2;//Attribute 3 + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_004(int9, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Group + + if(getverdict == pass){ + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + //Check attribute 1 + if(not match(v_responsePrimitive.primitiveContent.group_.groupName, valueof(v_updateRequest.primitiveContent.group_.groupName))){ + setverdict(fail, __SCOPE__ & ": Error: groupName attribute not updated correctly") + } + //Check attribute 2 + if(not match(v_responsePrimitive.primitiveContent.group_.expirationTime, valueof(v_updateRequest.primitiveContent.group_.expirationTime))){ + setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_responsePrimitive.primitiveContent.group_.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + //Check attribute 1 + if(v_primitiveContentRetrieveResource.group_.groupName != valueof(v_updateRequest.primitiveContent.group_.groupName)){ + setverdict(fail, __SCOPE__ & ": Error: groupName attribute not updated correctly") + } + //Check attribute 2 + if(v_primitiveContentRetrieveResource.group_.expirationTime != valueof(v_updateRequest.primitiveContent.group_.expirationTime)){ + setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_primitiveContentRetrieveResource.group_.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_004_ACP_PV_AT_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var SetOfAcrs v_privileges_2 := {accessControlRule_list := {valueof(m_createAcr({PX_SUPER_USER}, int61))}}; + var AttributeAux_list v_nullFields; + var template RequestPrimitive v_createRequest := m_createAcpBase;// privileges set by default to 63 for * + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1;//Attribute 3 + v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_2; //Attribute 1 + v_updateRequest.primitiveContent.accessControlPolicy.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2 + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2;//Attribute 3 + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_004(int1, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//AccessControlPolicy + + if(getverdict == pass){ + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + //Check attribute 1 + if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges.accessControlRule_list[0].accessControlOperations, v_privileges_2.accessControlRule_list[0].accessControlOperations)){ + setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly") + } + //Check attribute 2 + if(not match(v_responsePrimitive.primitiveContent.accessControlPolicy.announceTo, valueof(v_updateRequest.primitiveContent.accessControlPolicy.announceTo))){ + setverdict(fail, __SCOPE__ & ": Error: Announce_to attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + //Check attribute 1 + if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.privileges.accessControlRule_list[0].accessControlOperations, v_privileges_2.accessControlRule_list[0].accessControlOperations)){ + setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly") + } + //Check attribute 2 + if(not match (v_primitiveContentRetrieveResource.accessControlPolicy.announceTo, valueof(v_updateRequest.primitiveContent.accessControlPolicy.announceTo))){ + setverdict(fail, __SCOPE__ & ": Error: Announce_to attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_primitiveContentRetrieveResource.accessControlPolicy.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_004_SCH_SE_AT_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"To be deleted"}; + var AttributeAux_list v_nullFields; + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.schedule.scheduleElement := {{"0,0,0 1 2,1,1,*"}};//Attribute 1 + v_updateRequest.primitiveContent.schedule.scheduleElement := {{"1,1,1 1 2,1,1,*"}}; //Attribute 1 + v_updateRequest.primitiveContent.schedule.announceTo := {f_getAnnouncementTargetPoA()};//Attribute 2 + v_updateRequest.primitiveContent.schedule.labels := v_labels_1;//Attribute 3 + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_004(int18, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Schedule + + if(getverdict == pass){ + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.schedule)) { + //Check attribute 1 + if(v_responsePrimitive.primitiveContent.schedule.scheduleElement != valueof(v_updateRequest.primitiveContent.schedule.scheduleElement)){ + setverdict(fail, __SCOPE__ & ": Error: Schedule Element attribute not updated correctly") + } + //Check attribute 2 + if(v_responsePrimitive.primitiveContent.schedule.announceTo != valueof(v_updateRequest.primitiveContent.schedule.announceTo)){ + setverdict(fail, __SCOPE__ & ": Error: Announce_To attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_responsePrimitive.primitiveContent.schedule.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.schedule)) { + //Check attribute 1 + if(v_primitiveContentRetrieveResource.schedule.scheduleElement != valueof(v_updateRequest.primitiveContent.schedule.scheduleElement)){ + setverdict(fail, __SCOPE__ & ": Error: Schedule Element attribute not updated correctly") + } + //Check attribute 2 + if(v_primitiveContentRetrieveResource.schedule.announceTo != valueof(v_updateRequest.primitiveContent.schedule.announceTo)){ + setverdict(fail, __SCOPE__ & ": Error: Announce_To attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_primitiveContentRetrieveResource.schedule.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_004_PCH_LBL_ACP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"To be deleted"}; + var AttributeAux_list v_nullFields; + var template RequestPrimitive v_createRequest := m_createPollingChannelBase; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.pollingChannel.labels := v_labels_1;//Attribute 3 + //No Attribute 1 + //v_updateRequest.primitiveContent.pollingChannel.accessControlPolicyIDs := v_acp;//Attribute 2 TODO Find another alternative for Attribute 2 + v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_2;//Attribute 3 + + v_nullFields := {{"labels", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_004(int15, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//PollingChannel + + if(getverdict == pass){ + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.pollingChannel)) { + //Check attribute 1 + + //Check attribute 2 TODO once another alternative is found, activate this checking + /*if(not match(v_responsePrimitive.primitiveContent.pollingChannel.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.pollingChannel.accessControlPolicyIDs))){ + setverdict(fail, __SCOPE__ & ": Error: ACPI attribute not added correctly") + }*/ + //Check attribute 3 + if(ispresent(v_responsePrimitive.primitiveContent.pollingChannel.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { + if(ispresent (v_primitiveContentRetrieveResource.pollingChannel.labels)){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not deleted correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_004_SUB_ET_LBL_EXC() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var AttributeAux_list v_nullFields; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_createRequest.primitiveContent.subscription.expirationCounter := 10;//Attribute 3 + v_updateRequest.primitiveContent.subscription.expirationTime := "20301231T012345";//Attribute 1 + v_updateRequest.primitiveContent.subscription.labels := v_labels_1;//Attribute 2 + v_updateRequest.primitiveContent.subscription.expirationCounter := 5;//Attribute 3 + + v_nullFields := {{"expirationCounter", omit}}; + + v_responsePrimitive := f_CSE_DMR_UPD_004(int23, v_createRequest, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Subscription + + if(getverdict == pass){ + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + //Check attribute 1 + if(not match(v_responsePrimitive.primitiveContent.subscription.labels, valueof(v_updateRequest.primitiveContent.subscription.labels))){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + //Check attribute 2 + if(not match(v_responsePrimitive.primitiveContent.subscription.expirationTime, valueof(v_updateRequest.primitiveContent.subscription.expirationTime))){ + setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_responsePrimitive.primitiveContent.subscription.expirationCounter)){ + setverdict(fail, __SCOPE__ & ": Error: expirationCounter attribute not deleted correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + //Check attribute 1 + if(not match (v_primitiveContentRetrieveResource.subscription.labels, valueof(v_updateRequest.primitiveContent.subscription.labels))){ + setverdict(fail, __SCOPE__ & ": Error: Label attribute not updated correctly") + } + //Check attribute 2 + if(not match (v_primitiveContentRetrieveResource.subscription.expirationTime, valueof(v_updateRequest.primitiveContent.subscription.expirationTime))){ + setverdict(fail, __SCOPE__ & ": Error: expirationTime attribute not updated correctly") + } + //Check attribute 3 + if(ispresent(v_primitiveContentRetrieveResource.subscription.expirationCounter)){ + setverdict(fail, __SCOPE__ & ": Error: expirationCounter attribute not deleted correctly") + } + } + } + } + + function f_CSE_DMR_UPD_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request, p_nullFields)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated 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 updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_004 + + } // end g_CSE_DMR_UPD_004 + + group g_CSE_DMR_UPD_005{ + + /** + * @desc Check that the IUT responds with an error when the AE tries to update an attribute of a TARGET_RESOURCE_ADDRESS resource which does not exist + * + */ + testcase TC_CSE_DMR_UPD_005_CNT_EXC() runs on CseTester system CseSystem { + // Local variables + var XSD.PositiveInteger v_expirationCounter := 1; + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + + v_updateRequest.primitiveContent := {container_update_invalid := m_contentUpdateContainer_invalid}; + + v_updateRequest.primitiveContent.container_update_invalid.expirationCounter := v_expirationCounter; + + f_CSE_DMR_UPD_005(int3, v_createRequest, v_updateRequest);//Container + } + + testcase TC_CSE_DMR_UPD_005_GRP_EXC() runs on CseTester system CseSystem { + // Local variables + var XSD.PositiveInteger v_expirationCounter := 1; + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + + v_updateRequest.primitiveContent := {group_update_invalid := m_contentUpdateGroup_invalid}; + + v_updateRequest.primitiveContent.group_update_invalid.expirationCounter := v_expirationCounter; + + f_CSE_DMR_UPD_005(int9, v_createRequest, v_updateRequest);//Group + } + + testcase TC_CSE_DMR_UPD_005_ACP_EXC() runs on CseTester system CseSystem { + // Local variables + var XSD.PositiveInteger v_expirationCounter := 1; + var template RequestPrimitive v_createRequest := m_createAcpBase; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + + v_updateRequest.primitiveContent := {aCP_update_invalid := m_contentUpdateAcp_invalid}; + + v_updateRequest.primitiveContent.aCP_update_invalid.expirationCounter := v_expirationCounter; + + f_CSE_DMR_UPD_005(int1, v_createRequest, v_updateRequest);//AccessControlPolicy + } + + testcase TC_CSE_DMR_UPD_005_SCH_EXC() runs on CseTester system CseSystem { + // Local variables + var XSD.PositiveInteger v_expirationCounter := 1; + var template RequestPrimitive v_createRequest := m_createScheduleBase; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + + v_updateRequest.primitiveContent := {schedule_update_invalid := m_contentUpdateSchedule_invalid}; + + v_updateRequest.primitiveContent.schedule_update_invalid.expirationCounter := v_expirationCounter; + + f_CSE_DMR_UPD_005(int18, v_createRequest, v_updateRequest);//Schedule + } + + testcase TC_CSE_DMR_UPD_005_PCH_EXC() runs on CseTester system CseSystem { + // Local variables + var XSD.PositiveInteger v_expirationCounter := 1; + var template RequestPrimitive v_createRequest := m_createPollingChannelBase; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + + v_updateRequest.primitiveContent := {pollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}; + + v_updateRequest.primitiveContent.pollingChannel_update_invalid.expirationCounter := v_expirationCounter; + + f_CSE_DMR_UPD_005(int15, v_createRequest, v_updateRequest);//PollingChannel + } + + testcase TC_CSE_DMR_UPD_005_SUB_MNI() runs on CseTester system CseSystem { + // Local variables + var XSD.NonNegativeInteger v_maxNrOfInstances := 5; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + + v_updateRequest.primitiveContent := {subscription_update_invalid := m_contentUpdateSubscription_invalid}; + + v_updateRequest.primitiveContent.subscription_update_invalid.maxNrOfInstances := v_maxNrOfInstances; + + f_CSE_DMR_UPD_005(int23, v_createRequest, v_updateRequest);//Subscription + } + + function f_CSE_DMR_UPD_005(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_aeIndex := -1; + var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive , v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource " & c_defaultResourceName & " of type " & int2str(enum2int(p_resourceType)) & " not found"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating an unexisting resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_005 + + } // end g_CSE_DMR_UPD_005 + + group g_CSE_DMR_UPD_006{ + + /** + * @desc Check that the IUT responds with an error when the AE tries to update the attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource without having privileges for the UPDATE operation + * + */ + testcase TC_CSE_DMR_UPD_006_CNT_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.labels := v_labels_1; + + f_CSE_DMR_UPD_006(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.labels == v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_006_GRP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.labels := v_labels_1; + + f_CSE_DMR_UPD_006(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.labels == v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_006_ACP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var template RequestPrimitive v_requestPrimitive := m_createAcpBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_requestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[0].accessControlOperations := int59; + + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; + + f_CSE_DMR_UPD_006(int1, v_requestPrimitive, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.labels == v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_006_SCH_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.schedule.labels := v_labels_1; + + f_CSE_DMR_UPD_006(int18, m_createScheduleBase, v_updateRequest, v_primitiveContentRetrieveResource);//Schedule + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.schedule)) { + if(v_primitiveContentRetrieveResource.schedule.labels == v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_006_PCH_LBL() runs on CseTester system CseSystem { + // Local variable + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.pollingChannel.labels := v_labels_1; + + f_CSE_DMR_UPD_006(int15, m_createPollingChannelBase, v_updateRequest, v_primitiveContentRetrieveResource);//PollingChannel + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { + if(v_primitiveContentRetrieveResource.pollingChannel.labels == v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_006_SUB_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.labels := v_labels_1; + + f_CSE_DMR_UPD_006(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.labels == v_labels_1){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + } + + function f_CSE_DMR_UPD_006(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_acpAuxIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int59);//c_CRDNDi) + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to update attributes from resource type " & int2str(enum2int(p_resourceType))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Updating attributes from resource without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_006 + + } // end g_CSE_DMR_UPD_006 + + + group g_CSE_DMR_UPD_007{ + + /** + * @desc Check that the IUT responds with an error when the AE tries to update a non-RW attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource + * + */ + testcase TC_CSE_DMR_UPD_007_CNT_CT() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_creationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent := {container_update_invalid := m_contentUpdateContainer_invalid}; + v_updateRequest.primitiveContent.container_update_invalid.creationTime := v_creationTime; + + f_CSE_DMR_UPD_007(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.container_update_invalid)) { + if(v_primitiveContentRetrieveResource.container_update_invalid.creationTime == v_creationTime){ + setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_007_GRP_CT() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_creationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent := {group_update_invalid := m_contentUpdateGroup_invalid}; + v_updateRequest.primitiveContent.group_update_invalid.creationTime := v_creationTime; + + f_CSE_DMR_UPD_007(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.group_update_invalid)) { + if(v_primitiveContentRetrieveResource.group_update_invalid.creationTime == v_creationTime){ + setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_007_ACP_CT() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_creationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent := {aCP_update_invalid := m_contentUpdateAcp_invalid}; + v_updateRequest.primitiveContent.aCP_update_invalid.creationTime := v_creationTime; + + f_CSE_DMR_UPD_007(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.aCP_update_invalid)) { + if(v_primitiveContentRetrieveResource.aCP_update_invalid.creationTime == v_creationTime){ + setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_007_SCH_CT() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_creationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent := {schedule_update_invalid := m_contentUpdateSchedule_invalid}; + v_updateRequest.primitiveContent.schedule_update_invalid.creationTime := v_creationTime; + + f_CSE_DMR_UPD_007(int18, m_createScheduleBase, v_updateRequest, v_primitiveContentRetrieveResource);//Schedule + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.schedule_update_invalid)) { + if(v_primitiveContentRetrieveResource.schedule_update_invalid.creationTime == v_creationTime){ + setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_007_PCH_CT() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_creationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent := {pollingChannel_update_invalid := m_contentUpdatePollingChannel_invalid}; + v_updateRequest.primitiveContent.pollingChannel_update_invalid.creationTime := v_creationTime; + + f_CSE_DMR_UPD_007(int15, m_createPollingChannelBase, v_updateRequest, v_primitiveContentRetrieveResource);//PollingChannel + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.pollingChannel_update_invalid)) { + if(v_primitiveContentRetrieveResource.pollingChannel_update_invalid.creationTime == v_creationTime){ + setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_007_SUB_CT() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_creationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent := {subscription_update_invalid := m_contentUpdateSubscription_invalid}; + v_updateRequest.primitiveContent.subscription_update_invalid.creationTime := v_creationTime; + + f_CSE_DMR_UPD_007(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.subscription_update_invalid)) { + if(v_primitiveContentRetrieveResource.subscription_update_invalid.creationTime == v_creationTime){ + setverdict(fail, __SCOPE__ & ": Error: Creation Time attribute updated") + } + } + } + } + + function f_CSE_DMR_UPD_007(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation not allowed. RO attribute from resource type " & int2str(enum2int(p_resourceType)) ); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Updating RO attribute from resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_007 + + } // end g_CSE_DMR_UPD_007 + + group g_CSE_DMR_UPD_008{ + + /** + * @desc Check that the IUT responds with an error when the AE tries to delete a mandatory RW attribute ATTRIBUTE_NAME of a TARGET_RESOURCE_ADDRESS resource + * + */ + testcase TC_CSE_DMR_UPD_008_CNT_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var AttributeAux_list v_nullFields; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_nullFields := {{"expirationTime", omit}}; + + v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime; + + f_CSE_DMR_UPD_008(int3, m_createContainerBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.expirationTime == v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_008_GRP_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var AttributeAux_list v_nullFields; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_nullFields := {{"expirationTime", omit}}; + + v_updateRequest.primitiveContent.group_.expirationTime := v_expirationTime; + + f_CSE_DMR_UPD_008(int9, m_createGroupBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.expirationTime == v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_008_ACP_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var AttributeAux_list v_nullFields; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_nullFields := {{"expirationTime", omit}}; + + v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime; + + f_CSE_DMR_UPD_008(int1, m_createAcpBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//AccessControlPolicy + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.expirationTime == v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_008_SCH_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateScheduleBase; + var AttributeAux_list v_nullFields; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_nullFields := {{"expirationTime", omit}}; + + v_updateRequest.primitiveContent.schedule.expirationTime := v_expirationTime; + + f_CSE_DMR_UPD_008(int18, m_createScheduleBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Schedule + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.schedule)) { + if(v_primitiveContentRetrieveResource.schedule.expirationTime == v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_008_PCH_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updatePollingChannelBase; + var AttributeAux_list v_nullFields; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_nullFields := {{"expirationTime", omit}}; + + v_updateRequest.primitiveContent.pollingChannel.expirationTime := v_expirationTime; + + f_CSE_DMR_UPD_008(int15, m_createPollingChannelBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//PollingChannel + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.pollingChannel)) { + if(v_primitiveContentRetrieveResource.pollingChannel.expirationTime == v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") + } + } + } + } + + testcase TC_CSE_DMR_UPD_008_SUB_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var AttributeAux_list v_nullFields; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_nullFields := {{"expirationTime", omit}}; + + v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime; + + f_CSE_DMR_UPD_008(int23, m_createSubscriptionBase, v_updateRequest, v_nullFields, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.expirationTime == v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute updated") + } + } + } + } + + function f_CSE_DMR_UPD_008(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, template (omit) AttributeAux_list p_nullFields := omit, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request,p_nullFields)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation not allowed. Mandatory RW attribute from resource type " & int2str(enum2int(p_resourceType)) ); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Deleting a mandatory RW attribute from resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_UPD_008 + + } // end g_CSE_DMR_UPD_008 + + group g_CSE_DMR_UPD_010{ + + /** + * @desc Check that the stateTag attribute of a container resource is increased when an update operation has been performed on its child resource + * + */ + testcase TC_CSE_DMR_UPD_010() runs on CseTester system CseSystem { + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + if(ispresent(vc_resourcesList[v_containerIndex].resource.container.stateTag)) { + + v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 1) { //(Create and Delete) + setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented"); + } + else{ + setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + }//end if + else{ + setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_UPD_010 + + } // end group g_CSE_DMR_UPD_010 + + group g_CSE_DMR_UPD_011{ + + /** + * @desc Check that the IUT rejects the UPDATE Request of an existing contentInstance resource with error “OPERATION_NOT_ALLOWED†+ * + */ + testcase TC_CSE_DMR_UPD_011() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex := -1; + var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase; + var Labels v_labels:= {"LABEL"}; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.contentInstance.labels := v_labels; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); + + //Test Body + v_request := f_getUpdateRequestPrimitive(int4, v_contentInstanceIndex, v_updateRequest); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Not allowed to update a contentInstance with error OPERATION_NOT_ALLOWED"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Accepted update of contentInstance"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating contentInstance"); + } + } + + v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex); + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) { + if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_UPD_011 + + } // end group g_CSE_DMR_UPD_011 + + group g_CSE_DMR_UPD_012{ + + /** + * @desc Check that the IUT rejects the UPDATE Request of a latest resource as a direct child of a <container> resource with error “OPERATION_NOT_ALLOWED†+ * + */ + testcase TC_CSE_DMR_UPD_012() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex := -1; + var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase; + var Labels v_labels := {"LABEL"}; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.contentInstance.labels := v_labels; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); + + //Test Body + v_request := f_getUpdateRequestPrimitive(int4, v_containerIndex, v_updateRequest); + + v_request.to_ := v_request.to_ & "/" & c_resourceShortNameLatest; //<latest> + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Not allowed to update a latest resource with error OPERATION_NOT_ALLOWED"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Accepted update of a latest resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating a latest resource"); + } + } + + v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex); + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) { + if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_UPD_012 + + } // end group g_CSE_DMR_UPD_012 + + group g_CSE_DMR_UPD_013{ + + /** + * @desc Check that the IUT rejects the UPDATE Request of an oldest resource as a direct child of a <container> resource with error “OPERATION_NOT_ALLOWED†+ * + */ + testcase TC_CSE_DMR_UPD_013() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex := -1; + var template RequestPrimitive v_updateRequest := m_updateContentInstanceBase; + var Labels v_labels:= {"LABEL"}; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.contentInstance.labels := v_labels; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); + + //Test Body + v_request := f_getUpdateRequestPrimitive(int4, v_containerIndex, v_updateRequest); + + v_request.to_ := v_request.to_ & "/" & c_resourceShortNameOldest; //<oldest> + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Not allowed to update an oldest resource with error OPERATION_NOT_ALLOWED"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Accepted update of an oldest resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating an oldest resource"); + } + } + + v_primitiveContentRetrieveResource:=f_cse_retrieveResource(v_contentInstanceIndex); + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrieveResource.contentInstance)) { + if(v_primitiveContentRetrieveResource.contentInstance.labels == v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute updated") + } + } + } + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_DMR_UPD_013 + + } // end group g_CSE_DMR_UPD_013 + + group g_CSE_DMR_UPD_014 { + + /** + * @desc Check that the IUT updates successfully the value of the optional attribute OPTIONAL_ATTRIBUTE of the RESOURCE_TYPE resource. + * + */ + testcase TC_CSE_DMR_UPD_014_ACP_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime_1 := "20301231T012345"; + var Timestamp v_expirationTime_2 := "20401020T012345"; + var template RequestPrimitive v_createRequest := m_createAcpBase; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime_1; + v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest);//ACP + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.expirationTime != v_expirationTime_2){ + setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_ACP_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"VALUE_2"}; + var template RequestPrimitive v_createRequest := m_createAcpBase; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.accessControlPolicy.labels := v_labels_1; + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest);//ACP + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_ACP_PV() runs on CseTester system CseSystem { + // Local variables + var SetOfAcrs v_privileges_1; + var SetOfAcrs v_privileges_2; + var template RequestPrimitive v_createRequest := m_createAcpBase; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + + v_privileges_1.accessControlRule_list[0].accessControlOperations := int31; + v_privileges_2.accessControlRule_list[0].accessControlOperations := int63; + + v_createRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1; + v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest);//ACP + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges != v_privileges_2){ + setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_ACP_PVS() runs on CseTester system CseSystem { + // Local variables + var SetOfAcrs v_selfPrivileges_1; + var SetOfAcrs v_selfPrivileges_2; + var template RequestPrimitive v_createRequest := m_createAcpBase; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + + v_selfPrivileges_1.accessControlRule_list[0].accessControlOperations := int31; + v_selfPrivileges_2.accessControlRule_list[0].accessControlOperations := int63; + + v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfPrivileges_1; + v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_selfPrivileges_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int1, v_createRequest, v_updateRequest);//ACP + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.selfPrivileges != v_selfPrivileges_2){ + setverdict(fail, __SCOPE__ & ": Error: SelfPrivileges attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_CNT_ACPI() runs on CseTester system CseSystem { + // Local variables + var AcpType v_accessControlPolicyIDs_1 := {"NotInitialized_1"}; + var AcpType v_accessControlPolicyIDs_2 := {"NotInitialized_2"}; + var ResponsePrimitive v_responsePrimitive; + + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + + v_createRequest.primitiveContent.container.accessControlPolicyIDs := v_accessControlPolicyIDs_1; + v_updateRequest.primitiveContent.container.accessControlPolicyIDs := v_accessControlPolicyIDs_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container + + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.accessControlPolicyIDs != v_accessControlPolicyIDs_2){ + setverdict(fail, __SCOPE__ & ": Error: AccessControlPolicyIDs attribute not updated correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_014_CNT_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime_1 := "20301231T012345"; + var Timestamp v_expirationTime_2 := "20401020T012345"; + var ResponsePrimitive v_responsePrimitive; + + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + + v_createRequest.primitiveContent.container.expirationTime := v_expirationTime_1; + v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container + + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.expirationTime != v_expirationTime_2){ + setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_014_CNT_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"VALUE_2"}; + var ResponsePrimitive v_responsePrimitive; + + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + + v_createRequest.primitiveContent.container.labels := v_labels_1; + v_updateRequest.primitiveContent.container.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container + + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_014_CNT_MBS() runs on CseTester system CseSystem { + // Local variables + var XSD.NonNegativeInteger v_maxByteSize_1 := 256; + var XSD.NonNegativeInteger v_maxByteSize_2 := 512; + var ResponsePrimitive v_responsePrimitive; + + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + + v_createRequest.primitiveContent.container.maxByteSize := v_maxByteSize_1; + v_updateRequest.primitiveContent.container.maxByteSize := v_maxByteSize_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container + + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.maxByteSize != v_maxByteSize_2){ + setverdict(fail, __SCOPE__ & ": Error: MaxByteSize attribute not updated correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_014_CNT_MIA() runs on CseTester system CseSystem { + // Local variables + var XSD.NonNegativeInteger v_maxInstanceAge_1 := 60; + var XSD.NonNegativeInteger v_maxInstanceAge_2 := 120; + var ResponsePrimitive v_responsePrimitive; + + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + + v_createRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge_1; + v_updateRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container + + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.maxInstanceAge != v_maxInstanceAge_2){ + setverdict(fail, __SCOPE__ & ": Error: MaxInstanceAge attribute not updated correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_014_CNT_MNI() runs on CseTester system CseSystem { + // Local variables + var XSD.NonNegativeInteger v_maxNrOfInstances_1 := 1; + var XSD.NonNegativeInteger v_maxNrOfInstances_2 := 2; + var ResponsePrimitive v_responsePrimitive; + + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + + v_createRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances_1; + v_updateRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container + + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != v_maxNrOfInstances_2){ + setverdict(fail, __SCOPE__ & ": Error: MaxNrOfInstances attribute not updated correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_014_CNT_OR() runs on CseTester system CseSystem { + // Local variables + var XSD.AnyURI v_ontologyRef_1 := "MyOntologyRef_1"; + var XSD.AnyURI v_ontologyRef_2 := "MyOntologyRef_2"; + var ResponsePrimitive v_responsePrimitive; + + var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + + v_createRequest.primitiveContent.container.ontologyRef := v_ontologyRef_1; + v_updateRequest.primitiveContent.container.ontologyRef := v_ontologyRef_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int3, v_createRequest, v_updateRequest);//Container + + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.ontologyRef != v_ontologyRef_2){ + setverdict(fail, __SCOPE__ & ": Error: OntologyRef attribute not updated correctly") + } + } + } + } + } + + testcase TC_CSE_DMR_UPD_014_SUB_ACPI() runs on CseTester system CseSystem { + // Local variables + var AcpType v_accessControlPolicyIDs_1 := {"NotInitialized_1"}; + var AcpType v_accessControlPolicyIDs_2 := {"NotInitialized_2"}; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.accessControlPolicyIDs := v_accessControlPolicyIDs_1; + v_updateRequest.primitiveContent.subscription.accessControlPolicyIDs := v_accessControlPolicyIDs_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.accessControlPolicyIDs != v_accessControlPolicyIDs_2){ + setverdict(fail, __SCOPE__ & ": Error: AccessControlPolicyIDs attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_BN() runs on CseTester system CseSystem { + // Local variables + var BatchNotify v_batchNotify_1 := {1, "PT1S"}; + var BatchNotify v_batchNotify_2 := {2, "PT1S"}; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.batchNotify := v_batchNotify_1; + v_updateRequest.primitiveContent.subscription.batchNotify := v_batchNotify_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.batchNotify != v_batchNotify_2){ + setverdict(fail, __SCOPE__ & ": Error: EventNotificationCriteria attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_ENC() runs on CseTester system CseSystem { + // Local variables + var EventNotificationCriteria v_eventNotificationCriteria_1 := valueof(m_eventNotificationCriteria({int1}, -)); + var EventNotificationCriteria v_eventNotificationCriteria_2 := valueof(m_eventNotificationCriteria({int2}, -)); + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.eventNotificationCriteria := v_eventNotificationCriteria_1; + v_updateRequest.primitiveContent.subscription.eventNotificationCriteria := v_eventNotificationCriteria_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.eventNotificationCriteria != v_eventNotificationCriteria_2){ + setverdict(fail, __SCOPE__ & ": Error: EventNotificationCriteria attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_ET() runs on CseTester system CseSystem { + // Local variables + var Timestamp v_expirationTime_1 := "20301231T012345"; + var Timestamp v_expirationTime_2 := "20401020T012345"; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.expirationTime := v_expirationTime_1; + v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.expirationTime != v_expirationTime_2){ + setverdict(fail, __SCOPE__ & ": Error: ExpirationTime attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_EXC() runs on CseTester system CseSystem { + // Local variables + var XSD.PositiveInteger v_expirationCounter_1 := 10; + var XSD.PositiveInteger v_expirationCounter_2 := 20; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.expirationCounter := v_expirationCounter_1; + v_updateRequest.primitiveContent.subscription.expirationCounter := v_expirationCounter_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.expirationCounter != v_expirationCounter_2){ + setverdict(fail, __SCOPE__ & ": Error: ExpirationCounter attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_GPI() runs on CseTester system CseSystem { + // Local variables + var XSD.AnyURI v_groupID_1 := "MyGroupID_1"; + var XSD.AnyURI v_groupID_2 := "MyGroupID_2"; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.groupID := v_groupID_1; + v_updateRequest.primitiveContent.subscription.groupID := v_groupID_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.groupID != v_groupID_2){ + setverdict(fail, __SCOPE__ & ": Error: GroupID attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_LBL() runs on CseTester system CseSystem { + // Local variables + var Labels v_labels_1 := {"VALUE_1"}; + var Labels v_labels_2 := {"VALUE_2"}; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.labels := v_labels_1; + v_updateRequest.primitiveContent.subscription.labels := v_labels_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels_2){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_LN() runs on CseTester system CseSystem { + // Local variables + var XSD.Boolean v_latestNotify_1 := true; + var XSD.Boolean v_latestNotify_2 := false; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.latestNotify := v_latestNotify_1; + v_updateRequest.primitiveContent.subscription.latestNotify := v_latestNotify_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.latestNotify != v_latestNotify_2){ + setverdict(fail, __SCOPE__ & ": Error: LatestNotify attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_NCT() runs on CseTester system CseSystem { + // Local variables + var NotificationContentType v_notificationContentType_1 := int1; + var NotificationContentType v_notificationContentType_2 := int2; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType_1; + v_updateRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationContentType != v_notificationContentType_2){ + setverdict(fail, __SCOPE__ & ": Error: NotificationContentType attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_NEC() runs on CseTester system CseSystem { + // Local variables + var EventCat v_notificationEventCat_1 := {alt_1 := 100}; + var EventCat v_notificationEventCat_2 := {alt_1 := 101}; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.notificationEventCat := v_notificationEventCat_1; + v_updateRequest.primitiveContent.subscription.notificationEventCat := v_notificationEventCat_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationEventCat != v_notificationEventCat_2){ + setverdict(fail, __SCOPE__ & ": Error: NotificationEventCat attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_NFU() runs on CseTester system CseSystem { + // Local variables + var XSD.AnyURI v_notificationForwardingURI_1 := "MyForwardingURI_1"; + var XSD.AnyURI v_notificationForwardingURI_2 := "MyForwardingURI_2"; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.notificationForwardingURI := v_notificationForwardingURI_1; + v_updateRequest.primitiveContent.subscription.notificationForwardingURI := v_notificationForwardingURI_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationForwardingURI != v_notificationForwardingURI_2){ + setverdict(fail, __SCOPE__ & ": Error: NotificationForwardingURI attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_NSP() runs on CseTester system CseSystem { + // Local variables + var XSD.PositiveInteger v_notificationStoragePriority_1 := 1; + var XSD.PositiveInteger v_notificationStoragePriority_2 := 2; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.notificationStoragePriority := v_notificationStoragePriority_1; + v_updateRequest.primitiveContent.subscription.notificationStoragePriority := v_notificationStoragePriority_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationStoragePriority != v_notificationStoragePriority_2){ + setverdict(fail, __SCOPE__ & ": Error: NotificationStoragePriority attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_PN() runs on CseTester system CseSystem { + // Local variables + var PendingNotification v_pendingNotification_1 := int1; + var PendingNotification v_pendingNotification_2 := int2; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.pendingNotification := v_pendingNotification_1; + v_updateRequest.primitiveContent.subscription.pendingNotification := v_pendingNotification_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.pendingNotification != v_pendingNotification_2){ + setverdict(fail, __SCOPE__ & ": Error: PendingNotification attribute not updated correctly") + } + } + } + } + + } + + testcase TC_CSE_DMR_UPD_014_SUB_RL() runs on CseTester system CseSystem { + // Local variables + var RateLimit v_rateLimit_1 := {0, omit}; + var RateLimit v_rateLimit_2 := {1, omit}; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + + v_createRequest.primitiveContent.subscription.rateLimit := v_rateLimit_1; + v_updateRequest.primitiveContent.subscription.rateLimit := v_rateLimit_2; + + v_responsePrimitive := f_CSE_DMR_UPD_014(int23, v_createRequest, v_updateRequest);//Subscription + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.rateLimit != v_rateLimit_2){ + setverdict(fail, __SCOPE__ & ": Error: RateLimit attribute not updated correctly") + } + } + } + } + + } + + function f_CSE_DMR_UPD_014(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive) runs on CseTester return ResponsePrimitive{ + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + return v_response.primitive.responsePrimitive; + + }//end f_CSE_DMR_UPD_014 + + } // end g_CSE_DMR_UPD_014 + + group g_CSE_DMR_UPD_017{ + + /** + * @desc Check that the IUT updates successfully the value of the optional attribute OPTIONAL_ATTRIBUTE of the RESOURCE_TYPE resource under CSEBase + */ + testcase TC_CSE_DMR_UPD_017_CSR_LBL() runs on CseTester system CseSystem { + var Labels v_labels := {"MyLabel"}; + var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.remoteCSE.labels := v_labels; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource);//Remote CSE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { + if(v_responsePrimitive.primitiveContent.remoteCSE.labels != v_labels){ + setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { + if(v_primitiveContentRetrieveResource.remoteCSE.labels != v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CSR_POA() runs on CseTester system CseSystem { + var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"}; + var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := v_poaList; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource);//Remote CSE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { + if(v_responsePrimitive.primitiveContent.remoteCSE.pointOfAccess != v_poaList){ + setverdict(fail, __SCOPE__, ": Error: Point of access attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { + if(v_primitiveContentRetrieveResource.remoteCSE.pointOfAccess != v_poaList){ + setverdict(fail, __SCOPE__ & ": Error: Point of access attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CSR_NL() runs on CseTester system CseSystem { + var XSD.AnyURI v_nodeLink := "MyNodeId"; + var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.remoteCSE.nodeLink := v_nodeLink; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource);//Remote CSE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { + if(v_responsePrimitive.primitiveContent.remoteCSE.nodeLink != v_nodeLink){ + setverdict(fail, __SCOPE__, ": Error: Node link attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { + if(v_primitiveContentRetrieveResource.remoteCSE.nodeLink != v_nodeLink){ + setverdict(fail, __SCOPE__ & ": Error: Node link attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_NOD_LBL() runs on CseTester system CseSystem { + var Labels v_labels := {"MyLabel"}; + var template RequestPrimitive v_updateRequest := m_updateNodeBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.node.labels := v_labels; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createNodeBase, v_updateRequest, v_primitiveContentRetrieveResource);//Node + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.node)) { + if(v_responsePrimitive.primitiveContent.node.labels != v_labels){ + setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.node)) { + if(v_primitiveContentRetrieveResource.node.labels != v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_NOD_ACPI() runs on CseTester system CseSystem { + var AcpType v_acpType := {"NotInitialized"}; + var template RequestPrimitive v_updateRequest := m_updateNodeBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.node.accessControlPolicyIDs := v_acpType; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createNodeBase, v_updateRequest, v_primitiveContentRetrieveResource);//Node + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.node)) { + if(v_responsePrimitive.primitiveContent.node.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__, ": Error: Access Control Policy attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.node)) { + if(v_primitiveContentRetrieveResource.node.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__ & ": Error: Access Control Policy attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_NOD_HCL() runs on CseTester system CseSystem { + + /* TO BE DONE */ + } + + testcase TC_CSE_DMR_UPD_017_AE_LBL() runs on CseTester system CseSystem { + var Labels v_labels := {"MyLabel"}; + var template RequestPrimitive v_updateRequest := m_updateAE; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.aE.labels := v_labels; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.aE)) { + if(v_responsePrimitive.primitiveContent.aE.labels != v_labels){ + setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.aE)) { + if(v_primitiveContentRetrieveResource.aE.labels != v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_AE_ACPI() runs on CseTester system CseSystem { + var AcpType v_acpType := {"NotInitialized"}; + var template RequestPrimitive v_updateRequest := m_updateAE; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.aE.accessControlPolicyIDs := v_acpType; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.aE)) { + if(v_responsePrimitive.primitiveContent.aE.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__, ": Error: Access control policy IDs attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.aE)) { + if(v_primitiveContentRetrieveResource.aE.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__ & ": Error: Access control policy IDs attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_AE_APN() runs on CseTester system CseSystem { + var XSD.String v_appName := "MyAppName"; + var template RequestPrimitive v_updateRequest := m_updateAE; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.aE.appName := v_appName; + v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.aE)) { + if(v_responsePrimitive.primitiveContent.aE.appName != v_appName){ + setverdict(fail, __SCOPE__, ": Error: AppName attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.aE)) { + if(v_primitiveContentRetrieveResource.aE.appName != v_appName){ + setverdict(fail, __SCOPE__ & ": Error: AppName attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_AE_POA() runs on CseTester system CseSystem { + var PoaList v_poaList := {"http://" & PX_AE2_ADDRESS & "/"}; + var template RequestPrimitive v_updateRequest := m_updateAE; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.aE.pointOfAccess := v_poaList; + v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.aE)) { + if(v_responsePrimitive.primitiveContent.aE.pointOfAccess != v_poaList){ + setverdict(fail, __SCOPE__, ": Error: Point of Access attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.aE)) { + if(v_primitiveContentRetrieveResource.aE.pointOfAccess != v_poaList){ + setverdict(fail, __SCOPE__ & ": Error: Point of Access attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_AE_OR() runs on CseTester system CseSystem { + var XSD.AnyURI v_ontoLogyRef := "MyOntologyRef"; + var template RequestPrimitive v_updateRequest := m_updateAE; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.aE.ontologyRef := v_ontoLogyRef; + v_responsePrimitive := f_CSE_DMR_UPD_017(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.aE)) { + if(v_responsePrimitive.primitiveContent.aE.ontologyRef != v_ontoLogyRef){ + setverdict(fail, __SCOPE__, ": Error: Ontology Ref attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.aE)) { + if(v_primitiveContentRetrieveResource.aE.ontologyRef != v_ontoLogyRef){ + setverdict(fail, __SCOPE__ & ": Error: Ontology Ref attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CNT_LBL() runs on CseTester system CseSystem { + var Labels v_labels := {"MyLabel"}; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.labels := v_labels; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.labels != v_labels){ + setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.labels != v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CNT_ACPI() runs on CseTester system CseSystem { + var AcpType v_acpType := {"NotInitialized"}; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.accessControlPolicyIDs := v_acpType; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CNT_MNI() runs on CseTester system CseSystem { + var XSD.NonNegativeInteger v_maxNrOfInstances := 5; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.maxNrOfInstances := v_maxNrOfInstances; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.maxNrOfInstances != v_maxNrOfInstances){ + setverdict(fail, __SCOPE__, ": Error: Maximum number of instances attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.maxNrOfInstances != v_maxNrOfInstances){ + setverdict(fail, __SCOPE__ & ": Error: Maximum number of instances attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CNT_MBS() runs on CseTester system CseSystem { + var XSD.NonNegativeInteger v_maxByteSize := 512; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.maxByteSize := v_maxByteSize; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.maxByteSize != v_maxByteSize){ + setverdict(fail, __SCOPE__, ": Error: Maximum Byte size attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.maxByteSize != v_maxByteSize){ + setverdict(fail, __SCOPE__ & ": Error: Maximum Byte Size attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CNT_MIA() runs on CseTester system CseSystem { + var XSD.NonNegativeInteger v_maxInstanceAge := 1; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.maxInstanceAge := v_maxInstanceAge; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.maxInstanceAge != v_maxInstanceAge){ + setverdict(fail, __SCOPE__, ": Error: Maximum Instance age attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.maxInstanceAge != v_maxInstanceAge){ + setverdict(fail, __SCOPE__ & ": Error: Maximum Instance age attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CNT_OR() runs on CseTester system CseSystem { + var XSD.AnyURI v_ontoLogyRef := "MyOntologyRef"; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.ontologyRef := v_ontoLogyRef; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.ontologyRef != v_ontoLogyRef){ + setverdict(fail, __SCOPE__, ": Error: Ontology Ref attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.ontologyRef != v_ontoLogyRef){ + setverdict(fail, __SCOPE__ & ": Error: Ontology Ref attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_CNT_LI() runs on CseTester system CseSystem { + var XSD.AnyURI v_locationID := "MyLocationID"; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.locationID := v_locationID; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.locationID != v_locationID){ + setverdict(fail, __SCOPE__, ": Error: Location ID attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.locationID != v_locationID){ + setverdict(fail, __SCOPE__ & ": Error: Location ID attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_ACP_LBL() runs on CseTester system CseSystem { + var Labels v_labels := {"MyLabel"}; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.accessControlPolicy.labels := v_labels; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.labels != v_labels){ + setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.labels != v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_ACPI() runs on CseTester system CseSystem { + var AcpType v_acpType := {"NotInitialized"}; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.accessControlPolicyIDs := v_acpType; + + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_LBL() runs on CseTester system CseSystem { + var Labels v_labels := {"MyLabel"}; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.labels := v_labels; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.labels != v_labels){ + setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.labels != v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_ENC() runs on CseTester system CseSystem { + var EventNotificationCriteria v_eventNotificationCriteria:= valueof(m_eventNotificationCriteria({int3}, -)); + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.eventNotificationCriteria:=v_eventNotificationCriteria ; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.eventNotificationCriteria != v_eventNotificationCriteria){ + setverdict(fail, __SCOPE__, ": Error: Event Notification Criteria attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.eventNotificationCriteria != v_eventNotificationCriteria){ + setverdict(fail, __SCOPE__ & ": Error: Event Notofication Criteria attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_EXC() runs on CseTester system CseSystem { + var XSD.PositiveInteger v_expirationCounter:=10; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.expirationCounter:=v_expirationCounter; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.expirationCounter != v_expirationCounter){ + setverdict(fail, __SCOPE__, ": Error: Expiration Counter attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.expirationCounter != v_expirationCounter){ + setverdict(fail, __SCOPE__ & ": Error: Expiration Counter attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_GPI() runs on CseTester system CseSystem { + var XSD.AnyURI v_groupID := "MyGroupID"; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.groupID:=v_groupID; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.groupID != v_groupID){ + setverdict(fail, __SCOPE__, ": Error: Group ID attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.groupID != v_groupID){ + setverdict(fail, __SCOPE__ & ": Error: Group ID attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_NFU() runs on CseTester system CseSystem { + var XSD.AnyURI v_notificationForwardingURI:= "MyNotificationForwardingURI"; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.notificationForwardingURI:=v_notificationForwardingURI; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationForwardingURI != v_notificationForwardingURI){ + setverdict(fail, __SCOPE__, ": Error: Notification Forwarding URI attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.notificationForwardingURI != v_notificationForwardingURI){ + setverdict(fail, __SCOPE__ & ": Error: Notification Forwarding URI attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_BN() runs on CseTester system CseSystem { + var BatchNotify v_batchNotify:= {1, "PT1S"}; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.batchNotify:=v_batchNotify; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.batchNotify != v_batchNotify){ + setverdict(fail, __SCOPE__, ": Error: Batch Notify attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.batchNotify != v_batchNotify){ + setverdict(fail, __SCOPE__ & ": Error: Batch Notify attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_RL() runs on CseTester system CseSystem { + var RateLimit v_rateLimit:= {2, "PT1S"}; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.rateLimit:=v_rateLimit; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.rateLimit != v_rateLimit){ + setverdict(fail, __SCOPE__, ": Error: Rate Limit attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.rateLimit != v_rateLimit){ + setverdict(fail, __SCOPE__ & ": Error: Rate Limit attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_PN() runs on CseTester system CseSystem { + var PendingNotification v_pendingNotification:=int2; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.pendingNotification:=v_pendingNotification; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.pendingNotification != v_pendingNotification){ + setverdict(fail, __SCOPE__, ": Error: Pending Notification attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.pendingNotification != v_pendingNotification){ + setverdict(fail, __SCOPE__ & ": Error: Pending Notification attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_NSP() runs on CseTester system CseSystem { + var XSD.PositiveInteger v_notificationStoragePriority:=10; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.notificationStoragePriority:=v_notificationStoragePriority; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationStoragePriority != v_notificationStoragePriority){ + setverdict(fail, __SCOPE__, ": Error: Notification Storage priority attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.notificationStoragePriority != v_notificationStoragePriority){ + setverdict(fail, __SCOPE__ & ": Error: Notification Storage priority attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_LN() runs on CseTester system CseSystem { + var XSD.Boolean v_latestNotify:=true; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.latestNotify:=v_latestNotify; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.latestNotify != v_latestNotify){ + setverdict(fail, __SCOPE__, ": Error: Latest Notify priority attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.latestNotify != v_latestNotify){ + setverdict(fail, __SCOPE__ & ": Error: Latest Notify attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_SUB_NEC() runs on CseTester system CseSystem { + var EventCat v_eventCat:= {alt_1:= 300}; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.notificationEventCat:=v_eventCat; + v_responsePrimitive := f_CSE_DMR_UPD_017(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationEventCat != v_eventCat){ + setverdict(fail, __SCOPE__, ": Error: Notification Event Cat attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.notificationEventCat != v_eventCat){ + setverdict(fail, __SCOPE__ & ": Error: Notification Event Cat attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_GRP_LBL() runs on CseTester system CseSystem { + var Labels v_labels := {"MyLabel"}; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.labels := v_labels; + v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.labels != v_labels){ + setverdict(fail, __SCOPE__, ": Error: Labels attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.labels != v_labels){ + setverdict(fail, __SCOPE__ & ": Error: Labels attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_GRP_ACPI() runs on CseTester system CseSystem { + var AcpType v_acpType := {"NotInitialized"}; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.accessControlPolicyIDs := v_acpType; + v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__, ": Error: Access Control Policy IDs attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.accessControlPolicyIDs != v_acpType){ + setverdict(fail, __SCOPE__ & ": Error: Access Control Policy IDs attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_GRP_MACP() runs on CseTester system CseSystem { + var ListOfURIs v_membersAccessControlPolicyIDs := {"NotInitialized"}; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.membersAccessControlPolicyIDs := v_membersAccessControlPolicyIDs; + v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.membersAccessControlPolicyIDs != v_membersAccessControlPolicyIDs){ + setverdict(fail, __SCOPE__, ": Error: Members Access Control Policy IDs attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.membersAccessControlPolicyIDs != v_membersAccessControlPolicyIDs){ + setverdict(fail, __SCOPE__ & ": Error: Members Access Control Policy IDs attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_017_GRP_GN() runs on CseTester system CseSystem { + var XSD.String v_groupName:="MyGroupName"; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.groupName := v_groupName; + v_responsePrimitive := f_CSE_DMR_UPD_017(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.groupName != v_groupName){ + setverdict(fail, __SCOPE__, ": Error: Group name attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.groupName != v_groupName){ + setverdict(fail, __SCOPE__ & ": Error: Group name attribute not updated correctly") + } + } + } + } + + function f_CSE_DMR_UPD_017(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive { + //Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource + } else { //ResourceType = RemoteCSE + v_resourceIndex := f_cse_registerRemoteCse(p_createRequestPrimitive); + } + + //Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); //CSEBase + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated 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 updating optional attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + return v_response.primitive.responsePrimitive; + } // end function f_CSE_DMR_UPD_017 + + } // end group g_CSE_DMR_UPD_017 + + group g_CSE_DMR_UPD_018 { + + /** + * @desc Check that the IUT updates successfully the value of the attribute MANDATORY_ATTRIBUTE of the RESOURCE_TYPE resource under CSEBase + */ + testcase TC_CSE_DMR_UPD_018_CSR_ET() runs on CseTester system CseSystem { + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.remoteCSE.expirationTime := v_expirationTime; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource);//Remote CSE + + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { + if(v_responsePrimitive.primitiveContent.remoteCSE.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { + if(v_primitiveContentRetrieveResource.remoteCSE.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_CSR_RR() runs on CseTester system CseSystem { + var XSD.Boolean v_requestReachability := true; + var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.remoteCSE.requestReachability := v_requestReachability; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int16, m_createRemoteCSEBase, v_updateRequest, v_primitiveContentRetrieveResource);//Remote CSE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.remoteCSE)) { + if(v_responsePrimitive.primitiveContent.remoteCSE.requestReachability != v_requestReachability){ + setverdict(fail, __SCOPE__, ": Error: Request Reachability attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.remoteCSE)) { + if(v_primitiveContentRetrieveResource.remoteCSE.requestReachability != v_requestReachability){ + setverdict(fail, __SCOPE__ & ": Error: Request Reachability attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_NOD_ET() runs on CseTester system CseSystem { + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateNodeBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.node.expirationTime := v_expirationTime; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createNodeBase, v_updateRequest, v_primitiveContentRetrieveResource);//Node + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.node)) { + if(v_responsePrimitive.primitiveContent.node.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.node)) { + if(v_primitiveContentRetrieveResource.node.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_NOD_NI() runs on CseTester system CseSystem { + var template RequestPrimitive v_updateRequest := m_updateNodeBase; + var XSD.Token v_targetId := "TARGET-ID"; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.node.nodeID := v_targetId; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createNodeBase, v_updateRequest, v_primitiveContentRetrieveResource);//Node + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.node)) { + if(v_responsePrimitive.primitiveContent.node.nodeID != v_targetId){ + setverdict(fail, __SCOPE__, ": Error: NodeID attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.node)) { + if(v_primitiveContentRetrieveResource.node.nodeID != v_targetId){ + setverdict(fail, __SCOPE__ & ": Error: NodeID attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_AE_ET() runs on CseTester system CseSystem { + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateAE; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.aE.expirationTime := v_expirationTime; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.aE)) { + if(v_responsePrimitive.primitiveContent.aE.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.aE)) { + if(v_primitiveContentRetrieveResource.aE.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_AE_RR() runs on CseTester system CseSystem { + var XSD.Boolean v_requestReachability := true; + var template RequestPrimitive v_updateRequest := m_updateAE; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.aE.requestReachability := v_requestReachability; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int2, m_createAe(PX_APP_ID), v_updateRequest, v_primitiveContentRetrieveResource);//AE + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.aE)) { + if(v_responsePrimitive.primitiveContent.aE.requestReachability != v_requestReachability){ + setverdict(fail, __SCOPE__, ": Error: Request Reachability attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.aE)) { + if(v_primitiveContentRetrieveResource.aE.requestReachability != v_requestReachability){ + setverdict(fail, __SCOPE__ & ": Error: Request Reachability attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_CNT_ET() runs on CseTester system CseSystem { + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.container.expirationTime := v_expirationTime; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int3, m_createContainerBase, v_updateRequest, v_primitiveContentRetrieveResource);//Container + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.container)) { + if(v_responsePrimitive.primitiveContent.container.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.container)) { + if(v_primitiveContentRetrieveResource.container.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_ACP_ET() runs on CseTester system CseSystem { + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.accessControlPolicy.expirationTime := v_expirationTime; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_ACP_PV() runs on CseTester system CseSystem { + var SetOfAcrs v_privileges_1 := {{valueof(m_createAcr({PX_SUPER_USER}, int61))}}; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.accessControlPolicy.privileges := v_privileges_1; + v_responsePrimitive := f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.privileges != v_privileges_1){ + setverdict(fail, __SCOPE__, ": Error: Privileges attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.privileges != v_privileges_1){ + setverdict(fail, __SCOPE__ & ": Error: Privileges attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_ACP_PVS() runs on CseTester system CseSystem { + var SetOfAcrs v_privileges_1 := {{valueof(m_createAcr({PX_SUPER_USER}, int61))}}; + var template RequestPrimitive v_updateRequest := m_updateAcpBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.accessControlPolicy.selfPrivileges := v_privileges_1; + v_responsePrimitive := f_CSE_DMR_UPD_018(int1, m_createAcpBase, v_updateRequest, v_primitiveContentRetrieveResource);//AccessControlPolicy + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.accessControlPolicy)) { + if(v_responsePrimitive.primitiveContent.accessControlPolicy.selfPrivileges != v_privileges_1){ + setverdict(fail, __SCOPE__, ": Error: Self Privileges attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.accessControlPolicy)) { + if(v_primitiveContentRetrieveResource.accessControlPolicy.selfPrivileges != v_privileges_1){ + setverdict(fail, __SCOPE__ & ": Error: Self Privileges attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_SUB_ET() runs on CseTester system CseSystem { + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.expirationTime := v_expirationTime; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__, ": Error: Expiration time attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration time attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_SUB_NU() runs on CseTester system CseSystem { + var ListOfURIs v_notificationURI := {"NotReachableNotificationURI"}; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.notificationURI := v_notificationURI; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationURI != v_notificationURI){ + setverdict(fail, __SCOPE__, ": Error: Notification URI attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.notificationURI != v_notificationURI){ + setverdict(fail, __SCOPE__ & ": Error: Notification URI attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_SUB_NCT() runs on CseTester system CseSystem { + var NotificationContentType v_notificationContentType := int2; + var template RequestPrimitive v_updateRequest := m_updateSubscriptionBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.subscription.notificationContentType := v_notificationContentType; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int23, m_createSubscriptionBase, v_updateRequest, v_primitiveContentRetrieveResource);//Subscription + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.subscription)) { + if(v_responsePrimitive.primitiveContent.subscription.notificationContentType != v_notificationContentType){ + setverdict(fail, __SCOPE__, ": Error: Notification Content Type attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.subscription)) { + if(v_primitiveContentRetrieveResource.subscription.notificationContentType != v_notificationContentType){ + setverdict(fail, __SCOPE__ & ": Error: Notification Content Type attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_GRP_ET() runs on CseTester system CseSystem { + var Timestamp v_expirationTime := "20001231T012345"; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.expirationTime := v_expirationTime; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__, ": Error: Expiration Time attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.expirationTime != v_expirationTime){ + setverdict(fail, __SCOPE__ & ": Error: Expiration Time attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_GRP_MNM() runs on CseTester system CseSystem { + var XSD.PositiveInteger v_maxNrOfMembers := 10; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.maxNrOfMembers := v_maxNrOfMembers; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.maxNrOfMembers != v_maxNrOfMembers){ + setverdict(fail, __SCOPE__, ": Error: Maximum Number of Members attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.maxNrOfMembers != v_maxNrOfMembers){ + setverdict(fail, __SCOPE__ & ": Error: Maximum Number of Members attribute not updated correctly") + } + } + } + } + + testcase TC_CSE_DMR_UPD_018_GRP_MID() runs on CseTester system CseSystem { + var ListOfURIs v_memberIDs := {"NotInitialized"}; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var ResponsePrimitive v_responsePrimitive; + var PrimitiveContent v_primitiveContentRetrieveResource; + + v_updateRequest.primitiveContent.group_.memberIDs := v_memberIDs; + + v_responsePrimitive := f_CSE_DMR_UPD_018(int9, m_createGroupBase, v_updateRequest, v_primitiveContentRetrieveResource);//Group + if(getverdict == pass){ + //Check attribute 1 + if(ispresent(v_responsePrimitive.primitiveContent)) { + if(ischosen(v_responsePrimitive.primitiveContent.group_)) { + if(v_responsePrimitive.primitiveContent.group_.memberIDs != v_memberIDs){ + setverdict(fail, __SCOPE__, ": Error: Member IDs attribute not updated correctly") + } + } + } + + //Check that the resource has been udpated correctly + if(ischosen(v_primitiveContentRetrieveResource.group_)) { + if(v_primitiveContentRetrieveResource.group_.memberIDs != v_memberIDs){ + setverdict(fail, __SCOPE__ & ": Error: Member IDs attribute not updated correctly") + } + } + } + } + + function f_CSE_DMR_UPD_018(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, template RequestPrimitive p_updateRequestPrimitive, out PrimitiveContent p_primitiveContentRetrievedResource) runs on CseTester return ResponsePrimitive { + //Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf02Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + if (p_resourceType!=int16){ //ResourceType != RemoteCSE + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive);//under the CSEBase resource + } else { //ResourceType = RemoteCSE + v_resourceIndex := f_cse_registerRemoteCse(p_createRequestPrimitive); + } + + //Test Body + v_request := f_getUpdateRequestPrimitive(p_resourceType, v_resourceIndex, p_updateRequestPrimitive); + + mcaPort.send(m_request(v_request)); //CSEBase + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__, ": Attribute of resource type " & int2str(enum2int(p_resourceType)) & " updated 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 updating mandatory attribute"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__, ": No answer while updating resource type " & int2str(enum2int(p_resourceType))); + } + } + + p_primitiveContentRetrievedResource := f_cse_retrieveResource(v_resourceIndex); + + //Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf02Down(); + + return v_response.primitive.responsePrimitive; + } //end function f_CSE_DMR_UPD_018 + + } // end group g_CSE_DMR_UPD_018 + + }//end group Update + + group Delete { + + group g_CSE_DMR_DEL_001{ + + /** + * @desc Check that the IUT accepts the deletion of a RESOURCE_TYPE resource + * + */ + testcase TC_CSE_DMR_DEL_001_CNT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_001(int3, m_createContainerBase);//Container + + if(getverdict == pass){ + //check if "MyRessource" container resource isn't present in the IUT (for exemple attempt to update the resource) + }; + }; + + testcase TC_CSE_DMR_DEL_001_GRP() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_001(int9, m_createGroupBase);//Group + }; + + testcase TC_CSE_DMR_DEL_001_ACP() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_001(int1, m_createAcpBase);//AccessControlPolicy + }; + + testcase TC_CSE_DMR_DEL_001_SCH() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_001(int18, m_createScheduleBase);//Schedule + }; + + testcase TC_CSE_DMR_DEL_001_PCH() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_001(int15, m_createPollingChannelBase);//PollingChannel + }; + + testcase TC_CSE_DMR_DEL_001_SUB() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_001(int23, m_createSubscriptionBase);//Subscription + }; + + testcase TC_CSE_DMR_DEL_001_CIN() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_001(int4, m_createContentInstanceBase);//ContentInstance + }; + + function f_CSE_DMR_DEL_001(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on CseTester { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_parentIndex := -1; + var integer v_containerIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi) + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + if(p_resourceType == int4) { + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + v_parentIndex := v_containerIndex; + }else{ + v_parentIndex := v_aeIndex; + } + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_parentIndex); + + // Test Body + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource" & int2str(enum2int(p_resourceType)) & " deleted 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 deleting resource type " & int2str(enum2int(p_resourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + };//end f_CSE_DMR_DEL_001 + + };//end of group g_CSE_DMR_DEL_001 + + group g_CSE_DMR_DEL_002{ + + /** + * @desc Check that the IUT responds with an error when the AE tries to delete the resource TARGET_RESOURCE_ADDRESS without having privileges for the DELETE operation + * + */ + testcase TC_CSE_DMR_DEL_002_CNT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_002(int3, m_createContainerBase);//Container + }; + + testcase TC_CSE_DMR_DEL_002_GRP() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_002(int9, m_createGroupBase);//Group + }; + + testcase TC_CSE_DMR_DEL_002_ACP() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_002(int1, m_createAcpBase);//AccessControlPolicy + }; + + testcase TC_CSE_DMR_DEL_002_SCH() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_002(int18, m_createScheduleBase);//Schedule + }; + + testcase TC_CSE_DMR_DEL_002_PCH() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_002(int15, m_createPollingChannelBase);//PollingChannel + }; + + testcase TC_CSE_DMR_DEL_002_SUB() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_002(int23, m_createSubscriptionBase);//Subscription + }; + + + function f_CSE_DMR_DEL_002(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive) runs on CseTester { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var RequestPrimitive v_updateRequest; + var integer v_acpAuxIndex := -1; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); + var AccessControlRule v_accessControlRule_2; + var SetOfAcrs v_setOfArcs; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-,-);//c_CRDNDi); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRUNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + //Update ACP Aux to remove DELETE operation rights to AE, keeping rights of SUPER USER to run postamble + v_accessControlRule_2 := valueof(m_createAcr({f_getResourceId(vc_resourcesList[v_aeIndex].resource)}, int55)); + + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, vc_acpAuxIndex, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + //Adjustments for ACP resource type + if(p_resourceType == int1) { + p_createRequestPrimitive.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_2};//{v_accessControlRule_1,v_accessControlRule_2}; + } else { + p_createRequestPrimitive := f_setAcpId(p_createRequestPrimitive, {f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}); + } + + //Creation of resource + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + // Test Body + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); + v_request.from_ := f_getOriginator(v_aeIndex); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to delete the resource " & int2str(enum2int(p_resourceType))); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error resource deleted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(p_resourceType))); + } + } + + f_checkCseTesterStatus(); + + //Check if the resource has been deleted or not + if(f_isResourcePresent(v_resourceIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource not deleted"); + } else { + setverdict(fail, __SCOPE__ & ":INFO: Resource deleted"); + } + + // Postamble + // We are forced to delete the Ae because the delete request in the postamble_deleteResources is sent by Ae itself, witch doesn't have privileges + f_cse_deleteResource(v_aeIndex); + + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + };//end f_CSE_DMR_DEL_002 + + };//end of group g_CSE_DMR_DEL_002 + + group g_CSE_DMR_DEL_003{ + + /** + * @desc Check that the IUT responds with an error when the AE tries to delete the resource TARGET_RESOURCE_ADDRESS which does not exist + * + */ + testcase TC_CSE_DMR_DEL_003() runs on CseTester system CseSystem { + + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var charstring v_resourceIdOrName := "NotExistingResource"; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + // Test Body + if(vc_addressingMethod == e_nonHierarchical and (vc_primitiveScope == e_cseRelative)) { + v_request := valueof(m_deleteRequest(v_resourceIdOrName)); + } else { + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_aeIndex) & "/" & v_resourceIdOrName)); + } + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Unexisting resource cannot be deleted"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting non existing resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + };//end f_CSE_DMR_DEL003 + };//end of group g_CSE_DMR_DEL_003 + + group g_CSE_DMR_DEL_004{ + + /** + * @desc Check that the IUT responds with an error when AE tries to delete a child resource of a RESOURCE_TYPE resource when this resource has been already deleted + * + */ + testcase TC_CSE_DMR_DEL_004_CNT() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_004(int3, m_createContainerBase, int3, m_createContainerBase);//Container + }; + + testcase TC_CSE_DMR_DEL_004_GRP() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_004(int9, m_createGroupBase, int23, m_createSubscriptionBase);//Group + }; + + testcase TC_CSE_DMR_DEL_004_ACP() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_004(int1, m_createAcpBase, int23, m_createSubscriptionBase);//AccessControlPolicy + }; + + testcase TC_CSE_DMR_DEL_004_SCH() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_004(int18, m_createScheduleBase, int23, m_createSubscriptionBase);//Schedule + }; + + testcase TC_CSE_DMR_DEL_004_PCH() runs on CseTester system CseSystem { + // Local variables + // don't exist pollingChannel's child resource + //f_CSE_DMR_DEL_004(int15, m_createPollingChannelBase, int23, m_createSubscriptionBase);//PollingChannel TODO ResourceType needed is PollingChannelURI + }; + + testcase TC_CSE_DMR_DEL_004_SUB() runs on CseTester system CseSystem { + // Local variables + + f_CSE_DMR_DEL_004(int23, m_createSubscriptionBase, int18, m_createScheduleBase);//Subscription + }; + + + function f_CSE_DMR_DEL_004(ResourceType p_resourceType, template RequestPrimitive p_createRequestPrimitive, ResourceType p_childResourceType, template RequestPrimitive p_createRequestPrimitiveChildResource) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, p_createRequestPrimitive, p_resourceType); + + v_resourceIndex := f_cse_createResource(p_resourceType, p_createRequestPrimitive, v_aeIndex); + + v_childResourceIndex := f_cse_createResource(p_childResourceType, p_createRequestPrimitiveChildResource, v_resourceIndex); + + f_cse_deleteResource(v_resourceIndex); + + // Test Body + mcaPort.send(m_request(m_deleteRequest(f_getResourceAddress(v_childResourceIndex), f_getOriginator(v_childResourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Error while deleting non existing resource"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error while deleting non existing resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + };//end f_CSE_DMR_DEL_004 + };//end of group g_CSE_DMR_DEL_004 + + group g_CSE_DMR_DEL_005{ + + /** + * @desc Check that the stateTag attribute of a container resource is increased when a child resource is deleted + * + */ + testcase TC_CSE_DMR_DEL_005() runs on CseTester 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_childResourceIndex := -1; + const ResourceType c_containerResourceType := int3; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); + + if(ispresent(vc_resourcesList[v_resourceIndex].resource.container.stateTag)) { + + v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); + + // Test Body + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_childResourceIndex))); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " delete 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 deleting resource type " & int2str(enum2int(c_containerResourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); + } + } + + + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + if(v_response.primitive.responsePrimitive.primitiveContent.container.stateTag == 2) { //(Create and Delete) + setverdict(pass, __SCOPE__ & ": The stateTag attribute is incremented"); + } + else{ + setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is not incremented"); + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving resource attributes"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + }//end if + else{ + setverdict(fail, __SCOPE__ & ": Error the stateTag attribute is empty"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_DEL_005 + } // end group g_CSE_DMR_DEL_005 + + group g_CSE_DMR_DEL_006{ + + /** + * @desc Check that the IUT decreases the field value of attribute currentNrOfInstances and currentByteSize of parent container when a latest contentInstance resource is deleted successfully + * + */ + testcase TC_CSE_DMR_DEL_006() runs on CseTester system CseSystem { + // Local variables + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex := -1; + var PrimitiveContent v_attributesContainer, v_attributesContainer_afterDeletion; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); + + v_attributesContainer := f_cse_retrieveResource(v_containerIndex); + + if(not(ispresent(v_attributesContainer.container.currentNrOfInstances))) { + setverdict(fail, __SCOPE__ & ": Error the currentNrOfInstances attribute is empty"); + f_checkCseTesterStatus(); + } + + // Test Body + f_cse_deleteResource(v_contentInstanceIndex); + + v_attributesContainer_afterDeletion := f_cse_retrieveResource(v_containerIndex); + + if(not(ispresent(v_attributesContainer.container.currentNrOfInstances))) { + setverdict(fail, __SCOPE__ & ": Error the currentNrOfInstances attribute is empty"); + f_checkCseTesterStatus(); + } + + if((v_attributesContainer.container.currentNrOfInstances > v_attributesContainer_afterDeletion.container.currentNrOfInstances) and + (v_attributesContainer.container.currentByteSize > v_attributesContainer_afterDeletion.container.currentByteSize)) { + setverdict(pass, __SCOPE__ & ": The currentNrOfInstances and currentByteSize attributes are decreased"); + } else { + setverdict(fail, __SCOPE__ & ": currentNrOfInstances and/or currentByteSize attributes are not decreased"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_DEL_006 + } // end group g_CSE_DMR_DEL_006 + + group g_CSE_DMR_DEL_007{ + + /** + * @desc Check that the IUT accepts the DELETE Request of the latest contentInstance resource target to a container resource + * + */ + testcase TC_CSE_DMR_DEL_007() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex_1 := -1; + var integer v_contentInstanceIndex_2 := -1; + const ResourceType c_containerResourceType := int3; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); + v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); + + // Test Body + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest)); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " deleted successfuly"); + } + [] 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 deleting resource type " & int2str(enum2int(c_containerResourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); + } + } + + f_checkCseTesterStatus(); + + mcaPort.send(m_request(m_retrieveResource((f_getResourceAddress(v_contentInstanceIndex_2)), f_getOriginator(v_contentInstanceIndex_2)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has already been deleted"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Error while retrieving resource attributes as" & int2str(enum2int(c_containerResourceType)) & " has been deleted"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_DEL_007 + } // end group g_CSE_DMR_DEL_007 + + group g_CSE_DMR_DEL_008{ + + /** + * @desc Check that the IUT rejects the DELETE request of a latest resource in a container resource that has no direct child contentInstance resources. + * + */ + testcase TC_CSE_DMR_DEL_008() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + const ResourceType c_containerResourceType := int4; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest)); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " NOT FOUND"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " has not been created"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_DEL_008 + } // end group g_CSE_DMR_DEL_008 + + group g_CSE_DMR_DEL_009{ + + /** + * @desc Check that the IUT accepts the DELETE Request of the oldest contentInstance resource target to a container resource + * + */ + testcase TC_CSE_DMR_DEL_009() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_contentInstanceIndex_1 := -1; + var integer v_contentInstanceIndex_2 := -1; + const ResourceType c_containerResourceType := int3; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); + v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstance_noResourceName, v_containerIndex); + + // Test Body + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest)); + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_containerResourceType)) & " deleted successfuly"); + } + [] 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 deleting resource type " & int2str(enum2int(c_containerResourceType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); + } + } + + f_checkCseTesterStatus(); + + mcaPort.send(m_request(m_retrieveResource((f_getResourceAddress(v_contentInstanceIndex_1)), f_getOriginator(v_contentInstanceIndex_1)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has already been deleted"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Error while retrieving resource attributes as " & int2str(enum2int(c_containerResourceType)) & " has been deleted"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource attributes"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end f_CSE_DMR_DEL_009 + } // end group g_CSE_DMR_DEL_009 + + group g_CSE_DMR_DEL_010{ + + /** + * @desc Check that the IUT rejects the DELETE request of a oldest resource in a container resource that has no direct child contentInstance resources. + * + */ + testcase TC_CSE_DMR_DEL_010() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + const ResourceType c_containerResourceType := int4; + + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest)); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " NOT FOUND"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Resource type" & int2str(enum2int(c_containerResourceType)) & " has not been created"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type " & int2str(enum2int(c_containerResourceType))); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + }//end f_CSE_DMR_DEL_010 + } // end group g_CSE_DMR_DEL_010 + + }//end group Delete + + }//end group Data_Management_and_Repository + + group Location { + + group g_CSE_LOC_BV_001{ + + testcase TC_CSE_LOC_BV_001() runs on CseTester system CseSystem { + + var integer v_aeIndex := -1; + var RequestPrimitive v_request; + var MsgIn v_response; + var LocationSource v_locationSource := int1;//Network-based + + //Test component configuration + f_cf01Up(); + + //Preamble + v_aeIndex := f_cse_preamble_registerAe(); + + //Set requestPrimitive + v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, omit, omit, omit), v_aeIndex); + + //Test Body + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt{ + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { //BAD REQUEST + tc_ac.stop; + setverdict(pass, __SCOPE__ & "Resource <locationPolicy> create request is rejected due to invalid request body message!!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Created a locationPolicy resource for an invalid create request with response status code:" & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": Timeout due to no response received from requested server!"); + } + + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }// end testcase TC_CSE_LOC_BV_001 + }//end group g_CSE_LOC_BV_001 + + + group g_CSE_LOC_BV_002{ + testcase TC_CSE_LOC_BV_002() runs on CseTester system CseSystem { + + var integer v_aeAuxIndex := -1; + var LocationSource v_locationSource := int1;//Network-based + var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; + var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; + var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; + var RequestPrimitive v_request; + var MsgIn v_response; + var integer v_resourceIndex := -1; + + //Test component configuration + f_cf01Up(); + + //Preamble + v_aeAuxIndex := f_cse_preamble_registerAe(); + + //Set requestPrimitive + v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeAuxIndex); + + // Test Body + mcaPort.send(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 locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex); + } + [] 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 occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); + } + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }// end testcase TC_CSE_LOC_BV_002 + + }//end group g_CSE_LOC_BV_002 + + + group g_CSE_LOC_BO_003{ + + testcase TC_CSE_LOC_BO_003() runs on CseTester system CseSystem {//the originator has no privileges to create a locationPolicy resource!! + + var integer v_aeIndex := -1; + var integer v_acpAuxIndex := -1; + var LocationSource v_locationSource := int1;//Network-based + var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; + var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; + var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; + var RequestPrimitive v_request; + var MsgIn v_response; + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + //Test component configuration + f_cf01Up(); + + //Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int62);//c_RUDNDi) //No resource creation privilege + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -); + + //Set requestPrimitive + v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource,omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeIndex); + + // Test Body + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to create a resource including locationPolicy!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT failed to check the access privilege of originator!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); + } + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + + } // end testcase TC_CSE_LOC_BO_003 + + }//end group g_CSE_LOC_BO_003 + + group g_CSE_LOC_BO_004{ + testcase TC_CSE_LOC_BO_004() runs on CseTester system CseSystem { + + var integer v_aeIndex := -1; + var LocationSource v_locationSource := int1;//Netwok-based + var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; + var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; + var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; + var RequestPrimitive v_request; + var MsgIn v_response; + + //Test component configuration + f_cf01Up(); + + //Preamble + v_aeIndex := f_cse_preamble_registerAe(); + + //Set requestPrimitive + v_request := f_getCreateRequestPrimitive(int10, m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress), v_aeIndex); + + // Test Body + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": The targeted resource is not found!!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error occurrs with response status code: "& int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT created a locationPolicy resource under a non-existed parent resource!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); + } + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }// end testcase TC_CSE_LOC_BO_004 + + }//end group g_CSE_LOC_BO_004 + + + group g_CSE_LOC_BI_005{ + + testcase TC_CSE_LOC_BI_005() runs on CseTester system CseSystem {//reject an invalid update request with invalid attribtue locationUpdatePeriod + + var integer v_aeAuxIndex := -1; + var integer v_locPolicyResourceIndex := -1; + var LocationSource v_locationSource := int1;//Netwok-based + var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; + var XSD.Duration locationUpdatePeriod_invalid := c_invalid_location_update_period; + var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; + var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; + var RequestPrimitive v_request; + var RequestPrimitive v_locpolicy_request_preamble; + var MsgIn v_response; + + //Test component configuration + f_cf01Up(); + + //Preamble - register AE + v_aeAuxIndex := f_cse_preamble_registerAe(); + //Preamble - create a valid locationPolicy resource for later update use + v_locpolicy_request_preamble:= valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); + v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex); + + //Set requestPrimitive + v_request := f_getUpdateRequestPrimitive(int10, v_locPolicyResourceIndex, m_updateLocationPolicy(f_getResourceAddress(v_locPolicyResourceIndex), omit, locationUpdatePeriod_invalid)); + + // Test Body + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update locationPolicy resource is rejected!!"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error occurrs with response status code: "& int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "due to IUT failed to handle an invalid locationPolicy update request"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); + } + } + f_checkCseTesterStatus(); + + //TODO: Check to see if the resource has been updated or not + // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); - }//end testcase TC_CSE_LOC_BI_001 + }//end testcase TC_CSE_LOC_BI_005 - }//end group g_CSE_LOC_BI_001 + }//end group g_CSE_LOC_BI_005 - group g_CSE_LOC_BV_003 { + group g_CSE_LOC_BV_006 { - testcase TC_CSE_LOC_BV_003() runs on CseTester system CseSystem{ + testcase TC_CSE_LOC_BV_006() runs on CseTester system CseSystem{ //TO RETRIEVE a <container> resource that has created in cse and linked with a <locationPolicy> resource (network-based case) var integer v_aeAuxIndex := -1; @@ -4942,46 +13057,50 @@ module OneM2M_Testcases { alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Container_optional.locationID)){ - setverdict(fail, testcasename() & "No locationID is included in the response!"); + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.locationID)){ + setverdict(fail, __SCOPE__ & "No locationID is included in the response!"); }else{ - setverdict(pass, testcasename() & "Container resource associated with locationPolicy resource is successfully retrieved with locationID included in the response!"); + setverdict(pass, __SCOPE__ & "Container resource associated with locationPolicy resource is successfully retrieved with locationID included in the response!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; - setverdict(fail, testcasename() & "Requested container resource is not found!"); + setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource!"); + setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource!"); + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); } } + + f_checkCseTesterStatus(); + // Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); - }//end testcase TC_CSE_LOC_BV_003 + }//end testcase TC_CSE_LOC_BV_006 - }//end group g_CSE_LOC_BV_003 + }//end group g_CSE_LOC_BV_006 - group g_CSE_LOC_BV_004 { + group g_CSE_LOC_BV_007 { - testcase TC_CSE_LOC_BV_004() runs on CseTester system CseSystem{ + testcase TC_CSE_LOC_BV_007() runs on CseTester system CseSystem{ //TO create a <locationPolicy> resource with locationSource set to Device-based var integer v_aeAuxIndex := -1; - var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; + var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var RequestPrimitive v_request; var MsgIn v_response; var LocationSource v_locationSource := int2;//Device-based + var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); @@ -4997,19 +13116,33 @@ module OneM2M_Testcases { mcaPort.send(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 locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource locationPolicy is created successfuly with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); + setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); + setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); } } + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + // Postamble f_cse_postamble_deleteResources(); @@ -5017,19 +13150,20 @@ module OneM2M_Testcases { // Tear down f_cf01Down(); - }//end testcase TC_CSE_LOC_BV_004 + }//end testcase TC_CSE_LOC_BV_007 - }//end group g_CSE_LOC_BV_004 + }//end group g_CSE_LOC_BV_007 - group g_CSE_LOC_BV_005 { + group g_CSE_LOC_BV_008 { - testcase TC_CSE_LOC_BV_005() runs on CseTester system CseSystem{ + testcase TC_CSE_LOC_BV_008() runs on CseTester system CseSystem{ //TO create a <locationPolicy> resource with locationSource set to Share-based var integer v_aeAuxIndex := -1; var LocationSource v_locationSource := int3;//Share-based var RequestPrimitive v_request; var MsgIn v_response; + var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); @@ -5046,19 +13180,33 @@ module OneM2M_Testcases { mcaPort.send(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 locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int10, v_aeAuxIndex); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource locationPolicy is created successfuly with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); + setverdict(fail, __SCOPE__ & ": Error occurrs with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode)) & "while handling a valid locationPolicy resource create request!"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); + setverdict(fail, __SCOPE__ & ": Timeout due to no response from requested server!"); } } + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_resourceIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + // Postamble f_cse_postamble_deleteResources(); @@ -5066,13 +13214,13 @@ module OneM2M_Testcases { // Tear down f_cf01Down(); - }//end testcase TC_CSE_LOC_BV_005 + }//end testcase TC_CSE_LOC_BV_008 - }//end group g_CSE_LOC_BV_005 + }//end group g_CSE_LOC_BV_008 - group g_CSE_LOC_BV_006 { + group g_CSE_LOC_BV_009 { - testcase TC_CSE_LOC_BV_006_01() runs on CseTester system CseSystem{ + testcase TC_CSE_LOC_BV_009_01() runs on CseTester system CseSystem{ //TO NOTIFY a location information var integer v_aeAuxIndex := -1; @@ -5108,23 +13256,23 @@ module OneM2M_Testcases { alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Notification.notificationEvent)){ - setverdict(fail, testcasename() & "No NotificationEvent is included in the response!"); + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){ + setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!"); }else{ - setverdict(pass, testcasename() & "Location information is successfully sent!"); + setverdict(pass, __SCOPE__ & "Location information is successfully sent!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; - setverdict(fail, testcasename() & "Requested container resource is not found!"); + setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource!"); + setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource!"); + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); } } @@ -5134,9 +13282,9 @@ module OneM2M_Testcases { // Tear down f_cf01Down(); - }//end testcase TC_CSE_LOC_BV_006_01 + }//end testcase TC_CSE_LOC_BV_009_01 - testcase TC_CSE_LOC_BV_006_02() runs on CseTester system CseSystem{ + testcase TC_CSE_LOC_BV_009_02() runs on CseTester system CseSystem{ //TO NOTIFY a location information var integer v_aeAuxIndex := -1; @@ -5144,7 +13292,7 @@ module OneM2M_Testcases { var integer v_locContainerResourceIndex := -1; var integer v_subscriptionResourceIndex := -1; var LocationSource v_locationSource := int2;//Device-based - var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; + var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; var RequestPrimitive v_locpolicy_request_preamble; var RequestPrimitive v_container_request_preamble; var RequestPrimitive v_subscription_request_preamble; @@ -5171,23 +13319,23 @@ module OneM2M_Testcases { alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Notification.notificationEvent)){ - setverdict(fail, testcasename() & "No NotificationEvent is included in the response!"); + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){ + setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!"); }else{ - setverdict(pass, testcasename() & "Location information is successfully sent!"); + setverdict(pass, __SCOPE__ & "Location information is successfully sent!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; - setverdict(fail, testcasename() & "Requested container resource is not found!"); + setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource!"); + setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource!"); + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); } } @@ -5197,9 +13345,9 @@ module OneM2M_Testcases { // Tear down f_cf01Down(); - }//end testcase TC_CSE_LOC_BV_006_02 + }//end testcase TC_CSE_LOC_BV_009_02 - testcase TC_CSE_LOC_BV_006_03() runs on CseTester system CseSystem{ + testcase TC_CSE_LOC_BV_009_03() runs on CseTester system CseSystem{ //TO NOTIFY a location information var integer v_aeAuxIndex := -1; @@ -5215,170 +13363,42 @@ module OneM2M_Testcases { //Test component configuration f_cf01Up(); - //Preamble - register AE - v_aeAuxIndex := f_cse_preamble_registerAe(); - //Preamble - create a valid locationPolicy resource - - v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, omit, omit, omit)); - v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? - - v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index - v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index - v_subscription_request_preamble := valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -)); - v_subscriptionResourceIndex := f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex); - - //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource - mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); - tc_ac.start; - alt{ - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ - tc_ac.stop; - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Notification.notificationEvent)){ - setverdict(fail, testcasename() & "No NotificationEvent is included in the response!"); - }else{ - setverdict(pass, testcasename() & "Location information is successfully sent!"); - } - - } - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ - tc_ac.stop; - setverdict(fail, testcasename() & "Requested container resource is not found!"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource!"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource!"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end testcase TC_CSE_LOC_BV_006_03 - }//end group g_CSE_LOC_BV_006 - - /*group g_CSE_LOC_BV_007 { - testcase TC_CSE_LOC_BV_007() runs on CseTester system CseSystem{ - //TODO - }//end testcase TC_CSE_LOC_BV_007 - }//end group g_CSE_LOC_BV_007 - - group g_CSE_LOC_BV_008 { - testcase TC_CSE_LOC_BV_008() runs on CseTester system CseSystem{ - //TODO - }//end testcase TC_CSE_LOC_BV_008 - }//end group g_CSE_LOC_BV_008 - */ - - group g_CSE_LOC_BV_009 { - testcase TC_CSE_LOC_BV_009() runs on CseTester system CseSystem{ - //To CREATE a <subscription> resource as a child resource of the created <container> - - var integer v_aeAuxIndex := -1; - var integer v_locPolicyResourceIndex := -1; - var integer v_locContainerResourceIndex := -1; - var LocationSource v_locationSource := int1;//Netwok-based - var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; - var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; - var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; - var RequestPrimitive v_locpolicy_request_preamble; - var RequestPrimitive v_container_request_preamble; - var RequestPrimitive v_subscription_request_preamble; - var MsgIn v_response; - - //Test component configuration - f_cf01Up(); - - //Preamble - register AE - v_aeAuxIndex := f_cse_preamble_registerAe(); - //Preamble - create a valid locationPolicy resource - v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); - v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? - - v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index - v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index - v_subscription_request_preamble := valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -)); - - //Test Body - mcaPort.send(m_request(valueof(f_getCreateRequestPrimitive(int23, v_subscription_request_preamble, v_locContainerResourceIndex)))); - tc_ac.start; - alt{ - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ - tc_ac.stop; - setverdict(pass, testcasename() & "Subscription resource is successfully!"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ - tc_ac.stop; - setverdict(fail, testcasename() & "Requested container resource is not found!"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating subscription resource!"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - }//end testcase TC_CSE_LOC_BV_009 - }//end group g_CSE_LOC_BV_009 - - group g_CSE_LOC_BV_010 { - - testcase TC_CSE_LOC_BV_010() runs on CseTester system CseSystem{ - //TO RETRIEVE a <locationPolicy> resource that has created in cse - - var integer v_aeAuxIndex := -1; - var integer v_locPolicyResourceIndex := -1; - var RequestPrimitive v_locpolicy_request_preamble; - var MsgIn v_response; - var LocationSource v_locationSource := int1;//Netwok-based - var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; - var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; - var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; - - - //Test component configuration - f_cf01Up(); - - //Preamble - register AE - v_aeAuxIndex := f_cse_preamble_registerAe(); - //Preamble - create a valid locationPolicy resource for later container resource creation - v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); - v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index + //Preamble - register AE + v_aeAuxIndex := f_cse_preamble_registerAe(); + //Preamble - create a valid locationPolicy resource + + v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, omit, omit, omit)); + v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? + + v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index + v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index + v_subscription_request_preamble := valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -)); + v_subscriptionResourceIndex := f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex); - //Test Body - retrieve the created locationpolicy resource - mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locPolicyResourceIndex), f_getOriginator(v_locPolicyResourceIndex))))); + //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource + mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ tc_ac.stop; - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].LocationPolicy_optional.locationContainerID)){ - setverdict(fail, testcasename() & "No locationContainerID is included in the response!"); + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.notification.notificationEvent)){ + setverdict(fail, __SCOPE__ & "No NotificationEvent is included in the response!"); }else{ - setverdict(pass, testcasename() & "LocationPolicy resource is successfully retrieved with locationContainerID included in the response!"); + setverdict(pass, __SCOPE__ & "Location information is successfully sent!"); } } [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ tc_ac.stop; - setverdict(fail, testcasename() & "Requested locationPolicy is not found!"); + setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource!"); + setverdict(fail, __SCOPE__ & ": Error while retrieving resource!"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource!"); - } - + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource!"); + } } // Postamble @@ -5387,595 +13407,166 @@ module OneM2M_Testcases { // Tear down f_cf01Down(); - }//end testcase TC_CSE_LOC_BV_010 - - }//end group g_CSE_LOC_BV_010 + }//end testcase TC_CSE_LOC_BV_009_03 + }//end group g_CSE_LOC_BV_009 + /*group g_CSE_LOC_BV_007 { + testcase TC_CSE_LOC_BV_007() runs on CseTester system CseSystem{ + //TODO + }//end testcase TC_CSE_LOC_BV_007 + }//end group g_CSE_LOC_BV_007 - }//end group Location - - group Group_Managment { - - - // Test objective: - // Check that the IUT rejects the creation of the group resource when member ID exceed max number - // of members. - group g_CSE_GMG_BV_001 { - - testcase TC_CSE_GMG_BV_001() runs on CseTester system CseSystem { - // Local constants - const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESOURCE_ADDRESS_1"; - const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESOURCE_ADDRESS_2"; - const XSD.AnyURI c_memberResourceAddress3 := "MEMBER_RESOURCE_ADDRESS_3"; - const XSD.AnyURI c_memberResourceAddress4 := "MEMBER_RESOURCE_ADDRESS_4"; - const XSD.AnyURI c_memberResourceAddress5 := "MEMBER_RESOURCE_ADDRESS_5"; - const XSD.AnyURI c_memberResourceAddress6 := "MEMBER_RESOURCE_ADDRESS_6"; - const XSD.NonNegativeInteger c_maxNrOfMembers := 5; - const ListOfURIs c_memberIDs := {c_memberResourceAddress1, c_memberResourceAddress2, c_memberResourceAddress3, c_memberResourceAddress4, c_memberResourceAddress5, c_memberResourceAddress6}; - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var RequestPrimitive v_request; - var template RequestPrimitive v_createRequest; - var ResponsePrimitive v_responsePrimitive; - - v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, c_memberIDs, omit)); - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - // Test Body - v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); - - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Creation failed because member ID exceed max number of member"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error resource created while member ID exceed max number of member"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } - - } // end group g_CSE_GMG_BV_001 - - - // Test objective: - // Check that the IUT rejects the creation of the group resource when the memberType cannot - // be retrieved due to lack of privilege. - group g_CSE_GMG_BV_002 { - - testcase TC_CSE_GMG_BV_002() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_request; - var template RequestPrimitive v_containerCreateRequest := m_createContainerBase; - var template RequestPrimitive v_createRequest; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, int61); //c_CUDNDi - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerCreateRequest.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_containerIndex := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource - - v_createRequest := m_createGroup(1, {f_getResourceAddress(v_containerIndex)}, omit, int3); - v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // creating group - - // Test Body - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": creation failed due to lack of privilege"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error creation successful while doesn't have privileges for retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - } - - } // end group g_CSE_GMG_BV_002 - - - // Test objective: - // Check that the IUT rejects the update of the group resource when the - // memberType cannot be retrieved due to lack of privilege. - group g_CSE_GMG_BV_003 { - - testcase TC_CSE_GMG_BV_003() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_acpIndex := -1; - var integer v_groupIndex := -1; - var RequestPrimitive v_request; - var template RequestPrimitive v_containerCreateRequest := m_createContainer("NotInitialized", "MyContainer2"); - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, int61); //c_CUDNDi - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerCreateRequest.primitiveContent.any_1[0].Container_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceAddress(v_containerIndex1)}, omit, int3), v_aeIndex); - - v_updateRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(v_containerIndex2)}; - v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); // creating group - - // Test Body - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Update failed due to lack of privilege"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error update successful while doesn't have privileges for retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - } - - } // end group g_CSE_GMG_BV_003 - - // Test objective: - // Check that the IUT rejects the update of the group - // resource when member ID exceed max number of members. - group g_CSE_GMG_BV_004 { - - testcase TC_CSE_GMG_BV_004() runs on CseTester system CseSystem { - // Local constants - const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESOURCE_ADDRESS_1"; - const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESOURCE_ADDRESS_2"; - const XSD.AnyURI c_memberResourceAddress3 := "MEMBER_RESOURCE_ADDRESS_3"; - const XSD.AnyURI c_memberResourceAddress4 := "MEMBER_RESOURCE_ADDRESS_4"; - const XSD.AnyURI c_memberResourceAddress5 := "MEMBER_RESOURCE_ADDRESS_5"; - const XSD.AnyURI c_memberResourceAddress6 := "MEMBER_RESOURCE_ADDRESS_6"; - - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var RequestPrimitive v_request; - var template RequestPrimitive v_createRequest := m_createGroup(5, -, omit); - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - - v_updateRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {c_memberResourceAddress1, c_memberResourceAddress2, c_memberResourceAddress3, c_memberResourceAddress4, c_memberResourceAddress5, c_memberResourceAddress6}; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_resourceIndex := f_cse_createResource(int9, v_createRequest, v_aeIndex); - - // Test Body - v_request := f_getUpdateRequestPrimitive(int9, v_resourceIndex, v_updateRequest); - - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Update failed because member ID exceed max number of member"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error resource updated while member ID exceed max number of member"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } - - } // end group g_CSE_GMG_BV_004 - - // Test objective: - // Check that the IUT accepts the creation of the RESOURCE_TYPE resource by using - // fanOutPoint in group resource. - group g_CSE_GMG_BV_005 { - - testcase TC_CSE_GMG_BV_005() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var RequestPrimitive v_createRequest := valueof(m_createContainerBase); - var integer v_aeIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - var integer i; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3), v_aeIndex); // AE child resource - - v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; // short name of fanOutPoint - v_createRequest.from_ := f_getOriginator(v_groupIndex); - - // Test Body + group g_CSE_LOC_BV_008 { + testcase TC_CSE_LOC_BV_008() runs on CseTester system CseSystem{ + //TODO + }//end testcase TC_CSE_LOC_BV_008 + }//end group g_CSE_LOC_BV_008 + */ - mcaPort.send(m_request(v_createRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); - } - else { - for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list); i := i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ - setverdict(fail, testcasename(), ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } + group g_CSE_LOC_BV_012 { + testcase TC_CSE_LOC_BV_012() runs on CseTester system CseSystem{ + //To CREATE a <subscription> resource as a child resource of the created <container> + + var integer v_aeAuxIndex := -1; + var integer v_locPolicyResourceIndex := -1; + var integer v_locContainerResourceIndex := -1; + var LocationSource v_locationSource := int1;//Netwok-based + var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; + var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; + var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; + var RequestPrimitive v_locpolicy_request_preamble; + var RequestPrimitive v_container_request_preamble; + var RequestPrimitive v_subscription_request_preamble; + var MsgIn v_response; + + //Test component configuration + f_cf01Up(); + + //Preamble - register AE + v_aeAuxIndex := f_cse_preamble_registerAe(); + //Preamble - create a valid locationPolicy resource + v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); + v_container_request_preamble := valueof(m_createContainer(f_getResourceAddress(v_aeAuxIndex), omit));//no location-container name provided? + + v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index + v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index + v_subscription_request_preamble := valueof(m_createSubscription(f_getResourceAddress(v_locContainerResourceIndex), c_defaultResourceName, -)); + + //Test Body + mcaPort.send(m_request(valueof(f_getCreateRequestPrimitive(int23, v_subscription_request_preamble, v_locContainerResourceIndex)))); + tc_ac.start; + alt{ + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response{ + tc_ac.stop; + setverdict(pass, __SCOPE__ & "Subscription resource is successfully!"); } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } - - } // end group g_CSE_GMG_BV_005 - - // Test objective: - // Check that the IUT returns successfully the resource of the group members by using - // fanOutPoint in group resource. - group g_CSE_GMG_BV_006 { - - testcase TC_CSE_GMG_BV_006() runs on CseTester system CseSystem { - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_groupIndex := -1; - var XSD.AnyURI v_fanoutPointAddress; - var ListOfURIs v_memberIDs; - var integer i; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3), v_aeIndex); // AE child resource - - v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/fopt"; // short name of fanOutPoint - - // Test Body - mcaPort.send(m_request(m_retrieveResource(v_fanoutPointAddress, f_getOriginator(v_groupIndex)))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": retrieve attributes successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); - } - else { - for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list); i := i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ - setverdict(fail, testcasename(), ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } - - } // end group g_CSE_GMG_BV_006 - - // Test objective: - // Check that the IUT accepts the update of the RESOURCE_TYPE resource by using - // fanOutPoint in group resource. - group g_CSE_GMG_BV_007 { - - testcase TC_CSE_GMG_BV_007() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var RequestPrimitive v_updateRequest := valueof(m_updateContainerBase); - var integer v_aeIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - var Labels v_labels_1:= {"VALUE_1"}; - var integer i; - - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3), v_aeIndex); // AE child resource - - v_updateRequest.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; // short name of fanOutPoint - v_updateRequest.from_ := f_getOriginator(v_groupIndex); - - // Test Body - mcaPort.send(m_request(v_updateRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": update successful by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); - } - else { - for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list); i := i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ - setverdict(fail, testcasename(), ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response{ tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - + setverdict(fail, __SCOPE__ & "Requested container resource is not found!"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating subscription resource!"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end testcase TC_CSE_LOC_BV_012 + }//end group g_CSE_LOC_BV_012 + + group g_CSE_LOC_BV_013 { + + testcase TC_CSE_LOC_BV_013() runs on CseTester system CseSystem{ + //TO RETRIEVE a <locationPolicy> resource that has created in cse + + var integer v_aeAuxIndex := -1; + var integer v_locPolicyResourceIndex := -1; + var RequestPrimitive v_locpolicy_request_preamble; + var MsgIn v_response; + var LocationSource v_locationSource := int1;//Netwok-based + var XSD.Duration locationUpdatePeriod := PX_LOCATION_UPDATE_PERIOD; + var XSD.Token locationTargetID := PX_LOCATION_TARGET_ID; + var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; + + + //Test component configuration + f_cf01Up(); + + //Preamble - register AE + v_aeAuxIndex := f_cse_preamble_registerAe(); + //Preamble - create a valid locationPolicy resource for later container resource creation + v_locpolicy_request_preamble := valueof(m_createLocationPolicy(v_locationSource, omit, locationUpdatePeriod, locationTargetID, locationServerAddress)); + v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index + + //Test Body - retrieve the created locationpolicy resource + mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locPolicyResourceIndex), f_getOriginator(v_locPolicyResourceIndex))))); + tc_ac.start; + alt{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ + tc_ac.stop; + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.locationPolicy.locationContainerID)){ + setverdict(fail, __SCOPE__ & "No locationContainerID is included in the response!"); + }else{ + setverdict(pass, __SCOPE__ & "LocationPolicy resource is successfully retrieved with locationContainerID included in the response!"); + } + } - - } // end group g_CSE_GMG_BV_007 - - // Test objective: - // Check that the IUT could delete the RESOURCE_TYPE resource by using - // fanOutPoint in group resource. - group g_CSE_GMG_BV_008 { - - testcase TC_CSE_GMG_BV_008() runs on CseTester system CseSystem { - //Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_groupIndex := -1; - var XSD.AnyURI v_fanoutPointAddress; - var ListOfURIs v_memberIDs; - var integer i; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3), v_aeIndex); // AE child resource - - v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/fopt"; // short name of fanOutPoint - - // Test Body - mcaPort.send(m_request(m_deleteRequest(v_fanoutPointAddress))); //TODO see if we set AE_ID or PX_SUPER_USER to from_ attribute - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": delete successful by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); - } - else { - for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list); i := i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ - setverdict(fail, testcasename(), ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & "Requested locationPolicy is not found!"); } - - } // end group g_CSE_GMG_BV_008 - - // Test objective: - // Check that the IUT detects the presence of duplicate member IDs during the creation of the - // group resource and removes the duplicate member IDs prior to creation of the group resource. - group g_CSE_GMG_BV_009 { + [] 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(); + + }//end testcase TC_CSE_LOC_BV_013 + + }//end group g_CSE_LOC_BV_013 + + + }//end group Location + + group Group_Managment { + + group Create { - testcase TC_CSE_GMG_BV_009() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT rejects the creation of the group resource when member ID exceed max number of members. + * + */ + testcase TC_CSE_GMG_CRE_001() runs on CseTester system CseSystem { + // Local constants + const XSD.NonNegativeInteger c_maxNrOfMembers := 1; + // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var RequestPrimitive v_createRequest; - var XSD.AnyURI v_memberID; - - // Test control + var integer v_containerIndex_1, v_containerIndex_2 := -1; + var RequestPrimitive v_request; + var ListOfURIs v_memberIDs; + var template RequestPrimitive v_createRequest; + + // Test control // Test component configuration f_cf01Up(); @@ -5983,36 +13574,49 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi. - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource - v_memberID := f_getResourceAddress(v_containerIndex); - v_createRequest := valueof(m_createGroup(2, {v_memberID, v_memberID}, omit, int3)); - v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); - - // Test Body - mcaPort.send(m_request(v_createRequest)); + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + + v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, v_memberIDs, omit, int3)); + + // Test Body + v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); + + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource created successfuly"); - - if(not match({v_memberID}, v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs)){ - setverdict(fail, testcasename(), ": Error, presence of duplicate member IDs "); - } - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs) != 1) { - setverdict(fail, testcasename() & ": Error, wrong number of memberIDs attribute"); - } + setverdict(pass, __SCOPE__ & ": Creation failed because member ID exceed max number of member"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error resource created while member ID exceed max number of member"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + + // Postamble f_cse_postamble_deleteResources(); @@ -6021,80 +13625,92 @@ module OneM2M_Testcases { } - } // end group g_CSE_GMG_BV_009 - - // Test objective: - // Check that the IUT validates the resource type during the creation of the - // group resource when memberType attribute is not ‘mixed’. - group g_CSE_GMG_BV_010 { - - testcase TC_CSE_GMG_BV_010() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT rejects the creation of the group resource when the memberType cannot be retrieved due to lack of privilege. + * + */ + testcase TC_CSE_GMG_CRE_002() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; - var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; - + var integer v_acpIndex := -1; + var RequestPrimitive v_request; + var template RequestPrimitive v_containerCreateRequest := m_createContainerBase; + var template RequestPrimitive v_createRequest; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, int61); //c_CUDNDi + // Test control - + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource - v_createRequest := valueof(m_createGroup(2, {f_getResourceAddress(v_containerIndex)}, omit, int3)); //Member type is set to Container - v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); + + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerCreateRequest.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_containerIndex := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource + + v_createRequest := m_createGroup(1, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int3); + v_request := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); // creating group + + // Test Body - // Test Body - mcaPort.send(m_request(v_createRequest)); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource created successfuly"); - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)){ - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); - } - else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false){ - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct"); - } - } + setverdict(pass, __SCOPE__ & ": creation failed due to lack of privilege"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error creation successful while doesn't have privileges for retrieving resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource" ); + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } - + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + // Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - + f_cf01Down(); } - } // end group g_CSE_GMG_BV_010 - - - // Test objective: - // Check that the IUT handles unsuccessful validation of the resource type during the creation of the - // group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. - group g_CSE_GMG_BV_011 { - - testcase TC_CSE_GMG_BV_011() runs on CseTester system CseSystem { - //Local variables + + /** + * @desc Check that the IUT detects the presence of duplicate member IDs during the creation of the <group> resource and removes the duplicate member IDs prior to creation of the <group> resource. + * + */ + testcase TC_CSE_GMG_CRE_003() runs on CseTester system CseSystem { + // Local variables var MsgIn v_response; - var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; - + var RequestPrimitive v_createRequest; + var XSD.AnyURI v_memberID; + // Test control // Test component configuration @@ -6103,44 +13719,33 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi. v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource - v_createRequest := valueof(m_createGroup(2, {f_getResourceAddress(v_containerIndex)}, omit, int2, int3)); //Member type is set to AE and consistencyStrategy is set to MIXED - v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); - - // Test Body + v_memberID := f_getResourceId(vc_resourcesList[v_containerIndex].resource); + v_createRequest := valueof(m_createGroup(2, {v_memberID, v_memberID}, omit, int3)); + v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); + + // Test Body mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource created successfuly"); - - // check for memberTypeValidated - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)){ - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); - } - else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated != false){ - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct"); - } + setverdict(pass, __SCOPE__ & ": Resource created successfully"); + + if(not match({v_memberID}, v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ + setverdict(fail, __SCOPE__, ": Error, presence of duplicate member IDs "); } - // check for memberType (MIXED) - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberType)){ - setverdict(fail, testcasename(), ": Error, memberType attribute not provided"); + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) { + setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); } - else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberType != int0){ //Mixed is int0 in release 2 and int24 in release 1 - setverdict(fail, testcasename(), ": Error, memberType attribute not correct"); - } - } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } @@ -6148,25 +13753,19 @@ module OneM2M_Testcases { f_cse_postamble_deleteResources(); // Tear down - f_cf01Down(); + f_cf01Down(); } - } // end group g_CSE_GMG_BV_011 - - // Test objective: - // Check that the IUT handles unsuccessful validation of the resource type during the creation of the - // group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is - // ABANDON_MEMBER,. - group g_CSE_GMG_BV_012 { - - testcase TC_CSE_GMG_BV_012() runs on CseTester system CseSystem { - //Local variables + + /** + * @desc Check that the IUT validates the resource type during the creation of the <group> resource when memberType attribute is not ‘mixed’. + */ + testcase TC_CSE_GMG_CRE_004() runs on CseTester system CseSystem { + // Local variables var MsgIn v_response; var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; - var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; // Test control @@ -6177,1827 +13776,2212 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); - v_groupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); - v_memberIDs := {f_getResourceAddress(v_groupIndex), f_getResourceAddress(v_containerIndex)}; - v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, omit)); //Member type is set to container and consistencyStrategy is set to ABANDON MEMBER (default value) - v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); - - // Test Body + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource + v_createRequest := valueof(m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int3)); //Member type is set to Container + v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); + + // Test Body mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource created successfuly"); - - // check for memberTypeValidated - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)){ - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); - } else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false){ - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not correct"); - } + setverdict(pass, __SCOPE__ & ": Resource created successfully"); + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } - // check for membersId - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs)){ - setverdict(fail, testcasename(), ": Error, memberIDs attribute not provided"); - } else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[0] != f_getResourceAddress(v_containerIndex)){ - setverdict(fail, testcasename(), ": Error, memberIDs attribute not correct"); + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct"); } - } + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } - - } // end group g_CSE_GMG_BV_012 - - // Test objective: - // Check that the IUT handles unsuccessful validation of the resource type during the creation of the - // group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is - // ABANDON_GROUP. - group g_CSE_GMG_BV_013 { - - testcase TC_CSE_GMG_BV_013() runs on CseTester system CseSystem { - //Local variables - var MsgIn v_response; - var RequestPrimitive v_createRequest; - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); - v_groupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); - v_memberIDs := {f_getResourceAddress(v_groupIndex), f_getResourceAddress(v_containerIndex)}; - v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, int2)); //Member type is set to container and consistencyStrategy is set to ABANDON GROUP - v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); - - // Test Body - mcaPort.send(m_request(v_createRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4110))) -> value v_response {//TODO Double check ResponseStatusCode - tc_ac.stop; - setverdict(pass, testcasename() & ": unsuccessful validation of the resource type during the creation of the group"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error create succesfull while the operation should be aborted"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } - - } // end group g_CSE_GMG_BV_013 - - // Test objective: - // Check that the IUT detects the presence of duplicate member IDs during the creation of the - // group resource and removes the duplicate member IDs prior to updating of the group resource. - group g_CSE_GMG_BV_014 { - testcase TC_CSE_GMG_BV_014() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_groupIndex := -1; - var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); - var XSD.AnyURI v_memberID1; - var XSD.AnyURI v_memberID2; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberID1 := f_getResourceAddress(v_containerIndex1); - v_memberID2 := f_getResourceAddress(v_containerIndex2); - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberID1, v_memberID2}, omit, int3), v_aeIndex); // AE child resource - - v_updateRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {v_memberID2, v_memberID2}; - v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); - - //Test Body - mcaPort.send(m_request(v_updateRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": update successful"); - - // check for membersId - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs)){ - setverdict(fail, testcasename(), ": Error, memberIDs attribute not provided"); - } - else { - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs) != 1) { - setverdict(fail, testcasename() & ": Error, wrong number of memberIDs attribute"); - } - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[0] != v_memberID2){ - setverdict(fail, testcasename(), ": Error, memberIDs attribute not correct"); - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource"); - } - } - - //Postamble + setverdict(fail, __SCOPE__ & ": No answer while creating resource" ); + } + } + + // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); + } - } // end group g_CSE_GMG_BV_014 - - //Test objective: - //Check that the IUT validates the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’. - group g_CSE_GMG_BV_015 { - testcase TC_CSE_GMG_BV_015() runs on CseTester system CseSystem { - // Local variables + + /** + * @desc Check that the IUT handles unsuccessful validation of the resource type during the creation of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. + * + */ + testcase TC_CSE_GMG_CRE_005() runs on CseTester system CseSystem { + //Local variables var MsgIn v_response; + var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_groupIndex := -1; - var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); - + var integer v_containerIndex := -1; + // Test control // Test component configuration f_cf01Up(); - - // Test adapter configuration + // Test adapter configuration + // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceAddress(v_containerIndex1)}, omit, int3), v_aeIndex); - - v_updateRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {f_getResourceAddress(v_containerIndex2)}; - v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); - + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // AE child resource + v_createRequest := valueof(m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, omit, int2, int3)); //Member type is set to AE and consistencyStrategy is set to MIXED + v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); + // Test Body - mcaPort.send(m_request(v_updateRequest));// TODO see if the memberTypeValidated is present in the update response + mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": update successful"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)) { - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); - } - else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false) { - setverdict(fail, testcasename(), ": Error, memberTypeValidated wrong value"); + setverdict(pass, __SCOPE__ & ": Resource created successfully"); + + // check for memberTypeValidated + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); + } + else { + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct"); } - } + } + // check for memberType (MIXED) + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType)){ + setverdict(fail, __SCOPE__, ": Error, memberType attribute not provided"); + } + else { + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType != int0){ + setverdict(fail, __SCOPE__, ": Error, memberType attribute not correct"); + } + } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource"); - } - } - - //Postamble + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); + f_cf01Down(); + } - } // end group g_CSE_GMG_BV_015 - - //Test objective: - //Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. - group g_CSE_GMG_BV_016 { - - testcase TC_CSE_GMG_BV_016() runs on CseTester system CseSystem { - // Local variables + + /** + * @desc Check that the IUT handles unsuccessful validation of the resource type during the creation of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_MEMBER,. + * + */ + testcase TC_CSE_GMG_CRE_006() runs on CseTester system CseSystem { + //Local variables var MsgIn v_response; - var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); + var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_groupIndex := -1; - var integer v_subGroupIndex := -1; - var XSD.AnyURI v_memberID1; - var XSD.AnyURI v_memberID2; + var ListOfURIs v_memberIDs; // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); - v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); - v_memberID1 := f_getResourceAddress(v_containerIndex); - v_memberID2 := f_getResourceAddress(v_subGroupIndex); - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberID1}, omit, int3, int3), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to MIXED (int3) - - v_updateRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {v_memberID1, v_memberID2}; - v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); - - // Test Body - mcaPort.send(m_request(v_updateRequest));// TODO see if the memberTypeValidated is present in the update response + v_groupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); + v_memberIDs := {f_getResourceId(vc_resourcesList[v_groupIndex].resource), f_getResourceId(vc_resourcesList[v_containerIndex].resource)}; + v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, -, -, -)); //Member type is set to container and consistencyStrategy is set to ABANDON MEMBER (default value) + v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); + + // Test Body + mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": update successful"); - - //memberTypeValidated attribute set to FALSE - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)) { - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); - } - else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated != false) { - setverdict(fail, testcasename(), ": Error, memberTypeValidated must be FALSE"); + setverdict(pass, __SCOPE__ & ": Resource created successfully"); + + // check for memberTypeValidated + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not correct"); } } - - //memberType attribute set to MIXED - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberType)) { - setverdict(fail, testcasename(), ": Error, memberType attribute not provided"); - } + // check for membersId + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided"); + } else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberType != int0) { //Mixed is int0 in release 2 and int24 in release 1 - setverdict(fail, testcasename(), ": Error, memberType was not set to MIXED"); + if(not match({f_getResourceId(vc_resourcesList[v_containerIndex].resource)}, v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); } } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); + setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } - - //Postamble + + // Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); + f_cf01Down(); + } - } // end group g_CSE_GMG_BV_016 - - //Test objective: Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_MEMBER. - group g_CSE_GMG_BV_017 { - - testcase TC_CSE_GMG_BV_017() runs on CseTester system CseSystem { - // Local variables + + + /** + * @desc Check that the IUT handles unsuccessful validation of the resource type during the creation of the group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_GROUP. + * + */ + testcase TC_CSE_GMG_CRE_007() runs on CseTester system CseSystem { + //Local variables var MsgIn v_response; - var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); + var RequestPrimitive v_createRequest; var integer v_aeIndex := -1; var integer v_containerIndex := -1; var integer v_groupIndex := -1; - var integer v_subGroupIndex := -1; - var XSD.AnyURI v_memberID1; - var XSD.AnyURI v_memberID2; - + var ListOfURIs v_memberIDs; + // Test control - + // Test component configuration f_cf01Up(); // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); - v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); - v_memberID1 := f_getResourceAddress(v_containerIndex); - v_memberID2 := f_getResourceAddress(v_subGroupIndex); - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberID1}, omit, int3, omit), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to ABANDON MEMBER (default value) - - v_updateRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {v_memberID2, v_memberID1}; - v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); - - //Test Body + v_groupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); + v_memberIDs := {f_getResourceId(vc_resourcesList[v_groupIndex].resource), f_getResourceId(vc_resourcesList[v_containerIndex].resource)}; + v_createRequest := valueof(m_createGroup(2, v_memberIDs, omit, int3, int2, -, -)); //Member type is set to container and consistencyStrategy is set to ABANDON GROUP + v_createRequest := f_getCreateRequestPrimitive(int9, v_createRequest, v_aeIndex); - mcaPort.send(m_request(v_updateRequest)); + // Test Body + mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4110))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": update successful"); - - //memberTypeValidated attribute set to TRUE - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)) { - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); - } - else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated != true) { - setverdict(fail, testcasename(), ": Error, memberTypeValidated must be TRUE"); - } - } - - //memberIDs attribute set to v_memberID1 - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs)){ - setverdict(fail, testcasename(), ": Error, memberIDs attribute not provided"); - } - else { - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs) != 1) { - setverdict(fail, testcasename() & ": Error, wrong number of memberIDs attribute"); - } - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[0] != v_memberID1){ - setverdict(fail, testcasename(), ": Error, memberIDs attribute not correct"); - } - } + setverdict(pass, __SCOPE__ & ": unsuccessful validation of the resource type during the creation of the group"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource"); - } - } - - //Postamble + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error create succesfull while the operation should be aborted"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble f_cse_postamble_deleteResources(); - + // Tear down f_cf01Down(); + } - } // end group g_CSE_GMG_BV_017 - - //Test objective: Check that the IUT handles unsuccessful validation of the resource type during an update of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_GROUP. - group g_CSE_GMG_BV_018 { - - testcase TC_CSE_GMG_BV_018() runs on CseTester system CseSystem { + + group g_CSE_GMG_CRE_008 { + + /** + * @desc Check that IUT generates a request primitive for each resource in memberIDs with no relative address appended to it. + * + */ + testcase TC_CSE_GMG_CRE_008_CRE() runs on CseTester system CseSystem { //Create + var template PrimitiveContent v_contentResponse; + v_contentResponse.container := mw_contentContainer_rc1; + + f_CSE_GMG_CRE_008(m_createContainerBase, v_contentResponse, int2001); + }//end TC_CSE_GMG_CRE_008_CRE + + testcase TC_CSE_GMG_CRE_008_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var template PrimitiveContent v_contentResponse; + var Labels v_labels_1:= {"VALUE_1"}; + v_contentResponse.aE := m_contentAe_allOmit; + v_contentResponse.aE.labels := ?; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + + f_CSE_GMG_CRE_008(v_updateRequest, v_contentResponse, int2004); + }//end TC_CSE_GMG_CRE_008_UPD + + testcase TC_CSE_GMG_CRE_008_RET() runs on CseTester system CseSystem { //Retrieve + var template PrimitiveContent v_contentResponse; + v_contentResponse.aE := mw_contentAeBase; + + f_CSE_GMG_CRE_008(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000); + }//end TC_CSE_GMG_CRE_008_RET + + testcase TC_CSE_GMG_CRE_008_DEL() runs on CseTester system CseSystem { //Delete + var template PrimitiveContent v_contentResponse; + v_contentResponse.aE := mw_contentAeBase;// TODO see with wath should it be matched + + f_CSE_GMG_CRE_008(m_deleteRequest("Temporary"), v_contentResponse, int2002); + }//end TC_CSE_GMG_CRE_008_DEL + + function f_CSE_GMG_CRE_008(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse, in ResponseStatusCode p_responseStatusCode) runs on CseTester { + //Local constants + const integer c_numberOfResponsePrimitive := 2; + + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var ListOfURIs v_memberIDs; + var integer i; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, -), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else{ + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ + setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); + } + else{ + for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); + } + } + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_CRE_008 + + } // end group g_CSE_GMG_CRE_008 + + + /** + * @desc Check that IUT generates a request primitive for each resource in memberIDs with a relative address appended to it. + * + */ + testcase TC_CSE_GMG_CRE_009() runs on CseTester system CseSystem { + //Local constants + const integer c_numberOfResponsePrimitive := 2; + // Local variables var MsgIn v_response; - var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var integer v_groupIndex := -1; - var integer v_subGroupIndex := -1; - var XSD.AnyURI v_memberID1; - var XSD.AnyURI v_memberID2; - + var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex := -1; + var integer i; + var ListOfURIs v_memberIDs; + var ListOfURIs v_membersAcpIds; + var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1")); + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); + var template PrimitiveContent v_contentResponse; + + v_contentResponse.contentInstance := mw_contentContentInstanceBase; + // Test control - + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); - v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); - v_memberID1 := f_getResourceAddress(v_containerIndex); - v_memberID2 := f_getResourceAddress(v_subGroupIndex); - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberID1}, omit, int3, int2), v_aeIndex); //Member type is set to Container(int3) and consistencyStrategy is set to ABANDON GROUP (default value) - - v_updateRequest.primitiveContent.any_1[0].Group_optional.memberIDs := {v_memberID2, v_memberID1}; - v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); - - //Test Body - mcaPort.send(m_request(v_updateRequest)); + v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", omit), -1); // AE2 is registred + v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)}; + v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds, -), -); + + v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName; + v_createRequest.from_ := f_getOriginator(v_groupIndex); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN + + // Test Body + + mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4110))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": unsuccessful validation of the resource type during the creation of the group"); + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else{ + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ + setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); + } + else{ + for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); + } + } + } + } } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error create succesfull while the operation should be aborted"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + setverdict(fail, __SCOPE__ & ": Error while creating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } - - //Postamble + + // Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - } - } // end group g_CSE_GMG_BV_018 - - group g_CSE_GMG_BV_019 { - // Test objective: Check that the IUT detects when the number of memberIDs exceeds the limitation of maxNrOfMembers. - testcase TC_CSE_GMG_BV_019() runs on CseTester system CseSystem - { + f_cf01Down(); + + } // end TC_CSE_GMG_CRE_009 + + } // end group Create + + group Retrieve { + + /** + * @desc Check that the IUT generates a request primitive for each resource in memberIDs with a relative address appended to fanOutPoint that includes a virtual resource. + * + */ + testcase TC_CSE_GMG_RET_001() runs on CseTester system CseSystem { //Local constants - const ResourceType c_ResourceTypeGroup := int9; - const ResourceType c_ResourceType1 := int4; - const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 - const XSD.String c_primitiveContent := "primitive_contet"; -// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; - const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; - const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; - const XSD.AnyURI c_memberResourceAddress3 := "MEMBER_RESSOURCE_ADDRESS_3"; - + const integer c_numberOfResponsePrimitive := 2; + // Local variables var MsgIn v_response; - var RequestPrimitive v_request; - var integer v_aeIndex := -1; - var integer v_groupIndex := -1; - - var template RequestPrimitive v_createRequest := m_createGroupBase; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - var template RequestPrimitive v_createMember; - + var integer v_aeIndex_1, v_aeIndex_2, v_acpIndex, v_containerIndex_1, v_containerIndex_2, v_groupIndex, v_contentInstanceIndex_1, v_contentInstanceIndex_2 := -1; + var integer i; + var ListOfURIs v_memberIDs; + var ListOfURIs v_membersAcpIds; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); + var template PrimitiveContent v_contentResponse; + var XSD.AnyURI v_fanoutPointAddress; + + v_contentResponse.container := mw_contentContainerBase; + // Test control - + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi - - // and the IUT having a resource at TARGET_RESOURCE_ADDRESS of type <group> - // containing - // memberIDs attribute set to MEMBER_RESOURCE_ADDRESS_1, - // MEMBER_RESOURCE_ADDRESS_2 - // maxNrOfMembers attribute set to 2 - // and the AE having privileges to perform UPDATE operation on the TARGET_RESOURCE_ADDRESS - v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); - v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit); - v_createRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := 2; - v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); - - // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_1 - // having resourceType attribute RESOURCE_TYPE_1 - // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_2 - // having resourceType attribute RESOURCE_TYPE_1 - // and the IUT having a resource at MEMBER_RESOURCE_ADDRESS_3 - // having resourceType attribute RESOURCE_TYPE_1 - v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); - f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); - v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_2"); - f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); - v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_3"); - f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); - - - //Test Body - v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); -// v_request.to_ := c_targetResourceAddress; - v_request.primitiveContent.any_1[0].Group_optional := valueof(m_contentCreateGroup(3, {c_memberResourceAddress1, c_memberResourceAddress2, c_memberResourceAddress3}, omit)); - - mcaPort.send(m_request(v_request)); + v_aeIndex_1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_aeIndex_2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE2_ID_STEM, "MyAe2", omit), -1); // AE2 is registred + v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_1); // AE1 child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainerBase, v_aeIndex_2); // AE2 child resource + v_contentInstanceIndex_1 := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex_1); // Container_1 child resource + v_contentInstanceIndex_2 := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex_2); // Container_2 child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_aeIndex_1].resource), f_getResourceId(vc_resourcesList[v_aeIndex_2].resource)}; + v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersAcpIds), -1); + + v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_defaultContainerResourceName & "/" & c_resourceShortNameLatest; + + // Test Body + mcaPort.send(m_request(m_retrieveResource(v_fanoutPointAddress, f_getOriginator(v_aeIndex_1)))); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else{ + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ + setverdict(fail, __SCOPE__, ": Error, length of aggregatedResponse is not valid"); + } + else{ + for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse doesn't match with template expected"); + } + } + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; - setverdict(pass, testcasename() & ": operation is not allowed"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } - - //Postamble + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - } - } // end group g_CSE_GMG_BV_019 + f_cf01Down(); - // Test objective: Check that the IUT detects when the value provided for maxNrOfMembers attribute is less than the value of the currentNrOfMembers attribute. - group g_CSE_GMG_BV_020 { - - testcase TC_CSE_GMG_BV_020() runs on CseTester system CseSystem { + } // end TC_CSE_GMG_RET_001 + + } // end group Retrieve + + group Update { + + /** + * @desc Check that the IUT rejects the update of the group resource when the memberType cannot be retrieved due to lack of privilege. + * + */ + testcase TC_CSE_GMG_UPD_001() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; - var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var integer v_aeIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_acpIndex := -1; var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - var XSD.PositiveInteger v_maxNrOfMembers:= 1; - - v_updateRequest.primitiveContent.any_1[0].Group_optional.maxNrOfMembers := v_maxNrOfMembers; - + var RequestPrimitive v_request; + var template RequestPrimitive v_containerCreateRequest := m_createContainer_noResourceName; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyAcp", -, int61); //c_CUDNDi + // Test control - + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3), v_aeIndex); - - v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerCreateRequest.primitiveContent.container.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, v_containerCreateRequest, v_aeIndex); // AE child resource + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3, -, - , -), v_aeIndex); - //Test Body - mcaPort.send(m_request(v_updateRequest)); + v_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); // creating group + + // Test Body + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": max number of member exceeded"); + setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource"); - } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error update successful while operation is not allowed"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource"); - } - } - - //Postamble + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error update successful while doesn't have privileges for retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); + } + } + + // Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); + f_cf01Down(); } - } // end group g_CSE_GMG_BV_020 - group g_CSE_GMG_BV_021 { - // Test objective: Check that the IUT handles validation of the resource type during an UPDATE of the <group> resource when memberIDs contains a sub-group on a temporarily unreachable Hosting CSE. - testcase TC_CSE_GMG_BV_021() runs on CseTester system CseSystem - { - //Local constants - const ResourceType c_ResourceTypeGroup := int9; - const ResourceType c_ResourceType1 := int4; - const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 - const XSD.String c_primitiveContent := "primitive_contet"; - const ConsistencyStrategy c_consistentcyStrategy := int1; // ABANDOND_MEMBER -// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; - const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; - const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; - + + /** + * @desc Check that the IUT detects the presence of duplicate member IDs during an update of the <group> resource and removes the duplicate member IDs prior to updating the <group> resource. + * + */ + testcase TC_CSE_GMG_UPD_002() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; - var RequestPrimitive v_request; var integer v_aeIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; - - var template RequestPrimitive v_createRequest := m_createGroupBase; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - var template RequestPrimitive v_createMember; - + var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); + var XSD.AnyURI v_memberId_1; + var XSD.AnyURI v_memberId_2; + var PrimitiveContent v_primitiveContentRetrievedResource; + // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi -// TODO: -> register IUT to the remoteCSE - - v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); - v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit); - v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_memberType1; - v_createRequest.primitiveContent.any_1[0].Group_optional.memberTypeValidated := true; - v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := c_consistentcyStrategy; - v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); - - // TODO: -> do the resources actually need to be created? - // TODO: choose the right template for member resource - v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); - f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); - - // TODO: create resource of type <group> at c_memberResourceAddress2 on remoteCSE - // TODO: set onlineStatus to false on remoteCSE - - + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex_1].resource); + v_memberId_2 := f_getResourceId(vc_resourcesList[v_containerIndex_2].resource); + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1, v_memberId_2}, omit, int3, -, -, -), v_aeIndex); // AE child resource + + v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_2}; + v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); + //Test Body - v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); -// v_request.to_ := c_targetResourceAddress; - v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit); - - mcaPort.send(m_request(v_request)); + mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": update successful"); + + // check for membersId + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided"); + } + else { + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) { + setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); + } + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] != v_memberId_2){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated)) { - setverdict(fail, testcasename(), ": Error, memberTypeValidated attribute not provided"); - } else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberTypeValidated == false) { - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs) != 2) { - setverdict(fail, testcasename() & ": Error, wrong number of memberIDs attribute"); - } else { - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[0] == c_memberResourceAddress1 and v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Group_optional.memberIDs[1] == c_memberResourceAddress2) { - setverdict(pass, testcasename() & ": update successful"); - } else { - setverdict(fail, testcasename(), ": Error, wrong memberIDs"); - } - } - } else { - setverdict(fail, testcasename(), ": Error, memberTypeValidated must be set to FALSE"); - } - } - } + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); + setverdict(fail, __SCOPE__ & ": Error while updating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } } - + + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); + if(getverdict == pass){ + if(ischosen(v_primitiveContentRetrievedResource.group_)){ + if(v_primitiveContentRetrievedResource.group_.memberIDs[0] != v_memberId_2){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not updated"); + } + } + } + //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } - } // end group g_CSE_GMG_BV_021 - - group g_CSE_GMG_BV_022 { - // Test objective: Check that the IUT handles validation of the resource type during an UPDATE of the <group> resource when memberIDs contains a sub-group on a a previously unreachable Hosting CSE that has become reachable - testcase TC_CSE_GMG_BV_022() runs on CseTester system CseSystem - { - //Local constants - const ResourceType c_ResourceTypeGroup := int9; - const ResourceType c_ResourceType1 := int4; - const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 - const XSD.String c_primitiveContent := "primitive_contet"; - const ConsistencyStrategy c_consistentcyStrategy := int1; // ABANDOND_MEMBER -// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; - const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; - const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; - + + /** + * @desc Check that the IUT validates the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’. + * + */ + testcase TC_CSE_GMG_UPD_003() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; - var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_remoteCSEIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; - - var template RequestPrimitive v_createRequest := m_createGroupBase; - var template RequestPrimitive v_updateRequest := m_updateGroupBase; - var template RequestPrimitive v_createMember; - + var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); + var PrimitiveContent v_primitiveContentRetrievedResource; + // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi -// TODO: -> register IUT to the remoteCSE - //v_remoteCSEIndex := ... - - v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); - v_createRequest.primitiveContent.any_1[0].Group_optional := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit); - v_createRequest.primitiveContent.any_1[0].Group_optional.memberType := c_memberType1; - v_createRequest.primitiveContent.any_1[0].Group_optional.memberTypeValidated := false; - v_createRequest.primitiveContent.any_1[0].Group_optional.consistencyStrategy := c_consistentcyStrategy; - v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); - - // TODO: -> the AE having a subscription to c_targetResourceAddress - - // TODO: -> do the resources actually need to be created? - // TODO: choose the right template for member resource - v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); - f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); - - // TODO: create resource of type <group> at c_memberResourceAddress2 on remoteCSE - // TODO: set onlineStatus to false on remoteCSE - - - //Test Body - v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); - //v_request.from_ := CSE-ID - v_request.to_ := f_getResourceAddress(v_remoteCSEIndex); - //Content set to <remoteCSE> resource containing onlineStatus := false; - - mcaPort.send(m_request(v_request)); + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource)}, omit, int3, -, -, -), v_aeIndex); + + v_updateRequest.primitiveContent.group_.memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); + + // Test Body + mcaPort.send(m_request(v_updateRequest));// TODO see if the memberTypeValidated is present in the update response tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - - + setverdict(pass, __SCOPE__ & ": update successful"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); + } + else { + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false) { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated wrong value"); + } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while updating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } } + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); + if(getverdict == pass){ + if(ischosen(v_primitiveContentRetrievedResource.group_)){ + if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated"); + } + } + } + //Postamble f_cse_postamble_deleteResources(); // Tear down f_cf01Down(); } - } // end group g_CSE_GMG_BV_022 - - - group g_CSE_GMG_BV_023 { - - testcase TC_CSE_GMG_BV_023_01() runs on CseTester system CseSystem { //Create - f_CSE_GMG_BV_023(m_createContainerBase); - }//end TC_CSE_GMG_BV_023_01 - - testcase TC_CSE_GMG_BV_023_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - f_CSE_GMG_BV_023(v_updateRequest); - }//end TC_CSE_GMG_BV_023_02 - - testcase TC_CSE_GMG_BV_023_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_GMG_BV_023(m_retrieveResource("Temporary", "Temporary")); - }//end TC_CSE_GMG_BV_023_03 - - testcase TC_CSE_GMG_BV_023_04() runs on CseTester system CseSystem { //Delete - f_CSE_GMG_BV_023(m_deleteRequest("Temporary")); - }//end TC_CSE_GMG_BV_023_04 - - function f_CSE_GMG_BV_023(template RequestPrimitive p_requestPrimitive) runs on CseTester { + + /** + * @desc Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the <group> resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is SET_MIXED. + * + */ + testcase TC_CSE_GMG_UPD_004() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; + var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; + var integer v_containerIndex := -1; var integer v_groupIndex := -1; - var integer i; - var ListOfURIs v_memberIDs; - var ListOfURIs v_membersACPIDs; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); - + var integer v_subGroupIndex := -1; + var XSD.AnyURI v_memberId_1; + var XSD.AnyURI v_memberId_2; + var PrimitiveContent v_primitiveContentRetrievedResource; + // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_membersACPIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersACPIDs), v_aeIndex); // AE child resource + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); + v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); + v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); + v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, int3, -, -), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to MIXED (int3) + + v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_1, v_memberId_2}; + v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); + mcaPort.send(m_request(v_updateRequest));// TODO see if the memberTypeValidated is present in the update response tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); + setverdict(pass, __SCOPE__ & ": update successful"); + + //memberTypeValidated attribute set to FALSE + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); } else { - for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list); i := i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ - setverdict(fail, testcasename(), ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); - } + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated != false) { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be FALSE"); } - } + } + + //memberType attribute set to MIXED + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType)) { + setverdict(fail, __SCOPE__, ": Error, memberType attribute not provided"); + } + else { + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberType != int0) { //Mixed is int0 in release 2 and int24 in release 1 + setverdict(fail, __SCOPE__, ": Error, memberType was not set to MIXED"); + } + } + + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } } - - // Postamble + + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); + if(getverdict == pass){ + if(ischosen(v_primitiveContentRetrievedResource.group_)){ + if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated"); + } + + if(v_primitiveContentRetrievedResource.group_.memberType != int0){ + setverdict(fail, __SCOPE__, ": Error, memberType attribute not set to MIXED"); + } + } + } + + //Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_BV_023 - - } // end group g_CSE_GMG_BV_023 - - group g_CSE_GMG_BO_024 { - - testcase TC_CSE_GMG_BO_024_01() runs on CseTester system CseSystem { //Create - f_CSE_GMG_BO_024(m_createContainerBase, int62); //c_RUDNDi - }//end TC_CSE_GMG_BO_024_01 - - testcase TC_CSE_GMG_BO_024_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - f_CSE_GMG_BO_024(v_updateRequest, int59);//c_CRDNDi - }//end TC_CSE_GMG_BO_024_02 - - testcase TC_CSE_GMG_BO_024_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_GMG_BO_024(m_retrieveResource("Temporary", "Temporary"), int61);//c_CUDNDi - }//end TC_CSE_GMG_BO_024_03 - - testcase TC_CSE_GMG_BO_024_04() runs on CseTester system CseSystem { //Delete - f_CSE_GMG_BO_024(m_deleteRequest("Temporary"), int55); //c_CRUNDi - }//end TC_CSE_GMG_BO_024_04 - - function f_CSE_GMG_BO_024(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on CseTester { - // Local variables + f_cf01Down(); + } + + /** + * @desc Check that the IUT handles unsuccessful validation of the resource type during an UPDATE of the group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_MEMBER. + * + */ + testcase TC_CSE_GMG_UPD_005() runs on CseTester system CseSystem { + // Local variables var MsgIn v_response; + var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; + var integer v_containerIndex := -1; var integer v_groupIndex := -1; - var ListOfURIs v_memberIDs; - var ListOfURIs v_membersACPIDs; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); - + var integer v_subGroupIndex := -1; + var XSD.AnyURI v_memberId_1; + var XSD.AnyURI v_memberId_2; + var PrimitiveContent v_primitiveContentRetrievedResource; + // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_membersACPIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersACPIDs), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); + v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); + v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); + v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, omit), v_aeIndex); //Member type is set to Container (int3) and consistencyStrategy is set to ABANDON MEMBER (default value) + + v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_1}; + v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); + + //Test Body + + mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Update failed due to lack of privilege"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation"); + setverdict(pass, __SCOPE__ & ": update successful"); + + //memberTypeValidated attribute set to TRUE + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); + } + else { + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated != true) { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be TRUE"); + } + } + + //memberIDs attribute set to v_memberID1 + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs)){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not provided"); + } + else { + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 1) { + setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); + } + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] != v_memberId_1){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); + } + } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error operation successful while doesn't have privileges"); + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error while updating resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation"); + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); } - } + } - // Postamble + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); + if(getverdict == pass){ + if(ischosen(v_primitiveContentRetrievedResource.group_)){ + if(v_primitiveContentRetrievedResource.group_.memberTypeValidated == false){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated"); + } + + if(v_primitiveContentRetrievedResource.group_.memberIDs[0] != v_memberId_1){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); + } + } + } + + //Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_BO_024 - - } // end group g_CSE_GMG_BO_024 - - group g_CSE_GMG_BV_025 { - - testcase TC_CSE_GMG_BV_025_01() runs on CseTester system CseSystem { //Create - f_CSE_GMG_BV_025(m_createContainerBase); - }//end TC_CSE_GMG_BV_025_01 - - testcase TC_CSE_GMG_BV_025_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - f_CSE_GMG_BV_025(v_updateRequest); - }//end TC_CSE_GMG_BV_025_02 - - testcase TC_CSE_GMG_BV_025_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_GMG_BV_025(m_retrieveResource("Temporary", "Temporary")); - }//end TC_CSE_GMG_BV_025_03 - - testcase TC_CSE_GMG_BV_025_04() runs on CseTester system CseSystem { //Delete - f_CSE_GMG_BV_025(m_deleteRequest("Temporary")); - }//end TC_CSE_GMG_BV_025_04 - - function f_CSE_GMG_BV_025(template RequestPrimitive p_requestPrimitive) runs on CseTester { + f_cf01Down(); + } + + /** + * @desc Check that the IUT handles unsuccessful validation of the resource type during the creation of the group resource when memberType attribute is not ‘mixed’ and the consistencyStrategy attribute is ABANDON_GROUP. + * + */ + testcase TC_CSE_GMG_UPD_006() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; + var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_groupIndex := -1; - var integer i; - var ListOfURIs v_memberIDs; - var AcpType v_acpIDs; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); - + var integer v_containerIndex := -1; + var integer v_groupIndex := -1; + var integer v_subGroupIndex := -1; + var XSD.AnyURI v_memberId_1; + var XSD.AnyURI v_memberId_2; + // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi + v_containerIndex := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer"), v_aeIndex); + v_subGroupIndex := f_cse_createResource(int9, m_createGroupBase, v_aeIndex); + v_memberId_1 := f_getResourceId(vc_resourcesList[v_containerIndex].resource); + v_memberId_2 := f_getResourceId(vc_resourcesList[v_subGroupIndex].resource); + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, {v_memberId_1}, omit, int3, int2), v_aeIndex); //Member type is set to Container(int3) and consistencyStrategy is set to ABANDON GROUP (default value) + + v_updateRequest.primitiveContent.group_.memberIDs := {v_memberId_2, v_memberId_1}; + v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); + + //Test Body + mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4110))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); - } - else { - for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list); i := i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ - setverdict(fail, testcasename(), ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); - } - } - } + setverdict(pass, __SCOPE__ & ": unsuccessful validation of the resource type during the creation of the group"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error create succesfull while the operation should be aborted"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } - - // Postamble + + //Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_BV_025 - - } // end group g_CSE_GMG_BV_025 - - group g_CSE_GMG_BO_026 { - - testcase TC_CSE_GMG_BO_026_01() runs on CseTester system CseSystem { //Create - f_CSE_GMG_BO_026(m_createContainerBase, int62); //c_RUDNDi - }//end TC_CSE_GMG_BO_026_01 - - testcase TC_CSE_GMG_BO_026_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - f_CSE_GMG_BO_026(v_updateRequest, int59);//c_CRDNDi - }//end TC_CSE_GMG_BO_026_02 - - testcase TC_CSE_GMG_BO_026_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_GMG_BO_026(m_retrieveResource("Temporary", "Temporary"), int61);//c_CUDNDi - }//end TC_CSE_GMG_BO_026_03 - - testcase TC_CSE_GMG_BO_026_04() runs on CseTester system CseSystem { //Delete - f_CSE_GMG_BO_026(m_deleteRequest("Temporary"), int55); //c_CRUNDi - }//end TC_CSE_GMG_BO_026_04 - - function f_CSE_GMG_BO_026(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on CseTester { - // Local variables + f_cf01Down(); + } + + /** + * @desc Check that the IUT detects when the number of memberIDs exceeds the limitation of maxNrOfMembers. + * + */ + testcase TC_CSE_GMG_UPD_007() runs on CseTester system CseSystem + { + //Local constants + const integer c_maxNrOfMembers := 2; + + // Local variables var MsgIn v_response; + var RequestPrimitive v_request; var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; - var integer v_groupIndex := -1; + var integer v_groupIndex, v_containerIndex_1, v_containerIndex_2, v_containerIndex_3 := -1; var ListOfURIs v_memberIDs; - var AcpType v_acpIDs; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); - + var template RequestPrimitive v_createRequest; + var PrimitiveContent v_primitiveContentRetrievedResource; + + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer1"), v_aeIndex); // AE child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex); // AE child resource - v_memberIDs := {f_getResourceAddress(v_containerIndex1), f_getResourceAddress(v_containerIndex2)}; - v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_3 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + + v_createRequest := valueof(m_createGroup(c_maxNrOfMembers, v_memberIDs, omit, int3)); + + v_groupIndex := f_cse_createResource(int9, v_createRequest, v_aeIndex); + + //Test Body + v_request := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); + v_memberIDs := v_memberIDs & {f_getResourceId(vc_resourcesList[v_containerIndex_3].resource)}; + v_request.primitiveContent.group_.memberIDs := v_memberIDs; + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Update failed due to lack of privilege"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation"); + setverdict(pass, __SCOPE__ & ": operation is not allowed"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error operation successful while doesn't have privileges"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error update successful while maxNrOfMembers has exceeded"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation"); + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrievedResource.group_)) { + if(v_primitiveContentRetrievedResource.group_.memberIDs == v_memberIDs){ + setverdict(fail, __SCOPE__ & ": Error: MemberIDs attribute updated") + } } } - - // Postamble + + //Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_BO_026 - - } // end group g_CSE_GMG_BO_026 - - group g_CSE_GMG_BV_027 { - - testcase TC_CSE_GMG_BV_027_01() runs on CseTester system CseSystem { //Create - var template PrimitiveContent v_contentResponse; - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; - - f_CSE_GMG_BV_027(m_createContainerBase, v_contentResponse); - }//end TC_CSE_GMG_BV_027_01 - - testcase TC_CSE_GMG_BV_027_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateAeBase; - var template PrimitiveContent v_contentResponse; - var Labels v_labels_1:= {"VALUE_1"}; - v_contentResponse.any_1[0].AE_optional := mw_contentAe_allOmit; // TODO make a new template with all attributes set to * for exemple - v_contentResponse.any_1[0].AE_optional.labels := ?; - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - - f_CSE_GMG_BV_027(v_updateRequest, v_contentResponse); - }//end TC_CSE_GMG_BV_027_02 - - testcase TC_CSE_GMG_BV_027_03() runs on CseTester system CseSystem { //Retrieve - var template PrimitiveContent v_contentResponse; - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; - - f_CSE_GMG_BV_027(m_retrieveResource("Temporary", "Temporary"), v_contentResponse); - }//end TC_CSE_GMG_BV_027_03 - - testcase TC_CSE_GMG_BV_027_04() runs on CseTester system CseSystem { //Delete - var template PrimitiveContent v_contentResponse; - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase;// TODO see with wath should it be matched - - f_CSE_GMG_BV_027(m_deleteRequest("Temporary"), v_contentResponse); - }//end TC_CSE_GMG_BV_027_04 - - function f_CSE_GMG_BV_027(template RequestPrimitive p_requestPrimitive, template PrimitiveContent p_contentResponse) runs on CseTester { - //Local constants - const integer c_numberOfResponsePrimitive := 2; - - // Local variables + f_cf01Down(); + } + + /** + * @desc Check that the IUT detects when the value provided for maxNrOfMembers attribute is less than the value of the currentNrOfMembers attribute. + * + */ + testcase TC_CSE_GMG_UPD_008() runs on CseTester system CseSystem { + // Local variables var MsgIn v_response; - var integer v_aeIndex1 := -1; - var integer v_aeIndex2 := -1; + var RequestPrimitive v_updateRequest := valueof(m_updateGroupBase); + var integer v_aeIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; var integer v_groupIndex := -1; var ListOfURIs v_memberIDs; - var integer i; + var XSD.PositiveInteger v_maxNrOfMembers:= 1; + var PrimitiveContent v_primitiveContentRetrievedResource; + + v_updateRequest.primitiveContent.group_.maxNrOfMembers := v_maxNrOfMembers; // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_aeIndex2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", omit), -1); // AE2 is registred - v_memberIDs := {f_getResourceAddress(v_aeIndex1), f_getResourceAddress(v_aeIndex2)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2), -1); - - p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex1); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN - - // Test Body - - mcaPort.send(m_request(valueof(p_requestPrimitive))); + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3), v_aeIndex); + + v_updateRequest := f_getUpdateRequestPrimitive(int9, v_groupIndex, v_updateRequest); + + //Test Body + mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); - } - else{ - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ - setverdict(fail, testcasename(), ": Error, length of aggregatedResponse is not valid"); - } - else{ - for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i].primitiveContent, p_contentResponse)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse doesn't match with template expected"); - } - } - } - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int6010))) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + setverdict(pass, __SCOPE__ & ": max number of member exceeded"); } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error update successful while operation is not allowed"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource"); + } + } + + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); + if(getverdict == pass){ + //Check that the resource has NOT been udpated + if(ischosen(v_primitiveContentRetrievedResource.group_)) { + if(v_primitiveContentRetrievedResource.group_.maxNrOfMembers == v_maxNrOfMembers){ + setverdict(fail, __SCOPE__ & ": Error: maxNrOfMembers attribute updated") + } } } - - // Postamble + + //Postamble f_cse_postamble_deleteResources(); - + // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_BV_027 - - } // end group g_CSE_GMG_BV_027 - - group g_CSE_GMG_BV_028 { - - testcase TC_CSE_GMG_BV_028() runs on CseTester system CseSystem { + f_cf01Down(); + } + + /** + * @desc Check that the IUT handles validation of the resource type during an UPDATE of the <group> resource when memberIDs contains a sub-group on a temporarily unreachable Hosting CSE. + * + */ + testcase TC_CSE_GMG_UPD_009() runs on CseTester system CseSystem + { //Local constants - const integer c_numberOfResponsePrimitive := 2; - + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const XSD.String c_primitiveContent := "primitive_contet"; + const ConsistencyStrategy c_consistentcyStrategy := int1; // ABANDOND_MEMBER +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + // Local variables var MsgIn v_response; - var integer v_aeIndex1 := -1; - var integer v_aeIndex2 := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; var integer v_groupIndex := -1; - var integer i; - var ListOfURIs v_memberIDs; - var ListOfURIs v_membersACPIDs; - var RequestPrimitive v_createRequest := valueof(m_createContentInstance("NotInitialized", "Value1")); - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); - var template PrimitiveContent v_contentResponse; - - v_contentResponse.any_1[0].ContentInstance_optional := mw_contentContentInstanceBase; - + var integer v_contentInstanceIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + var PrimitiveContent v_primitiveContentRetrievedResource; + // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_aeIndex2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", omit), -1); // AE2 is registred - v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "myCon"), v_aeIndex1); // AE1 child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "myCon"), v_aeIndex2); // AE2 child resource - v_memberIDs := {f_getResourceAddress(v_aeIndex1), f_getResourceAddress(v_aeIndex2)}; - v_membersACPIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersACPIDs), -1); - - v_createRequest.to_ := f_getResourceAddress(v_groupIndex) & "/fopt" & "/myCon"; - v_createRequest.from_ := f_getOriginator(v_aeIndex1); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN - - // Test Body - - mcaPort.send(m_request(v_createRequest)); + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi +// TODO: -> register IUT to the remoteCSE + + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.group_ := m_contentCreateGroup(1, {c_memberResourceAddress1}, omit); + v_createRequest.primitiveContent.group_.memberType := c_memberType1; + v_createRequest.primitiveContent.group_.memberTypeValidated := true; + v_createRequest.primitiveContent.group_.consistencyStrategy := c_consistentcyStrategy; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + // TODO: -> do the resources actually need to be created? + // TODO: choose the right template for member resource + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + v_contentInstanceIndex := f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + + // TODO: create resource of type <group> at c_memberResourceAddress2 on remoteCSE + // TODO: set onlineStatus to false on remoteCSE + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); +// v_request.to_ := c_targetResourceAddress; + v_createRequest.primitiveContent.group_ := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit); + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource"); - - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); - } - else{ - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ - setverdict(fail, testcasename(), ": Error, length of aggregatedResponse is not valid"); - } - else{ - for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse doesn't match with template expected"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated)) { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not provided"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberTypeValidated == false) { + if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs) != 2) { + setverdict(fail, __SCOPE__ & ": Error, wrong number of memberIDs attribute"); + } else { + if(v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[0] == c_memberResourceAddress1 and v_response.primitive.responsePrimitive.primitiveContent.group_.memberIDs[1] == c_memberResourceAddress2) { + setverdict(pass, __SCOPE__ & ": update successful"); + } else { + setverdict(fail, __SCOPE__, ": Error, wrong memberIDs"); } } - } + } else { + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated must be set to FALSE"); + } } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } - } - - // Postamble - f_cse_postamble_deleteResources(); + [] 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"); + } + } + + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_groupIndex); + if(getverdict == pass){ + if(ischosen(v_primitiveContentRetrievedResource.group_)){ + if(v_primitiveContentRetrievedResource.group_.memberTypeValidated != false){ + setverdict(fail, __SCOPE__, ": Error, memberTypeValidated attribute not updated"); + } + if((v_primitiveContentRetrievedResource.group_.memberIDs[0] != c_memberResourceAddress1) and (v_primitiveContentRetrievedResource.group_.memberIDs[1] != c_memberResourceAddress2)){ + setverdict(fail, __SCOPE__, ": Error, memberIDs attribute not correct"); + } + } + } + + //Postamble + f_cse_postamble_deleteResources(); + // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_BV_028 - - } // end group g_CSE_GMG_BV_028 - - group g_CSE_GMG_BV_029 { - - testcase TC_CSE_GMG_BV_029() runs on CseTester system CseSystem { + f_cf01Down(); + } + + /** + * @desc Check that the IUT handles validation of the resource type during an UPDATE of the group resource when memberIDs contains a sub-group on a a previously unreachable Hosting CSE that has become reachable + * @verdict + */ + testcase TC_CSE_GMG_UPD_010() runs on CseTester system CseSystem + { //Local constants - const integer c_numberOfResponsePrimitive := 2; - + const ResourceType c_ResourceTypeGroup := int9; + const ResourceType c_ResourceType1 := int4; + const MemberType c_memberType1 := int4; // should be set same type as c_ResourceType1 + const XSD.String c_primitiveContent := "primitive_contet"; + const ConsistencyStrategy c_consistentcyStrategy := int1; // ABANDOND_MEMBER +// const XSD.AnyURI c_targetResourceAddress := "TARGET_RESOURCE_ADDRESS"; + const XSD.AnyURI c_memberResourceAddress1 := "MEMBER_RESSOURCE_ADDRESS_1"; + const XSD.AnyURI c_memberResourceAddress2 := "MEMBER_RESSOURCE_ADDRESS_2"; + // Local variables var MsgIn v_response; - var integer v_aeIndex1 := -1; - var integer v_aeIndex2 := -1; - var integer v_acpIndex := -1; - var integer v_containerIndex1 := -1; - var integer v_containerIndex2 := -1; + var RequestPrimitive v_request; + var integer v_aeIndex := -1; + var integer v_remoteCSEIndex := -1; var integer v_groupIndex := -1; - var integer i; - var ListOfURIs v_memberIDs; - var ListOfURIs v_membersACPIDs; - var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); - var template PrimitiveContent v_contentResponse; - var XSD.AnyURI v_fanoutPointAddress; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainerBase; - + var integer v_contentInstanceIndex := -1; + + var template RequestPrimitive v_createRequest := m_createGroupBase; + var template RequestPrimitive v_updateRequest := m_updateGroupBase; + var template RequestPrimitive v_createMember; + // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble - v_aeIndex1 := f_cse_preamble_registerAe(-, -); //c_CRUDNDi - v_aeIndex2 := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", omit), -1); // AE2 is registred - v_acpIndex := f_cse_createResource(int1, v_createAcp, -1); // AE child resource - v_containerIndex1 := f_cse_createResource(int3, m_createContainer("NotInitialized", "myCon"), v_aeIndex1); // AE1 child resource - v_containerIndex2 := f_cse_createResource(int3, m_createContainer("NotInitialized", "myCon"), v_aeIndex2); // AE2 child resource - v_memberIDs := {f_getResourceAddress(v_aeIndex1), f_getResourceAddress(v_aeIndex2)}; - v_membersACPIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; - v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int2, -, v_membersACPIDs), -1); - - v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/fopt" & "/myCon" & "/la"; - - // Test Body - mcaPort.send(m_request(m_retrieveResource(v_fanoutPointAddress, f_getOriginator(v_aeIndex1)))); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN + v_aeIndex := f_cse_preamble_registerAe(); //c_CRUDNDi +// TODO: -> register IUT to the remoteCSE + //v_remoteCSEIndex := ... + + v_createRequest := f_getCreateRequestPrimitive(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + v_createRequest.primitiveContent.group_ := m_contentCreateGroup(2, {c_memberResourceAddress1, c_memberResourceAddress2}, omit); + v_createRequest.primitiveContent.group_.memberType := c_memberType1; + v_createRequest.primitiveContent.group_.memberTypeValidated := false; + v_createRequest.primitiveContent.group_.consistencyStrategy := c_consistentcyStrategy; + v_groupIndex := f_cse_createResource(c_ResourceTypeGroup, v_createRequest, v_aeIndex); + + // TODO: -> the AE having a subscription to c_targetResourceAddress + + // TODO: -> do the resources actually need to be created? + // TODO: choose the right template for member resource + v_createMember := m_createContentInstance(f_getResourceAddress(v_aeIndex), c_primitiveContent & "_1"); + v_contentInstanceIndex := f_cse_createResource(c_ResourceType1, v_createMember, v_aeIndex); + + // TODO: create resource of type <group> at c_memberResourceAddress2 on remoteCSE + // TODO: set onlineStatus to false on remoteCSE + + + //Test Body + v_request := f_getUpdateRequestPrimitive(c_ResourceTypeGroup, v_groupIndex, v_updateRequest); + //v_request.from_ := CSE-ID + v_request.to_ := f_getResourceAddress(v_remoteCSEIndex); + //Content set to <remoteCSE> resource containing onlineStatus := false; + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": creation successfull by using fanOutPoint in group resource"); + + + } + [] 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(); - if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse attribute not provided"); + // Tear down + f_cf01Down(); + } + } // end group Update + + + + + + + group Basic_Operations { + + group g_CSE_GMG_001 { + + /** + * @desc Check that the IUT allows a <group>/fanoutPoint OPERATION when the Originator has OPERATION_PERMISSION specified in membersAccessControlPolicyIDs attribute in the group resource. + * + */ + testcase TC_CSE_GMG_001_CRE() runs on CseTester system CseSystem { //Create + f_CSE_GMG_001(m_createContainerBase, int2001); + }//end TC_CSE_GMG_001_CRE + + testcase TC_CSE_GMG_001_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + f_CSE_GMG_001(v_updateRequest, int2004); + }//end TC_CSE_GMG_001_UPD + + testcase TC_CSE_GMG_001_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_GMG_001(m_retrieveResource("Temporary", "Temporary"), int2000); + }//end TC_CSE_GMG_001_RET + + testcase TC_CSE_GMG_001_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_GMG_001(m_deleteRequest("Temporary"), int2002); + }//end TC_CSE_GMG_001_DEL + + function f_CSE_GMG_001(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var integer i; + var ListOfURIs v_memberIDs; + var AcpType v_acpIDs; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); + } + else { + for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ + setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); + } + } + } } - else{ - if(lengthof(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list) != c_numberOfResponsePrimitive){ - setverdict(fail, testcasename(), ": Error, length of aggregatedResponse is not valid"); + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_001 + + } // end group g_CSE_GMG_001 + + group g_CSE_GMG_002 { + + /** + * @desc Check that IUT denies a <group>/fanOutPoint OPERATION when the Originator does not have OPERATION_PERMISSION specified in membersAccessControlPolicyIDs in the group resource. + * + */ + testcase TC_CSE_GMG_002_CRE() runs on CseTester system CseSystem { //Create + f_CSE_GMG_002(m_createContainerBase, int62); //c_RUDNDi + }//end TC_CSE_GMG_002_CRE + + testcase TC_CSE_GMG_002_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + f_CSE_GMG_002(v_updateRequest, int59);//c_CRDNDi + }//end TC_CSE_GMG_002_UPD + + testcase TC_CSE_GMG_002_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_GMG_002(m_retrieveResource("Temporary", "Temporary"), int61);//c_CUDNDi + }//end TC_CSE_GMG_002_RET + + testcase TC_CSE_GMG_002_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_GMG_002(m_deleteRequest("Temporary"), int55); //c_CRUNDi + }//end TC_CSE_GMG_002_DEL + + function f_CSE_GMG_002(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var ListOfURIs v_memberIDs; + var ListOfURIs v_membersAcpIds; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error operation successful while doesn't have privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_002 + + } // end group g_CSE_GMG_002 + + group g_CSE_GMG_003 { + + /** + * @desc Check that the IUT allows a <group>/fanoutPoint OPERATION when the Originator has OPERATION_PERMISSION specified in accessControlPolicyIDs and the membersAccessControlPolicyIDs is empty in the <group> resource. + * @verdict + */ + testcase TC_CSE_GMG_003_CRE() runs on CseTester system CseSystem { //Create + f_CSE_GMG_003(m_createContainerBase, int2001); + }//end TC_CSE_GMG_003_CRE + + testcase TC_CSE_GMG_003_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + f_CSE_GMG_003(v_updateRequest, int2004); + }//end TC_CSE_GMG_003_UPD + + testcase TC_CSE_GMG_003_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_GMG_003(m_retrieveResource("Temporary", "Temporary"), int2000); + }//end TC_CSE_GMG_003_RET + + testcase TC_CSE_GMG_003_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_GMG_003(m_deleteRequest("Temporary"), int2002); + }//end TC_CSE_GMG_003_DEL + + function f_CSE_GMG_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var integer i; + var ListOfURIs v_memberIDs; + var ListOfURIs v_membersAcpIds; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, -); + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_membersAcpIds := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, omit, int3, -, v_membersAcpIds), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": creation successfull by using fanOutPoint in group resource"); + + if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list)){ + setverdict(fail, __SCOPE__, ": Error, aggregatedResponse attribute not provided"); } - else{ - for(i:=0; i<c_numberOfResponsePrimitive; i:=i+1){ - if(not match(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].AggregatedResponse.responsePrimitive_list[i].primitiveContent, v_contentResponse)){ - setverdict(fail, testcasename(), ": Error, aggregatedResponse doesn't match with template expected"); + else { + for(i:=0; i<lengthof(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list); i := i+1){ + if(not match(v_response.primitive.responsePrimitive.primitiveContent.aggregatedResponse.responsePrimitive_list[i], mw_responsePrimitiveOK)){ + setverdict(fail, __SCOPE__, ": Error, one responsePrimitve of aggregatedResponse_list is not successful"); } } - } - } + } + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource"); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_003 + + } // end group g_CSE_GMG_003 + + group g_CSE_GMG_004 { + + /** + * @desc Check that IUT rejects a <group>/fanOutPoint OPERATION when the Originator does not have OPERATION_PERMISSION specified in accessControlPolicyIDs and the membersAccessControlPolicyIDs is empty in the group resource. + * + */ + testcase TC_CSE_GMG_004_CRE() runs on CseTester system CseSystem { //Create + f_CSE_GMG_004(m_createContainerBase, int62); //c_RUDNDi + }//end TC_CSE_GMG_004_CRE + + testcase TC_CSE_GMG_004_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + f_CSE_GMG_004(v_updateRequest, int59);//c_CRDNDi + }//end TC_CSE_GMG_004_UPD + + testcase TC_CSE_GMG_004_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_GMG_004(m_retrieveResource("Temporary", "Temporary"), int61);//c_CUDNDi + }//end TC_CSE_GMG_004_RET + + testcase TC_CSE_GMG_004_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_GMG_004(m_deleteRequest("Temporary"), int55); //c_CRUNDi + }//end TC_CSE_GMG_004_DEL + + function f_CSE_GMG_004(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_accessControlOperations) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var integer v_containerIndex_1 := -1; + var integer v_containerIndex_2 := -1; + var integer v_groupIndex := -1; + var ListOfURIs v_memberIDs; + var AcpType v_acpIDs; + var template RequestPrimitive v_createAcp := m_createAcp("NotInitialized", "MyACP", -, p_accessControlOperations); + + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); //c_CRUDNDi + v_acpIndex := f_cse_createResource(int1, v_createAcp, v_aeIndex); // AE child resource + v_containerIndex_1 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_containerIndex_2 := f_cse_createResource(int3, m_createContainer_noResourceName, v_aeIndex); // AE child resource + v_memberIDs := {f_getResourceId(vc_resourcesList[v_containerIndex_1].resource), f_getResourceId(vc_resourcesList[v_containerIndex_2].resource)}; + v_acpIDs := {f_getResourceId(vc_resourcesList[v_acpIndex].resource)}; + v_groupIndex := f_cse_createResource(int9, m_createGroup(2, v_memberIDs, v_acpIDs, int3), v_aeIndex); // AE child resource + + p_requestPrimitive.to_ := f_getResourceAddress(v_groupIndex) & "/fopt"; + p_requestPrimitive.from_ := f_getOriginator(v_groupIndex); + + // Test Body + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update failed due to lack of privilege"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error operation successful while doesn't have privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } } - } - - // Postamble - f_cse_postamble_deleteResources(); - - // Tear down - f_cf01Down(); - - } // end f_CSE_GMG_BV_029 - - } // end group g_CSE_GMG_BV_029 + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + } // end f_CSE_GMG_004 + + } // end group g_CSE_GMG_004 + + }// End of Basic_Operations } // end group Group_Managment - group Subscription_And_Notification { + group Discovery { + + /** + * @desc Check that the IUT returns successfully a list all discovered resource addresses + * + */ + testcase TC_CSE_DIS_001() runs on CseTester system CseSystem { + // Local variables + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var RequestPrimitive v_request; + var integer v_childResourceIndex := -1; + const ResourceType c_containerResourceType := int3; + + // Test control - group g_CSE_SUB_BV_001{ - testcase TC_CSE_SUB_BV_001_01() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var RequestPrimitive v_request; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription resource is created - - v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_resourceIndex); + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; + + v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); + v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); + v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responseDiscovery)){ + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": URI List Representation available"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + 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 while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // end TC_CSE_DIS_001 + + /** + * @desc Check that the IUT returns the empty address list when no result matching with filter criteria is discovered + * + */ + testcase TC_CSE_DIS_003() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var RequestPrimitive v_request; + var integer v_childResourceIndex := -1; + const ResourceType c_containerResourceType := int3; - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5203))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": <Subscription> Resource not subscribable"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while subscribing a ressource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Subsciption successful whereas <Subscription> resource is not subscribable"); + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; + + v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); + v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); + v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response { + tc_ac.stop; + if(sizeof(v_response.primitive.responsePrimitive.primitiveContent.uRIList) == 0){ + setverdict(pass, __SCOPE__ & ": No Content is present"); } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + else + { + setverdict(fail, __SCOPE__ & ": Wrong content available in URIList element"); } - } - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } // end TC_CSE_SUB_BV_001_01 + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + 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 while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // end TC_CSE_DIS_003 + + /** + * @desc Check that the IUT returns successfully a list of discovered resource addresses with Non-hierarchical addressing form when the Discovery Result Type is provided in the request + * + */ + testcase TC_CSE_DIS_004() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var RequestPrimitive v_request; + var integer v_childResourceIndex := -1; + const ResourceType c_containerResourceType := int3; - testcase TC_CSE_SUB_BV_001_02() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerResourceIndex := -1; - var integer v_contentInstanceResourceIndex := -1; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var RequestPrimitive v_request; - - v_createRequest.primitiveContent.any_1[0].Subscription_optional.resourceName := omit; - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container - - v_contentInstanceResourceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_aeIndex), "Random Value"), v_containerResourceIndex);//ContentInstance - - v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_contentInstanceResourceIndex); - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5203))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": <Subscription> Resource not subscribable"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while subscribing a ressource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Subsciption successful whereas <Subscription> resource is not subscribable"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; + + v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); + v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); + v_request := valueof(m_retrieveResourceDiscResTypeFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int2, int1)); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response { + tc_ac.stop; + if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) { + setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList element"); + } else { + setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList representation"); } } - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } // end TC_CSE_SUB_BV_001_02 + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + 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 while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // end TC_CSE_DIS_004 + + /** + * @desc Check that the IUT rejects the discovery requests to the resource TARGET_RESOURCE_ADDRESS when AE has no privilege to perform the discovery request for the resource TARGET_RESOURCE_ADDRESS + * + */ + testcase TC_CSE_DIS_005() runs on CseTester system CseSystem { + // Local variables + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var RequestPrimitive v_request; + var integer v_childResourceIndex := -1; + var integer v_acpAuxIndex := -1; + const ResourceType c_containerResourceType := int3; - }//end group g_CSE_SUB_BV_001 + // Test control + if(not(PICS_ACP_SUPPORT)) { + log(__SCOPE__ & ":INFO: AccessControlPolicy support is required for executing this test case"); + stop; + } + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration - group g_CSE_SUB_BV_002 { + // Preamble + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int31);//c_CRUDN) - testcase TC_CSE_SUB_BV_002() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpAuxIndex := -1; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var RequestPrimitive v_request; - - // Test control - if(not(PICS_ACP_SUPPORT)) { - setverdict(inconc, testcasename() & ": AccessControlPolicy support is required to run this test case"); - stop; - } - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int61);//c_CUDNDi) - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi); + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)});//AE1 is registred; - v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5105))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": No privilege for subscribing to the resource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while subscribing a ressource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Subsciption successful whereas it doesn't have privilege"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } + v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); + v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); + v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Access denied to discovery operation for resource " & f_getResourceAddress(v_resourceIndex)); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Discovering " & f_getResourceAddress(v_resourceIndex) & " without having privileges"); } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while discovering resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // end TC_CSE_DIS_005 + + /** + * @desc Check that the IUT responds with an error when the AE sends requests to discover the resource TARGET_RESOURCE_ADDRESS which does not exist in the Hosting CSE + * + */ + testcase TC_CSE_DIS_006() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var RequestPrimitive v_request; + var XSD.ID v_resourceId := "nonexisting"; - //Postamble - f_cse_postamble_deleteResources(); + // Test control - //Tear down - f_cf01Down(); + // Test component configuration + f_cf01Up(); - } // end TC_CSE_SUB_BV_002 + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; - }//end group g_CSE_SUB_BV_002 + if(PX_ADDRESSING_METHOD == e_nonHierarchical and (PX_PRIMITIVE_SCOPE == e_cseRelative)) { + v_request := valueof(m_retrieveResourceFilterUsageOption(v_resourceId, f_getOriginator(v_aeIndex), int1)); + } else { + v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_aeIndex) & "/" & v_resourceId, f_getOriginator(v_resourceIndex), int1)); + } - group g_CSE_SUB_BV_003 { + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { - testcase TC_CSE_SUB_BV_003() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var RequestPrimitive v_request; + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource not found"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); - // Test control + // Tear down + f_cf01Down(); + } // end TC_CSE_DIS_006 + + /** + * @desc Check that the IUT responds the originator with an error when the originator sends a request including an invalid format of filter criteria to discover the resource TARGET_RESOURCE_ADDRESS + * + */ + testcase TC_CSE_DIS_007() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var RequestPrimitive v_request; + var integer v_childResourceIndex := -1; + const ResourceType c_containerResourceType := int3; + + // Test control - // Test component configuration - f_cf01Up(); + // Test component configuration + f_cf01Up(); - // Test adapter configuration + // Test adapter configuration - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CUDNDi); - - v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription - //v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {"Not Initialized"}; - - - mcaPort.send(m_request(v_request)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5204))) -> value v_response { //SUBSCRIPTION_VERIFICATION_INITIATION_FAILED - tc_ac.stop; - setverdict(pass, testcasename() & ": OK : Subscription verification initiation failed"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while subscribing a ressource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Subsciption successful whereas subsciption verification failed"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; + + v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); + v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); + v_request := valueof(m_retrieveResourceInvalidFormatOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Contents Unacceptable"); } - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } // end TC_CSE_SUB_BV_003 - - }//end group g_CSE_SUB_BV_003 + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code while retrieving resource"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response while retrieving resource"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); - group g_CSE_SUB_BV_004 { + // Tear down + f_cf01Down(); + } // end TC_CSE_DIS_007 - testcase TC_CSE_SUB_BV_004() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var RequestPrimitive v_request; - var CseTester notifyHandler := CseTester.create("NotifyHandler"); - var integer v_ae2Index := -1; - - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(omit,omit);//c_CUDNDi); - v_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", {"http://" & PX_TESTER_ADDRESS & "/"}), -1); - - v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription - v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)}; - - notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(v_aeIndex), int4101)); + } //end group Group Discovery - mcaPort.send(m_request(v_request)); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4101))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE - tc_ac.stop; - setverdict(pass, testcasename() & ": OK : Subscription creator has no privilege"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while subscribing a ressource"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Subsciption successful whereas subsciption creator has no privilege"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); - } - } - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } // end TC_CSE_SUB_BV_004 - - }//end group g_CSE_SUB_BV_004 - - group g_CSE_SUB_BV_005 { + group Subscription_And_Notification { + + group Create { - testcase TC_CSE_SUB_BV_005() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT rejects the creation of the <subscription> resource when the target subscribed-to RESOURCE_TYPE resource is not subscribable. + * + */ + testcase TC_CSE_SUB_CRE_001_SUB() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; - var CseTester notifyHandler := CseTester.create("NotifyHandler"); + var CseTester v_notifyHandler; var integer v_ae2Index := -1; - + // Test control // Test component configuration f_cf01Up(); - + // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe(omit,omit);//c_CUDNDi); // set poa to MTC adress - v_ae2Index := f_cse_createResource(int2, m_createAe(PX_APP_ID, -, PX_AE_ID_STEM, "MyAe2", {"http://" & PX_TESTER_ADDRESS & "/"}), -1); + v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; - v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription - v_request.primitiveContent.any_1[0].Subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)}; + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - notifyHandler.start(f_subscriptionVerificationHandler(f_getResourceAddress(v_aeIndex), int5205)); - + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription resource is created + + v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_resourceIndex); + + // Test Body mcaPort.send(m_request(v_request)); - tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int5205))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5203))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": OK : Subscription creator has no privilege"); + setverdict(pass, __SCOPE__ & ": <Subscription> Resource not subscribable"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while subscribing a ressource"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Subsciption successful whereas subsciption creator has no privilege"); + setverdict(fail, __SCOPE__ & ": Subsciption successful whereas <Subscription> resource is not subscribable"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } - } + } + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_resourceIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_005 - - }//end group g_CSE_SUB_BV_005 - - group g_CSE_SUB_BV_006 { + } // end TC_CSE_SUB_CRE_001_SUB - testcase TC_CSE_SUB_BV_006() runs on CseTester system CseSystem { + testcase TC_CSE_SUB_CRE_001_CIN() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; - var Labels v_labels_1:= {"VALUE_1"}; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var template PrimitiveContent v_contentResponse; - var template RequestPrimitive v_updateRequest := m_updateAeBase; - var RequestPrimitive v_request; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected - + var integer v_containerResourceIndex := -1; + var integer v_contentInstanceResourceIndex := -1; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var RequestPrimitive v_request; + + v_createRequest.primitiveContent.subscription.resourceName := omit; // Test control // Test component configuration @@ -8007,41 +15991,42 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request - - if(v_notifyHandler.running) { - v_notifyHandler.stop; - }; + v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container + + v_contentInstanceResourceIndex := f_cse_createResource(int4, m_createContentInstance(f_getResourceAddress(v_aeIndex), "Random Value"), v_containerResourceIndex);//ContentInstance + + v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_contentInstanceResourceIndex); // Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs - mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5203))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type int2 (Ae) updated successfully"); + setverdict(pass, __SCOPE__ & ": <Subscription> Resource not subscribable"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Subsciption successful whereas <Subscription> resource is not subscribable"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } - }; - - f_is_component_done(v_notifyHandler); + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_contentInstanceResourceIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -8049,26 +16034,25 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_006 - - }//end group g_CSE_SUB_BV_006 - - group g_CSE_SUB_BV_007{ - - testcase TC_CSE_SUB_BV_007() runs on CseTester system CseSystem { - + } // end TC_CSE_SUB_CRE_001_CIN + + /** + * @desc Check that the IUT rejects the creation of the <subscription> resource when the originator does not have privileges for retrieving the subscribed-to resource. + * + */ + testcase TC_CSE_SUB_CRE_002() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var template RequestPrimitive v_createRequest := omit; - var template PrimitiveContent v_contentResponse; + var integer v_acpAuxIndex := -1; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; // all attributes expected + // Test control + if(not(PICS_ACP_SUPPORT)) { + setverdict(inconc, __SCOPE__ & ": AccessControlPolicy support is required to run this test case"); + stop; + } // Test component configuration f_cf01Up(); @@ -8076,69 +16060,61 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int3}, -)); // TODO this field is initialised 2 time with parent adress resource (here and in f_cse_createResource) - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - - v_request:= f_getCreateRequestPrimitive(int3, m_createContainerBase, v_aeIndex); + v_acpAuxIndex := f_cse_preamble_createAcpAux(-, int61);//c_CUDNDi) + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpAuxIndex].resource)}, -);//c_CRDNDi); + + v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription - if(v_notifyHandler.running) { - v_notifyHandler.stop; - }; - // Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs - mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Resource type int3 (Container) created successfully"); + setverdict(pass, __SCOPE__ & ": No privilege for subscribing to the resource"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while creating resource type int3 (Container)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Subsciption successful whereas it doesn't have privilege"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while creating resource type int3 (Container)"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } - - f_is_component_done(v_notifyHandler); - + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_007 - - }//end group g_CSE_SUB_BV_007 - - group g_CSE_SUB_BV_008 { - - testcase TC_CSE_SUB_BV_008() runs on CseTester system CseSystem { + + } // end TC_CSE_SUB_CRE_002 + + /** + * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT cannot send the Notify request to the notificationURI + * + */ + testcase TC_CSE_SUB_CRE_003() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_subscriptionResourceIndex := -1; - var template RequestPrimitive v_createRequest := omit; - var template PrimitiveContent v_contentResponse; - var RequestPrimitive v_deleteRequest; - var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected - + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; + var RequestPrimitive v_request; + // Test control // Test component configuration @@ -8147,44 +16123,40 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int2}, -)); - - v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex );//Subscription - - v_deleteRequest:= valueof(m_deleteRequest(f_getResourceAddress(v_aeIndex))); // Ae delete request + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - if(v_notifyHandler.running) { - v_notifyHandler.stop; - }; - - //Test Body - v_notifyHandler.start(f_CSE_SUB_BV_008(v_contentResponse)); // check if the notification is well received and if its content matchs + v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription + v_request.primitiveContent.subscription.notificationURI := {"NotReachableNotificationURI"}; - mcaPort.send(m_request(v_deleteRequest)); + // Test Body + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5204))) -> value v_response { //SUBSCRIPTION_VERIFICATION_INITIATION_FAILED tc_ac.stop; - setverdict(pass, testcasename() & ": resource type int2 (AE) deleted successfully"); + setverdict(pass, __SCOPE__ & ": OK : Subscription verification initiation failed"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting resource type int2 (AE)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Subsciption successful whereas subsciption verification failed"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource type int2 (AE)"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } } - - f_is_component_done(v_notifyHandler); + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -8192,61 +16164,63 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_008 + } // end TC_CSE_SUB_CRE_003 - function f_CSE_SUB_BV_008( template PrimitiveContent p_primitiveContent) runs on CseTester { - var MsgIn v_response; - - map(self:mcaPort, system:mcaPort); - map(self:acPort, system:acPort); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_response { - tc_ac.stop; - if(not(match(v_response.primitive.requestPrimitive.primitiveContent.any_1[0].Notification.subscriptionDeletion, true))) { - setverdict(fail, testcasename() & ": subscriptionDeletion attribute have to be set to TRUE"); - } - if(f_check_notificationContent(v_response.primitive.requestPrimitive, p_primitiveContent)){ - setverdict(pass, testcasename() & ": Notification received"); - } - else{ - setverdict(fail, testcasename() & ": Notification received but the content doesn't match"); - } - } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No notification received"); - } - } - - mcaPort.send(m_response(valueof(m_responseNotification(int2001)))); - - unmap(self:mcaPort, system:mcaPort); - unmap(self:acPort, system:acPort); - - } //end f_CSE_SUB_BV_008 + /** + * @desc Check that the IUT stores Originator ID in the notification creator attribute when a <SUBSCRIPTION> creation request which needs verification is received and the notificationURI is not the Originator. + * + */ + testcase TC_CSE_SUB_CRE_004() runs on CseTester system CseSystem { + //Local variables + var template RequestPrimitive v_request := m_createSubscriptionBase; + var integer v_aeIndex := -1; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - }//end group g_CSE_SUB_BV_008 + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_request, int23); + + // Test Body + v_request := f_getCreateRequestPrimitive(int23, m_createSubscriptionBase, v_aeIndex); + + mcaPort.send(m_request(valueof(v_request))); + + f_is_component_done(v_notifyHandler); + + // Postamble + f_cse_postamble_deleteResources(); - group g_CSE_SUB_BV_009 { + // Tear down + f_cf01Down(); + + } // end TC_CSE_SUB_CRE_004 - testcase TC_CSE_SUB_BV_009() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Create_of_Direct_Child_Resource" and an create operation has been performed on the subscribed-to resource + * + */ + testcase TC_CSE_SUB_CRE_005() runs on CseTester system CseSystem { + // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_subscriptionResourceIndex := -1; - var integer v_containerResourceIndex := -1; - var template RequestPrimitive v_createRequest := omit; - var RequestPrimitive v_deleteRequest; - var template PrimitiveContent v_contentResponse; + var integer v_resourceIndex := -1; + var template RequestPrimitive v_createRequest := omit; + var template PrimitiveContent v_contentNotification := {container := mw_contentContainer_rc1};// all attributes expected + var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - - v_contentResponse.any_1[0].Container_optional := mw_contentContainer_rc1; // all attributes expected in notification + + // Test control // Test component configuration f_cf01Up(); @@ -8254,130 +16228,113 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi; - v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int4}, -)); + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int3}, -)); - v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription (with name attribute omitted) + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_deleteRequest := valueof(m_deleteRequest(f_getResourceAddress(v_containerResourceIndex)));// Container deletion request + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription if(v_notifyHandler.running) { v_notifyHandler.stop; }; - - //Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs + + // Test Body + v_request:= f_getCreateRequestPrimitive(int3, m_createContainerBase, v_aeIndex); - mcaPort.send(m_request(v_deleteRequest)); + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentNotification)); // check if the notification is well received and if its content matchs + + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Container resource deleted successfuly"); + setverdict(pass, __SCOPE__ & ": Resource type int3 (Container) created successfully"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting resource type int3 (Container)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error while creating resource type int3 (Container)"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource type int3 (Container)"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type int3 (Container)"); } - } - + } + f_is_component_done(v_notifyHandler); - + //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); - - } // end TC_CSE_SUB_BV_009 - - }//end group g_CSE_SUB_BV_009 + } // end TC_CSE_SUB_CRE_005 - group g_CSE_SUB_BV_010 { - - testcase TC_CSE_SUB_BV_010() runs on CseTester system CseSystem { - - } // end TC_CSE_SUB_BV_010 - - }//end group g_CSE_SUB_BV_010 + }//end group Create - group g_CSE_SUB_BV_011 { + group Notify{ - testcase TC_CSE_SUB_BV_011() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT have received the Notify response containing Response Status Code indicating SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE + * + */ + testcase TC_CSE_SUB_NTF_001() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var Labels v_labels_1:= {"VALUE_1"}; - var template PrimitiveContent v_contentResponse; - var template RequestPrimitive v_createRequest := omit; - var template RequestPrimitive v_updateRequest := m_updateAeBase; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - v_contentResponse.any_1[0].AE_optional := mw_contentAe_allOmit; // only modified attribute expected - v_contentResponse.any_1[0].AE_optional.labels := ?; - + // Test control // Test component configuration f_cf01Up(); - + // Test adapter configuration // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int2); //notificationContentType ="modified attributes" + v_aeIndex := f_cse_preamble_registerAe(omit,omit);//c_CUDNDi); - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); //Subscription - - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); - - if(v_notifyHandler.running) { - v_notifyHandler.stop; - }; - + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23, int4101); + // Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs + v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription mcaPort.send(m_request(v_request)); + tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4101))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type int2 (Ae) updated successfuly"); + setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Subsciption successful whereas subsciption creator has no privilege"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } - } + } - f_is_component_done(v_notifyHandler); + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -8385,70 +16342,65 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_011 - }//end group g_CSE_SUB_BV_011 - - group g_CSE_SUB_BV_012 { + } // end TC_CSE_SUB_NTF_001 - testcase TC_CSE_SUB_BV_012() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT rejects the creation of the <subscription> resource when the notificationURI is not the originator and the IUT have received the Notify response containing Response Status Code indicating SUBSCRIPTION_HOST_HAS_NO_PRIVILEGE + * + */ + testcase TC_CSE_SUB_NTF_002() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_resourceIndex := -1; - var Labels v_labels_1:= {"VALUE_1"}; - var template RequestPrimitive v_createRequest := omit; - var template PrimitiveContent v_contentResponse; - var template RequestPrimitive v_updateRequest := m_updateAeBase; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - v_contentResponse.any_1[0].AE_optional := mw_contentAe_allOmit; // only modified attribute expected - v_contentResponse.any_1[0].AE_optional.resourceID := ?; - + // Test control // Test component configuration f_cf01Up(); + + // Test adapter configuration - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int3); // notificationContentType ="ResourceID" - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); - - f_is_component_done(v_notifyHandler); - + // Preamble + v_aeIndex := f_cse_preamble_registerAe(omit,omit);//c_CUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23, int5205); + // Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs + v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription mcaPort.send(m_request(v_request)); + tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int5205))) -> value v_response { //SUBSCRIPTION_CREATOR_HAS_NO_PRIVILEGE tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type int2 (Ae) updated successfuly"); + setverdict(pass, __SCOPE__ & ": OK : Subscription creator has no privilege"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Subsciption successful whereas subsciption creator has no privilege"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type int2 (Ae) or None notification received"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); } - } + } + + f_checkCseTesterStatus(); + + //Check to see if the resource is NOT present + if(f_isResourceNotPresent(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -8456,27 +16408,27 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_012 - }//end group g_CSE_SUB_BV_012 - - group g_CSE_SUB_BV_013 { - testcase TC_CSE_SUB_BV_013() runs on CseTester system CseSystem { + } // end TC_CSE_SUB_NTF_002 + + /** + * @desc Check that the IUT sends aggregated notification to the subscriber resource when the duration value of the batchNotify attribute is set to TIME_LIMIT and when this timer expires + * + */ + testcase TC_CSE_SUB_NTF_003() runs on CseTester system CseSystem { // Local variables - var MsgIn v_response; + const integer numberOfAggregatedNotification := 3; + var Labels v_labels_1:= {"VALUE_1"}; + var Labels v_labels_2:= {"VALUE_2"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; - var Labels v_labels_1:= {"VALUE_1"}; - var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_createRequest := omit; + var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; - var template PrimitiveContent v_retrieveContentResponse; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected - v_retrieveContentResponse.any_1[0].Subscription_optional := mw_contentSubscription_rc1; + + v_contentResponse.aE := mw_contentAeBase; // all attributes expected // Test control @@ -8490,49 +16442,25 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 3); //expirationCounter set to 3 - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subscription + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification));// TODO fix the duration + + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription if(v_notifyHandler.running) { v_notifyHandler.stop; }; - + // Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs + v_notifyHandler.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, 2)); // check that no notification is received - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request - f_cse_updateResource(v_request); // AE update - - //TODO See if we keep this f_is_component_done, it assure that the retrieve operation is executed after having sent and received the Notification - f_is_component_done(v_notifyHandler); - - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_retrieveContentResponse))) -> value v_response { - tc_ac.stop; - if(v_response.primitive.responsePrimitive.primitiveContent.any_1[0].Subscription_optional.expirationCounter == 2 ){ - setverdict(pass, testcasename() & ": expirationCounter has been successfully decreased by one"); - } - else{ - setverdict(fail, testcasename() & ": Error expirationCounter hasn't been decreased by one"); - } - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 + f_cse_updateResource(v_request); + v_updateRequest.primitiveContent.aE.labels := v_labels_2; + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 + f_cse_updateResource(v_request); + f_is_component_done(v_notifyHandler); //Postamble @@ -8540,28 +16468,29 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); + + } // end TC_CSE_SUB_NTF_003 - } // end TC_CSE_SUB_BV_013 - - }//end group g_CSE_SUB_BV_013 + }//end group Notify + + group Update { - group g_CSE_SUB_BV_014 { - - testcase TC_CSE_SUB_BV_014() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT sends Notify request to the subscriber resource when an update operation has been performed on the subscribed-to resource + * + */ + testcase TC_CSE_SUB_UPD_001() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; + var Labels v_labels_1:= {"VALUE_1"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; - var Labels v_labels_1:= {"VALUE_1"}; + var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var template PrimitiveContent v_contentResponse; - var template RequestPrimitive v_createRequest := omit; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var CseTester v_notifyHandler; - var integer v_ae2Index := -1; - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected + var integer v_ae2Index := -1; // Test control @@ -8575,42 +16504,39 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 1); //expirationCounter set to 1 - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);// Subscription + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription if(v_notifyHandler.running) { v_notifyHandler.stop; }; - + // Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request - f_cse_updateResource(v_request); // AE update + v_contentResponse.aE := mw_contentAeBase; // all attributes expected - //TODO See if we keep this f_is_component_done, it assure that the retrieve operation is executed after having sent and received the Notification - f_is_component_done(v_notifyHandler); - - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs + + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Subscription Resource have been successfully deleted"); + setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving Subscription Resource"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error Subscription Resource has not been deleted"); + setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving Subscription Resource"); + setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae)"); } - } + }; f_is_component_done(v_notifyHandler); @@ -8620,29 +16546,25 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_014 - - }//end of group g_CSE_SUB_BV_014 - - group g_CSE_SUB_BV_015 { + } // end TC_CSE_SUB_UPD_001 - testcase TC_CSE_SUB_BV_015() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT sends a Notify request to the subscriber resource when the notificationContentType attribute is set to “modified attributes†and an update operation has been performed on the subscribed-to resource + * + */ + testcase TC_CSE_SUB_UPD_002() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; - var Labels v_labels_1:= {"VALUE_1"}; - var AttributeList_1 v_attributeList := {"labels"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; + var Labels v_labels_1:= {"VALUE_1"}; + var template PrimitiveContent v_contentResponse := {aE := m_contentAe_allOmit}; var template RequestPrimitive v_createRequest := omit; - var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected - + // Test control // Test component configuration @@ -8653,41 +16575,46 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int2); //notificationContentType ="modified attributes" - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList)); - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); //Subscription + if(v_notifyHandler.running) { v_notifyHandler.stop; }; // Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs + //TODO Use f_getTemplateFromPrimitiveContent() which needs to be modified to receive the template in which the output template will be built upon + v_contentResponse.aE.labels := ?;// only modified attribute expected + + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs + + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type int2 (Ae) updated successfuly"); + setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type int2 (Ae) or None notification received"); + setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae)"); } } - + f_is_component_done(v_notifyHandler); //Postamble @@ -8696,26 +16623,28 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_015 - - }//end group g_CSE_SUB_BV_015 - - group g_CSE_SUB_BV_016 { - - testcase TC_CSE_SUB_BV_016() runs on CseTester system CseSystem { + } // end TC_CSE_SUB_UPD_002 + + /** + * @desc Check that the IUT sends a Notify request to the subscriber resource when the notificationContentType attribute is set to “ResourceID†and an update operation has been performed on the subscribed-to resource + * + */ + testcase TC_CSE_SUB_UPD_003() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; - var Labels v_labels_1:= {"VALUE_1"}; - var AttributeList_1 v_attributeList := {"appName"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; + var Labels v_labels_1:= {"VALUE_1"}; var template RequestPrimitive v_createRequest := omit; + var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; + + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + v_contentResponse.aE := m_contentAe_allOmit; // only modified attribute expected + v_contentResponse.aE.resourceID := ?; // Test control @@ -8729,81 +16658,67 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList)); - + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit, omit, int3); // notificationContentType ="ResourceID" + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request - - if(v_notifyHandler.running) { - v_notifyHandler.stop; - }; + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); + f_is_component_done(v_notifyHandler); + // Test Body - v_notifyHandler.start(f_CSE_SUB_BV_016()); // check that no notification is received - + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs + mcaPort.send(m_request(v_request)); tc_ac.start; alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated successfully"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Attribute of resource type int2 (Ae) updated successfuly"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while updating resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": Error while updating resource type int2 (Ae)"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while updating resource type int2 (Ae) or None notification received"); + setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received"); } } - f_is_component_done(v_notifyHandler); - //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); - } // end TC_CSE_SUB_BV_016 - - function f_CSE_SUB_BV_016() runs on CseTester { - // Local variables - var MsgIn v_response; - - map(self:mcaPort, system:mcaPort); - map(self:acPort, system:acPort); - - tc_ac.start(10.0); - alt { - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, Notification isn't expected "); - } - [] tc_ac.timeout { - setverdict(pass, testcasename() & ": No notification received"); - } - } - - unmap(self:mcaPort, system:mcaPort); - unmap(self:acPort, system:acPort); - - } //end f_CSE_SUB_BV_016 - - }//end group g_CSE_SUB_BV_016 - - group g_CSE_SUB_BV_017{ - testcase TC_CSE_SUB_BV_017() runs on CseTester system CseSystem { + } // end TC_CSE_SUB_UPD_003 + + /** + * @desc Check that the IUT decreases the expirationCounter attribute of a subscription resource when the Hosting CSE of the subscribed-to resource successfully sends the notification request to subscriber resource(s) + * + */ + testcase TC_CSE_SUB_UPD_004() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; + var Labels v_labels_1:= {"VALUE_1"}; + var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_createRequest := omit; + var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; + var template PrimitiveContent v_retrieveContentResponse; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - + + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + v_contentResponse.aE := mw_contentAeBase; // all attributes expected + v_retrieveContentResponse.subscription := mw_contentSubscription_rc1; + // Test control // Test component configuration @@ -8816,102 +16731,78 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit,f_getResourceAddress(v_ae2Index)); // SubscriberURI ="ResourceID" - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subsciption + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 3); //expirationCounter set to 3 - v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); // Subscription resource deletion request + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subscription if(v_notifyHandler.running) { v_notifyHandler.stop; }; - + // Test Body - v_notifyHandler.start(f_CSE_SUB_BV_017(f_getResourceAddress(v_resourceIndex))); // check that no notification is received + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs + + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request + f_cse_updateResource(v_request); // AE update - mcaPort.send(m_request(v_request)); + //TODO See if we keep this f_is_component_done, it assure that the retrieve operation is executed after having sent and received the Notification + f_is_component_done(v_notifyHandler); + + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + + tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_retrieveContentResponse))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Subscription resource deleted successfuly"); + if(v_response.primitive.responsePrimitive.primitiveContent.subscription.expirationCounter == 2 ){ + setverdict(pass, __SCOPE__ & ": expirationCounter has been successfully decreased by one"); + } + else{ + setverdict(fail, __SCOPE__ & ": Error expirationCounter hasn't been decreased by one"); + } } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while deleting resource type int23 (Subscription)"); + setverdict(fail, __SCOPE__ & ": Error, resource elements provided not matching expected resource elements"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error while retrieving resource"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while deleting resource type int23 (Subscription)"); + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); } - } + } f_is_component_done(v_notifyHandler); //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - } // end TC_CSE_SUB_BV_017 - - function f_CSE_SUB_BV_017(in XSD.AnyURI p_subscriptionReference) runs on CseTester { - // Local variables - var MsgIn v_response; - var template Notification v_notificationRequest := mw_contentNotificationBase; - - v_notificationRequest.subscriptionDeletion := true; - v_notificationRequest.subscriptionReference := p_subscriptionReference; - - - map(self:mcaPort, system:mcaPort); - map(self:acPort, system:acPort); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_request(mw_notify(v_notificationRequest))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Notification received"); - } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No notification received"); - } - } - - unmap(self:mcaPort, system:mcaPort); - unmap(self:acPort, system:acPort); - - } //end f_CSE_SUB_BV_017 - - - }//end group g_CSE_SUB_BV_017 - - group g_CSE_SUB_BV_018 { - - testcase TC_CSE_SUB_BV_018() runs on CseTester system CseSystem { + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } // end TC_CSE_SUB_UPD_004 + + /** + * @desc Check that the IUT deletes the subscription resource when the the expirationCounter meets zero + * + */ + testcase TC_CSE_SUB_UPD_005() runs on CseTester system CseSystem { // Local variables - const integer numberOfAggregatedNotification := 3; var MsgIn v_response; - var Labels v_labels_1:= {"VALUE_1"}; - var Labels v_labels_2:= {"VALUE_2"}; - var Labels v_labels_3:= {"VALUE_3"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; - var template RequestPrimitive v_createRequest := omit; + var Labels v_labels_1:= {"VALUE_1"}; var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_createRequest := omit; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + v_contentResponse.aE := mw_contentAeBase; // all attributes expected // Test control @@ -8925,96 +16816,71 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification));// TODO fix the duration - - v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, 1); //expirationCounter set to 1 + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);// Subscription + if(v_notifyHandler.running) { v_notifyHandler.stop; }; - + // Test Body - v_notifyHandler.start(f_CSE_SUB_BV_018(v_contentResponse, numberOfAggregatedNotification)); // check that no notification is received - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 - f_cse_updateResource(v_request); - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_2; - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 - f_cse_updateResource(v_request); + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // AE update request + f_cse_updateResource(v_request); // AE update - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_3; - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 - f_cse_updateResource(v_request); - + //TODO See if we keep this f_is_component_done, it assure that the retrieve operation is executed after having sent and received the Notification f_is_component_done(v_notifyHandler); - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); - } // end TC_CSE_SUB_BV_018 - - function f_CSE_SUB_BV_018(template PrimitiveContent p_primitiveContent,in integer p_numberOfAggregatedNotification) runs on CseTester { - // Local variables - var MsgIn v_response; - - map(self:mcaPort, system:mcaPort); - map(self:acPort, system:acPort); - tc_ac.start; alt { - [] mcaPort.receive(mw_request(mw_aggregatedNotifyBase)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) -> value v_response { tc_ac.stop; - if(p_numberOfAggregatedNotification == lengthof(v_response.primitive.requestPrimitive.primitiveContent.any_1[0].AggregatedNotification.notification_list)){ - if(f_check_notificationContent(v_response.primitive.requestPrimitive, p_primitiveContent)){ - setverdict(pass, testcasename() & ": Notification received"); - } - else{ - setverdict(fail, testcasename() & ": Notification received but the content doesn't match"); - } - } - else { - setverdict(fail, testcasename() & ": Number of Notification in Aggregatednotification isn't right"); - } + setverdict(pass, __SCOPE__ & ": Subscription Resource have been successfully deleted"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error Subscription Resource has not been deleted"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No notification received"); + setverdict(fail, __SCOPE__ & ": No answer while retrieving Subscription Resource"); } } - - unmap(self:mcaPort, system:mcaPort); - unmap(self:acPort, system:acPort); - - } //end f_CSE_SUB_BV_018 - - }//end group g_CSE_SUB_BV_018 - - group g_CSE_SUB_BV_019 { + + f_is_component_done(v_notifyHandler); + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } // end TC_CSE_SUB_UPD_005 - testcase TC_CSE_SUB_BV_019() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT doesn’t send a Notify request to the subscriber resource when the “attribute†condition tag of eventNotificationCriteria attribute is set to LIST_OF_ATTRIBUTE and doesn’t contain the ATTRIBUTE_NAME attribute updated. + * + */ + testcase TC_CSE_SUB_UPD_006() runs on CseTester system CseSystem { // Local variables - const integer numberOfAggregatedNotification := 3; var MsgIn v_response; var Labels v_labels_1:= {"VALUE_1"}; - var Labels v_labels_2:= {"VALUE_2"}; + var AttributeList_1 v_attributeList := {"appName"}; var integer v_aeIndex := -1; var integer v_resourceIndex := -1; var template RequestPrimitive v_createRequest := omit; - var template PrimitiveContent v_contentResponse; var template RequestPrimitive v_updateRequest := m_updateAeBase; var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected + + v_updateRequest.primitiveContent.aE.labels := v_labels_1; // Test control @@ -9028,24 +16894,38 @@ module OneM2M_Testcases { f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification));// TODO fix the duration + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList)); v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - + + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request + if(v_notifyHandler.running) { v_notifyHandler.stop; }; // Test Body - v_notifyHandler.start(f_CSE_SUB_BV_018(v_contentResponse, 2)); // check that no notification is received - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 - f_cse_updateResource(v_request); - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_2; - v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 - f_cse_updateResource(v_request); + v_notifyHandler.start(f_cse_notifyProcedure_noNotificationHandler()); // check that no notification is received + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated 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 updating resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received"); + } + } f_is_component_done(v_notifyHandler); @@ -9054,17 +16934,16 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); - - } // end TC_CSE_SUB_BV_019 - - }//end group g_CSE_SUB_BV_019 - - group g_CSE_SUB_BV_020 { + + } // end TC_CSE_SUB_UPD_006 - testcase TC_CSE_SUB_BV_020() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT sends aggregated notification to the subscriber resource when the number value of the batchNotify attribute is set to GROUP_LIMIT and when this number have been reached + * + */ + testcase TC_CSE_SUB_UPD_007() runs on CseTester system CseSystem { // Local variables const integer numberOfAggregatedNotification := 3; - var MsgIn v_response; var Labels v_labels_1:= {"VALUE_1"}; var Labels v_labels_2:= {"VALUE_2"}; var Labels v_labels_3:= {"VALUE_3"}; @@ -9076,554 +16955,474 @@ module OneM2M_Testcases { var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; - - v_contentResponse.any_1[0].AE_optional := mw_contentAeBase; // all attributes expected - + + v_contentResponse.aE := mw_contentAeBase; // all attributes expected + // Test control - + // Test component configuration f_cf01Up(); - + // Test adapter configuration - + // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); - - v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification), true);// TODO fix the duration - - //TODO We Need to check if the IUT send a notification only for the latest update operation - // like we match a Notification we have to verify if it is the first (unvalid behavior) or the last (valid behavior) - // maybe we need to synchronise our components - + + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification));// TODO fix the duration + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - + if(v_notifyHandler.running) { v_notifyHandler.stop; }; - + // Test Body - v_notifyHandler.start(f_cse_notifyProcedure(v_contentResponse)); // check if the notification is well received and if its content matchs - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; + v_notifyHandler.start(f_cse_notifyProcedure_aggregatedNoficationHandler(v_contentResponse, numberOfAggregatedNotification)); // check that no notification is received + + v_updateRequest.primitiveContent.aE.labels := v_labels_1; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 f_cse_updateResource(v_request); - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_2; + + v_updateRequest.primitiveContent.aE.labels := v_labels_2; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 f_cse_updateResource(v_request); - - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_3; + + v_updateRequest.primitiveContent.aE.labels := v_labels_3; v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 f_cse_updateResource(v_request); - + f_is_component_done(v_notifyHandler); - + //Postamble f_cse_postamble_deleteResources(); - + //Tear down f_cf01Down(); - - } // end TC_CSE_SUB_BV_020 - - }//end group g_CSE_SUB_BV_020 - - }//end group Subscription_And_Notification - - group Security { - - group Access_Control_Policy { - - group g_CSE_SEC_ACP_BV_001 { - - testcase TC_CSE_SEC_ACP_BV_001() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var template PrimitiveContent v_contentResponse; - var RequestPrimitive v_createRequest := valueof(m_createAcpBase); - var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); - var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"wait"}, int55)); - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); // Only use for setting the ACR_2's accessControlOriginators attribute to AE_ID - - v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; - v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; - - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc1; - v_contentResponse.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; - v_contentResponse.any_1[0].AccessControlPolicy_optional.privileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; - - // Test Body - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_acpIndex), f_getOriginator(v_acpIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Response OK for retrieving"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } - - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end TC_CSE_SEC_ACP_BV_001 - - }//end g_CSE_SEC_ACP_BV_001 - - group g_CSE_SEC_ACP_BV_002 { - - testcase TC_CSE_SEC_ACP_BV_002() runs on CseTester system CseSystem { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var template PrimitiveContent v_contentResponse; - var RequestPrimitive v_createRequest := valueof(m_createAcpBase); - var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); - var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"wait"}, int55)); - // Test control - - // Test component configuration - f_cf01Up(); - - // Test adapter configuration - - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); // Only use for setting the ACR_2's accessControlOriginators attribute to AE_ID - - v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; - v_createRequest.primitiveContent.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; - - v_contentResponse.any_1[0].AccessControlPolicy_optional := mw_contentAcp_rc1; - v_contentResponse.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; - v_contentResponse.any_1[0].AccessControlPolicy_optional.selfPrivileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; - - // Test Body - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_acpIndex), f_getOriginator(v_acpIndex)))); - - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Response OK for retrieving"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, resource elements provided not matching expected resource elements"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while retrieving resource"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while retrieving resource"); - } - } - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); - - }//end TC_CSE_SEC_ACP_BV_002 - - }//end g_CSE_SEC_ACP_BV_002 - - group g_CSE_SEC_ACP_BV_003 { + } // end TC_CSE_SUB_UPD_007 + + /** + * @desc Check that the IUT sends the latest notification to the subscriber resource when latestNotify is set to TRUE, the number value of the batchNotify attribute is set to GROUP_LIMIT and when this number have been reached + * + */ + testcase TC_CSE_SUB_UPD_008() runs on CseTester system CseSystem { + // Local variables + const integer numberOfAggregatedNotification := 3; + var Labels v_labels_1:= {"VALUE_1"}; + var Labels v_labels_2:= {"VALUE_2"}; + var Labels v_labels_3:= {"VALUE_3"}; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var template RequestPrimitive v_createRequest := omit; + var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + v_contentResponse.aE := mw_contentAeBase; // all attributes expected + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - testcase TC_CSE_SEC_ACP_BV_003_01() runs on CseTester system CseSystem { //Create - f_CSE_SEC_ACP_BV_003(m_createContainerBase); - }//end TC_CSE_SEC_ACP_BV_003_01 + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); + + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)},omit,omit,m_batchNotifyNumber3Duration1(numberOfAggregatedNotification), true);// TODO fix the duration + + //TODO We Need to check if the IUT send a notification only for the latest update operation + // like we match a Notification we have to verify if it is the first (unvalid behavior) or the last (valid behavior) + // maybe we need to synchronise our components + + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription + + if(v_notifyHandler.running) { + v_notifyHandler.stop; + }; - testcase TC_CSE_SEC_ACP_BV_003_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateAeBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - f_CSE_SEC_ACP_BV_003(v_updateRequest); - }//end TC_CSE_SEC_ACP_BV_003_02 + // Test Body + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs + + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 1 + f_cse_updateResource(v_request); + + v_updateRequest.primitiveContent.aE.labels := v_labels_2; + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 2 + f_cse_updateResource(v_request); + + v_updateRequest.primitiveContent.aE.labels := v_labels_3; + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request 3 + f_cse_updateResource(v_request); - testcase TC_CSE_SEC_ACP_BV_003_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_SEC_ACP_BV_003(m_retrieveResource("Temporary", "Temporary")); - }//end TC_CSE_SEC_ACP_BV_003_03 + f_is_component_done(v_notifyHandler); - testcase TC_CSE_SEC_ACP_BV_003_04() runs on CseTester system CseSystem { //Delete - f_CSE_SEC_ACP_BV_003(m_deleteRequest("Temporary")); - }//end TC_CSE_SEC_ACP_BV_003_04 - - function f_CSE_SEC_ACP_BV_003(template RequestPrimitive p_requestPrimitive) runs on CseTester{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - var AccessControlRule v_accessControlRule_1; - var RequestPrimitive v_updateRequest; - var SetOfAcrs v_setOfArcs; - - // Test control - - // Test component configuration - f_cf01Up(); + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } // end TC_CSE_SUB_UPD_008 - // Test adapter configuration + /** + * @desc Check that the IUT sends a Notify request to the subscriber resource when the “attribute†condition tag of eventNotificationCriteria attribute is set to ATTRIBUTE_NAME and an update operation has been performed on the subscribed-to resource + * + */ + testcase TC_CSE_SUB_UPD_009() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var Labels v_labels_1:= {"VALUE_1"}; + var AttributeList_1 v_attributeList := {"labels"}; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var template RequestPrimitive v_createRequest := omit; + var template PrimitiveContent v_contentResponse; + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + v_contentResponse.aE := mw_contentAeBase; // all attributes expected - // Preamble - v_createRequest := valueof(m_createAcp(f_getResourceAddress(), c_defaultResourceName, {"testDomain"})); - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := "testDomain"; - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Successful operation on resource type int2 (Ae)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation on resource type int2 (Ae)"); - } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation on resource type int2 (Ae)"); - } - } + // Test control - //Postamble - v_accessControlRule_1 := valueof(m_createAcr({"*"}, int63)); - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); - v_updateRequest.from_ := "testDomain"; - mcaPort.send(m_request(v_updateRequest)); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - log(testcasename() & ": Attribute of resource type ACP updated successfuly"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - log(testcasename() & ": Error while updating resource type ACP"); - } - [] tc_ac.timeout { - log(testcasename() & ": No answer while updating resource type ACP"); - } - } - - f_cse_postamble_deleteResources(); + // Test component configuration + f_cf01Up(); - //Tear down - f_cf01Down(); + // Test adapter configuration - }//end f_CSE_SEC_ACP_BV_003 - - }//end g_CSE_SEC_ACP_BV_003 - - group g_CSE_SEC_ACP_BV_004 { + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - testcase TC_CSE_SEC_ACP_BV_004_01() runs on CseTester system CseSystem { //Create - f_CSE_SEC_ACP_BV_004(m_createContainerBase); - }//end TC_CSE_SEC_ACP_BV_004_01 - - testcase TC_CSE_SEC_ACP_BV_004_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateAeBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - f_CSE_SEC_ACP_BV_004(v_updateRequest); - }//end TC_CSE_SEC_ACP_BV_004_02 - - testcase TC_CSE_SEC_ACP_BV_004_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_SEC_ACP_BV_004(m_retrieveResource("Temporary", "Temporary")); - }//end TC_CSE_SEC_ACP_BV_004_03 - - testcase TC_CSE_SEC_ACP_BV_004_04() runs on CseTester system CseSystem { //Delete - f_CSE_SEC_ACP_BV_004(m_deleteRequest("Temporary")); - }//end TC_CSE_SEC_ACP_BV_004_04 + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); + + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int1}, v_attributeList)); - function f_CSE_SEC_ACP_BV_004(template RequestPrimitive p_requestPrimitive) runs on CseTester{ - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest; - - // Test control + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription - // Test component configuration - f_cf01Up(); + v_request:= f_getUpdateRequestPrimitive(int2, v_aeIndex, v_updateRequest); // Update request + + if(v_notifyHandler.running) { + v_notifyHandler.stop; + }; + + // Test Body + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentResponse)); // check if the notification is well received and if its content matchs + + mcaPort.send(m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Attribute of resource type int2 (Ae) updated 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 updating resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while updating resource type int2 (Ae) or None notification received"); + } + } + + f_is_component_done(v_notifyHandler); - // Test adapter configuration + //Postamble + f_cse_postamble_deleteResources(); - // Preamble - v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := "UnknowOriginator"; - - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Successful operation on resource type int2 (Ae)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation on resource type int2 (Ae)"); - } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation on resource type int2 (Ae)"); - } - } + //Tear down + f_cf01Down(); - //Postamble - f_cse_postamble_deleteResources(); + } // end TC_CSE_SUB_UPD_009 - //Tear down - f_cf01Down(); - }//end f_CSE_SEC_ACP_BV_004 - }//end g_CSE_SEC_ACP_BV_004 + }//end group Update + + group Delete { - group g_CSE_SEC_ACP_BV_011 { + /** + * @desc Check that the IUT sends a Notify request to the AE2_RESOURCE_ADDRESS of the subscriberURI attribute when the SUBSCRIPTION_RESOURCE_ADDRESS <subscription> resource is deleted + * + */ + testcase TC_CSE_SUB_DEL_001() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; + var template RequestPrimitive v_createRequest := omit; + var RequestPrimitive v_request; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; - testcase TC_CSE_SEC_ACP_BV_011_01() runs on CseTester system CseSystem { //Create - f_CSE_SEC_ACP_BV_011(m_createContainerBase); - }//end TC_CSE_SEC_ACP_BV_011_01 - - testcase TC_CSE_SEC_ACP_BV_011_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - f_CSE_SEC_ACP_BV_011(v_updateRequest); - }//end TC_CSE_SEC_ACP_BV_011_02 - - testcase TC_CSE_SEC_ACP_BV_011_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_SEC_ACP_BV_011(m_retrieveResource("Temporary", "Temporary")); - }//end TC_CSE_SEC_ACP_BV_011_03 - - testcase TC_CSE_SEC_ACP_BV_011_04() runs on CseTester system CseSystem { //Delete - f_CSE_SEC_ACP_BV_011(m_deleteRequest("Temporary")); - }//end TC_CSE_SEC_ACP_BV_011_04 - - function f_CSE_SEC_ACP_BV_011(template RequestPrimitive p_requestPrimitive) runs on CseTester { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - - // Test control + // Test control - // Test component configuration - f_cf01Up(); + // Test component configuration + f_cf01Up(); - // Test adapter configuration + // Test adapter configuration - // Preamble - v_aeIndex := f_cse_preamble_registerAe(-, -); - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); + + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, omit, omit, omit, omit,f_getResourceAddress(v_ae2Index)); // SubscriberURI ="ResourceID" + + v_resourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex); // Subsciption + + v_request := valueof(m_deleteRequest(f_getResourceAddress(v_resourceIndex))); // Subscription resource deletion request + + if(v_notifyHandler.running) { + v_notifyHandler.stop; + }; - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Successful operation on resource type int3 (Container)"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation on resource type int3 (Container)"); - } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation on resource type int3 (Container)"); - } + // Test Body + v_notifyHandler.start(f_CSE_SUB_DEL_001(f_getResourceAddress(v_resourceIndex))); // check that no notification is received + + mcaPort.send(m_request(v_request)); + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Subscription resource deleted 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 deleting resource type int23 (Subscription)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int23 (Subscription)"); + } + } + + f_is_component_done(v_notifyHandler); - //Postamble - f_cse_postamble_deleteResources(); - - //Tear down - f_cf01Down(); + //Postamble + f_cse_postamble_deleteResources(); - } //end f_CSE_SEC_ACP_BV_011 + //Tear down + f_cf01Down(); - } //end g_CSE_SEC_ACP_BV_011 + } // end TC_CSE_SUB_DEL_001 - group g_CSE_SEC_ACP_BO_012 { - - testcase TC_CSE_SEC_ACP_BO_012_01() runs on CseTester system CseSystem { //Create - f_CSE_SEC_ACP_BO_012(m_createContainerBase); - }//end TC_CSE_SEC_ACP_BO_012_01 + function f_CSE_SUB_DEL_001(in XSD.AnyURI p_subscriptionReference) runs on CseTester { + // Local variables + var MsgIn v_response; + var template Notification v_notificationRequest := mw_contentNotificationBase; + + v_notificationRequest.subscriptionDeletion := true; + v_notificationRequest.subscriptionReference := p_subscriptionReference; + + + map(self:mcaPort, system:mcaPort); + map(self:acPort, system:acPort); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_request(mw_notify(v_notificationRequest))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Notification received"); + } + [] mcaPort.receive{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, unexpected message received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No notification received"); + } + } + + unmap(self:mcaPort, system:mcaPort); + unmap(self:acPort, system:acPort); + + } //end f_CSE_SUB_DEL_001 - testcase TC_CSE_SEC_ACP_BO_012_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateContainerBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].Container_optional.labels := v_labels_1; - f_CSE_SEC_ACP_BO_012(v_updateRequest); - }//end TC_CSE_SEC_ACP_BO_012_02 + + /** + * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Delete_of_Resource" and an delete operation has been performed the subscribed-to resource + * + */ + testcase TC_CSE_SUB_DEL_002() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_subscriptionResourceIndex := -1; + var template RequestPrimitive v_createRequest := omit; + var template PrimitiveContent v_contentNotification := {aE:= mw_contentAeBase}; // all attributes expected; + var RequestPrimitive v_deleteRequest; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; + + // Test control - testcase TC_CSE_SEC_ACP_BO_012_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_SEC_ACP_BO_012(m_retrieveResource("Temporary", "Temporary")); - }//end TC_CSE_SEC_ACP_BO_012_03 + // Test component configuration + f_cf01Up(); - testcase TC_CSE_SEC_ACP_BO_012_04() runs on CseTester system CseSystem { //Delete - f_CSE_SEC_ACP_BO_012(m_deleteRequest("Temporary")); - }//end TC_CSE_SEC_ACP_BO_012_04 + // Test adapter configuration - function f_CSE_SEC_ACP_BO_012(template RequestPrimitive p_requestPrimitive) runs on CseTester { - // Local variables - var MsgIn v_response; - var integer v_aeIndex := -1; - var integer v_containerIndex := -1; - var integer v_acpIndex := -1; - var RequestPrimitive v_createRequest := valueof(m_createAcpBase); - var RequestPrimitive v_updateRequest; - var AccessControlRule v_accessControlRule_1; - var SetOfAcrs v_setOfArcs; + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); + + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int2}, -)); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); + + v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex );//Subscription + + if(v_notifyHandler.running) { + v_notifyHandler.stop; + }; - // Test control + //Test Body + v_notifyHandler.start(f_cse_notifyProcedure_subscriptionDeletionHandler(v_contentNotification)); // check if the notification is well received and if its content matchs + + v_deleteRequest:= valueof(m_deleteRequest(f_getResourceAddress(v_aeIndex))); // Ae delete request + + mcaPort.send(m_request(v_deleteRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + //Update vc_resourcesIndexToBeDeleted + f_removeElementFromList (vc_resourcesIndexToBeDeleted, v_aeIndex); + setverdict(pass, __SCOPE__ & ": resource type int2 (AE) deleted 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 deleting resource type int2 (AE)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int2 (AE)"); + } + } + + f_is_component_done(v_notifyHandler); - // Test component configuration - f_cf01Up(); + //Postamble + f_cse_postamble_deleteResources(); - // Test adapter configuration + //Tear down + f_cf01Down(); - // Preamble - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); - - v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER, f_getOriginator(v_aeIndex)}, int63)); - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); - f_cse_updateResource(v_updateRequest); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex); - p_requestPrimitive.from_ := "UnknowOriginator"; + } // end TC_CSE_SUB_DEL_002 + + /** + * @desc Check that the IUT sends a Notify request to the subscriber resource when eventType attribute is set to "Delete_of_Direct_Child_Resource" and an delete operation has been performed on a child resource of the subscribed-to resource + * + */ + testcase TC_CSE_SUB_DEL_003() runs on CseTester system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_subscriptionResourceIndex := -1; + var integer v_containerResourceIndex := -1; + var template RequestPrimitive v_createRequest := omit; + var RequestPrimitive v_deleteRequest; + var template PrimitiveContent v_contentNotification := {container := mw_contentContainer_rc1}; // all attributes expected in notification; + var CseTester v_notifyHandler; + var integer v_ae2Index := -1; - mcaPort.send(m_request(valueof(p_requestPrimitive))); - tc_ac.start; - alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { - tc_ac.stop; - setverdict(pass, testcasename() & ": Operation denied because of lack of right on Container"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error operation have been accpeted without having privileges"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation on resource type int3 (Container)"); - } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); - } - [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation on resource type int3 (Container)"); - } - } + // Test component configuration + f_cf01Up(); - //Postamble - f_cse_postamble_deleteResources(); + // Test adapter configuration - //Tear down - f_cf01Down(); + // Preamble + v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi; - } //end f_CSE_SEC_ACP_BO_012 + v_containerResourceIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex);//Container + + v_createRequest := m_createSubscriptionAdvanced(f_getResourceAddress(v_aeIndex), -, {f_getResourceAddress(v_ae2Index)}, m_eventNotificationCriteria({int4}, -)); + + f_cse_preamble_subscriptionVerification(v_notifyHandler, v_aeIndex, v_ae2Index, v_createRequest, int23); + + v_subscriptionResourceIndex := f_cse_createResource(int23, v_createRequest, v_aeIndex);//Subscription (with name attribute omitted) + + if(v_notifyHandler.running) { + v_notifyHandler.stop; + }; - } //end g_CSE_SEC_ACP_BO_012 - - group g_CSE_SEC_ACP_BO_013{ + //Test Body + v_notifyHandler.start(f_cse_notifyProcedure_representationHandler(v_contentNotification)); // check if the notification is well received and if its content matchs - testcase TC_CSE_SEC_ACP_BO_013_01() runs on CseTester system CseSystem { //Create - f_CSE_SEC_ACP_BO_013(m_createContainerBase); - }//end TC_CSE_SEC_ACP_BO_013_01 + v_deleteRequest := valueof(m_deleteRequest(f_getResourceAddress(v_containerResourceIndex)));// Container deletion request + + mcaPort.send(m_request(v_deleteRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource deleted 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 deleting resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource type int3 (Container)"); + } + } - testcase TC_CSE_SEC_ACP_BO_013_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateAeBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - f_CSE_SEC_ACP_BO_013(v_updateRequest); - }//end TC_CSE_SEC_ACP_BO_013_02 + f_is_component_done(v_notifyHandler); - testcase TC_CSE_SEC_ACP_BO_013_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_SEC_ACP_BO_013(m_retrieveResource("Temporary", "Temporary")); - }//end TC_CSE_SEC_ACP_BO_013_03 + //Postamble + f_cse_postamble_deleteResources(); - testcase TC_CSE_SEC_ACP_BO_013_04() runs on CseTester system CseSystem { //Delete - f_CSE_SEC_ACP_BO_013(m_deleteRequest("Temporary")); - }//end TC_CSE_SEC_ACP_BO_013_04 + //Tear down + f_cf01Down(); - function f_CSE_SEC_ACP_BO_013(template RequestPrimitive p_requestPrimitive) runs on CseTester { + } // end TC_CSE_SUB_DEL_003 + + }//end group Delete + + }//end group Subscription_And_Notification + + group Security { + + group Access_Control_Policy { + + group Create { + + /** + * @desc Check that the IUT accepts the creation of a accessControlPolicy resource with privileges attribute having multiple access control rules + * + */ + testcase TC_CSE_SEC_ACP_CRE_001() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; var integer v_acpIndex := -1; + var template PrimitiveContent v_contentResponse; var RequestPrimitive v_createRequest := valueof(m_createAcpBase); - var RequestPrimitive v_updateRequest; - var AccessControlRule v_accessControlRule_1; - var SetOfAcrs v_setOfArcs; + var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); + var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"wait"}, int55)); + const ResourceType c_accessControlPolicyType := int1; // Test control @@ -9633,84 +17432,69 @@ module OneM2M_Testcases { // Test adapter configuration // Preamble - v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); - - v_accessControlRule_1 := valueof(m_createAcr({ f_getOriginator(v_aeIndex), PX_SUPER_USER}, int63)); - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); - f_cse_updateResource(v_updateRequest); - - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := "UnknowOriginator"; + v_aeIndex := f_cse_preamble_registerAe(-, -); // Use for setting the ACR_2's accessControlOriginators attribute to AE_ID - mcaPort.send(m_request(valueof(p_requestPrimitive))); + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; + v_contentResponse.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};// TODO To handle reverse order of acrs + v_contentResponse.accessControlPolicy.privileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; + + // Test Body + v_createRequest := f_getCreateRequestPrimitive(c_accessControlPolicyType, v_createRequest, v_aeIndex); + + mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Operation denied because of lack of right on Container"); + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully"); + v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error operation have been accpeted without having privileges"); - } + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation on resource type int3 (Container)"); - } - [] mcaPort.receive{ - tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation on resource type int3 (Container)"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); } } + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_acpIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); - } //end f_CSE_SEC_ACP_BO_013 - - } //end g_CSE_SEC_ACP_BO_013 - - group g_CSE_SEC_ACP_BV_014{ - - testcase TC_CSE_SEC_ACP_BV_014_01() runs on CseTester system CseSystem { //Create - f_CSE_SEC_ACP_BV_014(m_createContainerBase); - }//end TC_CSE_SEC_ACP_BV_014_01 - - testcase TC_CSE_SEC_ACP_BV_014_02() runs on CseTester system CseSystem { //Update - var template RequestPrimitive v_updateRequest := m_updateAeBase; - var Labels v_labels_1:= {"VALUE_1"}; - v_updateRequest.primitiveContent.any_1[0].AE_optional.labels := v_labels_1; - f_CSE_SEC_ACP_BV_014(v_updateRequest); - }//end TC_CSE_SEC_ACP_BV_014_02 - - testcase TC_CSE_SEC_ACP_BV_014_03() runs on CseTester system CseSystem { //Retrieve - f_CSE_SEC_ACP_BV_014(m_retrieveResource("Temporary", "Temporary")); - }//end TC_CSE_SEC_ACP_BV_014_03 - - testcase TC_CSE_SEC_ACP_BV_014_04() runs on CseTester system CseSystem { //Delete - f_CSE_SEC_ACP_BV_014(m_deleteRequest("Temporary")); - }//end TC_CSE_SEC_ACP_BV_014_04 - - function f_CSE_SEC_ACP_BV_014(template RequestPrimitive p_requestPrimitive) runs on CseTester { + }//end TC_CSE_SEC_ACP_CRE_001 + + /** + * @desc Check that the IUT accepts the creation of a accessControlPolicy resource with selfPrivileges attribute having multiple access control rules + */ + testcase TC_CSE_SEC_ACP_CRE_002() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; - var integer v_acpIndex1 := -1; - var integer v_acpIndex2 := -1; - var RequestPrimitive v_createRequest := valueof(m_createAcp(f_getResourceAddress(-1), omit)); - var RequestPrimitive v_updateRequest; - var AccessControlRule v_accessControlRule_1; - var SetOfAcrs v_setOfArcs; + var integer v_acpIndex := -1; + var template PrimitiveContent v_contentResponse; + var RequestPrimitive v_createRequest := valueof(m_createAcpBase); + var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); + var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"wait"}, int55)); + const ResourceType c_accessControlPolicyType := int1; // Test control @@ -9719,61 +17503,66 @@ module OneM2M_Testcases { // Test adapter configuration - // Preamble - v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource - v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource - - v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource), f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}, -); - - v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int3)); // c_CR - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest); - f_cse_updateResource(v_updateRequest); - - v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int60)); // c_UDNDi - v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; - v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); - v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex2, v_updateRequest); - f_cse_updateResource(v_updateRequest); + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); // Only use for setting the ACR_2's accessControlOriginators attribute to AE_ID - // Test Body - p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); - p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2}; + v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; - mcaPort.send(m_request(valueof(p_requestPrimitive))); + v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; + v_contentResponse.accessControlPolicy.selfPrivileges.accessControlRule_list := {v_accessControlRule_1,v_accessControlRule_2};//TODO To handle reverse order of acrs + v_contentResponse.accessControlPolicy.selfPrivileges.accessControlRule_list[1].accessControlOriginators := {f_getOriginator(v_aeIndex)}; + + // Test Body + v_createRequest := f_getCreateRequestPrimitive(c_accessControlPolicyType, v_createRequest, v_aeIndex);// CSE child resource + + mcaPort.send(m_request(v_createRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Successful operation on resource type int2 (Ae)"); + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully"); + v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, c_accessControlPolicyType); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation on resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation on resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); } } + f_checkCseTesterStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_acpIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); - } //end f_CSE_SEC_ACP_BV_014 - - } //end g_CSE_SEC_ACP_BV_014 - - group g_CSE_SEC_ACP_BV_015{ + }//end TC_CSE_SEC_ACP_CRE_002 - testcase TC_CSE_SEC_ACP_BV_015() runs on CseTester system CseSystem { + }// end of group Create + + group Update { + + /** + * @desc Check that the IUT updates successfully the accessControlPolicyIDs attribute of the <AE> resource when the AE has privileges for UPDATE operation in any selfPrivileges of the <accessControlPolicy> resources which this attribute originally indicates. + * + */ + testcase TC_CSE_SEC_ACP_UPD_001() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; @@ -9785,6 +17574,7 @@ module OneM2M_Testcases { var AccessControlRule v_accessControlRule_2; var SetOfAcrs v_setOfArcs_1; var SetOfAcrs v_setOfArcs_2; + var PrimitiveContent v_primitiveContentRetrievedResource; // Test control @@ -9809,27 +17599,36 @@ module OneM2M_Testcases { f_cse_updateResource(v_updateRequest); // Test Body - v_updateRequest.primitiveContent.any_1[0].AE_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}; + v_updateRequest.primitiveContent.aE.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}; v_updateRequest := f_getUpdateRequestPrimitive(int1, v_aeIndex, v_updateRequest); mcaPort.send(m_request(v_updateRequest)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Successful Update operation on resource type int2 (Ae)"); + setverdict(pass, __SCOPE__ & ": Successful Update operation on resource type int2 (Ae)"); } - [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while Update operation on resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error while Update operation on resource type int2 (Ae)"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing update operation on resource type int2 (Ae)"); + setverdict(fail, __SCOPE__ & ": No answer while executing update operation on resource type int2 (Ae)"); + } + } + + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_aeIndex); + if(getverdict == pass){ + if(ischosen(v_primitiveContentRetrievedResource.aE)) { + if(not match (v_primitiveContentRetrievedResource.aE.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.aE.accessControlPolicyIDs))){ + setverdict(fail, __SCOPE__ & ": Error: Access Control policy ID attribute not updated correctly") } + } } //Postamble @@ -9838,13 +17637,13 @@ module OneM2M_Testcases { //Tear down f_cf01Down(); - }//end TC_CSE_SEC_ACP_BV_015 - - } //end g_CSE_SEC_ACP_BV_015 - - group g_CSE_SEC_ACP_BV_016{ + }//end TC_CSE_SEC_ACP_UPD_001 - testcase TC_CSE_SEC_ACP_BV_016() runs on CseTester system CseSystem { + /** + * @desc Check that the IUT responds with an error when the AE tries an UPDATE operation on the accessControlPolicyIDs attribute without having privileges for such operation in any selfPrivileges of the <accessControlPolicy> resources which this attribute originally indicates. + * + */ + testcase TC_CSE_SEC_ACP_UPD_002() runs on CseTester system CseSystem { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; @@ -9856,6 +17655,7 @@ module OneM2M_Testcases { var AccessControlRule v_accessControlRule_2; var SetOfAcrs v_setOfArcs_1; var SetOfAcrs v_setOfArcs_2; + var PrimitiveContent v_primitiveContentRetrievedResource; // Test control @@ -9880,7 +17680,7 @@ module OneM2M_Testcases { f_cse_updateResource(v_updateRequest); // Test Body - v_updateRequest.primitiveContent.any_1[0].AE_optional.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}; + v_updateRequest.primitiveContent.aE.accessControlPolicyIDs := {f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}; v_updateRequest := f_getUpdateRequestPrimitive(int1, v_aeIndex, v_updateRequest); mcaPort.send(m_request(v_updateRequest)); @@ -9888,35 +17688,575 @@ module OneM2M_Testcases { alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { tc_ac.stop; - setverdict(pass, testcasename() & ": Operation denied because of lack of right on Container"); - } - [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { - tc_ac.stop; - setverdict(fail, testcasename() & ": Error operation have been accpeted without having privileges"); + setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error while operation on resource type int3 (Container)"); + setverdict(fail, __SCOPE__ & ": Wrong response status code"); } - [] mcaPort.receive{ + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; - setverdict(fail, testcasename() & ": Error, unexpected message received"); + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); } [] tc_ac.timeout { - setverdict(inconc, testcasename() & ": No answer while executing operation on resource type int3 (Container)"); + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); } } + v_primitiveContentRetrievedResource := f_cse_retrieveResource(v_aeIndex); + if(getverdict == pass){ + if(ischosen(v_primitiveContentRetrievedResource.aE)) { + if(match(v_primitiveContentRetrievedResource.aE.accessControlPolicyIDs, valueof(v_updateRequest.primitiveContent.aE.accessControlPolicyIDs))){ + setverdict(fail, __SCOPE__ & ": Error: Access Control policy ID attribute updated") + } + } + } + //Postamble f_cse_postamble_deleteResources(); //Tear down f_cf01Down(); - }//end TC_CSE_SEC_ACP_BV_016 + }//end TC_CSE_SEC_ACP_UPD_002 - } //end g_CSE_SEC_ACP_BV_016 - + }// end of group Update + + group Basic_Operations { + + group g_CSE_SEC_ACP_001{ + + /** + * @desc Check that the IUT responds with an error when an ORIGINATOR tries an OPERATION without having privileges for performing the OPERATION on the TARGET_RESOURCE_TYPE resource. + * + */ + testcase TC_CSE_SEC_ACP_001_CRE() runs on CseTester system CseSystem { //Create + f_CSE_SEC_ACP_001(m_createContainerBase); + }//end TC_CSE_SEC_ACP_001_CRE + + testcase TC_CSE_SEC_ACP_001_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + f_CSE_SEC_ACP_001(v_updateRequest); + }//end TC_CSE_SEC_ACP_001_UPD + + testcase TC_CSE_SEC_ACP_001_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_SEC_ACP_001(m_retrieveResource("Temporary", "Temporary")); + }//end TC_CSE_SEC_ACP_001_RET + + testcase TC_CSE_SEC_ACP_001_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_SEC_ACP_001(m_deleteRequest("Temporary")); + }//end TC_CSE_SEC_ACP_001_DEL + + function f_CSE_SEC_ACP_001(template RequestPrimitive p_requestPrimitive) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest := valueof(m_createAcpBase); + var RequestPrimitive v_updateRequest; + var AccessControlRule v_accessControlRule_1; + var SetOfAcrs v_setOfArcs; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + v_accessControlRule_1 := valueof(m_createAcr({ f_getOriginator(v_aeIndex), PX_SUPER_USER}, int63)); + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := "UnknowOriginator"; + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } //end f_CSE_SEC_ACP_001 + + } //end g_CSE_SEC_ACP_001 + + group g_CSE_SEC_ACP_002{ + + /** + * @desc Check that the IUT responds successfully when the AE tries an OPERATION on its <AE> resource which has multiple accessControlPolicyID attribute + * + */ + testcase TC_CSE_SEC_ACP_002_CRE() runs on CseTester system CseSystem { //Create + f_CSE_SEC_ACP_002(m_createContainerBase, int2001); + }//end TC_CSE_SEC_ACP_002_CRE + + testcase TC_CSE_SEC_ACP_002_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + f_CSE_SEC_ACP_002(v_updateRequest, int2004); + }//end TC_CSE_SEC_ACP_002_UPD + + testcase TC_CSE_SEC_ACP_002_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_SEC_ACP_002(m_retrieveResource("Temporary", "Temporary"), int2000); + }//end TC_CSE_SEC_ACP_002_RET + + testcase TC_CSE_SEC_ACP_002_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_SEC_ACP_002(m_deleteRequest("Temporary"), int2002); + }//end TC_CSE_SEC_ACP_002_DEL + + function f_CSE_SEC_ACP_002(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex1 := -1; + var integer v_acpIndex2 := -1; + var RequestPrimitive v_createRequest := valueof(m_createAcp(f_getResourceAddress(-1), omit)); + var RequestPrimitive v_updateRequest; + var AccessControlRule v_accessControlRule_1; + var SetOfAcrs v_setOfArcs; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpIndex1 := f_cse_createResource(int1, v_createRequest); // CSE child resource + v_acpIndex2 := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex1].resource), f_getResourceId(vc_resourcesList[v_acpIndex2].resource)}, -); + + v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int3)); // c_CR + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex1, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + v_accessControlRule_1 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, int60)); // c_UDNDi + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex2, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] 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 operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } //end f_CSE_SEC_ACP_002 + + } //end g_CSE_SEC_ACP_002 + + + + group g_CSE_SEC_ACP_003 { + + /** + * @desc Check that the IUT responds successfully when an allowed DOMAIN tries an OPERATION on a AE_RESOURCE_TYPE resource. + * + */ + testcase TC_CSE_SEC_ACP_003_CRE() runs on CseTester system CseSystem { //Create + f_CSE_SEC_ACP_003(m_createContainerBase, int2001); + }//end TC_CSE_SEC_ACP_003_CRE + + testcase TC_CSE_SEC_ACP_003_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + f_CSE_SEC_ACP_003(v_updateRequest, int2004); + }//end TC_CSE_SEC_ACP_003_02 + + testcase TC_CSE_SEC_ACP_003_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_SEC_ACP_003(m_retrieveResource("Temporary", "Temporary"), int2000); + }//end TC_CSE_SEC_ACP_003_03 + + testcase TC_CSE_SEC_ACP_003_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_SEC_ACP_003(m_deleteRequest("Temporary"), int2002); + }//end TC_CSE_SEC_ACP_003_04 + + function f_CSE_SEC_ACP_003(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule_1; + var RequestPrimitive v_updateRequest; + var SetOfAcrs v_setOfArcs; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := valueof(m_createAcp(f_getResourceAddress(), -, {"testDomain"})); + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := "testDomain"; + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] 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 operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + //Postamble + v_accessControlRule_1 := valueof(m_createAcr({"*"}, int63)); + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, v_setOfArcs)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); + v_updateRequest.from_ := "testDomain"; + mcaPort.send(m_request(v_updateRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + log(__SCOPE__ & ":INFO: Attribute of resource type ACP updated successfully"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + log(__SCOPE__ & ":INFO: Error while updating resource type ACP"); + } + [] tc_ac.timeout { + log(__SCOPE__ & ":INFO: No answer while updating resource type ACP"); + } + } + + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_003 + + }//end g_CSE_SEC_ACP_003 + + group g_CSE_SEC_ACP_004 { + + /** + * @desc Check that the IUT responds successfully when any ORIGINATOR tries an OPERATION on a AE_RESOURCE_TYPE resource for which all originators are allowed + * + */ + testcase TC_CSE_SEC_ACP_004_CRE() runs on CseTester system CseSystem { //Create + f_CSE_SEC_ACP_004(m_createContainerBase, int2001); + }//end TC_CSE_SEC_ACP_004_CRE + + testcase TC_CSE_SEC_ACP_004_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + f_CSE_SEC_ACP_004(v_updateRequest, int2004); + }//end TC_CSE_SEC_ACP_004_UPD + + testcase TC_CSE_SEC_ACP_004_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_SEC_ACP_004(m_retrieveResource("Temporary", "Temporary"), int2000); + }//end TC_CSE_SEC_ACP_004_RET + + testcase TC_CSE_SEC_ACP_004_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_SEC_ACP_004(m_deleteRequest("Temporary"), int2002); + }//end TC_CSE_SEC_ACP_004_DEL + + function f_CSE_SEC_ACP_004(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := "UnknowOriginator"; + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] 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 operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_004 + + }//end g_CSE_SEC_ACP_004 + + group g_CSE_SEC_ACP_011 { + + /** + * @desc Check that the IUT responds successfully when the AE tries an OPERATION on its child <container> resource whose accessControlPolicyID attribute is not set and AE has privileges for such OPERATION on its associated accessControlPolicy resource + * + */ + testcase TC_CSE_SEC_ACP_011_CRE() runs on CseTester system CseSystem { //Create + f_CSE_SEC_ACP_011(m_createContainerBase, int2001); + }//end TC_CSE_SEC_ACP_011_CRE + + testcase TC_CSE_SEC_ACP_011_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + f_CSE_SEC_ACP_011(v_updateRequest, int2004); + }//end TC_CSE_SEC_ACP_011_UPD + + testcase TC_CSE_SEC_ACP_011_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_SEC_ACP_011(m_retrieveResource("Temporary", "Temporary"), int2000); + }//end TC_CSE_SEC_ACP_011_RET + + testcase TC_CSE_SEC_ACP_011_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_SEC_ACP_011(m_deleteRequest("Temporary"), int2002); + }//end TC_CSE_SEC_ACP_011_DEL + + function f_CSE_SEC_ACP_011(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_aeIndex := f_cse_preamble_registerAe(-, -); + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_containerIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int3 (Container)"); + } + [] 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 operation on resource type int3 (Container)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } //end f_CSE_SEC_ACP_011 + + } //end g_CSE_SEC_ACP_011 + + group g_CSE_SEC_ACP_012 { + + /** + * @desc Check that the IUT responds with an error when an ORIGINATOR tries an OPERATION on a <Container> resource with no accessControlPolicyID associated and such ORIGINATOR having no privileges for performing the OPERATION on the <Container> resource. + * + */ + testcase TC_CSE_SEC_ACP_012_CRE() runs on CseTester system CseSystem { //Create + f_CSE_SEC_ACP_012(m_createContainerBase, int62); + }//end TC_CSE_SEC_ACP_012_CRE + + testcase TC_CSE_SEC_ACP_012_UPD() runs on CseTester system CseSystem { //Update + var template RequestPrimitive v_updateRequest := m_updateContainerBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.container.labels := v_labels_1; + f_CSE_SEC_ACP_012(v_updateRequest, int62); //TODO Fix p_acor + }//end TC_CSE_SEC_ACP_012_UPD + + testcase TC_CSE_SEC_ACP_012_RET() runs on CseTester system CseSystem { //Retrieve + f_CSE_SEC_ACP_012(m_retrieveResource("Temporary", "Temporary"), int62); //TODO Fix p_acor + }//end TC_CSE_SEC_ACP_012_RET + + testcase TC_CSE_SEC_ACP_012_DEL() runs on CseTester system CseSystem { //Delete + f_CSE_SEC_ACP_012(m_deleteRequest("Temporary"), int62); //TODO Fix p_acor + }//end TC_CSE_SEC_ACP_012_DEL + + function f_CSE_SEC_ACP_012(template RequestPrimitive p_requestPrimitive, in AccessControlOperations p_acor) runs on CseTester { + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_request; + var RequestPrimitive v_createRequest := valueof(m_createAcpBase); + var RequestPrimitive v_updateRequest; + var AccessControlRule v_accessControlRule_1, v_accessControlRule_2; + var SetOfAcrs v_setOfArcs; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); + + v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); + v_accessControlRule_2 := valueof(m_createAcr({f_getOriginator(v_aeIndex)}, p_acor)); + v_setOfArcs.accessControlRule_list := {v_accessControlRule_1, v_accessControlRule_2}; + v_updateRequest := valueof(m_updateAcpPrivileges(v_setOfArcs, -)); + v_updateRequest := f_getUpdateRequestPrimitive(int1, v_acpIndex, v_updateRequest); + f_cse_updateResource(v_updateRequest); + + // Test Body + v_request := f_getCreateRequestPrimitive(int3, p_requestPrimitive, v_containerIndex); + + mcaPort.send(m_request(valueof(v_request))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied because of lack of right on Container"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> 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__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int3 (Container)"); + } + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + } //end f_CSE_SEC_ACP_012 + + } //end g_CSE_SEC_ACP_012 + + }// end of Basic_Operations + }//end group AccessControlPolicy }//end group Security