diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 05386ab5ff773740cdba9b3d6897c6149491709a..6f1015df7a3462bdccadcab28251cb547e70acb9 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -191,8 +191,10 @@ module OneM2M_Functions { function f_cf04Up() runs on CseSimu { // Variables + var PrimitiveContent v_cSEBaseResource; vc_config := e_cf04; - vc_testSystemRole := e_cse; + vc_testSystemRole := e_cse; + // Map map(self:mccPort, system:mccPort); @@ -200,10 +202,15 @@ module OneM2M_Functions { map(self:acPort, system:acPort); activate(a_default()); activate(a_cse_cf04()); + + //Creation of CSEBase + + v_cSEBaseResource := f_cse_generateLocalResource(-, -1, int5); + vc_cSEBaseIndex := f_setLocalResource(v_cSEBaseResource, int5, -1); // Connect - //Initialze the IUT + //Initialize the IUT } // end f_cf03Up @@ -1568,8 +1575,8 @@ module OneM2M_Functions { setverdict(pass, __SCOPE__&":INFO: Resource type RemoteCSE created successfuly"); f_checkAttributesToBeSaved(int16, v_request, v_response.primitive.responsePrimitive); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, int16, -1); - v_remoteCSEResource := f_cse_generateLocalResource(v_response.primitive.responsePrimitive.primitiveContent, 1, int16); - v_localResourceIndex := f_setLocalResource(v_remoteCSEResource, int16, -1); + v_remoteCSEResource := f_cse_generateLocalResource(v_response.primitive.responsePrimitive.primitiveContent, vc_cSEBaseIndex, int16); + v_localResourceIndex := f_setLocalResource(v_remoteCSEResource, int16, vc_cSEBaseIndex); } [] mccPort.receive(mw_response(mw_responsePrimitiveKO)) { tc_ac.stop; @@ -1608,8 +1615,8 @@ module OneM2M_Functions { [] mccPortIn.receive(mw_request(p_requestPrimitive)) -> value v_request { tc_ac.stop; setverdict(pass, __SCOPE__&":INFO: Resource type RemoteCSE created successfuly"); - v_remoteCSEResource := f_cse_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, 1, int16);//TODO Get index from v_request.primitive.requestPrimitive.to_ - v_localResourceIndex := f_setLocalResource(v_remoteCSEResource, int16, -1); + v_remoteCSEResource := f_cse_generateLocalResource(v_request.primitive.requestPrimitive.primitiveContent, vc_cSEBaseIndex, int16);//TODO Get index from v_request.primitive.requestPrimitive.to_ + v_localResourceIndex := f_setLocalResource(v_remoteCSEResource, int16, vc_cSEBaseIndex); v_response := valueof(m_responsePrimitive(int2001,v_request.primitive.requestPrimitive.requestIdentifier)); v_response.from_ := PX_CSE1_ID; @@ -1670,13 +1677,29 @@ module OneM2M_Functions { * @param p_resourceType Type of the resource to be created * @return Internal created resource */ - function f_cse_generateLocalResource(in PrimitiveContent p_resource, in integer p_parentIndex, in ResourceType p_resourceType) runs on CseSimu return PrimitiveContent { + function f_cse_generateLocalResource(in template(omit) PrimitiveContent p_resource := omit, in integer p_parentIndex, in ResourceType p_resourceType) runs on CseSimu return PrimitiveContent { var integer v_resourceIndex := lengthof(vc_localResourcesList); var PrimitiveContent v_myResource; // TODO To review the code (use of indexes, generation of value for certain attributes, etc..) - if(p_resourceType == int16 and ispresent(p_resource)) { + if(p_resourceType == int5) { //CSEBase + v_myResource.cSEBase.resourceName := "CSEBase"; + v_myResource.cSEBase.resourceType := p_resourceType; + v_myResource.cSEBase.resourceID := "CSEBase"; + v_myResource.cSEBase.parentID := omit; //Following TS-0001, it must be NULL + v_myResource.cSEBase.creationTime := fx_generateTimestamp(); + v_myResource.cSEBase.lastModifiedTime := v_myResource.cSEBase.creationTime; + v_myResource.cSEBase.cSE_ID := PX_CSE1_ID; + v_myResource.cSEBase.supportedResourceType := PX_CSE1_SRT; + v_myResource.cSEBase.pointOfAccess := {f_getAnnouncementTargetPoA(PX_PROTOCOL_BINDING, PX_CSE1_ADDRESS, "")}; + if (PX_MN_CSE){ + v_myResource.cSEBase.cseType := int1; //Tester is an IN-CSE + }else if (PX_IN_CSE){ + v_myResource.cSEBase.cseType := int2; //Tester is a MN-CSE + } + + }else if(p_resourceType == int16 and ispresent(p_resource)) { //RemoteCSE if(ischosen(p_resource.remoteCSE)){ v_myResource.remoteCSE := p_resource.remoteCSE; @@ -1684,8 +1707,7 @@ module OneM2M_Functions { v_myResource.remoteCSE.resourceName := "remoteCSE" & int2char(v_resourceIndex); } v_myResource.remoteCSE.resourceType := p_resourceType; - //v_myResource.remoteCSE.resourceID := "remoteCSE" & int2char(v_resourceIndex); - v_myResource.remoteCSE.resourceID := "remoteCSE"; + v_myResource.remoteCSE.resourceID := "remoteCSE" & int2char(v_resourceIndex); v_myResource.remoteCSE.parentID := f_getResourceId(vc_localResourcesList[p_parentIndex].resource); v_myResource.remoteCSE.creationTime := fx_generateTimestamp(); if(not(ispresent(p_resource.remoteCSE.expirationTime))) { @@ -2721,9 +2743,8 @@ module OneM2M_Functions { group CommonFunctions { /** - * @desc Sending of an Adapter Control primitive - * @param event Action to be performed by TA - * @param data Corresponding information for the correct execution of the given action + * @desc Boolean to charstring + * @param p_bool * @verdict */ function f_bool2str(in boolean p_bool) runs on Tester return charstring { @@ -2851,7 +2872,7 @@ module OneM2M_Functions { }else{ - action(__SCOPE__ & ":" & p_action); + action(p_action); } diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index bc046b783d70ee46c07d37fffd73f7d5e91c5644..92e13bda6d0fd4aa8b3ca7aff8ed5a4653575c37 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -104,6 +104,11 @@ module OneM2M_Pixits { * @desc Test System CSE1 resource ID with Unstructured-CSE-relative-Resource-ID (relative) format according to TS-0001-7.2-1 */ modulepar XSD.ID PX_CSE1_RESOURCE_ID := "CSE1_RESOURCE_ID"; + + /** + * @desc CSE1 Supported resource type + */ + modulepar ResourceTypeList_1 PX_CSE1_SRT := {int1, int2, int3, int16}; /** * @desc Test System M2M-SP1-ID with M2M-SP-ID format (absolute) according to TS-0001-7.2-1 Unstructured-CSE-relative -Resource-ID diff --git a/LibOneM2M/OneM2M_TestSystem.ttcn b/LibOneM2M/OneM2M_TestSystem.ttcn index c3fc66f1548c2cab2d69d25892c6de28fa3add3a..5f87154c3b7596f5c5a2650926bdf515f9e2490e 100644 --- a/LibOneM2M/OneM2M_TestSystem.ttcn +++ b/LibOneM2M/OneM2M_TestSystem.ttcn @@ -62,6 +62,7 @@ module OneM2M_TestSystem { var MyResourcesList vc_localResourcesList; var AeSimu vc_ae1;//For CF02 when CseSimu is master var integer vc_remoteCseIndex; + var integer vc_cSEBaseIndex; //Index of the CSEBase resource of the Tester inside vc_localResourcesList }; type component InCseSimu extends CseSimu {} diff --git a/OneM2M_Testcases_CSE.ttcn b/OneM2M_Testcases_CSE.ttcn index b93bf2ffd9e048519dbd764995920298a41c627b..9b43d7df359035782bab8a859091ce08f84b45fb 100644 --- a/OneM2M_Testcases_CSE.ttcn +++ b/OneM2M_Testcases_CSE.ttcn @@ -2749,7 +2749,7 @@ module OneM2M_Testcases_CSE { var ResourceType v_resourceType := int16; //remoteCSE var template PrimitiveContent v_contentResponse; var template UtTriggerPrimitive v_utRequest; - var charstring v_action := "Please, send a valid RETRIEVE Request containing To set to " & PX_CSE1_ADDRESS; + var charstring v_action := __SCOPE__ & ":" & " Please, send a valid RETRIEVE Request containing To set to " & PX_CSE1_ADDRESS; // Test control if(not(PICS_MN_CSE)) { @@ -3102,7 +3102,7 @@ module OneM2M_Testcases_CSE { var RequestPrimitive v_request; var ResourceType v_resourceType := int16; //remoteCSE var template UtTriggerPrimitive v_utRequest := m_utCreateRemoteCSE; - var charstring v_action := "Please, send a valid RETRIEVE Request containing To set to " & PX_CSE1_ADDRESS & " and Content containing remoteCSE resource containing attribute " & p_Attribute.name & " set to " & p_Attribute.value_; + var charstring v_action := __SCOPE__ & ":" & " Please, send a valid RETRIEVE Request containing To set to " & PX_CSE1_ADDRESS & " and Content containing remoteCSE resource containing attribute " & p_Attribute.name & " set to " & p_Attribute.value_; // Test control if(not(PICS_MN_CSE)) { @@ -3326,7 +3326,7 @@ module OneM2M_Testcases_CSE { var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest; var UtTriggerAckPrimitive v_trigger_response; var integer v_auxInteger; - var charstring v_action := "Please, send a valid DELETE Request containing To set to " & PX_CSE1_ADDRESS; + var charstring v_action := __SCOPE__ & ":" & " Please, send a valid DELETE Request containing To set to " & PX_CSE1_ADDRESS; // Test control // Test component configuration