diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index f69cfb0ba6cfb4679991df658a2323c0d3926117..b5d0cc3f1554f8eb0f5229405cb38f7864112044 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -14,7 +14,7 @@ module OneM2M_Functions { import from XSD all; import from OneM2M_Templates all; import from OneM2M_Types all; - import from OneM2M_Ports all; + import from OneM2M_Ports all; import from OneM2M_TypesAndValues all; import from OneM2M_TestSystem all; import from OneM2M_Pixits all; @@ -578,7 +578,48 @@ module OneM2M_Functions { // Connect } + + function f_cf07Up(in CseTypeID p_cseType := int2) runs on CseSimu system AeSystem { + + // Variables + var charstring v_binding; + var charstring v_binding_in; + var PrimitiveContent v_cSEBaseResource; + var charstring v_host; + vc_cseSimuDesc := PX_TS_CSE1; + + //Initialization of component variables + vc_config := e_cf07; + vc_testSystemRole := e_cse; + vc_cseType := p_cseType; + + //Creation of CSEBase + v_cSEBaseResource := f_generateLocalResource(-, -1, int5); + vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1); + + // Map + map(self:mcaPort, system:mcaPort) param (vc_cseSimuDesc.mcaPort);//TODO To be consistent, we should use mcaPortIn for AE testing + map(self:mcaPortIn, system:mcaPortIn) param (vc_cseSimuDesc.mcaPortIn);//TODO To be consistent, we should use mcaPortIn for AE testing + map(self:acPort, system:acPort); + + f_setProtocolBinding(vc_cseSimuDesc.mcaPort, vc_cseSimuDesc.mcaPortIn, v_binding, v_host, v_binding_in); + + vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mcaPort))] := { mcaPort, v_host, v_binding, vc_cseSimuDesc.mcaPort.serialization }; + vc_myInterfaces[enum2int(valueof(InterfaceIds:e_mcaPortIn))] := { mcaPortIn, v_host, v_binding_in, vc_cseSimuDesc.mcaPortIn.serialization }; + + if(PX_UT_IMPLEMENTED) { + map(self:utPort, system:utPort) param (PX_TS_UT); + } + activate(a_default()); + vc_cseSimu := activate(a_cse_cf07()); + + // Connect + + //Initialze the IUT + + } // End of function f_cf07Up + /** * @desc Ports unmapping */ @@ -730,6 +771,18 @@ module OneM2M_Functions { unmap(vc_ae2:acPort, system:acPort); }// end f_cf06DownCseSimuMaster + + function f_cf07Down() runs on CseSimu system AeSystem { + + unmap(self:mcaPort, system:mcaPort); + unmap(self:mcaPortIn, system:mcaPortIn); + unmap(self:acPort, system:acPort); + if(PX_UT_IMPLEMENTED){ + unmap(self:utPort, system:utPort); + } + + } // End of function f_cfDown + }//end group configFunctions group InfoPortCommunication { @@ -2148,6 +2201,7 @@ module OneM2M_Functions { function f_cse_notifyProcedure_subscriptionVerificationHandler(in ResponseStatusCode p_responseStatusCode := int2000) runs on AeSimu { // Local variables var ResponsePrimitive v_responsePrimitive; + var boolean v_notificationReceived := false; var template Notification v_notificationRequest := mw_contentNotificationVerification; //Activate defaults when running on a PTC @@ -2162,10 +2216,12 @@ module OneM2M_Functions { alt { [] mcaPortIn.receive(mw_request(mw_notifyNotification(v_notificationRequest))) -> value vc_request { tc_ac.stop; + v_notificationReceived := true; setverdict(pass, __SCOPE__ & ":INFO: Subscription Verification Notification received"); } [] mcaPortIn.receive(mw_request(mw_notifyNotification(mw_contentNotification(?)))) -> value vc_request { tc_ac.stop; + v_notificationReceived := true; setverdict(inconc, __SCOPE__ & ":ERROR: Notification received but verificationRequest isn't set to TRUE"); } [] tc_ac.timeout { @@ -2174,16 +2230,18 @@ module OneM2M_Functions { } } - //Sending response to the notification received - //Preparation of Notification response to be sent - v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit)); - v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; - - if(getverdict != pass) { - v_responsePrimitive.responseStatusCode := int4000; + if(v_notificationReceived) { + //Sending response to the notification received + //Preparation of Notification response to be sent + v_responsePrimitive := valueof(m_responseNotification(p_responseStatusCode, omit)); + v_responsePrimitive.requestIdentifier := vc_request.primitive.requestPrimitive.requestIdentifier; + + if(getverdict != pass) { + v_responsePrimitive.responseStatusCode := int4000; + } + f_send(e_mcaPortIn, m_response(v_responsePrimitive)); } - f_send(e_mcaPortIn, m_response(v_responsePrimitive)); - + } //end f_cse_notifyProcedure_subscriptionVerificationHandler /** @@ -4039,9 +4097,15 @@ module OneM2M_Functions { */ altstep a_cse_cf06_das() runs on AeSimu { [] a_cse_aeSimu(); - } - - + } + + /** + * @desc Cse altstep for config 07 + */ + altstep a_cse_cf07() runs on CseSimu { + [] a_ae_cseSimu(); + } + /** * @desc Altstep for CseSimu */ @@ -5331,15 +5395,23 @@ module OneM2M_Functions { log(">>> f_getLocalPoA: ", p_portDesc); if (ischosen(p_portDesc.binding.httpBindingDesc)) { - v_poa := "http://" & p_portDesc.binding.httpBindingDesc.bindingDesc.tsAddress; + if (ispresent(p_portDesc.binding.httpBindingDesc.bindingDesc.useTls) and (p_portDesc.binding.httpBindingDesc.bindingDesc.useTls == true)) { + v_poa := "https://" & p_portDesc.binding.httpBindingDesc.bindingDesc.tsAddress; + } else { + v_poa := "http://" & p_portDesc.binding.httpBindingDesc.bindingDesc.tsAddress; + } if (ispresent(p_portDesc.binding.httpBindingDesc.bindingDesc.localPort)) { - v_poa := v_poa & ":" & int2str(p_portDesc.binding.httpBindingDesc.bindingDesc.localPort); - } + v_poa := v_poa & ":" & int2str(p_portDesc.binding.httpBindingDesc.bindingDesc.localPort); + } } else if (ischosen(p_portDesc.binding.coapBindingDesc)) { - v_poa := "coap://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress; - if (ispresent(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort)) { - v_poa := v_poa & ":" & int2str(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort); - } + if (ispresent(p_portDesc.binding.coapBindingDesc.bindingDesc.useTls) and (p_portDesc.binding.coapBindingDesc.bindingDesc.useTls == true)) { + v_poa := "coaps://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress; + } else { + v_poa := "coap://" & p_portDesc.binding.coapBindingDesc.bindingDesc.tsAddress; + } + if (ispresent(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort)) { + v_poa := v_poa & ":" & int2str(p_portDesc.binding.coapBindingDesc.bindingDesc.localPort); + } } else if (ischosen(p_portDesc.binding.mqttBindingDesc)) { v_poa := "mqtt://" & p_portDesc.binding.mqttBindingDesc.bindingDesc.tsAddress; if (ispresent(p_portDesc.binding.mqttBindingDesc.bindingDesc.localPort)) { @@ -6616,7 +6688,7 @@ module OneM2M_Functions { //Calculate the SP-Relative-AE-ID following format defined in TS-0010 MQTT v_aeResourceAddress := f_getResourceAddress(p_aeIndex, e_nonHierarchical, e_spRelative); if(vc_resourcesList[p_aeIndex].resource.aE.aE_ID[0] == "S") { - v_spRelativeAeIdForMqtt := f_resourceIdCleaner(v_aeResourceAddress); + v_spRelativeAeIdForMqtt := oct2char(unichar2oct(f_resourceIdCleaner(v_aeResourceAddress))); } else { v_spRelativeAeIdForMqtt := f_getSpRelativeAeIdForMqtt(v_aeResourceAddress); } @@ -7047,6 +7119,11 @@ module OneM2M_Functions { */ external function fx_validateESCertKEMessage(XSD.Base64Binary incomingMessage, integer stage) return boolean; + /** + * @desc Retrieve the specified ontology description. + * @param p_ontology_description The ontology description (e.g. /saref). + */ + external function fx_retrieve_formal_ontology(in charstring p_ontology_description) return charstring; } // end externalFunctions diff --git a/LibOneM2M/OneM2M_Pics.ttcn b/LibOneM2M/OneM2M_Pics.ttcn index ddde51f09735477fe5fd97c0f8270fe723b27fcc..00d8b2f7df1cbb57c985043c9e0d8c6b8eebf22c 100644 --- a/LibOneM2M/OneM2M_Pics.ttcn +++ b/LibOneM2M/OneM2M_Pics.ttcn @@ -6,7 +6,7 @@ * All rights reserved. * * @author oneM2M/ETSI - * @desc Module containing Pixits for oneM2M + * @desc Module containing Pixits for oneM2M * */ module OneM2M_Pics { @@ -47,7 +47,8 @@ module OneM2M_Pics { */ modulepar boolean PICS_IN_CSE := true; modulepar boolean PICS_MN_CSE := true; - modulepar boolean PICS_ASN_CSE := true; + modulepar boolean PICS_ASN_CSE := true; + modulepar boolean PICS_AE_IPE := false; /** * @desc Resource Addressing methods @@ -189,6 +190,46 @@ module OneM2M_Pics { modulepar boolean PICS_SERVICE_SUBSCRIBED_NODE := true; modulepar boolean PICS_REMOTE_PROVISIONING := true; } + + group Onthology_based_interworking { + + /** + * @desc Does the Test System provide an ontology server? + */ + modulepar boolean PICS_TS_ONTOLOGY_SERVER := true; + + /** + * @desc Does the SUT support RESTfull API? + */ + modulepar boolean PICS_RESTFULL_API := true; + + /** + * @desc Does the SUT support Discovery? + */ + modulepar boolean PICS_AE_IPE_DISCOVERY := true; + + /** + * @desc The expected HTTP Content-type header value + */ + modulepar charstring PICS_HEADER_CONTENT_TYPE := "application/xml"; + + /** + * @desc The expected HTTP server where to retrieve the formal description of the ontology + */ + modulepar charstring PICS_HEADER_HOST := "www.someOrganization.org"; + + /** + * @desc HTTP Authorization if required + */ + modulepar boolean PICS_USE_TOKEN_HEADER := false; + modulepar charstring PICS_TOKEN_HEADER := ""; + + /** + * @desc HTTP GET Uri to retrieve the formal description of the ontology + */ + modulepar charstring PICS_OBI_URI := "/someOntology"; // TODO Could it be a Pixit? + } + } group SecurityAttributes { diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index 8dffa35bca890205f34910a67ec75ddf0b6c4fc0..b8d678351797d9840e533a2f7e8bcfd79358999f 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -105,14 +105,6 @@ module OneM2M_Pixits { */ modulepar PrimitiveScope PX_PRIMITIVE_SCOPE := e_cseRelative; - //WebSocket parameters - modulepar charstring PX_WS_PROTOCOL := "oneM2M.R2.0.xml"; - modulepar charstring PX_REQUEST_URI := "/"; - //MQTT parameters - modulepar charstring PX_HOSTING_CSE_ID := "CSE-ID"; - modulepar charstring PX_CREDENTIAL_ID := "admin:admin"; - - /** * @desc Protocol binding to use during test execution */ @@ -173,7 +165,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := 8080, // SUT CoAP/HTTP port localPort := 3031, // Test Adapter client port (for debug purpose only) - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -187,7 +180,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := omit, localPort := 3041, // Test Adapter listener port (AeSimu acts as server) - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -205,7 +199,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := 8080, // SUT CoAP/HTTP port localPort := 3032, // Test Adapter client port (for debug purpose only) - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -219,7 +214,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := omit, localPort := 3042, // Test Adapter listener port (AeSimu acts as server) - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -240,7 +236,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 3131, - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -254,7 +251,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= omit, localPort := 3141, - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -268,7 +266,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 4131, - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -282,7 +281,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= omit, localPort := 4141, - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -303,7 +303,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 3132, - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -317,7 +318,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 3142, - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -331,7 +333,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 4132, - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -345,14 +348,16 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort:= 8080, localPort := 4142, - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, serialization := "json" } }; - modulepar UtDesc PX_TS_UT := { url := "http://127.0.0.1:43000/" }; + + modulepar UrlDesc PX_TS_UT := { url := "http://127.0.0.1:43000/" }; modulepar AeSimuComponentDesc PX_TS_DAS := { // DAS component settings aeIdStem := "", @@ -365,7 +370,8 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := 8080, // SUT CoAP/HTTP port localPort := 3033, // Test Adapter client port (for debug purpose only) - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, @@ -379,14 +385,20 @@ module OneM2M_Pixits { tsAddress := "127.0.0.1", remotePort := omit, localPort := 3043, // Test Adapter listener port (AeSimu acts as server) - sutAddress := "127.0.0.1" + sutAddress := "127.0.0.1", + useTls := false } } }, serialization := "xml" } }; - + + /** + * @desc Simulated Ontology Server IP address and listening port + */ + modulepar UrlDesc PX_TS_ONTOLOGY_SERVER := { url := "http://127.0.0.1:80/" }; + } group ExecutionParameters { diff --git a/LibOneM2M/OneM2M_Ports.ttcn b/LibOneM2M/OneM2M_Ports.ttcn index 4a404f7c81c47547b0a5b9abb7963e605d3e300f..dad32616c3f7422906e0d8a999f5f30843e1268a 100644 --- a/LibOneM2M/OneM2M_Ports.ttcn +++ b/LibOneM2M/OneM2M_Ports.ttcn @@ -64,7 +64,7 @@ module OneM2M_Ports { UtTriggerAckPrimitive; out UtTriggerPrimitive; - map param (in UtDesc p_utDesc) + map param (in UrlDesc p_utDesc) } }//end module diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 58ced2c0a040e2f43e3e1648bda9c6a7b986df27..01de67d7f01bcbf24be6ee128dc81bd188a0bcb7 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -209,6 +209,13 @@ module OneM2M_Templates { vendorInformation := * }; + template RequestPrimitive mw_retrieveFormalOntology(template XSD.ID p_targetResourceAddress := ?, template XSD.ID p_originator := ?, template XSD.AnyURI p_ontologyServerUri := ?) modifies mw_retrieve := { + from_ := p_originator, + requestIdentifier := ?, + primitiveContent := { flexContainer := mw_contentFlexContainer(p_ontologyServerUri) }, + releaseVersionIndicator := "3" + }; + /** * @desc RETRIEVE request primitive for a single attribute in To field ("targetResourceAddress#AttributeName") * @param p_targetResourceAddress Target resource address (including "#AttributeName") @@ -2232,7 +2239,7 @@ module OneM2M_Templates { operationExecutionTime := *, responseType := *, resultPersistence := omit, - resultContent := omit, + resultContent := int0 ifpresent, eventCategory := *, deliveryAggregation := *, groupRequestIdentifier := *, @@ -2360,6 +2367,10 @@ module OneM2M_Templates { notification := p_notification }; + template (present) PrimitiveContent mw_primitiveContentFlexContainer(template (present) FlexContainerResource_optional p_flexContainer := ?) := { + flexContainer := p_flexContainer + }; + /** * @desc Base primitiveContent for CREATE operation for AEAnnc resource @@ -7264,7 +7275,30 @@ module OneM2M_Templates { nodeLink := omit //O } - template (value) DeviceAirConditioner_optional m_contentDeviceAirConditioner_allOmit := { + template (present) FlexContainerResource_optional mw_contentFlexContainer( + template (present) XSD.AnyURI p_ontologyRef := ? + ) := { + resourceName := *,//O + resourceType := *,//NP + resourceID := *,//NP + parentID := *,//NP + creationTime := *,//NP + lastModifiedTime := *,//NP + labels := *,//O + accessControlPolicyIDs := *,//O + expirationTime := *,//O + dynamicAuthorizationConsultationIDs := *, //O + announceTo := *,//O + announcedAttribute := *,//O + stateTag := *,//NP + creator := *,//O + containerDefinition := *, //M + ontologyRef := *, //O + contentSize := *, //NP + nodeLink := * //O + } + + template DeviceAirConditioner_optional m_contentDeviceAirConditioner_allOmit := { resourceName := omit,//O resourceType := omit,//NP resourceID := omit,//NP diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index 186db965b0c9fc665fbbfe7dc956d8a3e398b967..3aa24eaebf17ea847c1e83e8d67c41cb80746714 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -4100,13 +4100,17 @@ group OtherTypes { e_cf03, e_cf04, e_cf06, - e_cf06DasSimuMaster + e_cf06DasSimuMaster, + e_cf07, + e_cf07OSSimuMaster }; type enumerated TestSystemRole { e_cse, e_ae, - e_das + e_ae_ipe, + e_das, + e_os }; type NhURI ParentID; @@ -4330,7 +4334,8 @@ group OtherTypes { charstring tsAddress, integer remotePort optional, integer localPort optional, - charstring sutAddress + charstring sutAddress, + boolean useTls } /** @@ -4359,8 +4364,8 @@ group OtherTypes { type record MqttBindingDesc { ProtocolBindings bindingProtocol (e_mqtt), BindingDesc bindingDesc, - XSD.ID originator, - XSD.ID receiver + XSD.ID originator optional, + XSD.ID receiver optional } /** @@ -4394,7 +4399,7 @@ group OtherTypes { * @member requestId * @member url Test System IP address */ - type record UtDesc { + type record UrlDesc { charstring url } diff --git a/OneM2M_PermutationFunctions.ttcn b/OneM2M_PermutationFunctions.ttcn index 75d1e3978a390b730065d0d5651d8989ce721cd6..55f249009b4c694dd3f3475de86dda84f55e3b09 100644 --- a/OneM2M_PermutationFunctions.ttcn +++ b/OneM2M_PermutationFunctions.ttcn @@ -727,6 +727,346 @@ module OneM2M_PermutationFunctions { }//end SUB subgroup + group Onthology_Based_Interworking { + + group Registration { + + function f_AE_OBI_REG_001() runs on CseSimu { + var template UtTriggerPrimitive v_utRequest := m_utCreateAe; + var template RequestPrimitive v_requestPrimitive := mw_createAe; + var universal charstring v_action := __SCOPE__ & ": Please, start AE-IPE device"; + //primitives for mcaPortIn + var MsgIn v_request; + var integer v_parentIndex := -1; + var integer v_resourceIndex := -1; + var PrimitiveContent v_resource; + var ResponsePrimitive v_responsePrimitive; + + // Test control + if (not(PICS_AE_IPE)) { + setverdict(inconc, "PICS_AE_IPE shall be set"); + return; + } + + f_cf07Up(); + + //Send Trigger Message + v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED"; + v_requestPrimitive.primitiveContent.aE.resourceName := complement("UNINITIALIZED"); + v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -); + f_ae_sendUtPrimitive(v_utRequest, v_action & f_getLocalResourceAddress(-, -, -)); + + //Test behavior + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_createAe)) -> value v_request { + tc_ac.stop; + setverdict(pass, __SCOPE__ & " : AE-IPE registration request is accepted!!"); + v_resourceIndex := f_processCreateRequestPrimitive(v_request.primitive.requestPrimitive); + + //send back responsePrimitive + f_send(e_mcaPortIn, m_response(vc_response.primitive.responsePrimitive)); + } + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!"); + } + } + // Postamble + f_cf07Down(); + } + + } + + group Initialization { + + function f_AE_OBI_INI_001() runs on CseSimu { + var template UtTriggerPrimitive v_utRequest := m_utCreateAe; + var template RequestPrimitive v_requestPrimitive := mw_createAe; + var universal charstring v_action := __SCOPE__ & ": Please, start AE-IPE device"; + + // Test control + if (not(PICS_AE_IPE) or (not(PICS_TS_ONTOLOGY_SERVER))) { + setverdict(inconc, "PICS_AE_IPE and PICS_TS_ONTOLOGY_SERVER shall be set"); + return; + } + + f_cf07Up(); + + //Send Trigger Message + v_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -); + v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED"; + f_ae_sendUtPrimitive(v_utRequest,v_action & f_getLocalResourceAddress(-, -, -)); + + //Test behavior + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(mw_retrieveFormalOntology(v_utRequest.requestPrimitive.to_, v_utRequest.requestPrimitive.from_, PICS_OBI_URI))) -> value vc_request { + tc_ac.stop; + // Retrieve the formal description of the ontology + f_prepare_formal_description_ontology(vc_request.primitive.requestPrimitive); + // And send it to the IUT + mcaPortIn.send(m_response(vc_response.primitive.responsePrimitive)); + + // And the final verdict + setverdict(pass, __SCOPE__ & "SUT requests at least one of the formal description of the ontology required by none-oneM2M devices"); + } + [] mcaPortIn.receive { // Any other message is unexpected + + tc_ac.stop; + // Send error + f_prepare_formal_description_ontology(vc_request.primitive.requestPrimitive, int4000); + mcaPortIn.send(m_response(vc_request.primitive.responsePrimitive)); + setverdict(fail, __SCOPE__ & " : Unexpected Retrieve message received from requested SUT!"); + } + [] tc_ac.timeout{ + setverdict(fail, __SCOPE__ & " : Timeout due to no response received from requested SUT!"); + } + } + + // Postamble + f_cf07Down(); + } + + function f_prepare_formal_description_ontology(in RequestPrimitive p_request, in ResponseStatusCode p_responseStatusCode := int2000) runs on CseSimu { + vc_response.primitive.responsePrimitive := valueof(m_responsePrimitive(p_responseStatusCode, p_request.requestIdentifier)); + if(p_responseStatusCode == int2000) { + var charstring v_ontology := fx_retrieve_formal_ontology(p_request.primitiveContent.flexContainer.ontologyRef); + // FIXME How to return the formal ontoilogu, this is an OWL file in string foramt + //vc_response.primitive.responsePrimitive.primitiveContent := ???; + } + + vc_response.primitive.responsePrimitive.from_ := PX_TS_CSE1.cseId; + vc_response.primitive.responsePrimitive.to_ := p_request.from_; + } + + } + + group Discovery { + + function f_await_ipe_registration( + template UtTriggerPrimitive p_utRequest, + in universal charstring p_action, + template RequestPrimitive p_request := mw_create, + in ResponseStatusCode p_responseStatusCode := int2001 + ) runs on CseSimu return integer { + var integer v_localResourceIndex := -1; + + //Send Trigger Message + p_utRequest.requestPrimitive.to_ := f_getLocalResourceAddress(-, -, -); + p_request.to_ := p_utRequest.requestPrimitive.to_; + f_ae_sendUtPrimitive(p_utRequest,p_action & f_getLocalResourceAddress(-, -, -)); + + tc_ac.start; + alt { + [] mcaPortIn.receive(mw_request(p_request)) -> value vc_request { + tc_ac.stop; + v_localResourceIndex := f_processCreateRequestPrimitive(vc_request.primitive.requestPrimitive, p_responseStatusCode); + f_send(e_mcaPortIn, m_response(vc_response.primitive.responsePrimitive)); + } + [] tc_ac.timeout{ + setverdict(inconc, __SCOPE__&":INFO: No creation for resource received"); + } + } + + return v_localResourceIndex; + } + + function f_AE_OBI_DIS_001() runs on CseSimu { + var template UtTriggerPrimitive v_utRequest := m_utCreateAe; + var template RequestPrimitive v_requestPrimitive := mw_createAe; + var universal charstring v_action := __SCOPE__ & ": Please, start AE-IPE device"; + + // Test control + if (not(PICS_AE_IPE) or not(PICS_AE_IPE_DISCOVERY)) { + setverdict(inconc, "PICS_AE_IPE and PICS_AE_IPE_DISCOVERY shall be set"); + return; + } + + f_cf07Up(); + + // Preamble + // Await for AE-IPE registration + v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED"; + v_requestPrimitive.primitiveContent.aE.resourceName := complement("UNINITIALIZED"); + f_await_ipe_registration(v_utRequest, v_action); + // Give time to the AE-IPE to achieve the initial discovery + f_sleepIgnoreDef(5.0); + + // Test body + // Request for a non-oneM2M device description + f_send(e_mcaPortIn, m_request(m_retrieve(vc_request.primitive.requestPrimitive.from_, vc_request.primitive.requestPrimitive.to_))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(pass,__SCOPE__&":INFO: AE-IPE initial discovery successfuly done"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & " : Timeout due to no required request received from SUT"); + } + } + + } + + function f_AE_OBI_DIS_002() runs on CseSimu { + var template UtTriggerPrimitive v_utRequest := m_utCreateAe; + var template RequestPrimitive v_requestPrimitive := mw_createAe; + var universal charstring v_action := __SCOPE__ & ": Please, switch on a new none-oneM2M device"; + + // Test control + if (not(PICS_AE_IPE) or not(PICS_AE_IPE_DISCOVERY)) { + setverdict(inconc, "PICS_AE_IPE and PICS_AE_IPE_DISCOVERY shall be set"); + return; + } + + f_cf07Up(); + + // Preamble + // Await for AE-IPE registration + v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED"; + v_requestPrimitive.primitiveContent.aE.resourceName := complement("UNINITIALIZED"); + f_await_ipe_registration(v_utRequest, v_action); + // Give time to the AE-IPE to achieve the discovery of the new device + f_sleepIgnoreDef(5.0); + + // Test body + // Request for a non-oneM2M device description + f_send(e_mcaPortIn, m_request(m_retrieve(vc_request.primitive.requestPrimitive.from_, vc_request.primitive.requestPrimitive.to_))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { + tc_ac.stop; + setverdict(pass,__SCOPE__&":INFO: AE-IP successfuly discovered new device"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & " : Timeout due to no required request received from SUT"); + } + } + + } + + function f_AE_OBI_DIS_003() runs on CseSimu { + var template UtTriggerPrimitive v_utRequest := m_utCreateAe; + var template RequestPrimitive v_requestPrimitive := mw_createAe; + var universal charstring v_action := __SCOPE__ & ": Please, switch off the new none-oneM2M device"; + + // Test control + if (not(PICS_AE_IPE) or not(PICS_AE_IPE_DISCOVERY)) { + setverdict(inconc, "PICS_AE_IPE and PICS_AE_IPE_DISCOVERY shall be set"); + return; + } + + f_cf07Up(); + + // Preamble + // Await for AE-IPE registration + v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED"; + v_requestPrimitive.primitiveContent.aE.resourceName := complement("UNINITIALIZED"); + f_await_ipe_registration(v_utRequest, v_action); + // Give time to the AE-IPE to achieve the discovery of the new device + f_sleepIgnoreDef(5.0); + + // Test body + // Request for a non-oneM2M device description + f_send(e_mcaPortIn, m_request(m_retrieve(vc_request.primitive.requestPrimitive.from_, vc_request.primitive.requestPrimitive.to_))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) { + tc_ac.stop; + setverdict(pass,__SCOPE__&":INFO: AE-IP successfuly discovered switched off device"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & " : Timeout due to no required request received from SUT"); + } + } + + } + + function f_AE_OBI_DIS_004() runs on CseSimu { + var template UtTriggerPrimitive v_utRequest := m_utCreateAe; + var template RequestPrimitive v_requestPrimitive := mw_createAe; + var universal charstring v_action := __SCOPE__ & ": Please, start AE-IPE device"; + var RequestPrimitive v_request; + + // Test control + if (not(PICS_AE_IPE) or not(PICS_AE_IPE_DISCOVERY)) { + setverdict(inconc, "PICS_AE_IPE and PICS_AE_IPE_DISCOVERY shall be set"); + return; + } + + f_cf07Up(); + + // Preamble + // Await for AE-IPE registration + v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED"; + v_requestPrimitive.primitiveContent.aE.resourceName := complement("UNINITIALIZED"); + f_await_ipe_registration(v_utRequest, v_action); + // Give time to the AE-IPE to achieve the discovery of the new device + f_sleepIgnoreDef(5.0); + + // Test body + v_request := valueof(m_retrieveFilterUsageOption(vc_request.primitive.requestPrimitive.from_, vc_request.primitive.requestPrimitive.to_, int1)); + f_send(e_mcaPortIn, m_request(v_request)); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responseDiscovery)) { + tc_ac.stop; + setverdict(pass,__SCOPE__&":INFO: AE-IP successfuly discovered switched off device"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & " : Timeout due to no required request received from SUT"); + } + } + + } + + } + + group Retrieve { + + function f_AE_OBI_RET_001() runs on CseSimu { + var template UtTriggerPrimitive v_utRequest := m_utCreateAe; + var template RequestPrimitive v_requestPrimitive := mw_createAe; + var universal charstring v_action := __SCOPE__ & ": Please, start AE-IPE device"; + + // Test control + if (not(PICS_AE_IPE)) { + setverdict(inconc, "PICS_AE_IPE shall be set"); + return; + } + + f_cf07Up(); + + // Preamble + // Await for AE-IPE registration + v_utRequest.requestPrimitive.primitiveContent.aE.resourceName := "UNINITIALIZED"; + v_requestPrimitive.primitiveContent.aE.resourceName := complement("UNINITIALIZED"); + f_await_ipe_registration(v_utRequest, v_action); + // Give time to the AE-IPE to achieve the discovery of the new device + f_sleepIgnoreDef(5.0); + + // Test body + // Request for a non-oneM2M device description + // TODO Add more details + f_send(e_mcaPortIn, m_request(m_retrieve(vc_request.primitive.requestPrimitive.from_, vc_request.primitive.requestPrimitive.to_))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001, mw_primitiveContentFlexContainer(mw_contentFlexContainer)))) { + tc_ac.stop; + setverdict(pass,__SCOPE__&":INFO: Response OK for retrieving"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & " : Timeout due to no required request received from SUT"); + } + } + + } + + + } + + } + group Home_Appliance_Information_Model { group Create { diff --git a/OneM2M_Testcases_AE_Release_1.ttcn b/OneM2M_Testcases_AE_Release_1.ttcn index 730ac6f7db11c8ed8852e9027e0b30c8cb28578f..f60ad65e263e29875f6ab6b96e42712aec0e7bd4 100644 --- a/OneM2M_Testcases_AE_Release_1.ttcn +++ b/OneM2M_Testcases_AE_Release_1.ttcn @@ -2132,8 +2132,10 @@ module OneM2M_Testcases_AE_Release_1 { v_response_rsp1.to_ := v_request_req1.primitive.requestPrimitive.from_; //Put in the primitiveContent a Notify request (req2) (simulated) from another node CSE v_request_req2 := valueof(m_notify(f_getLocalResourceAddress(v_pollingChannelIndex))); + v_request_req2.from_ := PX_TS_CSE1.cseId; v_response_rsp1.primitiveContent := { requestPrimitive := v_request_req2 }; - mcaPortIn.send(m_response(v_response_rsp1)); + //send back responsePrimitive + f_send(e_mcaPortIn, m_response(v_response_rsp1)); } [] tc_ac.timeout { setverdict(inconc, __SCOPE__&":INFO: No request received for creating resource type Polling Channel"); diff --git a/OneM2M_Testcases_AE_Release_3.ttcn b/OneM2M_Testcases_AE_Release_3.ttcn index d5d5a2e4f9cf37368691b8df173dd1943a25e3bb..44786d2d7130c321fe2266f5b6514a3e95f062c3 100644 --- a/OneM2M_Testcases_AE_Release_3.ttcn +++ b/OneM2M_Testcases_AE_Release_3.ttcn @@ -24,6 +24,105 @@ module OneM2M_Testcases_AE_Release_3 { group AE { + group OBI { + + group Registration { + + /** + * @desc Check that the IUT sends an AE initial registration request when it is started + */ + testcase TC_AE_OBI_REG_001() runs on Tester system AeSystem { + + var CseSimu v_cse1Simu := CseSimu.create("CSE1") alive; + + v_cse1Simu.start(f_AE_OBI_REG_001()); + v_cse1Simu.done; + } + + } + + group Initialization { + + /** + * @desc Check that the IUT starts the Initialization sequence of an Ontology based Interworking + * IPE and retrieves the formal description of the ontology + */ + testcase TC_AE_OBI_INI_001() runs on Tester system AeSystem { + + var CseSimu v_os1 := CseSimu.create("OS1") alive; + + v_os1.start(f_AE_OBI_INI_001()); + v_os1.done; + } + + } + + group Discovery { + + /** + * @desc Check that the IUT starts the Initialization sequence of an Ontology based Interworking + * IPE and retrieves the formal description of the ontology + */ + testcase TC_AE_OBI_DIS_001() runs on Tester system AeSystem { + + var CseSimu v_cse1Simu := CseSimu.create("CSE1") alive; + + v_cse1Simu.start(f_AE_OBI_DIS_001()); + v_cse1Simu.done; + } + + /** + * @desc Check that the IUT continues to discover the devices in the non-oneM2M area + */ + testcase TC_AE_OBI_DIS_002() runs on Tester system AeSystem { + + var CseSimu v_cse1Simu := CseSimu.create("CSE1") alive; + + v_cse1Simu.start(f_AE_OBI_DIS_002()); + v_cse1Simu.done; + } + + /** + * @desc Check that the IUT continues to discover the devices in the non-oneM2M area + */ + testcase TC_AE_OBI_DIS_003() runs on Tester system AeSystem { + + var CseSimu v_cse1Simu := CseSimu.create("CSE1") alive; + + v_cse1Simu.start(f_AE_OBI_DIS_003()); + v_cse1Simu.done; + } + + /** + * @desc Check that the IUT accepts "on demand" discovery + */ + testcase TC_AE_OBI_DIS_004() runs on Tester system AeSystem { + + var CseSimu v_cse1Simu := CseSimu.create("CSE1") alive; + + v_cse1Simu.start(f_AE_OBI_DIS_004()); + v_cse1Simu.done; + } + + } + + group Retrieve { + + /** + * @desc Check that the IUT accepts a retrieval request resource and responds 2000 (OK) status + */ + testcase TC_AE_OBI_RET_001() runs on Tester system AeSystem { + + var CseSimu v_cse1Simu := CseSimu.create("CSE1") alive; + + v_cse1Simu.start(f_AE_OBI_RET_001()); + v_cse1Simu.done; + } + + } + + } + group HAIM { group Create { @@ -33,21 +132,6 @@ module OneM2M_Testcases_AE_Release_3 { */ group g_AE_HAIM_CRE_001 { - testcase TC_AE_HAIM_CRE_001_AIR() runs on Tester system AeSystem { - - var CseSimu v_cse1 := CseSimu.create("CSE1") alive; - var template UtTriggerPrimitive v_utRequest := m_utCreateDeviceAirConditioner; - var template RequestPrimitive v_requestPrimitive := mw_createDeviceAirConditioner; - - var universal charstring v_action := __SCOPE__ & ": Please, send a valid CREATE Request for deviceAirConditioner device model to "; - var XSD.AnyURI v_containerDefinition := "org.onem2m.home.device.deviceAirConditioner"; - - v_utRequest.requestPrimitive.primitiveContent.deviceAirConditioner.containerDefinition := v_containerDefinition; - v_requestPrimitive.primitiveContent.deviceAirConditioner.containerDefinition := v_containerDefinition; - - v_cse1.start(f_AE_HAIM_CRE_001(v_action, v_utRequest, v_requestPrimitive)); - v_cse1.done; - } testcase TC_AE_HAIM_CRE_001_CLO() runs on Tester system AeSystem { diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index 67f87073b706fd02ff288fc50d3c36bac44fa7c4..2abce727e704c9dc2a694650426b2cb618e292ab 100644 --- a/OneM2M_Testcases_CSE_Release_1.ttcn +++ b/OneM2M_Testcases_CSE_Release_1.ttcn @@ -43,7 +43,7 @@ module OneM2M_Testcases_CSE_Release_1 { var integer i; var XSD.ID v_resourceAddress; var RequestPrimitive v_request; - map(self:mcaPort, system:mcaPort); + f_cf01Up(); for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) { @@ -77,8 +77,7 @@ module OneM2M_Testcases_CSE_Release_1 { } } - unmap(self:mcaPort, system:mcaPort); - stop; + f_cf01Down(); } }//end group helpingTestCases @@ -1244,7 +1243,7 @@ module OneM2M_Testcases_CSE_Release_1 { f_send(e_mcaPort, m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responsePrimitive(int4107))) { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4126))) { tc_ac.stop; setverdict(pass, __SCOPE__ & ": AE creation rejected."); } @@ -8327,21 +8326,30 @@ module OneM2M_Testcases_CSE_Release_1 { // Local variables var MsgIn v_response; var integer v_aeIndex := -1; + var integer v_ae2Index := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; var RequestPrimitive v_request; // Test control // Test component configuration - f_cf01Up(); + f_cf01Up(true); // Test adapter configuration // Preamble v_aeIndex := f_cse_preamble_registerAe();//c_CRUDNDi); - v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription - v_request.primitiveContent.subscription.notificationURI := {"NotReachableNotificationURI"}; + vc_ae2.start(f_cse_createAccessControlPolicyAux("SubscriptionVerificationAcp",{"all"}, int63)); + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + vc_ae2.start(f_cse_createResource_withAcpAux(int2, m_createAe(PX_TS_AE2.appId, -, PX_TS_AE2.aeIdStem, c_defaultAe2ResourceName, -), -1)); // AE2 is registred + f_aeSimu_checkComponentDoneAndGetVerdict(vc_ae2); + + v_ae2Index := f_getLatestResource(vc_ae2); + + v_request := f_getCreateRequestPrimitive(int23, m_createSubscriptionBase, v_aeIndex); + v_request.primitiveContent.subscription.notificationURI := {f_getResourceAddress(v_ae2Index)}; // Test Body f_send(e_mcaPort, m_request(v_request)); @@ -8421,6 +8429,7 @@ module OneM2M_Testcases_CSE_Release_1 { v_resourceIndex := f_cse_createResource(int23, v_request, v_aeIndex);//Subscription if(vc_ae2.running) { + setverdict(inconc, __SCOPE__ & ": Notification not received"); vc_ae2.stop; }; @@ -9743,10 +9752,14 @@ module OneM2M_Testcases_CSE_Release_1 { f_send(e_mcaPort, m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responseDiscovery)){ + [] mcaPort.receive(mw_response(mw_responseDiscovery({?}))){ tc_ac.stop; setverdict(pass, __SCOPE__ & ": URI List Representation available"); } + [] mcaPort.receive(mw_response(mw_responseDiscovery)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI List Representation available but not the expected number of elements"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); @@ -9935,7 +9948,6 @@ module OneM2M_Testcases_CSE_Release_1 { var RequestPrimitive v_request; var integer v_childResourceIndex := -1; const ResourceType c_containerResourceType := int3; - var integer v_i_cont := 0; // Test control @@ -9955,17 +9967,18 @@ module OneM2M_Testcases_CSE_Release_1 { f_send(e_mcaPort, m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responseDiscovery({?}))) -> value v_response { tc_ac.stop; - while (v_i_cont<lengthof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){ - if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) { - setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element"); - } else { - setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element"); - } - v_i_cont := v_i_cont + 1; + if (f_isNonHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) { + setverdict(pass, __SCOPE__ & ": Non-hierarchical address form present in URIList[0] element"); + } else { + setverdict(fail, __SCOPE__ & ": Non-hierarchical address form absent in URIList[0] element"); } } + [] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI List Representation available but not the expected number of elements"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); @@ -10005,6 +10018,7 @@ module OneM2M_Testcases_CSE_Release_1 { var RequestPrimitive v_requestPrimitive := valueof(m_createContainerBase); var integer v_aeIndex := -1; var integer v_resourceIndex := -1; + var integer v_childResourceIndex := -1; var RequestPrimitive v_request; const ResourceType c_containerResourceType := int3; @@ -10024,9 +10038,11 @@ module OneM2M_Testcases_CSE_Release_1 { v_aeIndex := f_cse_preamble_registerAe();//AE1 is registred; + v_resourceIndex := f_cse_createResource(c_containerResourceType, v_requestPrimitive, v_aeIndex); + v_requestPrimitive := f_setAcpId(v_requestPrimitive, {f_getResourceId(vc_resourcesList[vc_acpIndex].resource)}); + v_childResourceIndex := f_cse_createResource(c_containerResourceType, v_requestPrimitive, v_resourceIndex); - v_resourceIndex := f_cse_createResource(c_containerResourceType, v_requestPrimitive, v_aeIndex); v_request := valueof(m_retrieveFilterUsageOption(f_getResourceAddress(v_resourceIndex), f_getOriginator(v_resourceIndex), int1)); f_send(e_mcaPort, m_request(v_request)); tc_ac.start; @@ -10366,7 +10382,6 @@ module OneM2M_Testcases_CSE_Release_1 { var RequestPrimitive v_request; var integer v_childResourceIndex := -1; const ResourceType c_containerResourceType := int3; - var integer v_i_cont := 0; // Test control @@ -10386,17 +10401,18 @@ module OneM2M_Testcases_CSE_Release_1 { f_send(e_mcaPort, m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responseDiscovery({?}))) -> value v_response { tc_ac.stop; - while (v_i_cont<lengthof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){ - if (f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) { - setverdict(pass, __SCOPE__ & ": Hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element"); - } else { - setverdict(fail, __SCOPE__ & ": Hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element"); - } - v_i_cont := v_i_cont + 1; + if (f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) { + setverdict(pass, __SCOPE__ & ": Hierarchical address form present in URIList[0] element"); + } else { + setverdict(fail, __SCOPE__ & ": Hierarchical address form absent in URIList[0] element"); } } + [] mcaPort.receive(mw_response(mw_responseDiscovery)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI List Representation available but not the expected number of elements"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); @@ -10439,7 +10455,6 @@ module OneM2M_Testcases_CSE_Release_1 { var RequestPrimitive v_request; var integer v_childResourceIndex := -1; const ResourceType c_containerResourceType := int3; - var integer v_i_cont := 0; // Test control @@ -10459,17 +10474,18 @@ module OneM2M_Testcases_CSE_Release_1 { f_send(e_mcaPort, m_request(v_request)); tc_ac.start; alt { - [] mcaPort.receive(mw_response(mw_responseDiscovery)) -> value v_response { + [] mcaPort.receive(mw_response(mw_responseDiscovery({?}))) -> value v_response { tc_ac.stop; - while (v_i_cont<lengthof(v_response.primitive.responsePrimitive.primitiveContent.uRIList)){ - if (f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[v_i_cont])) { - setverdict(pass, __SCOPE__ & ": Hierarchical address form present in URIList[" & int2str(v_i_cont) & "] element"); - } else { - setverdict(fail, __SCOPE__ & ": Hierarchical address form absent in URIList[" & int2str(v_i_cont) & "] element"); - } - v_i_cont := v_i_cont + 1; + if (f_isHierarchical(v_response.primitive.responsePrimitive.primitiveContent.uRIList[0])) { + setverdict(pass, __SCOPE__ & ": Hierarchical address form present in URIList[0] element"); + } else { + setverdict(fail, __SCOPE__ & ": Hierarchical address form absent in URIList[0] element"); } } + [] mcaPort.receive(mw_response(mw_responseDiscovery)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": URI List Representation available but not the expected number of elements"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) { tc_ac.stop; setverdict(fail, __SCOPE__ & ": Wrong response status code"); diff --git a/OneM2M_Testcases_CSE_Release_3.ttcn b/OneM2M_Testcases_CSE_Release_3.ttcn index 481608044c60fe8c931b922e6fec038e194897f8..12a7e215a580fc068068f0e58e7da242c346fa08 100644 --- a/OneM2M_Testcases_CSE_Release_3.ttcn +++ b/OneM2M_Testcases_CSE_Release_3.ttcn @@ -28,13 +28,20 @@ module OneM2M_Testcases_CSE_Release_3 { group helpingTestCases {//These are not part of the test suite, just for verification purposes - testcase TC_DELETE_RESOURCES() runs on AeSimu system CseSystem { + testcase TC_DELETE_RESOURCES() runs on Tester system CseSystem { + var AeSimu v_ae1 := AeSimu.create("AE1") alive; + + v_ae1.start(f_DELETE_RESOURCES()); + v_ae1.done; + } + + function f_DELETE_RESOURCES() runs on AeSimu system CseSystem{ timer t_ac := 5.0; var integer i; var XSD.ID v_resourceAddress; var RequestPrimitive v_request; - map(self:mcaPort, system:mcaPort) param (PX_TS_AE1.mcaPort); + f_cf01Up(); for (i:=0; i<lengthof(PX_RESOURCES_TO_BE_DELETED); i:= i+1) { @@ -68,7 +75,7 @@ module OneM2M_Testcases_CSE_Release_3 { } } - unmap(self:mcaPort, system:mcaPort); + f_cf01Down(); stop; }