diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 809477e6f781abf1e55d7e4f1cdbe3bcc83fb779..d493bb6eedaf3e6f24240554bed1ced9ac1f39d8 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -1244,18 +1244,25 @@ module OneM2M_Functions { * @return Internal AE resource index * @verdict */ - function f_cse_preamble_registerAe(template (omit) AcpType p_accessControlPolicyIDs := omit, in template (omit) PoaList p_poaList := omit) runs on AeSimu return integer {//c_CRUDNDi + function f_cse_preamble_registerAe(template (omit) AcpType p_accessControlPolicyIDs := omit, in template (omit) PoaList p_poaList := omit, in boolean p_userAuthentication := false) runs on AeSimu return integer {//c_CRUDNDi var RequestPrimitive v_request; var MsgIn v_response; //Activate defaults when running on a PTC - f_cse_activateDefaults_ae(); - - v_request := valueof(m_createAe(vc_aeSimuDesc.appId, p_accessControlPolicyIDs, vc_aeSimuDesc.aeIdStem, c_defaultAe1ResourceName, p_poaList)); - - v_request := f_getCreateRequestPrimitive(int2, v_request, -1); + f_cse_activateDefaults_ae(); + if(p_userAuthentication == true) { + // Create subscription and subscriber + f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, p_allowedUsers := true); + v_request := valueof(m_createAe(vc_aeSimuDesc.appId, p_accessControlPolicyIDs, PX_ALLOWED_C_AE_IDS[0], c_defaultAe1ResourceName, p_poaList)); + v_request := f_getCreateRequestPrimitive(int2, v_request, -1, PX_M2M_USER_ID); + + } else { + v_request := valueof(m_createAe(vc_aeSimuDesc.appId, p_accessControlPolicyIDs, vc_aeSimuDesc.aeIdStem, c_defaultAe1ResourceName, p_poaList)); + v_request := f_getCreateRequestPrimitive(int2, v_request, -1); + } + f_send(e_mcaPort, m_request(v_request)); tc_ac.start; @@ -1360,11 +1367,11 @@ module OneM2M_Functions { * @return Internal resource index * @verdict */ - function f_cse_preamble_createServiceSubscribedAppRule(in template ListOfM2MID p_allowedAEs := {""}) runs on AeSimu return integer {//c_CRUDNDi + function f_cse_preamble_createServiceSubscribedAppRule(in template ListOfM2MID p_allowedAEs := {""}, in template ListOfM2MID p_allowedUsers := {""}) runs on AeSimu return integer {//c_CRUDNDi var integer v_serviceSubscribedAppRuleIndex := -1; - v_serviceSubscribedAppRuleIndex := f_cse_createResource(int19, m_createServiceSubscribedAppRule({"None"}, {vc_aeSimuDesc.appId}, valueof(p_allowedAEs))); + v_serviceSubscribedAppRuleIndex := f_cse_createResource(int19, m_createServiceSubscribedAppRule({"None"}, {vc_aeSimuDesc.appId}, valueof(p_allowedAEs), valueof(p_allowedUsers))); return v_serviceSubscribedAppRuleIndex; @@ -1373,21 +1380,41 @@ module OneM2M_Functions { /** * @desc Creation of SubscribedProfile resource * @param p_allowedAEs Allowed AEs + * @param p_allowedUser To make the user in SubscribedUserProfile to be Allowed or not. * @return Internal resource index * @verdict */ - function f_cse_preamble_createServiceSubscribedProfile(in template ListOfM2MID p_allowedAEs := {""}) runs on AeSimu return integer {//c_CRUDNDi - + function f_cse_preamble_createServiceSubscribedProfile(in ListOfM2MID p_allowedAEs := {""}, + in boolean p_allowedUsers := true, + in template RequestPrimitive p_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1, + in template RequestPrimitive p_createServiceSubscribedUserProfile := m_createServiceSubscribedUserProfileMaxValue1) runs on AeSimu return integer { + var integer v_subscriptionProfileIndex := -1; + var integer v_subscribedProfileIndex := -1; var integer v_serviceSubscribedAppRuleIndex := -1; - var integer v_serviceSubscribedProfileIndex := -1; - var template RequestPrimitive m_request := m_createM2mServiceSubscriptionProfileBase; + var template RequestPrimitive v_createServiceSubscribedAppRule; + var template RequestPrimitive v_createServiceSubscribedNode; + var template ListOfM2MID v_allowedUsers := {""}; + + + v_subscriptionProfileIndex := f_cse_createResource(int11, p_createServiceSubscriptionProfile, -1); + + // TODO int52: To change to correct type value once serviceSubscribedUserProfile is added in TS-0004 + v_subscribedProfileIndex := f_cse_createResource(int52, p_createServiceSubscribedUserProfile, v_subscriptionProfileIndex); + + if (p_allowedUsers == true) { + v_allowedUsers := {p_createServiceSubscribedUserProfile.primitiveContent.serviceSubscribedUserProfile.M2M_User_ID}; + } + + v_createServiceSubscribedAppRule := m_createServiceSubscribedAppRule({"None"}, {vc_aeSimuDesc.appId}, p_allowedAEs, valueof(v_allowedUsers)); + // Create AppRule under CSEBase + v_serviceSubscribedAppRuleIndex := f_cse_createResource(int19, v_createServiceSubscribedAppRule); + - //TODO Create/Update serviceSubscribedNode //m_request.primitiveContent.m2mServiceSubscriptionProfile.choice.choice_list[0].serviceSubscribedNode := m_contentServiceSubscribedNode; - v_serviceSubscribedAppRuleIndex := f_cse_createResource(int19, m_createServiceSubscribedAppRule({"None"}, {vc_aeSimuDesc.appId}, valueof(p_allowedAEs))); - m_request.primitiveContent.m2mServiceSubscriptionProfile.choice.choice_list[0].serviceSubscribedNode.ruleLinks := {f_getResourceAddress(v_serviceSubscribedAppRuleIndex)}; - v_serviceSubscribedProfileIndex := f_cse_createResource(int11, m_request); + // ServiceSubscribedNode as a child of SubscriptionProfile with ruleLinks pointing to SubscribedAppRule + v_createServiceSubscribedNode := m_createServiceSubscribedNode({f_getResourceAddress(v_serviceSubscribedAppRuleIndex)}); + f_cse_createResource(int11, v_createServiceSubscribedNode, v_subscriptionProfileIndex); - return v_serviceSubscribedProfileIndex; + return v_subscribedProfileIndex; } @@ -1697,7 +1724,7 @@ module OneM2M_Functions { * @return Internal resource index of the created resource * @verdict */ - function f_cse_createResource(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1) runs on AeSimu return integer { + function f_cse_createResource(in ResourceType p_resourceType, template RequestPrimitive p_requestPrimitive := m_create, integer p_parentIndex := -1, in XSD.ID p_m2mServiceUser := "") runs on AeSimu return integer { var RequestPrimitive v_request; var integer v_resourceIndex := -1; @@ -1705,7 +1732,7 @@ module OneM2M_Functions { //Activate defaults when running on a PTC f_cse_activateDefaults_ae(); - v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex); + v_request := f_getCreateRequestPrimitive(p_resourceType, p_requestPrimitive, p_parentIndex, p_m2mServiceUser); f_send(e_mcaPort, m_request(v_request)); tc_ac.start; @@ -2190,6 +2217,35 @@ module OneM2M_Functions { } + function f_cse_createContentAndInstances(in integer p_totalStorage, in integer p_storagePerInstance, in integer p_parentIndex) runs on AeSimu{ + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + var template RequestPrimitive v_createRequestContentInstance; + var integer v_containerIndex; + var integer v_noSteps := p_totalStorage / p_storagePerInstance; + var integer v_reminder := p_totalStorage mod p_storagePerInstance; + var integer i; + var XSD.String v_instanceData := any2unistr(int2oct(1, p_storagePerInstance)); + var XSD.String v_resourceName; + + // Content resource + v_createRequestContainer.primitiveContent.container.maxNrOfInstances := p_totalStorage; + v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, p_parentIndex); + + // Content Instances of 100 bytes + for(i := 0; i < v_noSteps; i := i+1 ) { + v_resourceName := c_defaultContentInstanceResourceName & int2str(i); + v_createRequestContentInstance := m_createContentInstance(v_resourceName, v_instanceData); + f_cse_createResource(int4, v_createRequestContentInstance, v_containerIndex); + } + + if(v_reminder > 0) { + v_instanceData := any2unistr(int2oct(1, p_storagePerInstance)); + v_resourceName := c_defaultContentInstanceResourceName & int2str(i); + v_createRequestContentInstance := m_createContentInstance(v_resourceName, v_instanceData); + f_cse_createResource(int4, v_createRequestContentInstance, v_containerIndex); + } + } + }//end group AeSimu group CseSimuFunctions { @@ -4932,13 +4988,14 @@ module OneM2M_Functions { * @return Created CREATE request primitive * @verdict */ - function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex) runs on Tester return RequestPrimitive { + function f_getCreateRequestPrimitive(in ResourceType p_resourceType, template RequestPrimitive p_request := m_create, integer p_parentIndex, in template XSD.ID p_m2mServiceUser := omit) runs on Tester return RequestPrimitive { var template ListOfURIs v_defaultListOfURIs := {"NotInitialized"}; var template AcpType v_defaultAcpIDs := {"NotInitialized"}; var template Timestamp v_defaultTimestamp := "00000101T000000"; var template AbsRelTimestamp v_defaultAbsRelTimestamp := {alt_ := v_defaultTimestamp}; var template DynAuthJWT v_defaultDynAuthJWT := {alt_ := "oneM2M.oneM2M.oneM2M"}; + p_request.m2mServiceUser := p_m2mServiceUser; p_request.requestIdentifier := valueof(p_request.requestIdentifier) & f_rnd(1, 1000000); if((p_resourceType != int2) and (p_resourceType != int16)) { @@ -5086,11 +5143,12 @@ module OneM2M_Functions { * @return Created UPDATE request primitive * @verdict */ - function f_getUpdateRequestPrimitive(in ResourceType p_resourceType, integer p_resourceIndex, template RequestPrimitive p_request) runs on Tester return RequestPrimitive { + function f_getUpdateRequestPrimitive(in ResourceType p_resourceType, integer p_resourceIndex, template RequestPrimitive p_request, in template XSD.ID p_m2mServiceUser := omit) runs on Tester return RequestPrimitive { p_request.requestIdentifier := valueof(p_request.requestIdentifier) & f_rnd(1, 1000000); p_request.from_ := f_getOriginator(p_resourceIndex); + p_request.m2mServiceUser := p_m2mServiceUser; if(p_resourceType != int10002) { //Only set To parameter if it has not been set yet diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index b8d678351797d9840e533a2f7e8bcfd79358999f..597b9c11ba2a2ca75e53a62c95a25a9369206d40 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -73,7 +73,7 @@ module OneM2M_Pixits { /** * @desc Allowed AE-IDs starting with C */ - modulepar XSD.IDREFS PX_ALLOWED_C_AE_IDS := {"C-AllowedAeId"}; + modulepar ListOfM2MID PX_ALLOWED_C_AE_IDS := {"C-AllowedAeId", "C-AllowedAeId2"}; /** * @desc Not allowed AE-IDs starting with C @@ -124,6 +124,21 @@ module OneM2M_Pixits { * @desc Time given for configuring IUT when required (i.e. when UT not implemented) */ modulepar float PX_TCONFIG_IUT := 10.0; + + /** + * @desc Uniquely identifies a M2M Service Subscription within the M2M Service Provider Domain of the M2M Service Subscriber. + */ + modulepar XSD.ID PX_M2M_SUB_ID := "/subscription8459302"; + + /** + * @desc On the Mca and Mcc reference points: Uniquely identifies a M2M Service Subscriber within the M2M Service Provider Domain of the M2M Service Subscriber. + */ + modulepar XSD.ID PX_M2M_SS_ID := ""; + /** + * @desc On the Mca and Mcc reference points: Uniquely identifies a M2M Service user within the M2M Service Provider Domain of the M2M Service Subscriber. + */ + modulepar XSD.ID PX_M2M_USER_ID := "/allowedM2MUserID"; + modulepar XSD.ID PX_NOT_ALLOWED_M2M_USER_ID := "/NotAllowedM2MUserID"; /** * @desc Release version of IUT to be used. Any available release backwards from actual ATS release till 2a @@ -150,7 +165,7 @@ module OneM2M_Pixits { * * "3" = mca interface, "4" = mcc interface & CseSimu = "1", AeSimu = "0" & "3" = client, "4" server" & "2" = Primary/secondary AE/CSE components or "3" for DAS */ - + /** * @desc Test System settings */ diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index fd8bb3ab5e1f86dbf04458cb67b30432bb4fd030..0ed5befc25c17883a43755fcbc9c726b6c104a00 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -130,7 +130,49 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit + }; + + /** + * @desc Base RETRIEVE request primitive + * @param p_targetResourceAddress Target resource address + * @param p_originator Originator (from) + * @oaram p_m2mServiceUser UserId with subscription + */ + template (value) RequestPrimitive m_retrieveUserId(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template XSD.ID p_m2mServiceUser := omit) := { + operation := int2, + to_ := p_targetResourceAddress, + from_ := p_originator, + requestIdentifier := "m_retrieve" & f_rnd(1, 1000000), + resourceType := omit, + primitiveContent := omit, + roleIDs := omit, + originatingTimestamp := omit, + requestExpirationTimestamp := omit, + resultExpirationTimestamp := omit, + operationExecutionTime := omit, + responseType := omit, + resultPersistence := omit, + resultContent := omit, + eventCategory := omit, + deliveryAggregation := omit, + groupRequestIdentifier := omit, + filterCriteria := omit, + desiredIdentifierResultType := omit, + tokens := omit, + tokenIDs := omit, + localTokenIDs := omit, + tokenRequestIndicator := omit, + groupRequestTargetMembers := omit, + authorSignIndicator := omit, + authorSigns := omit, + authorRelIndicator := omit, + semanticQueryIndicator := omit, + releaseVersionIndicator := PX_RELEASE_VERSION, + vendorInformation := omit, + primitiveProfileIdentifier := omit, + m2mServiceUser := p_m2mServiceUser }; /** @@ -209,7 +251,8 @@ module OneM2M_Templates { semanticQueryIndicator := *, releaseVersionIndicator := ?, vendorInformation := *, - primitiveProfileIdentifier := * + primitiveProfileIdentifier := *, + m2mServiceUser := * }; template RequestPrimitive mw_retrieveFormalOntology(template XSD.ID p_targetResourceAddress := ?, template XSD.ID p_originator := ?, template XSD.AnyURI p_ontologyServerUri := ?) modifies mw_retrieve := { @@ -255,7 +298,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }; /** @@ -295,7 +339,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }; /** @@ -568,7 +613,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }; @@ -603,7 +649,8 @@ module OneM2M_Templates { semanticQueryIndicator := *, releaseVersionIndicator := ?, vendorInformation := *, - primitiveProfileIdentifier := * + primitiveProfileIdentifier := *, + m2mServiceUser := * }; /** @@ -808,13 +855,39 @@ module OneM2M_Templates { /** * @desc Base UPDATE request primitive for SemanticMashupInstance resource */ - template (value) RequestPrimitive m_updateSemanticMashupInstanceBase modifies m_create := { + template (value) RequestPrimitive m_updateSemanticMashupInstanceBase modifies m_update := { requestIdentifier := testcasename() & "-m_createSemanticMashupInstance", resourceType := int41, primitiveContent := {semanticMashupInstance := m_contentUpdateSemanticMashupInstance } }; - + /** + * @desc Base UPDATE request primitive for CreateServiceSubscribedUserProfile resource + */ + template (value) RequestPrimitive m_updateServiceSubscribedUserProfileMaxValue1 modifies m_update := { + requestIdentifier := testcasename() & "-m_updateServiceSubscribedUserProfileMaxValue1", + resourceType := int52, + primitiveContent := {serviceSubscribedUserProfile := m_contentUpdateServiceSubscribedUserProfileMaxValue1 } + }; + + /** + * @desc Base UPDATE request primitive for CreateServiceSubscribedUserProfile resource + */ + template (value) RequestPrimitive m_updateServiceSubscribedUserProfileMaxValue2 modifies m_update := { + requestIdentifier := testcasename() & "-m_updateServiceSubscribedUserProfileMaxValue2", + resourceType := int52, + primitiveContent := {serviceSubscribedUserProfile := m_contentUpdateServiceSubscribedUserProfileMaxValue2 } + }; + + /** + * @desc Base UPDATE request primitive for CreateServiceSubscribedUserProfile resource + */ + template (value) RequestPrimitive m_updateServiceSubscribedUserProfileHigherAE0 modifies m_update := { + requestIdentifier := testcasename() & "-m_updateServiceSubscribedUserProfileMaxValue2", + resourceType := int52, + primitiveContent := {serviceSubscribedUserProfile := m_contentUpdateServiceSubscribedUserProfileAE0 } + }; + /** * @desc Base UPDATE request primitive for TimeSeries resource */ @@ -882,7 +955,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }; @@ -920,7 +994,8 @@ module OneM2M_Templates { semanticQueryIndicator := *, releaseVersionIndicator := ?, vendorInformation := *, - primitiveProfileIdentifier := * + primitiveProfileIdentifier := *, + m2mServiceUser := * } /** @@ -1502,10 +1577,10 @@ module OneM2M_Templates { primitiveContent := {scheduleAnnc := mw_contentCreateScheduleAnncBase} }; - template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) modifies m_create := { + template (value) RequestPrimitive m_createServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs, in template (value) ListOfM2MID p_allowedUsers) modifies m_create := { requestIdentifier := testcasename() & "-m_createServiceSubscribedAppRule", - resourceType := int19,//FIXME Is this the correct value? - primitiveContent := {serviceSubscribedAppRule := m_contentCreateServiceSubscribedAppRule (p_applicableCredIDs, p_allowedAppIDs, p_allowedAEs)} + resourceType := int19, + primitiveContent := {serviceSubscribedAppRule := m_contentCreateServiceSubscribedAppRule (p_applicableCredIDs, p_allowedAppIDs, p_allowedAEs, p_allowedUsers)} }; /** @@ -1520,10 +1595,10 @@ module OneM2M_Templates { /** * @desc Base CREATE request primitive for ServiceSubscribedNode Resource */ - template (value) RequestPrimitive m_createServiceSubscribedNode modifies m_create := { + template (value) RequestPrimitive m_createServiceSubscribedNode(in ListOfURIs p_ruleLinks := {""}) modifies m_create := { requestIdentifier := testcasename() & "-m_createServiceSubscribedNode", resourceType := int20, - primitiveContent := {serviceSubscribedNode := m_contentServiceSubscribedNode} + primitiveContent := {serviceSubscribedNode := m_contentServiceSubscribedNode(p_ruleLinks)} }; /** @@ -1674,7 +1749,40 @@ module OneM2M_Templates { }; /** - * @desc Base CREATE request primitive for Stats Config resource + * @desc Base CREATE request primitive for Event Config resource + */ + template (value) RequestPrimitive m_createEventConfigBase modifies m_create := { + requestIdentifier := testcasename() & "-m_createEventConfig", + resourceType := int7, + primitiveContent := {eventConfig := m_contentCreateEventConfigBase} + }; + + + /** + * @desc Base CREATE request primitive for TIMERBASED Event Config resource + */ + template (value) RequestPrimitive m_createEventConfigTimerBased (in template (omit) Timestamp p_eventStart := omit, + in template (omit) Timestamp p_eventEnd := omit) modifies m_createEventConfigBase := { + primitiveContent := {eventConfig := m_contentCreateEventConfigTimerBased(p_eventStart, p_eventEnd)} + }; + + /** + * @desc Base CREATE request primitive for STORAGEBASED Event Config resource + */ + template (value) RequestPrimitive m_createEventConfigStorageBased (in template (omit) XSD.NonNegativeInteger p_dataSize) modifies m_createEventConfigBase := { + primitiveContent := {eventConfig := m_contentCreateEventConfigStorageBased(p_dataSize)} + }; + + + /** + * @desc Base CREATE request primitive for DATAOPERATION Event Config resource + */ + template (value) RequestPrimitive m_createEventConfigDataOperation (in template (omit) Operation p_operationType) modifies m_createEventConfigBase := { + primitiveContent := {eventConfig := m_contentCreateEventConfigDataOperation (p_operationType)} + }; + + /** + * @desc Base CREATE request primitive for Stats Collect resource */ template (value) RequestPrimitive m_createStatsCollectBase modifies m_create := { requestIdentifier := testcasename() & "-m_createStatsCollect", @@ -1685,10 +1793,37 @@ module OneM2M_Templates { /** * @desc Base CREATE request primitive for M2mServiceSubscriptionProfile resource */ - template (value) RequestPrimitive m_createM2mServiceSubscriptionProfileBase modifies m_create := { + template (value) RequestPrimitive m_createM2mServiceSubscriptionProfileMaxValue1 modifies m_create := { requestIdentifier := testcasename() & "-m_createM2mServiceSubscriptionProfile", resourceType := int11, - primitiveContent := {m2mServiceSubscriptionProfile := m_contentCreatem2mServiceSubscriptionProfileBase} + primitiveContent := {m2mServiceSubscriptionProfile := m_contentCreatem2mServiceSubscriptionProfileMaxValue1} + }; + + /** + * @desc Base CREATE request primitive for M2mServiceSubscriptionProfile resource + */ + template (value) RequestPrimitive m_createM2mServiceSubscriptionProfileMaxValue2 modifies m_create := { + requestIdentifier := testcasename() & "-m_createM2mServiceSubscriptionProfile", + resourceType := int11, + primitiveContent := {m2mServiceSubscriptionProfile := m_contentCreatem2mServiceSubscriptionProfileMaxValue2} + }; + + /** + * @desc Base CREATE request primitive for ServiceSubscribedUserProfile resource + */ + template (value) RequestPrimitive m_createServiceSubscribedUserProfileMaxValue1 modifies m_create := { + requestIdentifier := testcasename() & "-m_createServiceSubscribedUserProfile", + resourceType := int52, + primitiveContent := {serviceSubscribedUserProfile := m_contentCreateServiceSubscribedUserProfileMaxValue1} + }; + + /** + * @desc Base CREATE request primitive for ServiceSubscribedUserProfile resource + */ + template (value) RequestPrimitive m_createServiceSubscribedUserProfileMaxValue2 modifies m_create := { + requestIdentifier := testcasename() & "-m_createServiceSubscribedUserProfile", + resourceType := int52, + primitiveContent := {serviceSubscribedUserProfile := m_contentCreateServiceSubscribedUserProfileMaxValue2} }; /** @@ -1697,7 +1832,7 @@ module OneM2M_Templates { template (value) RequestPrimitive m_createTimeSeriesBase modifies m_create := { requestIdentifier := testcasename() & "-m_createTimeSeries", resourceType := int29, - primitiveContent := {timeSeries := m_contentCreateTimeSeries ()} + primitiveContent := {timeSeries := m_contentCreateTimeSeries} }; /** @@ -2253,8 +2388,15 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }; + + template (value) RequestPrimitive m_deleteUserId(XSD.ID p_resourceAddress, in XSD.ID p_originator := PX_SUPER_AE_ID, in template XSD.ID p_m2mServiceUser := omit) modifies m_delete := { + to_ := p_resourceAddress, + from_ := p_originator, + m2mServiceUser := p_m2mServiceUser + } template RequestPrimitive mw_delete(template XSD.ID p_resourceAddress := ?, template XSD.ID p_from := *) := { operation := int4, @@ -2287,7 +2429,8 @@ module OneM2M_Templates { semanticQueryIndicator := *, releaseVersionIndicator := ?, vendorInformation := *, - primitiveProfileIdentifier := * + primitiveProfileIdentifier := *, + m2mServiceUser := * }; /** @@ -2336,7 +2479,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }; @@ -2389,7 +2533,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }; /** @@ -2426,7 +2571,8 @@ module OneM2M_Templates { semanticQueryIndicator := *, releaseVersionIndicator := ?, vendorInformation := *, - primitiveProfileIdentifier := * + primitiveProfileIdentifier := *, + m2mServiceUser := * }; /** @@ -3516,7 +3662,7 @@ module OneM2M_Templates { choice := omit//NP }; - template (value) ServiceSubscribedAppRule_optional m_contentCreateServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs) := { + template (value) ServiceSubscribedAppRule_optional m_contentCreateServiceSubscribedAppRule (in ListOfM2MID p_applicableCredIDs, in ListOfM2MID p_allowedAppIDs, in ListOfM2MID p_allowedAEs, in ListOfM2MID p_allowedUsers) := { resourceName := omit,//TODO TS-0004 7.4.29.1 2 Missing attribute resourceType := omit,//NP resourceID := omit,//NP @@ -3531,6 +3677,8 @@ module OneM2M_Templates { allowedApp_IDs := p_allowedAppIDs,//O allowedAEs := p_allowedAEs,//O allowedRole_IDs := omit,//O + // TODO: To update once oneM2MTypes is updated + allowedUsers := p_allowedUsers, //O choice := omit //O } @@ -4494,6 +4642,114 @@ module OneM2M_Templates { choice := omit //NP }; + + /** + * @desc Base primitiveContent for CREATE operation for EventConfig resource + */ + template (value) EventConfig_optional m_contentCreateEventConfigBase := { + resourceName := omit, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + accessControlPolicyIDs := omit, //O + creationTime := omit, //NP + expirationTime := omit, //O + lastModifiedTime := omit, //NP + labels := omit, //O + dynamicAuthorizationConsultationIDs := omit, //O + creator := omit, //O + eventID := omit, //NP + eventType := omit, //M + eventStart := omit, //O + eventEnd := omit, //O + operationType := omit, //O + dataSize := omit, //O + eventResourceTypes := omit, //O + eventResourceIDs := omit, //O + choice := omit //NP + }; + + /** + * @desc primitiveContent for CREATE operation for TIMERBASED EventConfig resource + */ + template (value) EventConfig_optional m_contentCreateEventConfigTimerBased (in template (omit) Timestamp p_eventStart, + in template (omit) Timestamp p_eventEnd) := { + resourceName := c_defaultEventConfigResourceName, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + accessControlPolicyIDs := omit, //O + creationTime := omit, //NP + expirationTime := omit, //O + lastModifiedTime := omit, //NP + labels := omit, //O + dynamicAuthorizationConsultationIDs := omit, //O + creator := omit, //O + eventID := omit, //NP + eventType := int3, //M TIMERBASED + eventStart := p_eventStart, //O + eventEnd := p_eventEnd, //O + operationType := omit, //O + dataSize := omit, //O + eventResourceTypes := omit, //O + eventResourceIDs := omit, //O + choice := omit //NP + }; + + /** + * @desc primitiveContent for CREATE operation for STORAGEBASED EventConfig resource + */ + template (value) EventConfig_optional m_contentCreateEventConfigStorageBased (in template (omit) XSD.NonNegativeInteger p_dataSize := 1 ) := { // default 1K bytes + resourceName := c_defaultEventConfigResourceName, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + accessControlPolicyIDs := omit, //O + creationTime := omit, //NP + expirationTime := omit, //O + lastModifiedTime := omit, //NP + labels := omit, //O + dynamicAuthorizationConsultationIDs := omit, //O + creator := omit, //O + eventID := omit, //NP + eventType := int2, //M STORAGEBASED + eventStart := omit, //O + eventEnd := omit, //O + operationType := omit, //O + dataSize := p_dataSize, //O + eventResourceTypes := omit, //O + eventResourceIDs := omit, //O + choice := omit //NP + }; + + /** + * @desc primitiveContent for CREATE operation for DATAOPERATION EventConfig resource + */ + template (value) EventConfig_optional m_contentCreateEventConfigDataOperation (in template (omit) Operation p_operationType := int1 ) := { // default CREATE + resourceName := c_defaultEventConfigResourceName, //O + resourceType := omit, //NP + resourceID := omit, //NP + parentID := omit, //NP + accessControlPolicyIDs := omit, //O + creationTime := omit, //NP + expirationTime := omit, //O + lastModifiedTime := omit, //NP + labels := omit, //O + dynamicAuthorizationConsultationIDs := omit, //O + creator := omit, //O + eventID := omit, //NP + eventType := int1, //M DATAOPERATION + eventStart := omit, //O + eventEnd := omit, //O + operationType := {p_operationType}, //O + dataSize := omit, //O + eventResourceTypes := omit, //O + eventResourceIDs := omit, //O + choice := omit //NP + }; + + + /** * @desc Base primitiveContent for CREATE operation for StatCollect resource * @param p_primitiveContent Content for the StatCollect @@ -4511,20 +4767,20 @@ module OneM2M_Templates { dynamicAuthorizationConsultationIDs := omit, //O creator := omit, statsCollectID := omit, - collectingEntityID := omit, + collectingEntityID := omit, // //collect all Entities collectedEntityID := omit, - statsRuleStatus := omit, - statModel := omit, + statsRuleStatus := int1, // Active + statModel := int1, // Event Based collectPeriod := omit, eventID := omit, choice := omit //NP }; - /** + /** * @desc Base primitiveContent for CREATE operation for M2mServiceSubscriptionProfile resource * @param p_primitiveContent Content for the M2mServiceSubscriptionProfile */ - template (value) M2mServiceSubscriptionProfile_optional m_contentCreatem2mServiceSubscriptionProfileBase := { + template (value) M2mServiceSubscriptionProfile_optional m_contentCreatem2mServiceSubscriptionProfileMaxValue1 := { resourceName := c_defaultm2mServiceSubscriptionProfileResourceName, //O resourceType := omit, //NP resourceID := omit, //NP @@ -4532,10 +4788,70 @@ module OneM2M_Templates { creationTime := omit, //NP lastModifiedTime := omit, //NP labels := PX_LABELS,//O - accessControlPolicyIDs := omit, //O - expirationTime := omit, //O + accessControlPolicyIDs := omit, //O + expirationTime := omit, //O dynamicAuthorizationConsultationIDs := omit, //O - choice := omit //NP + M2M_Sub_ID := PX_M2M_SUB_ID, //M + M2M_SS_ID := PX_M2M_SS_ID, //O + Status := omit, //NP + Activate := true, //M + activationTime := omit, //NP + deactivationTime := omit, //NP + serviceSubscriptionDuration := omit, //O + currentNumAEs := omit, //NP + maxNumAEs := 1, //O + maxNumNodes := 1, //O + maxNumBytes := 1, //O + maxRequestRate := 1, //O + maxNumContainers := 1, //O + maxNumInstancesPerContainer := 1, //O + maxNumTimeSeries := 1, //O + maxNumInstancesPerTimeSeries := 1, //O + maxMembersPerGroup := 1, //O + maxNotificationRate := omit, //O + maxNumFlexContainers := omit, //O + maxNumInstancesPerFlexContainer := omit, //O + defaultAccessControlPrivileges := omit, //O + choice := omit //NP + }; + + /** + * @desc Base primitiveContent for CREATE operation for M2mServiceSubscriptionProfile resource + * @param p_primitiveContent Content for the M2mServiceSubscriptionProfile + */ + template (value) M2mServiceSubscriptionProfile_optional m_contentCreatem2mServiceSubscriptionProfileMaxValue2 modifies m_contentCreatem2mServiceSubscriptionProfileMaxValue1 := { + 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 + M2M_Sub_ID := PX_M2M_SUB_ID, //M + M2M_SS_ID := PX_M2M_SS_ID, //O + Status := omit, //NP + Activate := true, //M + activationTime := omit, //NP + deactivationTime := omit, //NP + serviceSubscriptionDuration := omit, //O + currentNumAEs := omit, //NP + maxNumAEs := 2, //O + maxNumNodes := 2, //O + maxNumBytes := 2, //O + maxRequestRate := 2, //O + maxNumContainers := 2, //O + maxNumInstancesPerContainer := 2, //O + maxNumTimeSeries := 2, //O + maxNumInstancesPerTimeSeries := 2, //O + maxMembersPerGroup := 2, //O + maxNotificationRate := omit, //O + maxNumFlexContainers := omit, //O + maxNumInstancesPerFlexContainer := omit, //O + defaultAccessControlPrivileges := omit, //O + choice := omit //NP }; /** @@ -4556,11 +4872,12 @@ module OneM2M_Templates { applicableCredIDs := omit, allowedApp_IDs := omit, allowedAEs := omit, + allowedUsers := omit, allowedRole_IDs := omit, choice := omit //NP }; - template (value) ServiceSubscribedNode_optional m_contentServiceSubscribedNode := { + template (value) ServiceSubscribedNode_optional m_contentServiceSubscribedNode (in ListOfURIs p_ruleLinks) := { resourceName := "MyServiceServiceSubscribedNodeResource", //O resourceType := omit, //M resourceID := omit, //M @@ -4579,9 +4896,57 @@ module OneM2M_Templates { choice := omit //O }; + /** + * @desc Base primitiveContent for CREATE operation for M2mServiceSubscriptionProfile resource + * @param p_primitiveContent Content for the M2mServiceSubscriptionProfile + */ + template (value) ServiceSubscribedUserProfile_optional m_contentCreateServiceSubscribedUserProfileMaxValue1 := { + resourceName := c_defaultServiceSubscribedUserProfileResourceName, //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 + M2M_User_ID := PX_M2M_USER_ID, // M + maxNumAEs := 1, // O + maxNumNodes := 1, // O + maxNumBytes := 1, // O + maxRequestRate := 1, // O + maxNumContainers := 1, // O + maxNumInstancesPerContainer := 1, // O + maxNumTimeSeries := 1, // O + maxNumInstancesPerTimeSeries := 1, // O + maxMembersPerGroup := 1, // O + maxNotificationRate := 1, // O + maxNumFlexContainers := 1, // O + maxNumInstancesPerFlexContainer := 1, // O + defaultAccessControlPrivileges := omit // O + }; + /** + * @desc primitiveContent for CREATE operation for M2mServiceSubscriptionProfile resource with higher maxNumAEs + * @param p_primitiveContent Content for the M2mServiceSubscriptionProfile + */ + template (value) ServiceSubscribedUserProfile_optional m_contentCreateServiceSubscribedUserProfileMaxValue2 modifies m_contentCreateServiceSubscribedUserProfileMaxValue1 := { + maxNumAEs := 2, // O + maxNumNodes := 2, // O + maxNumBytes := 2, // O + maxRequestRate := 2, // O + maxNumContainers := 2, // O + maxNumInstancesPerContainer := 2, // O + maxNumTimeSeries := 2, // O + maxNumInstancesPerTimeSeries := 2, // O + maxMembersPerGroup := 2, // O + maxNotificationRate := 2, // O + maxNumFlexContainers := 2, // O + maxNumInstancesPerFlexContainer := 2 // O + }; - + /** * @desc Base primitiveContent for CREATE operation for timeSeries resource * @param p_name Resource name @@ -6320,6 +6685,54 @@ module OneM2M_Templates { resultGenType := omit, //O periodForResultGen := omit //O } + + /** + * @desc Base primitiveContent for UPDATE operation for ServiceSubscribedUserProfile resource + */ + template (value) ServiceSubscribedUserProfile_optional m_contentUpdateServiceSubscribedUserProfileMaxValue1 modifies m_contentCreateServiceSubscribedUserProfileMaxValue1 := { + + maxNumAEs := 1, // O + maxNumNodes := 1, // O + maxNumBytes := 1, // O + maxRequestRate := 1, // O + maxNumContainers := 1, // O + maxNumInstancesPerContainer := 1, // O + maxNumTimeSeries := 1, // O + maxNumInstancesPerTimeSeries := 1, // O + maxMembersPerGroup := 1, // O + maxNotificationRate := 1, // O + maxNumFlexContainers := 1, // O + maxNumInstancesPerFlexContainer := 1 // O + }; + + /** + * @desc PrimitiveContent for UPDATE operation for ServiceSubscribedUserProfile resource + */ + template (value) ServiceSubscribedUserProfile_optional m_contentUpdateServiceSubscribedUserProfileMaxValue2 modifies m_contentCreateServiceSubscribedUserProfileMaxValue1 := { + + maxNumAEs := 2, // O + maxNumNodes := 2, // O + maxNumBytes := 2, // O + maxRequestRate := 2, // O + maxNumContainers := 2, // O + maxNumInstancesPerContainer := 2, // O + maxNumTimeSeries := 2, // O + maxNumInstancesPerTimeSeries := 2, // O + maxMembersPerGroup := 2, // O + maxNotificationRate := 2, // O + maxNumFlexContainers := 2, // O + maxNumInstancesPerFlexContainer := 2 // O + }; + + /** + * @desc PrimitiveContent for UPDATE operation for ServiceSubscribedUserProfile resource + */ + template (value) ServiceSubscribedUserProfile_optional m_contentUpdateServiceSubscribedUserProfileAE0 modifies m_contentCreateServiceSubscribedUserProfileMaxValue1 := { + + maxNumAEs := 0 // O + }; + + }//end group ContentUpdate group ContentRetrieve { @@ -8614,7 +9027,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }, forcedFields := omit }; @@ -8699,7 +9113,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }, forcedFields := omit }; @@ -8752,7 +9167,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }, forcedFields := omit }; @@ -8805,7 +9221,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }, forcedFields := omit }; @@ -9035,7 +9452,8 @@ module OneM2M_Templates { semanticQueryIndicator := omit, releaseVersionIndicator := PX_RELEASE_VERSION, vendorInformation := omit, - primitiveProfileIdentifier := omit + primitiveProfileIdentifier := omit, + m2mServiceUser := omit }, forcedFields := omit }; diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index d0862bee5fdff239e2e85d271c88f9632b032890..231c54bebb7df8d84bcf5bc037e2aa0999eaea05 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -39,9 +39,12 @@ module OneM2M_TypesAndValues { const XSD.String c_defaultRequestResourceName := "MyRequestResource"; const XSD.String c_dynamicAuthorizationConsultationName := "MyDynamicAuthorizationConsultation"; const XSD.String c_defaultStatsConfigResourceName := "MyStatsConfigResource"; + const XSD.String c_defaultEventConfigResourceName := "MyEventConfigResource"; + const XSD.String c_defaultEventConfigEventID := "MyEventConfigID"; const XSD.String c_defaultStatsCollectResourceName := "MyStatsCollectResource"; const XSD.String c_defaultm2mServiceSubscriptionProfileResourceName := "Mym2mServiceSubscriptionProfileResource"; const XSD.String c_defaultServiceSubscribedAppRuleResourceName := "MyServiceSubscribedAppRuleResource"; + const XSD.String c_defaultServiceSubscribedUserProfileResourceName := "MyServiceSubscribedUserProfileResourceName"; const XSD.String c_defaultTimeSeriesResourceName := "MyTimeSeriesResource"; const XSD.String c_defaultTimeSeriesAnncResourceName := "MyTimeSeriesAnncResource"; const XSD.String c_defaultTimeSeriesInstanceResourceName := "MyTimeSeriesInstanceResource"; @@ -1166,12 +1169,36 @@ group OptionalResourceTypes { AcpType accessControlPolicyIDs optional, Timestamp expirationTime optional, ListOfURIs dynamicAuthorizationConsultationIDs optional, + //TODO To be removed/replaced by the type defined in XSDs + XSD.ID M2M_Sub_ID optional, + XSD.ID M2M_SS_ID optional, + ServiceSubscriptionStatus Status optional , + XSD.Boolean Activate optional, + Timestamp activationTime optional, + Timestamp deactivationTime optional, + XSD.Duration serviceSubscriptionDuration optional, + XSD.NonNegativeInteger currentNumAEs optional, + XSD.NonNegativeInteger maxNumAEs optional, + XSD.NonNegativeInteger maxNumNodes optional, + XSD.NonNegativeInteger maxNumBytes optional, + XSD.NonNegativeInteger maxRequestRate optional, + XSD.NonNegativeInteger maxNumContainers optional, + XSD.NonNegativeInteger maxNumInstancesPerContainer optional, + XSD.NonNegativeInteger maxNumTimeSeries optional, + XSD.NonNegativeInteger maxNumInstancesPerTimeSeries optional, + XSD.NonNegativeInteger maxMembersPerGroup optional, + XSD.NonNegativeInteger maxNotificationRate optional, + XSD.NonNegativeInteger maxNumFlexContainers optional, + XSD.NonNegativeInteger maxNumInstancesPerFlexContainer optional, + SetOfAcrs defaultAccessControlPrivileges optional, union { record length(1 .. infinity) of ChildResourceRef childResource_list, record length(1 .. infinity) of union { ServiceSubscribedNode serviceSubscribedNode, Subscription subscription, - Transaction transaction + Transaction transaction, + //TODO To be removed/replaced by the type defined in XSDs + ServiceSubscribedUserProfile_optional serviceSubscribedUserProfile } choice_list } choice optional } @@ -1863,6 +1890,8 @@ group OptionalResourceTypes { ListOfM2MID allowedApp_IDs optional, ListOfM2MID allowedAEs optional, record length(1 .. infinity) of RoleID allowedRole_IDs optional, + // TODO: To update once oneM2MTypes is updated + ListOfM2MID allowedUsers optional, union { record length(1 .. infinity) of ChildResourceRef childResource_list, record length(1 .. infinity) of union { @@ -1922,6 +1951,34 @@ group OptionalResourceTypes { variant (choice.choice_list) "untagged"; variant (choice.choice_list[-]) "untagged"; }; + + //TODO To be removed/replaced by the type defined in XSDs + type record ServiceSubscribedUserProfile_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 M2M_User_ID optional, + XSD.NonNegativeInteger maxNumAEs optional, + XSD.NonNegativeInteger maxNumNodes optional, + XSD.NonNegativeInteger maxNumBytes optional, + XSD.NonNegativeInteger maxRequestRate optional, + XSD.NonNegativeInteger maxNumContainers optional, + XSD.NonNegativeInteger maxNumInstancesPerContainer optional, + XSD.NonNegativeInteger maxNumTimeSeries optional, + XSD.NonNegativeInteger maxNumInstancesPerTimeSeries optional, + XSD.NonNegativeInteger maxMembersPerGroup optional, + XSD.NonNegativeInteger maxNotificationRate optional, + XSD.NonNegativeInteger maxNumFlexContainers optional, + XSD.NonNegativeInteger maxNumInstancesPerFlexContainer optional, + SetOfAcrs defaultAccessControlPrivileges optional + }; type record StatsCollect_optional { @@ -1994,6 +2051,47 @@ group OptionalResourceTypes { variant (choice.choice_list) "untagged"; variant (choice.choice_list[-]) "untagged"; }; + + type record EventConfig_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 eventID optional, + EventType eventType optional, + Timestamp eventStart optional, + Timestamp eventEnd optional, + record of Operation operationType optional, + XSD.NonNegativeInteger dataSize optional, + ResourceTypeList eventResourceTypes optional, + ListOfURIs eventResourceIDs optional, + union { + record length(1 .. infinity) of ChildResourceRef childResource_list, + record length(1 .. infinity) of union { + Subscription subscription, + Transaction transaction + } choice_list + } choice optional + } + with { + variant "name as uncapitalized"; + variant "element"; + variant (resourceName) "attribute"; + variant (operationType) "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 Subscription_optional { @@ -4304,9 +4402,11 @@ group OtherTypes { ScheduleAnnc_optional scheduleAnnc, StatsConfig_optional statsConfig, StatsCollect_optional statsCollect, + EventConfig_optional eventConfig, M2mServiceSubscriptionProfile_optional m2mServiceSubscriptionProfile, ServiceSubscribedAppRule_optional serviceSubscribedAppRule, ServiceSubscribedNode_optional serviceSubscribedNode, + ServiceSubscribedUserProfile_optional serviceSubscribedUserProfile, Subscription_optional subscription, SemanticDescriptor_optional semanticDescriptor, SemanticMashupInstance_optional semanticMashupInstance, diff --git a/OneM2M_Testcases_CSE_Release_4.ttcn b/OneM2M_Testcases_CSE_Release_4.ttcn index 6c038f0228529284c075a9eb8d3afd27e818315b..220b076edbbf3ef050afde41fafc0aabbe3b3a83 100644 --- a/OneM2M_Testcases_CSE_Release_4.ttcn +++ b/OneM2M_Testcases_CSE_Release_4.ttcn @@ -182,7 +182,7 @@ module OneM2M_Testcases_CSE_Release_4 { testcase TC_CSE_DMR_CRE_001_MSSP_CB() runs on Tester system CseSystem { // Local variables - var template RequestPrimitive v_createRequest := m_createM2mServiceSubscriptionProfileBase; + var template RequestPrimitive v_createRequest := m_createM2mServiceSubscriptionProfileMaxValue1; var ResponsePrimitive v_responsePrimitive; var AeSimu v_ae1 := AeSimu.create("AE1") alive; @@ -5298,6 +5298,1690 @@ module OneM2M_Testcases_CSE_Release_4 { } // f_CSE_PP_016_UPD } // TC_CSE_PP_016 } //end group Primitive_Profile - }//end group CSE -}// + + group Service_Charging_and_Accounting { + group Event_Based_Charging { + + /** + * @desc Check that the IUT successfully generates the statistics collection record and send to target AE once the IUT receives an event collection trigger from AE when the eventType event is TIMERBASED in the stat collection configuration. + * + */ + testcase TC_CSE_SCA_EBC_001() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SCA_EBC_001()); + v_ae1.done; + } + + function f_CSE_SCA_EBC_001() runs on AeSimu system CseSystem { + + var integer v_statsConfigResourceIndex := -1; + var integer v_eventConfigResourceIndex := -1; + var integer v_statsCollectResourceIndex := -1; + var integer v_aeIndex1 := -1; + var integer v_aeIndex2 := -1; + var Timestamp v_eventStart := "20301231T012345"; //getcurrentTime() + var Timestamp v_timerDuration := "20301231T012345"; // 10 sec + var Timestamp v_eventEnd := "20301231T012345"; //v_eventStart + v_timerDuration; allow 10sec difference between Start and End + var template RequestPrimitive v_createStatsConfigResource := m_createStatsConfigBase; + var template RequestPrimitive v_createEventConfigResource; + var template RequestPrimitive v_createStatsCollectResource := m_createStatsCollectBase; + var PrimitiveContent v_primitiveContentRetrievedEventConfig; + + // Test component configuration + f_cf01Up(true); + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63);//c_CUDNDi) + + // AE1 - Billing application and client + v_aeIndex1 := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -);//c_CRDNDi); + + // AE2 - For performing billing operations + vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_TS_AE2.appId, {f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, PX_TS_AE2.aeIdStem, c_defaultAe2ResourceName, -), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_aeIndex2 := f_getLatestResourceIndex(vc_ae2); + + + // AE1- Create StatsConfig resource from Billing application + v_statsConfigResourceIndex := f_cse_createResource(int22, v_createStatsConfigResource, v_aeIndex2); + + //AE1 - Create EventConfig resource from Billing application as a child resource of StatsConfig + v_createEventConfigResource := m_createEventConfigTimerBased(v_eventStart, v_eventEnd); + v_eventConfigResourceIndex := f_cse_createResource(int7, v_createEventConfigResource, v_statsConfigResourceIndex); + + //AE1 - Use generated eventID from eventConfig resouce in the statsCollect + v_createStatsCollectResource.primitiveContent.statsCollect.eventID := vc_response.primitive.responsePrimitive.primitiveContent.statsCollect.eventID; + + //AE1 Trigger stats collection. + v_statsCollectResourceIndex := f_cse_createResource(int21, v_createStatsCollectResource, v_statsConfigResourceIndex); + + // Operations to generate charging info - AE2 stores total 200 bytes of data at 100 bytes at time + vc_ae2.start(f_cse_createContentAndInstances(200, 100, v_aeIndex2)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // wait for timeout f_sleep(v_timerDuration); + f_sleep(10.0); + tc_ac.start; + + alt { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ":INFO: Notification of statistic collection received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No notification received"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT successfully generates the statistics collection record and send to target AE once the IUT receives an event collection trigger from AE when the eventType attribute is TIMERBASED in the stat collection configuration. + * + */ + testcase TC_CSE_SCA_EBC_002() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SCA_EBC_002()); + v_ae1.done; + } + + function f_CSE_SCA_EBC_002() runs on AeSimu system CseSystem { + + var integer v_statsConfigResourceIndex := -1; + var integer v_eventConfigResourceIndex := -1; + var integer v_statsCollectResourceIndex := -1; + var integer v_aeIndex1 := -1; + var integer v_aeIndex2 := -1; + var integer v_containerIndex := -1; + var Timestamp v_eventStart := "20301231T012345"; //getcurrentTime() + var Timestamp v_timerDuration := "20301231T012345"; // 10 sec + var Timestamp v_eventEnd := "20301231T012345"; //v_eventStart + v_timerDuration; allow 10sec difference between Start and End + var template RequestPrimitive v_createStatsConfigResource := m_createStatsConfigBase; + var template RequestPrimitive v_createEventConfigResource; + var template RequestPrimitive v_createStatsCollectResource := m_createStatsCollectBase; + var PrimitiveContent v_primitiveContentRetrievedEventConfig; + var RequestPrimitive v_updateRequest := m_updateContainerBase; + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + + // Test component configuration + f_cf01Up(true); + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63);//c_CUDNDi) + + // AE1 - Billing application and client + v_aeIndex1 := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -);//c_CRDNDi); + + // AE2 - For performing billing operations + vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_TS_AE2.appId, {f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, PX_TS_AE2.aeIdStem, c_defaultAe2ResourceName, -), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_aeIndex2 := f_getLatestResourceIndex(vc_ae2); + + // Create a container + vc_ae2.start(f_cse_createResource(int3, v_createRequestContainer, v_aeIndex2)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_containerIndex := f_getLatestResourceIndex(vc_ae2); + + + // AE1- Create StatsConfig resource from Billing application + v_statsConfigResourceIndex := f_cse_createResource(int22, v_createStatsConfigResource, v_aeIndex2); + + //AE1 - Create TIMERBASED EventConfig resource from Billing application, as a child resource of StatsConfig + v_createEventConfigResource := m_createEventConfigTimerBased(v_eventStart, v_eventEnd); + v_eventConfigResourceIndex := f_cse_createResource(int7, v_createEventConfigResource, v_statsConfigResourceIndex); + + //AE1 - Use generated eventID from eventConfig resouce in the statsCollect + v_createStatsCollectResource.primitiveContent.statsCollect.eventID := vc_response.primitive.responsePrimitive.primitiveContent.statsCollect.eventID; + + //AE1 Trigger stats collection. + v_statsCollectResourceIndex := f_cse_createResource(int21, v_createStatsCollectResource, v_statsConfigResourceIndex); + + // Operations to generate charging info - update container resource + vc_ae2.start(f_cse_updateResource(int3, v_containerIndex, v_updateRequest)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // wait for timeout f_sleep(v_timerDuration); + f_sleep(10.0); + tc_ac.start; + + alt { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ":INFO: Notification of statistic collection received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No notification received"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT successfully generates the statistics collection record and send to target AE once the IUT receives an event collection trigger from AE when the eventType attribute is STORAGEBASED in the stat collection configuration. + * + */ + testcase TC_CSE_SCA_EBC_003() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SCA_EBC_003()); + v_ae1.done; + } + + function f_CSE_SCA_EBC_003() runs on AeSimu system CseSystem { + + var integer v_statsConfigResourceIndex := -1; + var integer v_eventConfigResourceIndex := -1; + var integer v_statsCollectResourceIndex := -1; + var integer v_aeIndex1 := -1; + var integer v_aeIndex2 := -1; + var template RequestPrimitive v_createStatsCollectResource := m_createStatsCollectBase; + var PrimitiveContent v_primitiveContentRetrievedEventConfig; + var XSD.NonNegativeInteger v_dataSize := 1; // size of data in Kbytes + var template RequestPrimitive v_createStatsConfigResource := m_createStatsConfigBase; + var template RequestPrimitive v_createEventConfigResource; + + // Test component configuration + f_cf01Up(true); + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63);//c_CUDNDi) + + // AE1 - Billing application and client + v_aeIndex1 := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -);//c_CRDNDi); + + // AE2 - For performing billing operations + vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_TS_AE2.appId, {f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, PX_TS_AE2.aeIdStem, c_defaultAe2ResourceName, -), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_aeIndex2 := f_getLatestResourceIndex(vc_ae2); + + + // AE1- Create StatsConfig resource from Billing application + v_statsConfigResourceIndex := f_cse_createResource(int22, v_createStatsConfigResource, v_aeIndex2); + + //AE1 - Create EventConfig resource from Billing application as a child resource of StatsConfig + v_createEventConfigResource := m_createEventConfigStorageBased(1); // dataSize = int1, 1Kbtes of storage to trigger stat collection + v_eventConfigResourceIndex := f_cse_createResource(int7, v_createEventConfigResource, v_statsConfigResourceIndex); + + //AE1 - Use generated eventID from eventConfig resouce in the statsCollect + v_createStatsCollectResource.primitiveContent.statsCollect.eventID := vc_response.primitive.responsePrimitive.primitiveContent.statsCollect.eventID; + + //AE1 Trigger stats collection. + v_statsCollectResourceIndex := f_cse_createResource(int21, v_createStatsCollectResource, v_statsConfigResourceIndex); + + // trigger statistics collection by a data strorage + // AE2 stores 1k bytes data storage, 100 bytes at time + vc_ae2.start(f_cse_createContentAndInstances(1024, 100, v_aeIndex2)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + tc_ac.start; + + alt { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ":INFO: Notification of statistic collection received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No notification received"); + } + } + + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT successfully generates the statistics collection record and send to target AE once the IUT receives an event collection trigger from AE when the eventType attribute is DataOperation in the stat collection configuration. + * + */ + testcase TC_CSE_SCA_EBC_004() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SCA_EBC_004()); + v_ae1.done; + } + + function f_CSE_SCA_EBC_004() runs on AeSimu system CseSystem { + + var integer v_statsConfigResourceIndex := -1; + var integer v_eventConfigResourceIndex := -1; + var integer v_statsCollectResourceIndex := -1; + var integer v_aeIndex1 := -1; + var integer v_aeIndex2 := -1; + var template RequestPrimitive v_createStatsCollectResource := m_createStatsCollectBase; + var PrimitiveContent v_primitiveContentRetrievedEventConfig; + var XSD.NonNegativeInteger v_dataSize := 1; // size of data in Kbytes + var template RequestPrimitive v_createStatsConfigResource := m_createStatsConfigBase; + var template RequestPrimitive v_createEventConfigResource; // STORAGEBASED + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + + // Test component configuration + f_cf01Up(true); + + // Preamble + f_cse_createAccessControlPolicyAux(-, -, int63);//c_CUDNDi) + + // AE1 - Billing application and client + v_aeIndex1 := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, -);//c_CRDNDi); + + // AE2 - For performing billing operations + vc_ae2.start(f_cse_createResource(int2, m_createAe(PX_TS_AE2.appId, {f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}, PX_TS_AE2.aeIdStem, c_defaultAe2ResourceName, -), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_aeIndex2 := f_getLatestResourceIndex(vc_ae2); + + + // AE1- Create StatsConfig resource from Billing application + v_statsConfigResourceIndex := f_cse_createResource(int22, v_createStatsConfigResource, v_aeIndex2); + + //AE1 - Create EventConfig resource from Billing application as a child resource of StatsConfig + v_createEventConfigResource := m_createEventConfigStorageBased(1); // dataSize = int1, 1Kbtes of storage to trigger stat collection + v_eventConfigResourceIndex := f_cse_createResource(int7, v_createEventConfigResource, v_statsConfigResourceIndex); + + //AE1 - Use generated eventID from eventConfig resouce in the statsCollect + v_createStatsCollectResource.primitiveContent.statsCollect.eventID := vc_response.primitive.responsePrimitive.primitiveContent.statsCollect.eventID; + + //AE1 Trigger stats collection. + v_statsCollectResourceIndex := f_cse_createResource(int21, v_createStatsCollectResource, v_statsConfigResourceIndex); + + //trigger statistics collection by a CREATE resource + vc_ae2.start(f_cse_createResource(int3, v_createRequestContainer, v_aeIndex2)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + tc_ac.start; + + alt { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ":INFO: Notification of statistic collection received"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No notification received"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + } + }// end group Service_Charging_and_Accounting + + group Service_Subscription_User_Profile { + group Basic_Operation { + + /** + * @desc Check that the IUT successfully performs operations on resource serviceSubscribedUserProfile for authorized M2M Service User. + * + */ + testcase TC_CSE_SSUP_001_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_001_CRE()); + v_ae1.done; + } + + function f_CSE_SSUP_001_CRE() runs on AeSimu system CseSystem { + var integer v_subscriptionProfileIndex := -1; + var integer v_subscribedProfileIndex := -1; + var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1; + var template RequestPrimitive v_createServiceSubscribedUserProfile := m_createServiceSubscribedUserProfileMaxValue1; + var RequestPrimitive v_request; + + // directly on CSEBase from superAE + v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1); + + // Create serviceSubscribedUserProfile + // TODO int52: To change to correct type value once serviceSubscribedUserProfile is added in TS-0004 + v_request := f_getCreateRequestPrimitive(int52, v_createServiceSubscribedUserProfile, v_subscriptionProfileIndex); + f_send(e_mcaPort, m_request(v_request)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile successfully created."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating serviceSubscribedUserProfile with status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT successfully performs operations on resource serviceSubscribedUserProfile for authorized M2M Service User. + * + */ + testcase TC_CSE_SSUP_001_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_001_RET()); + v_ae1.done; + } + + function f_CSE_SSUP_001_RET() runs on AeSimu system CseSystem { + var integer v_subscriptionProfileIndex := -1; + var integer v_subscribedProfileIndex := -1; + var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue2; + var template RequestPrimitive v_createServiceSubscribedUserProfile := m_createServiceSubscribedUserProfileMaxValue1; + var RequestPrimitive v_request; + + // directly on CSEBase from superAE + v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1); + + // Retrive ServiceSubscribedUserProfile + // TODO int52: To change to correct type value once serviceSubscribedUserProfile is added in TS-0004 + v_subscribedProfileIndex := f_cse_createResource(int52, v_createServiceSubscribedUserProfile, v_subscriptionProfileIndex); + + // from super AE + f_send(e_mcaPort, m_request(m_retrieve(f_getResourceAddress(v_subscribedProfileIndex), f_getOriginator(-1)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile successfully retrived."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2000))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving serviceSubscribedUserProfile with status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT successfully performs operations on resource serviceSubscribedUserProfile for authorized M2M Service User. + * + */ + testcase TC_CSE_SSUP_001_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_001_UPD()); + v_ae1.done; + } + + function f_CSE_SSUP_001_UPD() runs on AeSimu system CseSystem { + var integer v_subscriptionProfileIndex := -1; + var integer v_subscribedProfileIndex := -1; + var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue2; + var template RequestPrimitive v_createServiceSubscribedUserProfile := m_createServiceSubscribedUserProfileMaxValue1; + var RequestPrimitive v_updateRequest; + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue2; + + // directly on CSEBase from superAE + v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1); + + // TODO int52: To change to correct type value once serviceSubscribedUserProfile is added in TS-0004 + v_subscribedProfileIndex := f_cse_createResource(int52, v_createServiceSubscribedUserProfile, v_subscriptionProfileIndex); + + // Update ServiceSubscribedUserProfile + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile successfully retrived."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2004))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving serviceSubscribedUserProfile with status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + f_checkAeSimuStatus(); + + // Verifiy that the ServiceSubscribedUserProfile resource has been updated + vc_primitiveContentRetrievedResource := f_cse_retrieveResource(v_subscribedProfileIndex); + + if(not(match(v_updateRequestPrimitive.primitiveContent.serviceSubscribedUserProfile.maxNumAEs, vc_primitiveContentRetrievedResource.serviceSubscribedUserProfile.maxNumAEs))) { + setverdict(fail, __SCOPE__&":INFO: Retrived serviceSubscribedUserProfile does not match with updated content."); + } else { + setverdict(pass, __SCOPE__ & ": Retrived serviceSubscribedUserProfile matched with updated content."); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT successfully performs operations on resource serviceSubscribedUserProfile for authorized M2M Service User. + * + */ + testcase TC_CSE_SSUP_001_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_001_DEL()); + v_ae1.done; + } + + function f_CSE_SSUP_001_DEL() runs on AeSimu system CseSystem { + var integer v_subscriptionProfileIndex := -1; + var integer v_subscribedProfileIndex := -1; + var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1; + var template RequestPrimitive v_createServiceSubscribedUserProfile := m_createServiceSubscribedUserProfileMaxValue1; + + // directly on CSEBase from superAE + v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1); + + // TODO int52: To change to correct type value once serviceSubscribedUserProfile is added in TS-0004 + v_subscribedProfileIndex := f_cse_createResource(int52, v_createServiceSubscribedUserProfile, v_subscriptionProfileIndex); + + // Delete ServiceSubscribedUserProfile + f_send(e_mcaPort, m_request(m_delete(f_getResourceAddress(v_subscribedProfileIndex), f_getOriginator(v_subscribedProfileIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile successfully deleted."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2002))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting serviceSubscribedUserProfile with status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + f_checkAeSimuStatus(); + + // Verify that ServiceSubscribedUserProfile is not present + if (f_cse_isResourceNotPresent(v_subscriptionProfileIndex, f_getResourceName(vc_resourcesList[v_subscribedProfileIndex].resource))){ + setverdict(pass, __SCOPE__ & ":INFO: Resource deleted"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not deleted"); + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT rejects the operation on serviceSubscribedUserProfile resource when the attributes violate the limits specified in the parent resource. + * + */ + testcase TC_CSE_SSUP_002_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_002_CRE()); + v_ae1.done; + } + + function f_CSE_SSUP_002_CRE() runs on AeSimu system CseSystem { + var integer v_subscriptionProfileIndex := -1; + var integer v_subscribedProfileIndex := -1; + var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1; + var template RequestPrimitive v_createServiceSubscribedUserProfile := m_createServiceSubscribedUserProfileMaxValue2; + var RequestPrimitive v_request; + + // directly on CSEBase from superAE + v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1); + + // limits in v_createServiceSubscribedUserProfile is higher than parent v_createServiceSubscriptionProfile + // TODO int52: To change to correct type value once serviceSubscribedUserProfile is added in TS-0004 + v_request := f_getCreateRequestPrimitive(int52, v_createServiceSubscribedUserProfile, v_subscriptionProfileIndex); + f_send(e_mcaPort, m_request(v_request)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile creation rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": serviceSubscribedUserProfile successfully created."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4102))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT rejects the operation on serviceSubscribedUserProfile resource when the attributes violate the limits specified in the parent resource. + * + */ + testcase TC_CSE_SSUP_002_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_002_UPD()); + v_ae1.done; + } + + function f_CSE_SSUP_002_UPD() runs on AeSimu system CseSystem { + var integer v_subscriptionProfileIndex := -1; + var integer v_subscribedProfileIndex := -1; + var template RequestPrimitive v_createServiceSubscriptionProfile := m_createM2mServiceSubscriptionProfileMaxValue1; + var template RequestPrimitive v_createServiceSubscribedUserProfile := m_createServiceSubscribedUserProfileMaxValue1; + var RequestPrimitive v_updateRequest; + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue2; + + // directly on CSEBase from superAE + v_subscriptionProfileIndex := f_cse_createResource(int11, v_createServiceSubscriptionProfile, -1); + + // TODO int52: To change to correct type value once serviceSubscribedUserProfile is added in TS-0004 + v_subscribedProfileIndex := f_cse_createResource(int52, v_createServiceSubscribedUserProfile, v_subscriptionProfileIndex); + + // Update ServiceSubscribedUserProfile + // limits in v_updateRequestPrimitive is higher than parent v_createServiceSubscriptionProfile + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile update rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4102))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT successfully restricts the usage of services by a M2M Service User + * + */ + testcase TC_CSE_SSUP_003() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_003()); + v_ae1.done; + } + + function f_CSE_SSUP_003() runs on AeSimu system CseSystem { + + var RequestPrimitive v_request; + + // Test component configuration + f_cf01Up(true); + + // Create subscription and subscriber from a superAE with PX_ALLOWED_C_AE_IDS in allowedUsers of <serviceSubscribedAppRule> + vc_ae2.start(f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, true)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // M2M user is attempting registration from another AE, which is not included in the subscriptions + // This M2M user is not allowed to use the AE since PX_NOT_ALLOWED_C_AE_IDS is not inlucded in the allowedUsers of <serviceSubscribedAppRule> + v_request := valueof(m_createAe(vc_aeSimuDesc.appId, omit, PX_NOT_ALLOWED_C_AE_IDS[0])); + v_request := f_getCreateRequestPrimitive(int2, v_request, -1, PX_M2M_USER_ID); + + f_send(e_mcaPort, m_request(v_request)); + + tc_ac.start; + + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(pass, __SCOPE__&":INFO: User prevented from AE registration "); + stop; + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { + tc_ac.stop; + setverdict(fail,__SCOPE__&":INFO: Registration successfull with invalid user Id"); + } + [] tc_ac.timeout { + setverdict(inconc, __SCOPE__&":INFO: No answer while registering resource"); + stop; + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT rejects the OPERATION when the associated services of a M2M Service User reach limits provided in the serviceSubscribedUserProfile resource. + * + */ + testcase TC_CSE_SSUP_004() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_004()); + v_ae1.done; + } + + function f_CSE_SSUP_004() runs on AeSimu system CseSystem { + + var integer v_aeIndex := -1; + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + var RequestPrimitive v_request; + + // Test component configuration + f_cf01Up(true); + + // Create subscription and subscriber from a superAE, subsciption allows up to two containers, however ServiceSubscribedUserProfile allows only one container + vc_ae2.start(f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue1)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // AE registration with same user ID + f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID); + + // Create a container resource + f_cse_createResource(int3, m_createContainerBase, v_aeIndex, PX_M2M_USER_ID); + + // Creation of one more cotnainer should be rejected as maxNumContainers in ServiceSubscribedUserProfile is 1 + v_request := f_getCreateRequestPrimitive(int2, v_request, -1, PX_M2M_USER_ID); + + f_send(e_mcaPort, m_request(v_request)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource creation rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Container resource created."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4102))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT rejects the OPERATION when the associated services of a M2M Service User reach limits provided in the serviceSubscribedUserProfile resource. + * + */ + testcase TC_CSE_SSUP_005_MNA() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_005_MNA()); + v_ae1.done; + } + + function f_CSE_SSUP_005_MNA() runs on AeSimu system CseSystem { + + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileHigherAE0; + var integer v_subscribedProfileIndex := -1; + var RequestPrimitive v_updateRequest; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, with maxNumAEs = 1 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, p_allowedUsers := true); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Update ServiceSubscribedUserProfile and make maxNumAEs to 0 + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update to maxNumAEs rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4102))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT rejects the OPERATION when the associated services of a M2M Service User reach limits provided in the serviceSubscribedUserProfile resource. + * + */ + testcase TC_CSE_SSUP_005_MNC() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_005_MNC()); + v_ae1.done; + } + + function f_CSE_SSUP_005_MNC() runs on AeSimu system CseSystem { + + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue1; + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + var integer v_subscribedProfileIndex := -1; + var integer v_aeIndex := -1; + var RequestPrimitive v_updateRequest; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, with maxNumContainers = 2 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue2); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Create two containers + v_aeIndex := f_getLatestResourceIndex(vc_ae2); + vc_ae2.start(f_cse_createResource(int3, v_createRequestContainer, v_aeIndex)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + vc_ae2.start(f_cse_createResource(int3, m_createContainer("NotInitialized", "MyContainer2"), v_aeIndex)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Update ServiceSubscribedUserProfile and make maxNumContainers to 1 + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update to maxNumContainers rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4102))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that IUT rejects the request when the values of ATTRIBUTE in request exceed the actual resources associated with the Service user. + * + */ + testcase TC_CSE_SSUP_005_MNI() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_005_MNI()); + v_ae1.done; + } + + function f_CSE_SSUP_005_MNI() runs on AeSimu system CseSystem { + + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue1; + var integer v_subscribedProfileIndex := -1; + var integer v_aeIndex := -1; + var RequestPrimitive v_updateRequest; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, maxNumContainers = 2 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue2); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + // Create container + v_aeIndex := f_getLatestResourceIndex(vc_ae2); + //// Create 2 container instances + //trigger 1k bytes data storage 200 bytes of data at 100 bytes at time + // Operations to generate charging info - AE2 stores total 200 bytes of data at 100 bytes at time + vc_ae2.start(f_cse_createContentAndInstances(200, 100, v_aeIndex)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Update ServiceSubscribedUserProfile and make maxNumContainers to 1 + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4102))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update to maxNumInstancesPerContainer rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4102))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer during update operation."); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that IUT accepts the request when the values of ATTRIBUTE in request do not exceed the actual resources associated with the Service user. + * + */ + testcase TC_CSE_SSUP_006_MNA() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_006_MNA()); + v_ae1.done; + } + + function f_CSE_SSUP_006_MNA() runs on AeSimu system CseSystem { + + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue1; + var integer v_subscribedProfileIndex := -1; + var RequestPrimitive v_updateRequest; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, with maxNumAEs = 2 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue2); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Update ServiceSubscribedUserProfile tp reduce maxNumAEs to 1, should be accepted as current numAEs do not exceed existing number of AEs. + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update to maxNumAEs accepted."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2004))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that IUT accepts the request when the values of ATTRIBUTE in request do not exceed the actual resources associated with the Service user. + * + */ + testcase TC_CSE_SSUP_006_MNC() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_006_MNC()); + v_ae1.done; + } + + function f_CSE_SSUP_006_MNC() runs on AeSimu system CseSystem { + + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue1; + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + var integer v_subscribedProfileIndex := -1; + var integer v_aeIndex := -1; + var RequestPrimitive v_updateRequest; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, maxNumContainers = 2 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue2); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Create one container + v_aeIndex := f_getLatestResourceIndex(vc_ae2); + vc_ae2.start(f_cse_createResource(int3, v_createRequestContainer, v_aeIndex)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Update ServiceSubscribedUserProfile and make maxNumContainers to 1, should be accepted as it is not higher than + // existing number of containers. + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update to maxNumContainers accepted."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2004))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that IUT accepts the request when the values of ATTRIBUTE in request do not exceed the actual resources associated with the Service user. + * + */ + testcase TC_CSE_SSUP_006_MNI() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_005_MNI()); + v_ae1.done; + } + + function f_CSE_SSUP_006_MNI() runs on AeSimu system CseSystem { + + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue1; + var integer v_subscribedProfileIndex := -1; + var integer v_aeIndex := -1; + var RequestPrimitive v_updateRequest; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, maxNumInstancesPerContainer = 2 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue2); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Create container + v_aeIndex := f_getLatestResourceIndex(vc_ae2); + + // Create 1 container instance + // Operations to generate charging info - AE2 stores total 100 bytes of data at 100 bytes at time + vc_ae2.start(f_cse_createContentAndInstances(100, 100, v_aeIndex)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Update ServiceSubscribedUserProfile and make maxNumInstancesPerContainer to 1, + // will be accepted as current number of container instances is 1. + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update to maxNumInstancesPerContainer accepted."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2004))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer during update operation."); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that IUT successfully accepts the request with the default access control policies when the accessControlPolicyIDs attribute of a resource serviceSubscribedUserProfile created by this M2M Service User is not configured. + * + */ + testcase TC_CSE_SSUP_007_CRE() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_007_CRE()); + v_ae1.done; + } + + function f_CSE_SSUP_007_CRE() runs on AeSimu system CseSystem { + + var integer v_aeIndex := -1; + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + var RequestPrimitive v_request; + + // Test component configuration + f_cf01Up(true); + + // Create subscription and subscriber without accessControlPolicyIDs attribute + vc_ae2.start(f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, p_allowedUsers := true)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // AE registration with same user ID and without accessControlPolicyIDs + v_aeIndex := f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID); + + // Crate a container resource and default accessControlPolicyIDs should apply + v_request := f_getCreateRequestPrimitive(int3, v_createRequestContainer, v_aeIndex); + f_send(e_mcaPort, m_request(v_request)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource created with using accessControlPolicyIDs."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2001))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer during update operation."); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that IUT successfully accepts the request with the default access control policies when the accessControlPolicyIDs attribute of a resource serviceSubscribedUserProfile created by this M2M Service User is not configured. + * + */ + testcase TC_CSE_SSUP_007_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_007_RET()); + v_ae1.done; + } + + function f_CSE_SSUP_007_RET() runs on AeSimu system CseSystem { + + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + var RequestPrimitive v_request; + + // Test component configuration + f_cf01Up(true); + + // Create subscription and subscriber without accessControlPolicyIDs attribute + vc_ae2.start(f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, p_allowedUsers := true)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // AE registration with same user ID and without accessControlPolicyIDs + v_aeIndex := f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID); + + // Create container resource without accessControlPolicyIDs + v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex, PX_M2M_USER_ID); + + f_send(e_mcaPort, m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Container resource retrived using default accessControlPolicyIDs."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2000))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer during update operation."); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that IUT successfully accepts the request with the default access control policies when the accessControlPolicyIDs attribute of a resource serviceSubscribedUserProfile created by this M2M Service User is not configured. + * + */ + testcase TC_CSE_SSUP_007_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_007_UPD()); + v_ae1.done; + } + + function f_CSE_SSUP_007_UPD() runs on AeSimu system CseSystem { + + var integer v_aeIndex := -1; + var integer v_containerIndex := -1; + var template RequestPrimitive v_createRequestContainer := m_createContainerBase; + var RequestPrimitive v_updateRequest; + var template RequestPrimitive v_updateRequestPrimitive := m_updateContainerBase; + + // Test component configuration + f_cf01Up(true); + + // Create subscription and subscriber without accessControlPolicyIDs attribute + vc_ae2.start(f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, p_allowedUsers := true)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // AE registration with same user ID and without accessControlPolicyIDs + v_aeIndex := f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID); + + // Create container resource without accessControlPolicyIDs + v_containerIndex := f_cse_createResource(int3, v_createRequestContainer, v_aeIndex, PX_M2M_USER_ID); + + // update container resource + v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, 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 default accessControlPolicyIDs."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2004))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer during update operation."); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } + + /** + * @desc Check that the IUT successfully performs OPERATION on resource <serviceSubscribedUserProfile> for authorized M2M service user. + * + */ + testcase TC_CSE_SSUP_008_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_008_RET()); + v_ae1.done; + } + + function f_CSE_SSUP_008_RET() runs on AeSimu system CseSystem { + + var integer v_subscribedProfileIndex := -1; + var RequestPrimitive v_updateRequest; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, with maxNumAEs = 2 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue2); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // from super AE + f_send(e_mcaPort, m_request(m_retrieve(f_getResourceAddress(v_subscribedProfileIndex), f_getOriginator(-1)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile successfully retrived."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2000))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while retrieving serviceSubscribedUserProfile with status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // f_CSE_SSUP_008_RET + + /** + * @desc Check that the IUT successfully performs OPERATION on resource <serviceSubscribedUserProfile> for authorized M2M service user. + * + */ + testcase TC_CSE_SSUP_008_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_008_UPD()); + v_ae1.done; + } + + function f_CSE_SSUP_008_UPD() runs on AeSimu system CseSystem { + + var integer v_subscribedProfileIndex := -1; + var RequestPrimitive v_updateRequest; + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue1; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, with maxNumAEs = 2 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue2); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Update ServiceSubscribedUserProfile tp reduce maxNumAEs to 1, should be accepted as current numAEs do not exceed existing number of AEs. + v_updateRequest := f_getUpdateRequestPrimitive(int52, v_subscribedProfileIndex, v_updateRequestPrimitive); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2004))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update to maxNumAEs accepted."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2004))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // f_CSE_SSUP_008_UPD + + /** + * @desc Check that the IUT successfully performs OPERATION on resource <serviceSubscribedUserProfile> for authorized M2M service user. + * + */ + testcase TC_CSE_SSUP_008_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_008_UPD()); + v_ae1.done; + } + + function f_CSE_SSUP_008_DEL() runs on AeSimu system CseSystem { + + var integer v_subscribedProfileIndex := -1; + var RequestPrimitive v_updateRequest; + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue2; + + // Test component configuration + f_cf01Up(true); + + // AE1 - SuperAE, Create subscription, with maxNumAEs = 2 + v_subscribedProfileIndex := f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, + true, + m_createM2mServiceSubscriptionProfileMaxValue2, + m_createServiceSubscribedUserProfileMaxValue2); + + // register one AE + vc_ae2.start(f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + // Delete ServiceSubscribedUserProfile + f_send(e_mcaPort, m_request(m_delete(f_getResourceAddress(v_subscribedProfileIndex), f_getOriginator(v_subscribedProfileIndex)))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2002))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile successfully deleted."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int2002))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting serviceSubscribedUserProfile with status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // f_CSE_SSUP_008_DEL + + /** + * @desc Check that the IUT successfully performs OPERATION on resource <serviceSubscribedUserProfile> for authorized M2M service user. + * + */ + testcase TC_CSE_SSUP_009_RET() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_008_RET()); + v_ae1.done; + } + + function f_CSE_SSUP_009_RET() runs on AeSimu system CseSystem { + + var RequestPrimitive v_updateRequest; + var XSD.AnyURI v_subscribedProfileAddress; + var integer v_aeIndex; + + // Test component configuration + f_cf01Up(true); + + // Create subscription and subscriber from a superAE + vc_ae2.start(f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, p_allowedUsers := true)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_subscribedProfileAddress := f_getLatestResourceAddress(vc_ae2); + + // register one AE + v_aeIndex := f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID); + + // Retrieve from a user AE1 will be rejected as it is not a super AE. + f_send(e_mcaPort, m_request(m_retrieveUserId(v_subscribedProfileAddress, f_getOriginator(v_aeIndex), PX_M2M_USER_ID))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Retrieve serviceSubscribedUserProfile rejected."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4000))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code" & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // f_CSE_SSUP_009_RET + + /** + * @desc Check that the IUT successfully performs OPERATION on resource <serviceSubscribedUserProfile> for authorized M2M service user. + * + */ + testcase TC_CSE_SSUP_009_UPD() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_009_UPD()); + v_ae1.done; + } + + function f_CSE_SSUP_009_UPD() runs on AeSimu system CseSystem { + + var RequestPrimitive v_updateRequest; + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue1; + var XSD.AnyURI v_subscribedProfileAddress; + var integer v_aeIndex; + + // Test component configuration + f_cf01Up(true); + + // Create subscription and subscriber from a superAE + vc_ae2.start(f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, p_allowedUsers := true)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_subscribedProfileAddress := f_getLatestResourceAddress(vc_ae2); + + // register one AE + v_aeIndex := f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID); + + // Retrieve from a user AE1 will be rejected as it is not a super AE. + f_send(e_mcaPort, m_request(m_retrieveUserId(v_subscribedProfileAddress, f_getOriginator(v_aeIndex), PX_M2M_USER_ID))); + + // Update subscription from user AE1 will be rejected as it is not a super AE. + v_updateRequestPrimitive.to_ := v_subscribedProfileAddress; + v_updateRequest := f_getUpdateRequestPrimitive(int52, -1, v_updateRequestPrimitive, PX_M2M_USER_ID); + f_send(e_mcaPort, m_request(v_updateRequest)); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Update to maxNumAEs accepted."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4000))) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Unexpected status code."); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // f_CSE_SSUP_009_UPD + + /** + * @desc Check that the IUT successfully performs OPERATION on resource <serviceSubscribedUserProfile> for authorized M2M service user. + * + */ + testcase TC_CSE_SSUP_009_DEL() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SSUP_008_UPD()); + v_ae1.done; + } + + function f_CSE_SSUP_009_DEL() runs on AeSimu system CseSystem { + + var RequestPrimitive v_updateRequest; + var template RequestPrimitive v_updateRequestPrimitive := m_updateServiceSubscribedUserProfileMaxValue2; + var XSD.AnyURI v_subscribedProfileAddress; + var integer v_aeIndex; + + // Test component configuration + f_cf01Up(true); + + // Create subscription and subscriber from a superAE + vc_ae2.start(f_cse_preamble_createServiceSubscribedProfile(PX_ALLOWED_C_AE_IDS, p_allowedUsers := true)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + v_subscribedProfileAddress := f_getLatestResourceAddress(vc_ae2); + + // register AE + v_aeIndex := f_cse_createResource(int2, m_createAe(vc_aeSimuDesc.appId, omit, PX_ALLOWED_C_AE_IDS[0]), -1, PX_M2M_USER_ID); + + // Delete ServiceSubscribedUserProfile from AE + f_send(e_mcaPort, m_request(m_deleteUserId(v_subscribedProfileAddress, f_getOriginator(v_aeIndex), PX_M2M_USER_ID))); + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": serviceSubscribedUserProfile successfully deleted."); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveInverse(int4000))) -> value vc_response{ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while deleting serviceSubscribedUserProfile with status code " & int2str(enum2int(vc_response.primitive.responsePrimitive.responseStatusCode))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while deleting resource"); + } + } + + f_checkAeSimuStatus(); + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + } // f_CSE_SSUP_009_DEL + } // Basic_Operation + } // Service_Subscription_User_Profile + }//end group CSE + +}