diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 3d0972ae1c58881fb1e83a861644417a34e8c92e..ac14925ade42509fe64381d540ab777285166896 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -922,7 +922,7 @@ module OneM2M_Functions { */ function f_cse_retrieveResource(integer p_resourceIndex) runs on AeSimu return PrimitiveContent{ - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value vc_response { @@ -994,7 +994,7 @@ module OneM2M_Functions { function f_isResourcePresent (integer p_resourceIndex) runs on AeSimu return boolean { //Check to see if the resource is present or not - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { @@ -1023,7 +1023,7 @@ module OneM2M_Functions { function f_isResourcePresentCseSimu (integer p_resourceIndex) runs on CseSimu return boolean { //Check to see if the resource is present or not - mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) { @@ -1055,7 +1055,7 @@ module OneM2M_Functions { log(testcasename() & ":INFO: Hierarchical addressing method is required to check the non presence of the resource"); //Check to see if the resource has NOT been created - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(p_parentIndex, e_hierarchical) & "/" & p_resourceName, f_getOriginator(p_parentIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) { @@ -1335,11 +1335,11 @@ module OneM2M_Functions { tc_ac.start; alt { - [] mcaPortIn.receive(mw_request(mw_notify(v_notificationRequest))) -> value vc_request { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(v_notificationRequest))) -> value vc_request { tc_ac.stop; setverdict(pass, __SCOPE__ & ":INFO: Notification received"); } - [] mcaPortIn.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value vc_request { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { tc_ac.stop; setverdict(fail, __SCOPE__ & ":ERROR: Notification received but verificationRequest isn't set to TRUE"); } @@ -1377,7 +1377,7 @@ module OneM2M_Functions { tc_ac.start; alt { - [] mcaPortIn.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value vc_request { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { tc_ac.stop; if(f_check_notificationContent(vc_request.primitive.requestPrimitive, p_primitiveContent)){ setverdict(pass, __SCOPE__ & ":INFO: Notification received"); @@ -1413,7 +1413,7 @@ module OneM2M_Functions { tc_ac.start; alt { - [] mcaPortIn.receive(mw_request(mw_aggregatedNotifyBase)) -> value vc_request { + [] mcaPortIn.receive(mw_request(mw_notifyAggregatedNotification)) -> value vc_request { tc_ac.stop; if(p_numberOfAggregatedNotification == lengthof(vc_request.primitive.requestPrimitive.primitiveContent.aggregatedNotification.notification_list)){ if(f_check_notificationContent(vc_response.primitive.requestPrimitive, p_primitiveContent)){ @@ -1431,7 +1431,7 @@ module OneM2M_Functions { v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; mcaPortIn.send(m_response(v_responsePrimitive)); } - [] mcaPortIn.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value vc_request { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { tc_ac.stop; if(f_check_notificationContent(vc_request.primitive.requestPrimitive, p_primitiveContent)){ setverdict(pass, __SCOPE__ & ":INFO: Notification received"); @@ -1469,7 +1469,7 @@ module OneM2M_Functions { var ResponsePrimitive v_responsePrimitive; tc_ac.start; alt { - [] mcaPortIn.receive(mw_request(mw_notify(p_notification))) -> value vc_request { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(p_notification))) -> value vc_request { tc_ac.stop; v_responsePrimitive := valueof(m_responseNotification(int2001, omit)); v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; @@ -1498,7 +1498,7 @@ module OneM2M_Functions { tc_ac.start(10.0); alt { - [] mcaPortIn.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value vc_request { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Error, Non expected notification received"); } @@ -1582,7 +1582,7 @@ module OneM2M_Functions { tc_ac.start; alt { - [] mccPortIn.receive(mw_request(mw_notify(v_notificationRequest))) -> value vc_request { + [] mccPortIn.receive(mw_request(mw_notifyNotification(v_notificationRequest))) -> value vc_request { tc_ac.stop; setverdict(pass, __SCOPE__ & ":INFO: Notification received"); } @@ -1617,7 +1617,7 @@ module OneM2M_Functions { function f_cse_isResourcePresent (integer p_resourceIndex) runs on CseSimu return boolean { //Check to see if the resource is present or not - mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000))) { @@ -1850,7 +1850,7 @@ module OneM2M_Functions { var MsgIn v_request; var ResponsePrimitive v_responsePrimitive; - [] mcaPortIn.receive(mw_request(mw_notify(mw_contentNotification(?)))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value v_request { //Send response v_responsePrimitive := valueof(m_responseNotification(int2001, omit)); v_responsePrimitive.requestIdentifier := v_request.primitive.requestPrimitive.requestIdentifier; @@ -2195,6 +2195,12 @@ module OneM2M_Functions { if(match(valueof(p_request.primitiveContent.subscription.notificationURI), v_defaultListOfURIs )){ p_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(p_parentIndex)}; } + //subscriberURI + if(ispresent(p_request.primitiveContent.subscription.subscriberURI)) { + if(match(valueof(p_request.primitiveContent.subscription.subscriberURI), "NotInitialized" )){ + p_request.primitiveContent.subscription.subscriberURI := f_getResourceAddress(vc_aeAuxIndex); + } + } //creator attribute if(ispresent(p_request.primitiveContent.subscription.creator)) { p_request.primitiveContent.subscription.creator := f_getCreator(p_parentIndex); @@ -2498,7 +2504,7 @@ module OneM2M_Functions { * @param p_announcementTargetResource Announcement Target Resource * @return p_annoucementTargetPoA Announcemenet Target PoA */ - function f_getAnnouncementTargetPoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "CseBaseTester" ) return charstring { + function f_getAnnouncementTargetPoA(in charstring p_protocolBinding := PX_PROTOCOL_BINDING, in charstring p_announcementTargetAddress := PX_CSE1_ADDRESS, charstring p_announcementTargetResource := "" ) return charstring { if(p_protocolBinding == "HTTP") { return "http://" & p_announcementTargetAddress & "/" & p_announcementTargetResource; @@ -3379,6 +3385,41 @@ module OneM2M_Functions { } + /** + * @desc Retrieve Year from a given timestamp + * @param p_timestamp Given timestamp + * @return Year + */ + function f_getYear(charstring p_timestamp) runs on Tester return charstring { + + var charstring v_year; + var integer i; + + for(i := 0; i < 3; i := i+1){ + v_year := v_year & p_timestamp[i]; + } + return v_year; + + } // end f_getYear + + /** + * @desc Retrieve IP address from a given address which includes port information separated by : + * @param p_addressPort Given address + * @return IPv4 Address + */ + function f_getIpv4Address(charstring p_addressPort) runs on Tester return charstring { + + var charstring v_ipv4Address; + var integer i:= 0; + + while ((i < lengthof(p_addressPort)-1) and (p_addressPort[i] != ":")){ + v_ipv4Address := v_ipv4Address & p_addressPort[i]; + i := i + 1; + } + return v_ipv4Address; + + } // end f_getIpv4Address + }//end of commonFunctions group externalFunctions { diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 343a655f3500273afad22ffabe48088d79de55ab..fd41db868e3eaf0676bfc39a62035d42d65b1f54 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -99,11 +99,11 @@ module OneM2M_Templates { * @param p_targetResourceAddress Target resource address * @param p_originator Originator (from) */ - template (value) RequestPrimitive m_retrieveResource(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := { + template (value) RequestPrimitive m_retrieve(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := { operation := int2, to_ := p_targetResourceAddress, from_ := p_originator, - requestIdentifier := "m_retrieveResource" & f_rnd(1, 1000000), + requestIdentifier := "m_retrieve" & f_rnd(1, 1000000), resourceType := omit, primitiveContent := omit, role := omit, @@ -125,7 +125,7 @@ module OneM2M_Templates { * @desc Base Receive RETRIEVE request primitive * @param p_targetResourceAddress Target resource address */ - template RequestPrimitive mw_retrieveResource(XSD.ID p_targetResourceAddress) := { + template RequestPrimitive mw_retrieve(XSD.ID p_targetResourceAddress) := { operation := int2, to_ := p_targetResourceAddress, from_ := ?, @@ -152,7 +152,7 @@ module OneM2M_Templates { * @param p_targetResourceAddress Target resource address (including "#AttributeName") * @param p_originator Originator (from) */ - template (value) RequestPrimitive m_retrieveResourceAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := { + template (value) RequestPrimitive m_retrieveAttributeToOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) := { operation := int2, to_ := p_targetResourceAddress, from_ := p_originator, @@ -180,7 +180,7 @@ module OneM2M_Templates { * @param p_attributeList Target attribute list * @param p_originator Originator (from) */ - template (value) RequestPrimitive m_retrieveResourceAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := { + template (value) RequestPrimitive m_retrieveAttributeContentOption(XSD.ID p_targetResourceAddress, in template (value) AttributeList_1 p_attributeList, in XSD.ID p_originator) := { operation := int2, to_ := p_targetResourceAddress, from_ := p_originator, @@ -208,7 +208,7 @@ module OneM2M_Templates { * @param p_filterCriteria FilterCriteria * @param p_originator Originator (from) */ - template (value) RequestPrimitive m_retrieveResourceFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieveResource := { + template (value) RequestPrimitive m_retrieveFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := { requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000), filterCriteria := { createdBefore := omit, @@ -237,7 +237,7 @@ module OneM2M_Templates { * @param p_filterUsage FilterUsage * @param p_labels Labels */ - template (value) RequestPrimitive m_retrieveResourceFilterUsageOptionLabel(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage, in Labels p_labels) modifies m_retrieveResource := { + template (value) RequestPrimitive m_retrieveFilterUsageOptionLabel(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) FilterUsage p_filterUsage, in Labels p_labels) modifies m_retrieve := { requestIdentifier := "m_retrieveResourceFilterUsageOptionLabel" & f_rnd(1, 1000000), filterCriteria := { createdBefore := omit, @@ -265,7 +265,7 @@ module OneM2M_Templates { * @param p_filterCriteria FilterCriteria * @param p_originator Originator (from) */ - template (value) RequestPrimitive m_retrieveResourceDiscResTypeFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) DiscResType p_discResType, in template (value) FilterUsage p_filterUsage) modifies m_retrieveResource := { + template (value) RequestPrimitive m_retrieveDiscResTypeFilterUsageOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator, in template (value) DiscResType p_discResType, in template (value) FilterUsage p_filterUsage) modifies m_retrieve := { requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000), filterCriteria := { createdBefore := omit, @@ -294,7 +294,7 @@ module OneM2M_Templates { * @param p_filterCriteria FilterCriteria * @param p_originator Originator (from) */ - template (value) RequestPrimitive m_retrieveResourceInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieveResource := { + template (value) RequestPrimitive m_retrieveInvalidFormatOption(XSD.ID p_targetResourceAddress, in XSD.ID p_originator) modifies m_retrieve := { requestIdentifier := "m_retrieveResourceFilterUsageOption" & f_rnd(1, 1000000), filterCriteria := { createdBefore := omit, @@ -362,7 +362,7 @@ module OneM2M_Templates { deliveryAggregation := *, groupRequestIdentifier := *, filterCriteria := *, - discoveryResultType := * + discoveryResultType := omit }; /** @@ -533,8 +533,8 @@ module OneM2M_Templates { eventCategory := *, deliveryAggregation := *, groupRequestIdentifier := *, - filterCriteria := *, - discoveryResultType := * + filterCriteria := omit, + discoveryResultType := omit } @@ -1040,7 +1040,7 @@ module OneM2M_Templates { operation := int4, to_ := p_resourceAddress, from_ := p_originator, - requestIdentifier := testcasename() & "-m_deleteResource" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_delete" & f_rnd(1, 1000000), resourceType := omit, primitiveContent := omit, role := omit, @@ -1058,13 +1058,13 @@ module OneM2M_Templates { discoveryResultType := omit }; - template RequestPrimitive mw_deleteRequest(template XSD.ID p_resourceAddress := ?, template XSD.ID p_from := *) := { + template RequestPrimitive mw_delete(template XSD.ID p_resourceAddress := ?, template XSD.ID p_from := *) := { operation := int4, to_ := p_resourceAddress, from_ := p_from, requestIdentifier := ?, - resourceType := *, - primitiveContent := *, + resourceType := omit, + primitiveContent := omit, role := *, originatingTimestamp := *, requestExpirationTimestamp := *, @@ -1077,7 +1077,7 @@ module OneM2M_Templates { deliveryAggregation := *, groupRequestIdentifier := *, filterCriteria := *, - discoveryResultType := * + discoveryResultType := omit }; }//end group Delete @@ -1087,11 +1087,11 @@ module OneM2M_Templates { /** * @desc Base NOTIFY request primitive */ - template RequestPrimitive m_notifyRequest := { + template RequestPrimitive m_notify := { operation := int5, to_ := "NotInitialized", from_ := omit, - requestIdentifier := testcasename() & "-m_notifyRequest" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_notify" & f_rnd(1, 1000000), resourceType := omit, primitiveContent := {notification := m_contentCreateNotification_allOmit}, role := omit, @@ -1112,11 +1112,11 @@ module OneM2M_Templates { /** * @desc Base NOTIFY Aggregated request primitive */ - template RequestPrimitive m_notifyAggregatedRequest := { + template RequestPrimitive m_notifyAggregatedNotification := { operation := int5, to_ := "NotInitialized", from_ := omit, - requestIdentifier := testcasename() & "-m_notifyAggregatedRequest" & f_rnd(1, 1000000), + requestIdentifier := testcasename() & "-m_notifyAggregatedNotification" & f_rnd(1, 1000000), resourceType := omit, primitiveContent := {aggregatedNotification := {notification_list := {m_contentCreateNotification_allOmit,m_contentCreateNotification_allOmit}}}, role := omit, @@ -1137,12 +1137,12 @@ module OneM2M_Templates { /** * @desc Base NOTIFY request primitive */ - template RequestPrimitive mw_notifyBase := { + template RequestPrimitive mw_notify := { operation := int5, to_ := ?, from_ := *, requestIdentifier := ?, - resourceType := *, + resourceType := omit, primitiveContent := {notification := mw_contentNotificationBase}, role := *, originatingTimestamp := *, @@ -1150,45 +1150,27 @@ module OneM2M_Templates { resultExpirationTimestamp := *, operationExecutionTime := *, responseType := *, - resultPersistence := *, - resultContent := *, + resultPersistence := omit, + resultContent := omit, eventCategory := *, deliveryAggregation := *, groupRequestIdentifier := *, - filterCriteria := *, - discoveryResultType := * + filterCriteria := omit, + discoveryResultType := omit }; /** * @desc Base NOTIFY request primitive */ - template RequestPrimitive mw_aggregatedNotifyBase := { - operation := int5, - to_ := ?, - from_ := *, - requestIdentifier := ?, - resourceType := *, - primitiveContent := { aggregatedNotification := ?}, - role := *, - originatingTimestamp := *, - requestExpirationTimestamp := *, - resultExpirationTimestamp := *, - operationExecutionTime := *, - responseType := *, - resultPersistence := *, - resultContent := *, - eventCategory := *, - deliveryAggregation := *, - groupRequestIdentifier := *, - filterCriteria := *, - discoveryResultType := * + template RequestPrimitive mw_notifyAggregatedNotification (in template (present) AggregatedNotification p_aggregatedNotification := ?) modifies mw_notify := { + primitiveContent := { aggregatedNotification := p_aggregatedNotification} }; /** * @desc Base NOTIFY request primitive */ - template RequestPrimitive mw_notify(in template (present) Notification p_notification) modifies mw_notifyBase := { + template RequestPrimitive mw_notifyNotification(in template (present) Notification p_notification) modifies mw_notify := { primitiveContent := {notification := p_notification} }; @@ -1940,7 +1922,7 @@ module OneM2M_Templates { expirationTime := omit, //O announceTo := omit, //O announcedAttribute := omit, //O - locationSource := omit, //M + locationSource := int1, //M locationUpdatePeriod := omit, //O locationTargetID := omit, //O locationServer := omit,//O diff --git a/LibOneM2M/OneM2M_Types.ttcn b/LibOneM2M/OneM2M_Types.ttcn index 2958e489c470d8bae50559f3b320ad28c77866a7..4c39958581b99ed7513fce6887caa21567c519b8 100644 --- a/LibOneM2M/OneM2M_Types.ttcn +++ b/LibOneM2M/OneM2M_Types.ttcn @@ -95,13 +95,13 @@ module OneM2M_Types { ListOfURIs accessControlOriginators, AccessControlOperations accessControlOperations, record of record { - record of ScheduleEntry accessControlWindow_list, + record of ScheduleEntry accessControlWindow_list optional,//TODO It must be optional record { record length(1 .. infinity) of Ipv4 ipv4Addresses optional,//TODO It must be optional, record length(1 .. infinity) of Ipv6 ipv6Addresses optional//TODO It must be optional } accessControlIpAddresses optional, LocationRegion accessControlLocationRegion optional - } accessControlContexts_list + } accessControlContexts_list optional //TODO It must be optional } with { variant "name as uncapitalized"; diff --git a/OneM2M_Testcases_AE.ttcn b/OneM2M_Testcases_AE.ttcn index 354922c47c22d93df073b729594a999c32458753..bd68deb617d9810124025e19860707297d422af9 100644 --- a/OneM2M_Testcases_AE.ttcn +++ b/OneM2M_Testcases_AE.ttcn @@ -450,7 +450,7 @@ module OneM2M_Testcases_AE { tc_ac.start; alt { - [] mcaPortIn.receive(mw_request(mw_retrieveResource(v_utRequest.to_))) { + [] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.to_))) { tc_ac.stop; setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly"); @@ -538,7 +538,7 @@ module OneM2M_Testcases_AE { tc_ac.start; alt { - [] mcaPortIn.receive(mw_request(mw_retrieveResource(v_utRequest.to_))) { + [] mcaPortIn.receive(mw_request(mw_retrieve(v_utRequest.to_))) { tc_ac.stop; setverdict(pass, __SCOPE__, " : Container retrieve request received successfuly"); @@ -630,7 +630,7 @@ module OneM2M_Testcases_AE { tc_ac.start; alt { - [] mcaPortIn.receive(mw_request(mw_deleteRequest(v_utRequest.to_))) { + [] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.to_))) { tc_ac.stop; setverdict(pass, __SCOPE__, " : Container update request received successfuly"); @@ -718,7 +718,7 @@ module OneM2M_Testcases_AE { tc_ac.start; alt { - [] mcaPortIn.receive(mw_request(mw_deleteRequest(v_utRequest.to_))) { + [] mcaPortIn.receive(mw_request(mw_delete(v_utRequest.to_))) { tc_ac.stop; setverdict(pass, __SCOPE__, " : Container update request received successfuly"); @@ -957,7 +957,7 @@ module OneM2M_Testcases_AE { var charstring v_action := __SCOPE__ & ": Please, send a valid AE DELETE Registration Request"; //primitives for utPort - var template UtTriggerPrimitive v_utRequest := mw_deleteRequest; + var template UtTriggerPrimitive v_utRequest := mw_delete; f_cf03Up(); @@ -966,7 +966,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_deleteRequest)) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_delete)) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : AE deregistration request is accepted!"); @@ -1635,7 +1635,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_retrieveResource(p_address))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_retrieve(p_address))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : retrieve resource type request is accepted!!"); @@ -1685,7 +1685,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_retrieveResource(v_address & "/" & c_resourceShortNameOldest))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_retrieve(v_address & "/" & c_resourceShortNameOldest))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : retrieve attribute oldest request is accepted!"); @@ -1733,7 +1733,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_retrieveResource(v_address & "/" & c_resourceShortNameLatest))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_retrieve(v_address & "/" & c_resourceShortNameLatest))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : retrieve attribute latest request is accepted!!"); @@ -1782,7 +1782,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_retrieveResource(v_address))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_retrieve(v_address))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : retrieve resource type request is accepted!!"); @@ -1831,7 +1831,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_retrieveResource(v_address))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_retrieve(v_address))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : retrieve resource type request is accepted!!"); @@ -1883,7 +1883,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_deleteRequest(v_address & "/" & c_resourceShortNameOldest))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_delete(v_address & "/" & c_resourceShortNameOldest))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : delete attribute oldest request is accepted!!"); @@ -1931,7 +1931,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_deleteRequest(v_address & "/" & c_resourceShortNameLatest))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_delete(v_address & "/" & c_resourceShortNameLatest))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : delete attribute latest request is accepted!!"); @@ -1980,7 +1980,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_deleteRequest(v_address))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_delete(v_address))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : delete resource type request is accepted!!"); @@ -2029,7 +2029,7 @@ module OneM2M_Testcases_AE { //Test behavior tc_ac.start; alt{ - [] mcaPortIn.receive(mw_request(mw_deleteRequest(v_address))) -> value v_request { + [] mcaPortIn.receive(mw_request(mw_delete(v_address))) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__, " : delete resource type request is accepted!!"); @@ -2346,7 +2346,7 @@ module OneM2M_Testcases_AE { //Test behavior - mcaPortIn.send(m_request(m_notifyRequest)); + mcaPortIn.send(m_request(m_notify)); tc_ac.start; alt{ @@ -2437,7 +2437,7 @@ module OneM2M_Testcases_AE { //Test behavior - mcaPortIn.send(m_request(m_notifyAggregatedRequest)); + mcaPortIn.send(m_request(m_notifyAggregatedNotification)); tc_ac.start; alt{ diff --git a/OneM2M_Testcases_CSE.ttcn b/OneM2M_Testcases_CSE.ttcn index 0b0f7af5dbcd965624a85f5c250056bcdb9c7f49..84806f8ba5c9f1ed6326afbf6325d3bc68785871 100644 --- a/OneM2M_Testcases_CSE.ttcn +++ b/OneM2M_Testcases_CSE.ttcn @@ -337,7 +337,7 @@ module OneM2M_Testcases_CSE { v_addressingMethod := e_nonHierarchical; v_primitiveScope := p_primitiveScope; - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { @@ -429,7 +429,7 @@ module OneM2M_Testcases_CSE { v_addressingMethod := e_hierarchical; v_primitiveScope := p_primitiveScope; - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));tc_ac.start; + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex, v_addressingMethod, v_primitiveScope), f_getOriginator(v_resourceIndex))));tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) { tc_ac.stop; @@ -2536,7 +2536,7 @@ module OneM2M_Testcases_CSE { // Test Body v_contentResponse.cSEBase := mw_contentCSEBase_rc1; - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { @@ -2614,7 +2614,7 @@ module OneM2M_Testcases_CSE { // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex)))); tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { @@ -2671,7 +2671,7 @@ module OneM2M_Testcases_CSE { // Test Body v_contentResponse.aE := mw_contentAeBase; - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { @@ -2802,7 +2802,7 @@ module OneM2M_Testcases_CSE { // Preamble v_aeIndex := f_cse_createResource(int2, p_createRequestPrimitive, -1); - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { @@ -2864,7 +2864,7 @@ module OneM2M_Testcases_CSE { v_contentResponse.cSEBase := mw_contentCSEBase_rc1; v_contentResponse.cSEBase.cseType := int1; - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { @@ -2922,7 +2922,7 @@ module OneM2M_Testcases_CSE { v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; - mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { @@ -2951,7 +2951,7 @@ module OneM2M_Testcases_CSE { v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; - mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { @@ -3067,7 +3067,7 @@ module OneM2M_Testcases_CSE { // Preamble if(PICS_IN_CSE){ vc_remoteCseIndex := f_cse_registerRemoteCse(p_createRequestPrimitive); - mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { @@ -3092,7 +3092,7 @@ module OneM2M_Testcases_CSE { } } else if (PICS_MN_CSE){ vc_remoteCseIndex := f_cse_registrationRemoteCse(p_createRequestPrimitive); - mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, p_contentResponse))) -> value v_response { @@ -3150,7 +3150,7 @@ module OneM2M_Testcases_CSE { // Test Body v_contentResponse.cSEBase := mw_contentCSEBase_rc1; - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(v_aeIndex))));//TODO Maybe PX_SUPER_AE_ID tc_ac.start; alt { @@ -3230,7 +3230,7 @@ module OneM2M_Testcases_CSE { tc_ac.start; alt { - [] mccPortIn.receive(mw_request(mw_retrieveResource(f_getResourceAddress()))) -> value v_response { + [] mccPortIn.receive(mw_request(mw_retrieve(f_getResourceAddress()))) -> value v_response { tc_ac.stop; setverdict(pass, __SCOPE__ & ": Retrieve Request received successfully"); } @@ -3274,7 +3274,7 @@ module OneM2M_Testcases_CSE { v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; - mccPort.send(m_request(m_retrieveResource(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); + mccPort.send(m_request(m_retrieve(f_getResourceAddress(), f_getOriginator(vc_remoteCseIndex)))); tc_ac.start; alt { [] mccPort.receive(mw_response(mw_responsePrimitive(int2000, v_contentResponse))) -> value v_response { @@ -3796,7 +3796,7 @@ module OneM2M_Testcases_CSE { // Test Body tc_ac.start; alt { - [] mccPortIn.receive(mw_request(mw_deleteRequest( f_getResourceAddress(vc_remoteCseIndex), PX_CSE_ID))) { + [] mccPortIn.receive(mw_request(mw_delete( f_getResourceAddress(vc_remoteCseIndex), PX_CSE_ID))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": <remoteCSE> delete request has been received"); } @@ -5391,7 +5391,7 @@ module OneM2M_Testcases_CSE { v_contentInstanceIndex := f_cse_createResource(int4, m_createContentInstanceBase, v_containerIndex); // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); v_contentResponse.container := mw_contentContainerBase; @@ -5974,7 +5974,7 @@ module OneM2M_Testcases_CSE { var template RequestPrimitive v_createRequest := m_createSubscriptionBase; const AttributeList c_optionalAttribute := {"subscriberURI"}; - v_createRequest.primitiveContent.subscription.subscriberURI := "MySubscriberURI"; + v_createRequest.primitiveContent.subscription.subscriberURI := "NotInitialized"; v_ae1.start(f_CSE_DMR_CRE_012(int23, v_createRequest, c_optionalAttribute)); v_ae1.done; @@ -6194,7 +6194,7 @@ module OneM2M_Testcases_CSE { } //Check currentByteSize - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); tc_ac.start; alt { @@ -7135,7 +7135,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_parentIndex); // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { @@ -7207,7 +7207,7 @@ module OneM2M_Testcases_CSE { v_targetResourceAddress := f_getResourceAddress(v_aeIndex) & "/" & v_resourceName; } - mcaPort.send(m_request(m_retrieveResource(v_targetResourceAddress, f_getOriginator(v_aeIndex)))); + mcaPort.send(m_request(m_retrieve(v_targetResourceAddress, f_getOriginator(v_aeIndex)))); tc_ac.start; alt { @@ -7327,7 +7327,7 @@ module OneM2M_Testcases_CSE { f_cse_updateAcpAuxResource(int61); //c_CUDNDi // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { @@ -7460,7 +7460,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_resourceIndex)))); + mcaPort.send(m_request(m_retrieveAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { @@ -7597,7 +7597,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_resourceIndex)))); + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { @@ -7740,7 +7740,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi", "ct"}, f_getOriginator(v_resourceIndex)))); tc_ac.start; @@ -7854,7 +7854,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), {"lbl"}, f_getOriginator(v_resourceIndex)))); tc_ac.start; @@ -7963,7 +7963,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), {"lbl", "at"}, f_getOriginator(v_resourceIndex)))); tc_ac.start; @@ -8018,7 +8018,7 @@ module OneM2M_Testcases_CSE { v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))); tc_ac.start; alt { @@ -8083,7 +8083,7 @@ module OneM2M_Testcases_CSE { v_contentResponse.contentInstance.resourceName := vc_resourcesList[v_contentInstanceIndex1].resource.contentInstance.resourceName; // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))); tc_ac.start; alt { @@ -8142,7 +8142,7 @@ module OneM2M_Testcases_CSE { v_containerIndex := f_cse_createResource(int3, m_createContainerBase, v_aeIndex); // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameOldest, f_getOriginator(v_containerIndex)))); tc_ac.start; alt { @@ -8210,7 +8210,7 @@ module OneM2M_Testcases_CSE { // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex) & "/" & c_resourceShortNameLatest, f_getOriginator(v_containerIndex)))); tc_ac.start; alt { @@ -8385,7 +8385,7 @@ module OneM2M_Testcases_CSE { } // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { @@ -8536,7 +8536,7 @@ module OneM2M_Testcases_CSE { } // Test Body - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { @@ -8703,7 +8703,7 @@ module OneM2M_Testcases_CSE { } // Test Body - mcaPort.send(m_request(m_retrieveResourceAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_aeIndex))));//from AE ID + mcaPort.send(m_request(m_retrieveAttributeToOption(f_getResourceAddress(v_resourceIndex) & v_attribute, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { @@ -8877,7 +8877,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_getRemoteCseResource(vc_cse1); } - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_aeIndex))));//from AE ID + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi"}, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; alt { @@ -9136,7 +9136,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_getRemoteCseResource(vc_cse1); } - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex) , + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex) , {"pi", "ct"}, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; @@ -9283,7 +9283,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_getRemoteCseResource(vc_cse1); } - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), {"lbl"}, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; @@ -9426,7 +9426,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_getRemoteCseResource(vc_cse1); } - mcaPort.send(m_request(m_retrieveResourceAttributeContentOption(f_getResourceAddress(v_resourceIndex), + mcaPort.send(m_request(m_retrieveAttributeContentOption(f_getResourceAddress(v_resourceIndex), {"lbl", "at"}, f_getOriginator(v_aeIndex))));//from AE ID tc_ac.start; @@ -9510,7 +9510,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(p_resourceType, p_requestPrimitive, v_aeIndex); // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := p_resultContent; mcaPort.send(m_request(v_request)); tc_ac.start; @@ -9649,7 +9649,7 @@ module OneM2M_Testcases_CSE { } // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int1;//Attributes mcaPort.send(m_request(v_request)); tc_ac.start; @@ -9793,7 +9793,7 @@ module OneM2M_Testcases_CSE { } // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int4;//Attributes and child resources mcaPort.send(m_request(v_request)); tc_ac.start; @@ -9937,7 +9937,7 @@ module OneM2M_Testcases_CSE { } // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int5;//attributes and child resource references mcaPort.send(m_request(v_request)); tc_ac.start; @@ -10080,7 +10080,7 @@ module OneM2M_Testcases_CSE { } // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int6;//Child resource references mcaPort.send(m_request(v_request)); tc_ac.start; @@ -10223,7 +10223,7 @@ module OneM2M_Testcases_CSE { } // Test Body - v_request := valueof(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); + v_request := valueof(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex))); v_request.resultContent := int6;//Child resource references mcaPort.send(m_request(v_request)); tc_ac.start; @@ -12431,7 +12431,7 @@ module OneM2M_Testcases_CSE { v_updateRequest := f_getUpdateRequestPrimitive(int3, v_containerIndex, v_updateRequest); f_cse_updateResource(v_updateRequest); - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_containerIndex), f_getOriginator(v_containerIndex)))); tc_ac.start; alt { @@ -15903,7 +15903,7 @@ module OneM2M_Testcases_CSE { - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { @@ -16060,7 +16060,7 @@ module OneM2M_Testcases_CSE { f_checkAeSimuStatus(); - mcaPort.send(m_request(m_retrieveResource((f_getResourceAddress(v_contentInstanceIndex_2)), f_getOriginator(v_contentInstanceIndex_2)))); + mcaPort.send(m_request(m_retrieve((f_getResourceAddress(v_contentInstanceIndex_2)), f_getOriginator(v_contentInstanceIndex_2)))); tc_ac.start; alt { @@ -16205,7 +16205,7 @@ module OneM2M_Testcases_CSE { f_checkAeSimuStatus(); - mcaPort.send(m_request(m_retrieveResource((f_getResourceAddress(v_contentInstanceIndex_1)), f_getOriginator(v_contentInstanceIndex_1)))); + mcaPort.send(m_request(m_retrieve((f_getResourceAddress(v_contentInstanceIndex_1)), f_getOriginator(v_contentInstanceIndex_1)))); tc_ac.start; alt { @@ -16638,7 +16638,7 @@ module OneM2M_Testcases_CSE { v_locContainerResourceIndex := f_cse_createResource(int3, v_container_request_preamble, v_locPolicyResourceIndex);//created container index //Test Body - retrieve the created container resource - mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex), f_getOriginator(v_locContainerResourceIndex))))); + mcaPort.send(m_request(valueof(m_retrieve(f_getResourceAddress(v_locContainerResourceIndex), f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ @@ -16839,7 +16839,7 @@ module OneM2M_Testcases_CSE { v_subscriptionResourceIndex := f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex); //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource - mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); + mcaPort.send(m_request(valueof(m_retrieve(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ @@ -16902,7 +16902,7 @@ module OneM2M_Testcases_CSE { v_subscriptionResourceIndex := f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex); //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource - mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); + mcaPort.send(m_request(valueof(m_retrieve(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ @@ -16964,7 +16964,7 @@ module OneM2M_Testcases_CSE { v_subscriptionResourceIndex := f_cse_createResource(int23, v_subscription_request_preamble, v_locContainerResourceIndex); //Test Body - retrieve the <latest> resource of the created container resource linked with the locationPolicy resource - mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); + mcaPort.send(m_request(valueof(m_retrieve(f_getResourceAddress(v_locContainerResourceIndex) & "/" & "latest", f_getOriginator(v_locContainerResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ @@ -17095,7 +17095,7 @@ module OneM2M_Testcases_CSE { v_locPolicyResourceIndex := f_cse_createResource(int10, v_locpolicy_request_preamble, v_aeAuxIndex);//created locationpolicy index //Test Body - retrieve the created locationpolicy resource - mcaPort.send(m_request(valueof(m_retrieveResource(f_getResourceAddress(v_locPolicyResourceIndex), f_getOriginator(v_locPolicyResourceIndex))))); + mcaPort.send(m_request(valueof(m_retrieve(f_getResourceAddress(v_locPolicyResourceIndex), f_getOriginator(v_locPolicyResourceIndex))))); tc_ac.start; alt{ [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response{ @@ -17651,7 +17651,7 @@ module OneM2M_Testcases_CSE { v_fanoutPointAddress := f_getResourceAddress(v_groupIndex) & "/" & c_resourceShortNameFanOutPoint & "/" & c_resourceShortNameLatest; // Test Body - mcaPort.send(m_request(m_retrieveResource(v_fanoutPointAddress, f_getOriginator(v_aeIndex_1)))); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN + mcaPort.send(m_request(m_retrieve(v_fanoutPointAddress, f_getOriginator(v_aeIndex_1)))); //TODO see if it is correct or if we have to use PX_SUPER_ADMIN tc_ac.start; alt { [] mcaPort.receive(mw_response(mw_responsePrimitive(int2000))) -> value v_response { @@ -18555,7 +18555,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_GMG_001_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_GMG_001(m_retrieveResource("Temporary", "Temporary"), int2000)); + v_ae1.start(f_CSE_GMG_001(m_retrieve("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_GMG_001_RET @@ -18672,7 +18672,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_GMG_002_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_GMG_002(m_retrieveResource("Temporary", "Temporary"), int61));//c_CUDNDi + v_ae1.start(f_CSE_GMG_002(m_retrieve("Temporary", "Temporary"), int61));//c_CUDNDi v_ae1.done; }//end TC_CSE_GMG_002_RET @@ -18777,7 +18777,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_GMG_003_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_GMG_003(m_retrieveResource("Temporary", "Temporary"), int2000)); + v_ae1.start(f_CSE_GMG_003(m_retrieve("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_GMG_003_RET @@ -18894,7 +18894,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_GMG_004_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_GMG_004(m_retrieveResource("Temporary", "Temporary"), int61));//c_CUDNDi + v_ae1.start(f_CSE_GMG_004(m_retrieve("Temporary", "Temporary"), int61));//c_CUDNDi v_ae1.done; }//end TC_CSE_GMG_004_RET @@ -19006,7 +19006,7 @@ module OneM2M_Testcases_CSE { var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainerBase; - v_ae1.start(f_CSE_GMG_005(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000)); + v_ae1.start(f_CSE_GMG_005(m_retrieve("Temporary", "Temporary"), v_contentResponse, int2000)); v_ae1.done; }//end TC_CSE_GMG_005_RET @@ -19133,7 +19133,7 @@ module OneM2M_Testcases_CSE { var template PrimitiveContent v_contentResponse; v_contentResponse.container := mw_contentContainerBase; - v_ae1.start(f_CSE_GMG_006(m_retrieveResource("Temporary", "Temporary"), v_contentResponse, int2000)); + v_ae1.start(f_CSE_GMG_006(m_retrieve("Temporary", "Temporary"), v_contentResponse, int2000)); v_ae1.done; }//end TC_CSE_GMG_006_RET @@ -19268,7 +19268,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); - v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); + v_request := valueof(m_retrieveFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); mcaPort.send(m_request(v_request)); tc_ac.start; alt { @@ -19323,7 +19323,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); //v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); - v_request := valueof(m_retrieveResourceFilterUsageOptionLabel(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1, v_labels)); + v_request := valueof(m_retrieveFilterUsageOptionLabel(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1, v_labels)); mcaPort.send(m_request(v_request)); tc_ac.start; alt { @@ -19383,7 +19383,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); - v_request := valueof(m_retrieveResourceDiscResTypeFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int2, int1)); + v_request := valueof(m_retrieveDiscResTypeFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int2, int1)); mcaPort.send(m_request(v_request)); tc_ac.start; alt { @@ -19449,7 +19449,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); - v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); + v_request := valueof(m_retrieveFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); mcaPort.send(m_request(v_request)); tc_ac.start; alt { @@ -19500,9 +19500,9 @@ module OneM2M_Testcases_CSE { v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; if(PX_ADDRESSING_METHOD == e_nonHierarchical and (PX_PRIMITIVE_SCOPE == e_cseRelative)) { - v_request := valueof(m_retrieveResourceFilterUsageOption(v_resourceId, f_getOriginator(v_aeIndex), int1)); + v_request := valueof(m_retrieveFilterUsageOption(v_resourceId, f_getOriginator(v_aeIndex), int1)); } else { - v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_aeIndex) & "/" & v_resourceId, f_getOriginator(v_resourceIndex), int1)); + v_request := valueof(m_retrieveFilterUsageOption(f_getResourceAddress(v_aeIndex) & "/" & v_resourceId, f_getOriginator(v_resourceIndex), int1)); } mcaPort.send(m_request(v_request)); @@ -19558,7 +19558,7 @@ module OneM2M_Testcases_CSE { v_resourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_aeIndex); v_childResourceIndex := f_cse_createResource(c_containerResourceType, m_createContainerBase, v_resourceIndex); - v_request := valueof(m_retrieveResourceFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); + v_request := valueof(m_retrieveFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); v_request.filterCriteria.expireBefore := "20171231T012345"; v_request.filterCriteria.expireAfter := "20181231T012345"; mcaPort.send(m_request(v_request)); @@ -20457,7 +20457,7 @@ module OneM2M_Testcases_CSE { f_checkComponentDoneAndGetVerdict(vc_ae2); - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { @@ -20539,7 +20539,7 @@ module OneM2M_Testcases_CSE { f_checkComponentDoneAndGetVerdict(vc_ae2); - mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); + mcaPort.send(m_request(m_retrieve(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex)))); tc_ac.start; alt { @@ -21239,6 +21239,142 @@ module OneM2M_Testcases_CSE { f_cf01Down(); }//end TC_CSE_SEC_ACP_CRE_002 + + /** + * @desc Check that the IUT accepts the creation of a accessControlPolicy resource with privileges attribute having empty rules + * + */ + testcase TC_CSE_SEC_ACP_CRE_003() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_acpIndex := -1; + var template PrimitiveContent v_contentResponse; + var RequestPrimitive v_createRequest := valueof(m_createAcpBase); + const ResourceType c_accessControlPolicyType := int1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {}; + + v_contentResponse.accessControlPolicy := mw_contentAcp_rc1; + v_contentResponse.accessControlPolicy.privileges.accessControlRule_list := {}; + + // Test Body + v_createRequest := f_getCreateRequestPrimitive(c_accessControlPolicyType, v_createRequest, -1); + + mcaPort.send(m_request(v_createRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, v_contentResponse))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully"); + f_checkAttributesToBeSaved(c_accessControlPolicyType, v_createRequest, v_response.primitive.responsePrimitive); + v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1, -, -); + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " created successfully, but wrong ACP representation"); + f_checkAttributesToBeSaved(c_accessControlPolicyType, v_createRequest, v_response.primitive.responsePrimitive); + v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1, -, -); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if(f_isResourcePresent(v_acpIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource not created"); + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end TC_CSE_SEC_ACP_CRE_003 + + /** + * @desc Check that the IUT responds with an error when the creation of a accessControlPolicy resource with selfPrivileges attribute having empty rules + * + */ + testcase TC_CSE_SEC_ACP_CRE_004() runs on AeSimu system CseSystem { + // Local variables + var MsgIn v_response; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest := valueof(m_createAcpBase); + const ResourceType c_accessControlPolicyType := int1; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest.primitiveContent.accessControlPolicy.selfPrivileges.accessControlRule_list := {}; + + // Test Body + v_createRequest := f_getCreateRequestPrimitive(c_accessControlPolicyType, v_createRequest, -1); + + mcaPort.send(m_request(v_createRequest)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Resource type " & int2str(enum2int(c_accessControlPolicyType)) & " creation correctly rejected due to empty selfPriviles accessControlRules"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); + f_checkAttributesToBeSaved(c_accessControlPolicyType, v_createRequest, v_response.primitive.responsePrimitive); + v_acpIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int1, -, -); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while creating resource type " & int2str(enum2int(c_accessControlPolicyType))); + } + } + + f_checkAeSimuStatus(); + + //Check to see if the resource is present or not + if(f_isResourceNotPresent(-1, v_createRequest.primitiveContent.accessControlPolicy.resourceName)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource not created"); + } else { + setverdict(fail, __SCOPE__ & ":ERROR: Resource created"); + } + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end TC_CSE_SEC_ACP_CRE_004 }// end of group Create @@ -21439,7 +21575,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_SEC_ACP_001_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_SEC_ACP_001(m_retrieveResource("Temporary", "Temporary"))); + v_ae1.start(f_CSE_SEC_ACP_001(m_retrieve("Temporary", "Temporary"))); v_ae1.done; }//end TC_CSE_SEC_ACP_001_RET @@ -21542,7 +21678,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_SEC_ACP_002_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_SEC_ACP_002(m_retrieveResource("Temporary", "Temporary"), int2000)); + v_ae1.start(f_CSE_SEC_ACP_002(m_retrieve("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_SEC_ACP_002_RET @@ -21652,7 +21788,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_SEC_ACP_003_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_SEC_ACP_003(m_retrieveResource("Temporary", "Temporary"), int2000)); + v_ae1.start(f_CSE_SEC_ACP_003(m_retrieve("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_SEC_ACP_003_03 @@ -21768,7 +21904,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_SEC_ACP_004_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_SEC_ACP_004(m_retrieveResource("Temporary", "Temporary"), int2000)); + v_ae1.start(f_CSE_SEC_ACP_004(m_retrieve("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_SEC_ACP_004_RET @@ -21835,6 +21971,587 @@ module OneM2M_Testcases_CSE { }//end g_CSE_SEC_ACP_004 + group g_CSE_SEC_ACP_005 { + + /** + * @desc Check that the IUT responds successfully when the AE tries an OPERATION on a AE_RESOURCE_TYPE resource and that the request is within accessControlTimeWindow context. + * + */ + testcase TC_CSE_SEC_ACP_005_CRE() runs on Tester system CseSystem { //Create + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_005(m_createContainerBase, int2001)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_005_CRE + + testcase TC_CSE_SEC_ACP_005_UPD() runs on Tester system CseSystem { //Update + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + + v_ae1.start(f_CSE_SEC_ACP_005(v_updateRequest, int2004)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_005_UPD + + testcase TC_CSE_SEC_ACP_005_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_005(m_retrieve("Temporary", "Temporary"), int2000)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_005_RET + + testcase TC_CSE_SEC_ACP_005_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_005(m_delete("Temporary", "Temporary"), int2002)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_005_DEL + + function f_CSE_SEC_ACP_005(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var charstring v_currentTime; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_currentTime := fx_generateTimestamp(); + v_accessControlRule.accessControlContexts_list := {{{"* * * * * " & f_getYear(v_currentTime)}, omit, omit}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_005 + + }//end g_CSE_SEC_ACP_005 + + group g_CSE_SEC_ACP_006 { + + /** + * @desc Check that the IUT responds with an error when the AE tries an OPERATION on a AE_RESOURCE_TYPE resource out of accessControlTimeWindow context. + * + */ + testcase TC_CSE_SEC_ACP_006_CRE() runs on Tester system CseSystem { //Create + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_006(m_createContainerBase, int2001)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_006_CRE + + testcase TC_CSE_SEC_ACP_006_UPD() runs on Tester system CseSystem { //Update + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + + v_ae1.start(f_CSE_SEC_ACP_006(v_updateRequest, int2004)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_006_UPD + + testcase TC_CSE_SEC_ACP_006_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_006(m_retrieve("Temporary", "Temporary"), int2000)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_006_RET + + testcase TC_CSE_SEC_ACP_006_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_006(m_delete("Temporary", "Temporary"), int2002)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_006_DEL + + function f_CSE_SEC_ACP_006(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{{"* * * * * 3000"}, omit, omit}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_006 + + }//end g_CSE_SEC_ACP_006 + + group g_CSE_SEC_ACP_007 { + + /** + * @desc Check that the IUT responds successfully when the AE tries an OPERATION on a AE_RESOURCE_TYPE resource and that the request is within accessControlLocationRegion context. + * + */ + testcase TC_CSE_SEC_ACP_007_CRE() runs on Tester system CseSystem { //Create + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_007(m_createContainerBase, int2001)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_007_CRE + + testcase TC_CSE_SEC_ACP_007_UPD() runs on Tester system CseSystem { //Update + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + + v_ae1.start(f_CSE_SEC_ACP_007(v_updateRequest, int2004)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_007_UPD + + testcase TC_CSE_SEC_ACP_007_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_007(m_retrieve("Temporary", "Temporary"), int2000)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_007_RET + + testcase TC_CSE_SEC_ACP_007_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_007(m_delete("Temporary", "Temporary"), int2002)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_007_DEL + + function f_CSE_SEC_ACP_007(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{omit, omit, { choice := { countryCode := {"ES"}}}}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + //TODO How to indicate the location of the Originator (AE1)? + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_007 + + }//end g_CSE_SEC_ACP_007 + + group g_CSE_SEC_ACP_008 { + + /** + * @desc Check that the IUT responds with an error when the AE tries an OPERATION on a AE_RESOURCE_TYPE resource out of accessControlLocationRegion context + * + */ + testcase TC_CSE_SEC_ACP_008_CRE() runs on Tester system CseSystem { //Create + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_008(m_createContainerBase, int2001)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_008_CRE + + testcase TC_CSE_SEC_ACP_008_UPD() runs on Tester system CseSystem { //Update + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + + v_ae1.start(f_CSE_SEC_ACP_008(v_updateRequest, int2004)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_008_UPD + + testcase TC_CSE_SEC_ACP_008_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_008(m_retrieve("Temporary", "Temporary"), int2000)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_008_RET + + testcase TC_CSE_SEC_ACP_008_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_008(m_delete("Temporary", "Temporary"), int2002)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_008_DEL + + function f_CSE_SEC_ACP_008(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{omit, omit, { choice := { countryCode := {"ES"}}}}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + //TODO How to indicate the location of the Originator (AE1)? + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, -); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_008 + + }//end g_CSE_SEC_ACP_008 + + group g_CSE_SEC_ACP_009 { + + /** + * @desc Check that the IUT responds successfully when the AE tries an OPERATION on a TARGET_RESOURCE_TYPE resource and that the request is within accessControlIpAddresses context. + * + */ + testcase TC_CSE_SEC_ACP_009_CRE() runs on Tester system CseSystem { //Create + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_009(m_createContainerBase, int2001)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_009_CRE + + testcase TC_CSE_SEC_ACP_009_UPD() runs on Tester system CseSystem { //Update + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + + v_ae1.start(f_CSE_SEC_ACP_009(v_updateRequest, int2004)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_009_UPD + + testcase TC_CSE_SEC_ACP_009_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_009(m_retrieve("Temporary", "Temporary"), int2000)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_009_RET + + testcase TC_CSE_SEC_ACP_009_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_009(m_delete("Temporary", "Temporary"), int2002)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_009_DEL + + function f_CSE_SEC_ACP_009(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{omit, {{f_getIpv4Address(PX_AE1_ADDRESS)}, omit}, omit}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(p_responseStatusCode))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Successful operation on resource type int2 (Ae)"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error while operation on resource type int2 (Ae)"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation on resource type int2 (Ae)"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_009 + + }//end g_CSE_SEC_ACP_009 + + group g_CSE_SEC_ACP_010 { + + /** + * @desc Check that the IUT responds with an error when the AE tries an OPERATION on a AE_RESOURCE_TYPE resource out of accessControlIpAddresses context. + * + */ + testcase TC_CSE_SEC_ACP_010_CRE() runs on Tester system CseSystem { //Create + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_010(m_createContainerBase, int2001)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_010_CRE + + testcase TC_CSE_SEC_ACP_010_UPD() runs on Tester system CseSystem { //Update + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + var template RequestPrimitive v_updateRequest := m_updateAeBase; + var Labels v_labels_1:= {"VALUE_1"}; + v_updateRequest.primitiveContent.aE.labels := v_labels_1; + + v_ae1.start(f_CSE_SEC_ACP_010(v_updateRequest, int2004)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_010_UPD + + testcase TC_CSE_SEC_ACP_010_RET() runs on Tester system CseSystem { //Retrieve + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_010(m_retrieve("Temporary", "Temporary"), int2000)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_010_RET + + testcase TC_CSE_SEC_ACP_010_DEL() runs on Tester system CseSystem { //Delete + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_CSE_SEC_ACP_010(m_delete("Temporary", "Temporary"), int2002)); + v_ae1.done; + }//end TC_CSE_SEC_ACP_010_DEL + + function f_CSE_SEC_ACP_010(template RequestPrimitive p_requestPrimitive, in ResponseStatusCode p_responseStatusCode) runs on AeSimu{ + // Local variables + var MsgIn v_response; + var integer v_aeIndex := -1; + var integer v_acpIndex := -1; + var RequestPrimitive v_createRequest; + var AccessControlRule v_accessControlRule := valueof(m_createAcr({"all"}, int63)); + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble + v_createRequest := f_getCreateRequestPrimitive(int1, m_createAcpBase, -1); + v_accessControlRule.accessControlContexts_list := {{omit, {{f_getIpv4Address(PX_AE2_ADDRESS)}, omit}, omit}}; + v_createRequest.primitiveContent.accessControlPolicy.privileges.accessControlRule_list := {v_accessControlRule}; + v_acpIndex := f_cse_createResource(int1, v_createRequest); // CSE child resource + + v_aeIndex := f_cse_preamble_registerAe({f_getResourceId(vc_resourcesList[v_acpIndex].resource)}, {f_getAnnouncementTargetPoA(-, PX_AE1_ADDRESS, -)}); + + // Test Body + p_requestPrimitive.to_ := f_getResourceAddress(v_aeIndex); + p_requestPrimitive.from_ := f_getOriginator(v_aeIndex); + p_requestPrimitive.requestIdentifier := valueof(p_requestPrimitive.requestIdentifier) & f_rnd(1, 1000000); + + mcaPort.send(m_request(valueof(p_requestPrimitive))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4103))) -> value v_response { + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Operation denied due to lack of privileges, out of accessControlTimeWindow"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error operation have been accpeted without having privileges"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while executing operation"); + } + } + + + //Postamble + f_cse_postamble_deleteResources(); + + //Tear down + f_cf01Down(); + + }//end f_CSE_SEC_ACP_010 + + }//end g_CSE_SEC_ACP_010 + + group g_CSE_SEC_ACP_011 { /** @@ -21861,7 +22578,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_SEC_ACP_011_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_SEC_ACP_011(m_retrieveResource("Temporary", "Temporary"), int2000)); + v_ae1.start(f_CSE_SEC_ACP_011(m_retrieve("Temporary", "Temporary"), int2000)); v_ae1.done; }//end TC_CSE_SEC_ACP_011_RET @@ -21950,7 +22667,7 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_SEC_ACP_012_RET() runs on Tester system CseSystem { //Retrieve var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_ae1.start(f_CSE_SEC_ACP_012(m_retrieveResource("Temporary", "Temporary"), int61)); + v_ae1.start(f_CSE_SEC_ACP_012(m_retrieve("Temporary", "Temporary"), int61)); v_ae1.done; }//end TC_CSE_SEC_ACP_012_RET