diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index a1c13986abaf3170769ca61a8a61ede3d2303358..bacfc8472ce24825992283bdf30ca767a50eacb0 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -7,7 +7,7 @@ * * @author oneM2M * @version $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Functions.ttcn $ - * $Id: OneM2M_Functions.ttcn 298 2017-06-14 07:11:13Z reinaortega $ + * $Id: OneM2M_Functions.ttcn 299 2017-06-20 12:36:36Z reinaortega $ * @desc Module containing functions for oneM2M * */ @@ -868,10 +868,10 @@ module OneM2M_Functions { } //end f_cse_notifyProcedure - /** - * @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 + /** + * @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; diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 6f9cf9217e447d88c893fd4989ca9331c5b13205..5bf72c72c3318e38aa27628a4b7a5b9584f36289 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -7,7 +7,7 @@ * * @author oneM2M * @version $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/LibOneM2M/OneM2M_Templates.ttcn $ - * $Id: OneM2M_Templates.ttcn 298 2017-06-14 07:11:13Z reinaortega $ + * $Id: OneM2M_Templates.ttcn 299 2017-06-20 12:36:36Z reinaortega $ * @desc Module containing templates for oneM2M * */ @@ -683,6 +683,15 @@ module OneM2M_Templates { primitiveContent := {groupAnnc_optional := 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_optional := m_contentCreateMgmtCmd (-,-)} + }; + /** * @desc Base CREATE request primitive for MgmtObj resource */ @@ -798,6 +807,14 @@ module OneM2M_Templates { primitiveContent := {serviceSubscribedAppRule_optional := 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_optional := m_contentCreateServiceSubscribedAppRuleBase} + }; /** * @desc Base CREATE request primitive for Subscription resource @@ -827,6 +844,15 @@ module OneM2M_Templates { primitiveContent := {subscription_optional := 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_optional := m_contentCreateLocationPolicyBase} + }; + 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 @@ -866,6 +892,33 @@ module OneM2M_Templates { primitiveContent := {semanticDescriptor_optional := p_semanticDescriptor} }; + /** + * @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_optional := m_contentCreateStatConfigBase} + }; + + /** + * @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_optional := 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_optional := m_contentCreatem2mServiceSubscriptionProfileBase} + }; + }//end group Create group Delete { @@ -1233,6 +1286,31 @@ module OneM2M_Templates { 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 + dynamicAuthorizationConsultationIDs := 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 */ @@ -1557,6 +1635,29 @@ module OneM2M_Templates { }; + 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 + dynamicAuthorizationConsultationIDs := 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 */ @@ -1634,6 +1735,90 @@ module OneM2M_Templates { ontologyRef := p_ontologyRef } + /** + * @desc Base primitiveContent for CREATE operation for StatConfig resource + * @param p_primitiveContent Content for the StatConfig + */ + template StatsConfig_optional m_contentCreateStatConfigBase := { + 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 + dynamicAuthorizationConsultationIDs := 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 + dynamicAuthorizationConsultationIDs := 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 + dynamicAuthorizationConsultationIDs := 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 + dynamicAuthorizationConsultationIDs := omit, //O + applicableCredIDs := omit, + allowedApp_IDs := omit, + allowedAEs := omit, + allowedRole_IDs := omit, + choice := omit //NP + }; }//end group ContentCreate group ContentUpdate { diff --git a/LibOneM2M/OneM2M_Types.ttcn b/LibOneM2M/OneM2M_Types.ttcn index 33c1d9e3c27a79e19f9e5ce18bcc8d06242124f9..1c457afc31abeb257e3f48c7dff8545703fd52bf 100644 --- a/LibOneM2M/OneM2M_Types.ttcn +++ b/LibOneM2M/OneM2M_Types.ttcn @@ -1644,6 +1644,9 @@ type union PrimitiveContent { PollingChannel_optional pollingChannel_optional, Schedule_optional schedule_optional, ScheduleAnnc_optional scheduleAnnc_optional, + StatsConfig_optional statsConfig_optional, + StatsCollect_optional statsCollect_optional, + M2mServiceSubscriptionProfile_optional m2mServiceSubscriptionProfile_optional, ServiceSubscribedAppRule_optional serviceSubscribedAppRule_optional, Subscription_optional subscription_optional, SemanticDescriptor_optional semanticDescriptor_optional, @@ -7495,6 +7498,105 @@ with { variant (choice.choice_list[-]) "untagged"; }; +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, + ListOfURIs dynamicAuthorizationConsultationIDs 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 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, + ListOfURIs dynamicAuthorizationConsultationIDs 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 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, + ListOfURIs dynamicAuthorizationConsultationIDs 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"; +}; + }//end group OptionalResourceTypes diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index c64e3cf1cbe3ccbfecc2e78208599fa253409310..a393a8d4af226408f31ab6491169860a97b4a5ed 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -26,9 +26,14 @@ module OneM2M_TypesAndValues { const XSD.String c_defaultContentInstanceResourceName := "MyContentInstanceResource"; const XSD.String c_defaultContainerResourceName := "MyContainerResource"; 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_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) diff --git a/OneM2M_TestControl.ttcn b/OneM2M_TestControl.ttcn index 5f23afed323e688ea103e21f31833b867a77ce55..0b2cad97effd0804d9ac0df12eb66eeea7a45e12 100644 --- a/OneM2M_TestControl.ttcn +++ b/OneM2M_TestControl.ttcn @@ -6,8 +6,8 @@ * All rights reserved. * * @author oneM2M - * @version $URL: https://forge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_TestControl.ttcn $ - * $Id: OneM2M_TestControl.ttcn 254 2017-05-02 15:55:08Z reinaortega $ + * @version $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_TestControl.ttcn $ + * $Id: OneM2M_TestControl.ttcn 299 2017-06-20 12:36:36Z reinaortega $ * @desc Test control module for oneM2M * */ @@ -244,6 +244,11 @@ module OneM2M_TestControl { execute(TC_CSE_GMG_BV_022_03()); execute(TC_CSE_GMG_BV_022_04()); execute(TC_CSE_DIS_BV_001()); + execute(TC_CSE_DIS_BV_003()); + execute(TC_CSE_DIS_BV_004()); + execute(TC_CSE_DIS_BO_005()); + execute(TC_CSE_DIS_BO_006()); + execute(TC_CSE_DIS_BI_007()); execute(TC_CSE_SUB_BV_001_01()); execute(TC_CSE_SUB_BV_001_02()); execute(TC_CSE_SUB_BV_002()); diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index 8b4afe91d3ed1340f3590a152bb0eaf06abbfcb4..17f1ac7ada57a5228051a5926ac7335d1dcece8a 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -7,7 +7,7 @@ * * @author oneM2M * @version $URL: https://oldforge.etsi.org/svn/oneM2M/trunk/ttcn/OneM2M_Testcases.ttcn $ - * $Id: OneM2M_Testcases.ttcn 298 2017-06-14 07:11:13Z reinaortega $ + * $Id: OneM2M_Testcases.ttcn 299 2017-06-20 12:36:36Z reinaortega $ * @desc Module containing test cases for oneM2M * */ @@ -1175,188 +1175,402 @@ module OneM2M_Testcases { // 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)} - } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); - v_createRequest.primitiveContent.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.container_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int3, v_createRequest, -, v_notifyHandler); //Container + log(v_responsePrimitive); + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.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_createContainerBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.group_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int3, v_createRequest, m_createAeAux(omit,omit),v_notifyHandler);//Container + log(v_responsePrimitive); + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.group_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_03() 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.accessControlPolicy_optional.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int3, v_createRequest, m_createContainerBase, v_notifyHandler);//Container + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_04() 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))} + v_createRequest.primitiveContent.accessControlPolicy_optional.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int9, v_createRequest, -, v_notifyHandler);//Group + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); - v_createRequest.primitiveContent.group_optional.resourceName := omit; + } + + testcase TC_CSE_DMR_CRE_BV_001_05() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createGroupBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int9, v_createRequest, v_requestPrimitivematrix[i],v_notifyHandler); - log(v_responsePrimitive); - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.group_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } + v_createRequest.primitiveContent.accessControlPolicy_optional.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int9, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Group + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); } } + } - testcase TC_CSE_DMR_CRE_BV_001_03() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_BV_001_06() 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; + + v_createRequest.primitiveContent.accessControlPolicy_optional.resourceName := omit; - //CSEBase int5, remoteCSE int16, AE int2 - v_requestPrimitivematrix := { - {}, - {valueof(m_createAeAux(omit,omit))} + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int1, v_createRequest, -, v_notifyHandler);//AccessControlPolicy + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); + + } + + testcase TC_CSE_DMR_CRE_BV_001_07() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createAcpBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; v_createRequest.primitiveContent.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.accessControlPolicy_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int1, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//AccessControlPolicy + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.accessControlPolicy_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); } } + } - - testcase TC_CSE_DMR_CRE_BV_001_04() runs on CseTester system CseSystem { + + testcase TC_CSE_DMR_CRE_BV_001_08() 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; -// 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.schedule_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int18, v_createRequest, -, v_notifyHandler);//Schedule + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.schedule_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_09() 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_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 + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int18, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Schedule - if(getverdict == pass){ - if(not ispresent(v_responsePrimitive.primitiveContent.schedule_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.schedule_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); } } + + } + + testcase TC_CSE_DMR_CRE_BV_001_10() 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_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int18, v_createRequest, m_createSubscriptionBase, v_notifyHandler);//Schedule + + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.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_DMR_CRE_BV_001_11() 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; - //remoteCSE int16, AE int2 - v_requestPrimitivematrix := { - {valueof(m_createAeAux(omit,omit))} - } - v_sizeResourceTypeList := lengthof(v_requestPrimitivematrix); v_createRequest.primitiveContent.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.pollingChannel_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int15, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//PollingChannel + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.pollingChannel_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); } } + } - testcase TC_CSE_DMR_CRE_BV_001_06() runs on CseTester system CseSystem { + testcase TC_CSE_DMR_CRE_BV_001_12() 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 - - // 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.subscription_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest, -, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_13() 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_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest, m_createAeAux(omit,omit), v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_14() 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_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest, m_createContainerBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_15() 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_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest, m_createAcpBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + } + + testcase TC_CSE_DMR_CRE_BV_001_16() 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_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest, m_createScheduleBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + } + + testcase TC_CSE_DMR_CRE_BV_001_17() 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_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int23, v_createRequest, m_createGroupBase, v_notifyHandler);//Subscription + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.subscription_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + } + + testcase TC_CSE_DMR_CRE_BV_001_18() 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_optional.resourceName := omit; - 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.subscription_optional.resourceName)){ - setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); - } - } + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int14, v_createRequest, -, v_notifyHandler);//Node + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.node_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 { + testcase TC_CSE_DMR_CRE_BV_001_19() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createMgmtCmdBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.mgmtResource_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int12, v_createRequest, -, v_notifyHandler);//Management Command + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.mgmtResource_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_20() 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_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int10, v_createRequest, -, v_notifyHandler);//Location Policy + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.locationPolicy_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_21() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createStatsConfigBase; + var ResponsePrimitive v_responsePrimitive; + var RequestPrimitiveMatrix v_requestPrimitivematrix; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.statsConfig_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int22, v_createRequest, -, v_notifyHandler);//Stats Config + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.statsConfig_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + } + + testcase TC_CSE_DMR_CRE_BV_001_22() 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_optional.resourceName := omit; + + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int21, v_createRequest, -, v_notifyHandler);//Stats Collect + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.statsCollect_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_23() runs on CseTester system CseSystem { + // Local variables + var template RequestPrimitive v_createRequest := m_createM2mServiceSubscriptionProfileBase; + var ResponsePrimitive v_responsePrimitive; + var CseTester v_notifyHandler := CseTester.create("NotifyHandler") alive; + + v_createRequest.primitiveContent.m2mServiceSubscriptionProfile_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int11, v_createRequest, -, v_notifyHandler);//Subscription Profile + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.m2mServiceSubscriptionProfile_optional.resourceName)){ + setverdict(fail, testcasename(), ": Error, resourceName attribute not provided"); + } + } + + } + + testcase TC_CSE_DMR_CRE_BV_001_24() 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_optional.resourceName := omit; + v_responsePrimitive := f_CSE_DMR_CRE_BV_001(int19, v_createRequest, -, v_notifyHandler);//Service Subscribed App + if(getverdict == pass){ + if(not ispresent(v_responsePrimitive.primitiveContent.serviceSubscribedAppRule_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 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_sizeResourceTypeList := lengthof(p_requestPrimitiveList); var integer i; var integer v_parentIndex := -1; var integer v_resourceIndex := -1; @@ -1372,13 +1586,13 @@ module OneM2M_Testcases { // Preamble - for (i := 0; i<v_sizeResourceTypeList; i := i+1){ - if(match(int23, p_requestPrimitiveList[i].resourceType)){ + 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_requestPrimitiveList[i].primitiveContent.subscription_optional.notificationURI := {f_getResourceAddress(v_ae2Index)}; + p_parentRequestPrimitive.primitiveContent.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); + v_parentIndex := f_cse_createResource(valueof(p_parentRequestPrimitive.resourceType), p_parentRequestPrimitive, v_parentIndex); } // Test Body @@ -1398,9 +1612,7 @@ module OneM2M_Testcases { tc_ac.stop; setverdict(pass, testcasename() & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_parentIndex); - if (v_sizeResourceTypeList == 0){ - vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_resourceIndex}; - } + vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_resourceIndex}; } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -10324,6 +10536,7 @@ module OneM2M_Testcases { group g_CSE_DIS_BV_001{ testcase TC_CSE_DIS_BV_001() 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; @@ -10346,7 +10559,6 @@ module OneM2M_Testcases { mcaPort.send(m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responseDiscovery)){ tc_ac.stop; setverdict(pass, testcasename() & ": URI List Representation available"); @@ -10400,7 +10612,6 @@ module OneM2M_Testcases { 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){ @@ -10459,7 +10670,6 @@ module OneM2M_Testcases { 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])) { @@ -10569,7 +10779,7 @@ module OneM2M_Testcases { // Preamble v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; - if(PX_UNSTRUCTURED and (PX_ADDRESSING_FORMAT == e_cseRelative)) { + 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));