From 276f1b7a2609e39997a46c7d860234dee5a844c7 Mon Sep 17 00:00:00 2001 From: acverdugo <acverdugo@at4wireless.com> Date: Fri, 20 Oct 2017 15:01:50 +0200 Subject: [PATCH] Registration updates Signed-off-by: acverdugo <acverdugo@at4wireless.com> --- LibOneM2M/OneM2M_Templates.ttcn | 4 + OneM2M_Testcases_CSE.ttcn | 265 +++++++++++++++++++++++++++++--- 2 files changed, 250 insertions(+), 19 deletions(-) diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 357bec1..200d7ec 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -1209,6 +1209,10 @@ module OneM2M_Templates { cSEBase := p_cSEBase } + template PrimitiveContent m_primitiveContentRemoteCSE(template RemoteCSE_optional p_remoteCSE) := { + remoteCSE := p_remoteCSE + } + template PrimitiveContent mw_primitiveContent := ?; /** diff --git a/OneM2M_Testcases_CSE.ttcn b/OneM2M_Testcases_CSE.ttcn index 99e6f36..76f6d2e 100644 --- a/OneM2M_Testcases_CSE.ttcn +++ b/OneM2M_Testcases_CSE.ttcn @@ -1472,6 +1472,56 @@ module OneM2M_Testcases_CSE { } + /** + * @desc Check that the IUT rejects a create request of <AE> resource that doesn’t include the MANDATORY_ATTRIBUTE + * + */ + testcase TC_CSE_REG_CRE_021() runs on AeSimu system CseSystem { + + // Local variables + var RequestPrimitive v_request; + var integer v_cseBaseIndex := -1; + var ResourceType v_resourceType := int2; + + // Test control + + // Test component configuration + f_cf01Up(); + + // Test adapter configuration + + // Preamble +kk + // Test Body + f_cse_createResource(int2, m_createAe(omit, omit, omit)); //Mandatory app_ID field is being set empty + + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) { //BAD REQUEST + tc_ac.stop; + setverdict(pass, __SCOPE__ & ": Request successfully rejected"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) { + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Wrong response status code"); + } + [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)){ + tc_ac.stop; + setverdict(fail, __SCOPE__ & ": Error, AE has been registered"); + } + [] tc_ac.timeout { + setverdict(fail, __SCOPE__ & ": No answer while retrieving resource"); + } + } + + // Postamble + f_cse_postamble_deleteResources(); + + // Tear down + f_cf01Down(); + + }//end TC_CSE_REG_CRE_027 + /** * @desc Check that the IUT accepts an create request of <remoteCSE> resource with attributes multiplicity equals to 1. * @@ -1764,31 +1814,54 @@ module OneM2M_Testcases_CSE { } - /*testcase TC_CSE_REG_CRE_034_RN() runs on Tester system CseSystem { + /** + * @desc Check that IUT accepts a CSE registration request with cseType attribute set to ‘MN_CSE’ + * + */ + testcase TC_CSE_REG_CRE_030() runs on CseSimu system CseSystem { //Local variables + var ResourceType v_resourceType := int16; //remoteCSE var RequestPrimitive v_request; - var PrimitiveContent v_contentResponse; - - p_request := valueof(m_createRemoteCSEBase); - p_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE - p_request.primitiveContent.remoteCSE.resourceName := c_defaultRemoteCSEResourceName; + var template PrimitiveContent v_contentResponse; + // Test control - p_contentResponse.remoteCSE := mw_contentRemoteCSEBase; - p_contentResponse.remoteCSE.cseType := int2; //MN_CSE - p_contentResponse.remoteCSE.resourceName := c_defaultRemoteCSEResourceName; - - f_CSE_REG_CRE_034(p_request, p_contentResponse); - - - }*/ + // Test component configuration + f_cf04Up(); + + // Test adapter configuration + + // Preamble + v_request := valueof(m_createRemoteCSEBase); + + v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; + + //Test Body + vc_remoteCseIndex := f_cse_registerRemoteCse(v_request, v_contentResponse); + + //Check if the resource has been deleted or not + if(f_cse_isResourcePresent(vc_remoteCseIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + + }//end TC_CSE_REG_CRE_030 /** - * @desc Check that IUT accepts a CSE registration request with OPTIONAL_ATTRIBUTE attribute + * @desc Check that IUT accepts a CSE registration request with cseType attribute set to ‘MN_CSE’ * */ - function f_CSE_REG_CRE_034(RequestPrimitive p_request, PrimitiveContent p_contentResponse) runs on CseSimu{ //system CseSystem { + testcase TC_CSE_REG_CRE_033() runs on CseSimu system CseSystem { //Local variables var ResourceType v_resourceType := int16; //remoteCSE + var RequestPrimitive v_request; + var template PrimitiveContent v_contentResponse; // Test control // Test component configuration @@ -1797,10 +1870,21 @@ module OneM2M_Testcases_CSE { // Test adapter configuration // Preamble - + v_request := valueof(m_createRemoteCSEBase); + v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE + + v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; + v_contentResponse.remoteCSE.cseType := int2; //MN_CSE //Test Body - vc_remoteCseIndex := f_cse_registerRemoteCse(p_request, p_contentResponse); + vc_remoteCseIndex := f_cse_registerRemoteCse(v_request, v_contentResponse); + + //Check if the resource has been deleted or not + if(f_cse_isResourcePresent(vc_remoteCseIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); + } // Postamble f_cse_postamble_deleteResourcesCSE(); @@ -1808,7 +1892,141 @@ module OneM2M_Testcases_CSE { // Tear down f_cf04Down(); - }//end TC_CSE_REG_CRE_034 + }//end TC_CSE_REG_CRE_033 + + /** + * @desc Check that IUT accepts a CSE registration request with OPTIONAL_ATTRIBUTE attribute + * + */ + group g_CSE_REG_CRE_034 { + + testcase TC_CSE_REG_CRE_034_RN() runs on Tester system CseSystem { + //Local variables + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + var RequestPrimitive v_request; + var template PrimitiveContent v_contentResponse; + + v_request := valueof(m_createRemoteCSEBase); + v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE + v_request.primitiveContent.remoteCSE.resourceName := c_defaultRemoteCSEResourceName; + + v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; + v_contentResponse.remoteCSE.cseType := int2; //MN_CSE + v_contentResponse.remoteCSE.resourceName := c_defaultRemoteCSEResourceName; + + v_cse1.start(f_CSE_REG_CRE_034(v_request, v_contentResponse)); + v_cse1.done; + + } + + testcase TC_CSE_REG_CRE_034_ET() runs on Tester system CseSystem { + //Local variables + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + var RequestPrimitive v_request; + var template PrimitiveContent v_contentResponse; + + v_request := valueof(m_createRemoteCSEBase); + v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE + v_request.primitiveContent.remoteCSE.expirationTime := "20301231T012345"; + + v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; + v_contentResponse.remoteCSE.cseType := int2; //MN_CSE + v_contentResponse.remoteCSE.expirationTime := "20301231T012345"; + + v_cse1.start(f_CSE_REG_CRE_034(v_request, v_contentResponse)); + v_cse1.done; + + } + + testcase TC_CSE_REG_CRE_034_LBL() runs on Tester system CseSystem { + //Local variables + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + var RequestPrimitive v_request; + var template PrimitiveContent v_contentResponse; + var Labels v_labels_1 := {"VALUE_1"}; + + v_request := valueof(m_createRemoteCSEBase); + v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE + v_request.primitiveContent.remoteCSE.labels := v_labels_1; + + v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; + v_contentResponse.remoteCSE.cseType := int2; //MN_CSE + v_contentResponse.remoteCSE.labels := v_labels_1; + + v_cse1.start(f_CSE_REG_CRE_034(v_request, v_contentResponse)); + v_cse1.done; + + } + + testcase TC_CSE_REG_CRE_034_POA() runs on Tester system CseSystem { + //Local variables + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + var RequestPrimitive v_request; + var template PrimitiveContent v_contentResponse; + + v_request := valueof(m_createRemoteCSEBase); + v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE + v_request.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; + + v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; + v_contentResponse.remoteCSE.cseType := int2; //MN_CSE + v_contentResponse.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; + + v_cse1.start(f_CSE_REG_CRE_034(v_request, v_contentResponse)); + v_cse1.done; + + } + + testcase TC_CSE_REG_CRE_034_NL() runs on Tester system CseSystem { + //Local variables + var CseSimu v_cse1 := CseSimu.create("CSE1") alive; + var RequestPrimitive v_request; + var template PrimitiveContent v_contentResponse; + + v_request := valueof(m_createRemoteCSEBase); + v_request.primitiveContent.remoteCSE.cseType := int2; //MN_CSE + v_request.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; + + v_contentResponse.remoteCSE := mw_contentRemoteCSEBase; + v_contentResponse.remoteCSE.cseType := int2; //MN_CSE + v_contentResponse.remoteCSE.nodeLink := c_defaultNodeID; + + v_cse1.start(f_CSE_REG_CRE_034(v_request, v_contentResponse)); + v_cse1.done; + + } + + function f_CSE_REG_CRE_034(RequestPrimitive p_request, template PrimitiveContent p_contentResponse) runs on CseSimu{ //system CseSystem { + //Local variables + var ResourceType v_resourceType := int16; //remoteCSE + // Test control + + // Test component configuration + f_cf04Up(); + + // Test adapter configuration + + // Preamble + + + //Test Body + vc_remoteCseIndex := f_cse_registerRemoteCse(p_request, p_contentResponse); + + //Check if the resource has been deleted or not + if(f_cse_isResourcePresent(vc_remoteCseIndex)) { + setverdict(pass, __SCOPE__ & ":INFO: Resource created"); + } else { + setverdict(fail, __SCOPE__ & ":INFO: Resource not created"); + } + + // Postamble + f_cse_postamble_deleteResourcesCSE(); + + // Tear down + f_cf04Down(); + + }//end TC_CSE_REG_CRE_034 + }//end g_CSE_REG_CRE_034 } //end group Create @@ -2972,6 +3190,9 @@ module OneM2M_Testcases_CSE { */ testcase TC_CSE_REG_DEL_004() runs on CseSimu system CseSystem { //Local variables + var template UtTriggerPrimitive v_utRequest := m_utDeleteRequest; + var UtTriggerAckPrimitive v_trigger_response; + var integer v_auxInteger; // Test control // Test component configuration @@ -2981,6 +3202,12 @@ module OneM2M_Testcases_CSE { // Preamble vc_remoteCseIndex := f_cse_registrationRemoteCse(mw_createRemoteCSEBase); + + //Send Trigger Message + v_auxInteger := f_setResource(valueof(m_primitiveContentRemoteCSE(m_contentCreateRemoteCSE(omit,omit,omit,omit))), int16); + v_utRequest.to_ := f_getResourceAddress(v_auxInteger); + v_utRequest.from_ := "UNINITIALIZED"; + f_sendUtPrimitive(v_utRequest); // Test Body tc_ac.start; -- GitLab