From 57c8683bc64d5d3d8030dde9b76436dd555a1c9b Mon Sep 17 00:00:00 2001 From: pkulkarni <pkulkarni75@gmail.com> Date: Wed, 26 Jul 2017 09:30:55 +0200 Subject: [PATCH] TTCN changes to check the TP requirements for creation/non-creation of Resource. --- LibOneM2M/OneM2M_Functions.ttcn | 57 +++++++ LibOneM2M/OneM2M_Templates.ttcn | 2 +- OneM2M_Testcases.ttcn | 264 ++++++++++++++++++++++++++++++-- 3 files changed, 305 insertions(+), 18 deletions(-) diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index e6677ed..6c46314 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -624,6 +624,63 @@ module OneM2M_Functions { }// end f_cse_deleteResource + function f_isResourceCreated (integer p_resourceIndex) runs on CseTester return boolean { + + var ResponseStatusCode v_responseStatusCode; + + //Check to see if the resource has been created or not + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_resourceIndex), f_getOriginator(p_resourceIndex)))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int2001))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource created: " & f_getResourceAddress(p_resourceIndex)); + return true; + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(?))) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Wrong response status code in the response"); + return false; + } + [] tc_ac.timeout { + setverdict(fail, testcasename() & ": No answer while creating resource"); + return false; + } + } + + } + + function f_isResourceNotCreated (integer p_parentIndex, XSD.String p_resourceName) runs on CseTester return boolean { + + var ResponseStatusCode v_responseStatusCode; + + log(testcasename() & "Hierarchical method is required to check the non creation of the resource"); + vc_addressingMethod := e_hierarchical; + //Check to see if the resource has NOT been created + mcaPort.send(m_request(m_retrieveResource(f_getResourceAddress(p_parentIndex) & "/" & p_resourceName, f_getOriginator(p_parentIndex)))); + tc_ac.start; + alt { + [] mcaPort.receive(mw_response(mw_responsePrimitive(int4004))) { + tc_ac.stop; + setverdict(pass, testcasename() & ": Resource not created"); + vc_addressingMethod := PX_ADDRESSING_METHOD; + return true; + } + [] mcaPort.receive(mw_response(mw_responsePrimitive(?))) { + tc_ac.stop; + setverdict(fail, testcasename() & ": Wrong response status code in the response"); + vc_addressingMethod := PX_ADDRESSING_METHOD; + return false; + } + [] tc_ac.timeout { + setverdict(fail, testcasename() & ": No answer while creating resource"); + vc_addressingMethod := PX_ADDRESSING_METHOD; + return false; + } + } + + } + /** * @desc Update of the auxiliar ACP resource * @param p_allowedOperations New allowed operations diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 631f4fa..cd2c3bc 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -3143,7 +3143,7 @@ module OneM2M_Templates { primitiveContent := p_content } - template ResponsePrimitive mw_responsePrimitive(ResponseStatusCode p_statusCode) := { + template ResponsePrimitive mw_responsePrimitive(template ResponseStatusCode p_statusCode) := { responseStatusCode := p_statusCode, requestIdentifier := ?, primitiveContent := *, diff --git a/OneM2M_Testcases.ttcn b/OneM2M_Testcases.ttcn index 6fdd55f..bd0c57a 100644 --- a/OneM2M_Testcases.ttcn +++ b/OneM2M_Testcases.ttcn @@ -2896,7 +2896,7 @@ module OneM2M_Testcases { tc_ac.stop; setverdict(pass, testcasename() & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_parentIndex); - vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_resourceIndex}; + vc_resourcesIndexToBeDeleted := vc_resourcesIndexToBeDeleted & {v_resourceIndex}; } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -2908,6 +2908,12 @@ module OneM2M_Testcases { } f_checkCseTesterStatus(); + //Check to see if the resource has been created + if (f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -3036,6 +3042,7 @@ module OneM2M_Testcases { var integer v_aeIndex := -1; var CseTester v_notifyHandler; var integer v_ae2Index := -1; + var integer v_resourceIndex := -1; // Test control @@ -3058,6 +3065,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Resource type " & int2str(enum2int(p_resourceType)) & " created successfully"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_aeIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -3067,7 +3075,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } - + + //Check to see if the resource has been created + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -3266,7 +3280,14 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource"); } } - + + //Check to see if the resource has NOT been created + if(f_isResourceNotCreated(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } + // Postamble f_cse_postamble_deleteResources(); @@ -3353,7 +3374,14 @@ module OneM2M_Testcases { setverdict(fail, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } - + + //Check to see if the resource has NOT been created + if(f_isResourceNotCreated(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } + // Postamble f_cse_postamble_deleteResources(); @@ -3415,6 +3443,7 @@ module OneM2M_Testcases { var MsgIn v_response; var RequestPrimitive v_request; var integer v_aeIndex := -1; + var integer v_resourceIndex := -1; // Test control @@ -3435,6 +3464,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Accepted creation rejected for resource type " & int2str(enum2int(p_resourceType))); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_aeIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -3444,6 +3474,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } + + //Check to see if the resource has been created + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -3498,11 +3535,19 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, testcasename() & ": Accepted creation of contentInstance exceding maximum number of instances"); + } [] tc_ac.timeout { setverdict(inconc, testcasename() & ": No answer while creating resource type 4"); } } + + //Check to see if the resource has NOT been created + if(f_isResourceNotCreated(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -3523,7 +3568,8 @@ module OneM2M_Testcases { var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; - const integer c_maxByteSize := 0; + const integer c_maxByteSize := 0; + var integer v_resourceIndex := -1; // Test control // Test component configuration @@ -3547,6 +3593,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitive(int5207))) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Maximun byte size exceeded"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_containerIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -3556,11 +3603,19 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, testcasename() & ": Accepted creation of contentInstance exceding maximum byte size"); + } [] tc_ac.timeout { setverdict(inconc, testcasename() & ": No answer while creating resource type 4"); } } + + //Check to see if the resource has been created or not + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -3670,6 +3725,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Not allowed to create a contentInstance resource named 'la'"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -3678,11 +3734,19 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, testcasename() & ": Accepted creation of contentInstance named 'la'"); + } [] tc_ac.timeout { setverdict(fail, testcasename() & ": No answer while creating resource type 4"); } } + + //Check to see if the resource has NOT been created + if(f_isResourceNotCreated(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -3703,6 +3767,7 @@ module OneM2M_Testcases { var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; + var boolean v_resourceCreated := false; // Test control @@ -3727,6 +3792,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4005))) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Not allowed to create a contentInstance resource named 'ol'"); + } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -3735,11 +3801,19 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(fail, testcasename() & ": Accepted creation of contentInstance named 'ol'"); + } [] tc_ac.timeout { setverdict(inconc, testcasename() & ": No answer while creating resource type 4"); } } + + //Check to see if the resource has NOT been created + if(f_isResourceNotCreated(v_containerIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -4404,6 +4478,7 @@ module OneM2M_Testcases { var CseTester v_notifyHandler; var integer v_ae2Index := -1; const XSD.NCName c_accessControlPolicyIDs := "accessControlPolicyIDs"; + var integer v_resourceIndex := -1; // Test control if(match(c_accessControlPolicyIDs,p_optionalAttribute.name)) { @@ -4442,6 +4517,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(f_getTemplateFromPrimitiveContent(v_request.primitiveContent)))) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Accepted creation for resource type " & int2str(enum2int(p_resourceType)) & " containing attribute " & p_optionalAttribute.name); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_parentIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK())) -> value v_response { tc_ac.stop; @@ -4455,6 +4531,13 @@ module OneM2M_Testcases { setverdict(fail, testcasename() & ": No answer while creating resource type " & int2str(enum2int(p_resourceType))); } } + + //Check to see if the resource has been created or not + if(f_isResourceCreated(v_resourceIndex)) { + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -9340,6 +9423,13 @@ module OneM2M_Testcases { } } + + //Check to see if the resource has NOT been created + if(f_isResourceNotCreated(v_aeAuxIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource <locationPolicy> not created"); + } else { + setverdict(fail, testcasename() & "Resource <locationPolicy> created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -9360,6 +9450,7 @@ module OneM2M_Testcases { var XSD.AnyURI locationServerAddress := PX_LOCATION_SERVER_ADDRESS; var RequestPrimitive v_request; var MsgIn v_response; + var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); @@ -9377,6 +9468,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_aeAuxIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -9386,6 +9478,12 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); } } + + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource locationPolicy created"); + } else { + setverdict(fail, testcasename() & "Resource locationPolicy not created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -9444,6 +9542,12 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); } } + + if(f_isResourceNotCreated(v_aeAuxIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -9492,7 +9596,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); } } - + + //Check to see if the resource has NOT been created + if(f_isResourceNotCreated(v_aeAuxIndex, f_getResourceName(v_request.primitiveContent))) { + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -9518,6 +9628,7 @@ module OneM2M_Testcases { var RequestPrimitive v_request; var RequestPrimitive v_locpolicy_request_preamble; var MsgIn v_response; + var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); @@ -9538,6 +9649,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitive(int4000))) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Update locationPolicy resource is rejected!!"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_locPolicyResourceIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; @@ -9547,7 +9659,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); } } - + + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } + // Postamble f_cse_postamble_deleteResources(); @@ -9572,7 +9690,8 @@ module OneM2M_Testcases { var RequestPrimitive v_loc_request_preamble; var RequestPrimitive v_container_request_preamble; var MsgIn v_response; - var LocationSource v_locationSource := int1;//Network-based + var LocationSource v_locationSource := int1;//Network-based + var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); @@ -9594,7 +9713,8 @@ module OneM2M_Testcases { if(not ispresent(v_response.primitive.responsePrimitive.primitiveContent.container.locationID)){ setverdict(fail, testcasename() & "No locationID is included in the response!"); }else{ - setverdict(pass, testcasename() & "Container resource associated with locationPolicy resource is successfully retrieved with locationID included in the response!"); + setverdict(pass, testcasename() & "Container resource associated with locationPolicy resource is successfully retrieved with locationID included in the response!"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_locContainerResourceIndex); } } @@ -9611,6 +9731,13 @@ module OneM2M_Testcases { } } + + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } + // Postamble f_cse_postamble_deleteResources(); @@ -9631,6 +9758,7 @@ module OneM2M_Testcases { var RequestPrimitive v_request; var MsgIn v_response; var LocationSource v_locationSource := int2;//Device-based + var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); @@ -9649,6 +9777,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_aeAuxIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -9657,7 +9786,13 @@ module OneM2M_Testcases { [] tc_ac.timeout { setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); } - } + } + + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -9679,6 +9814,7 @@ module OneM2M_Testcases { var LocationSource v_locationSource := int3;//Share-based var RequestPrimitive v_request; var MsgIn v_response; + var integer v_resourceIndex := -1; //Test component configuration f_cf01Up(); @@ -9698,6 +9834,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Resource locationPolicy is created successfully with response status code: " & int2str(enum2int(v_response.primitive.responsePrimitive.responseStatusCode))&"!"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_aeAuxIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -9706,7 +9843,13 @@ module OneM2M_Testcases { [] tc_ac.timeout { setverdict(inconc, testcasename() & ": Timeout due to no response from requested server!"); } - } + } + + if(f_isResourceCreated(v_resourceIndex)) { + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -10063,6 +10206,7 @@ module OneM2M_Testcases { var ListOfURIs v_memberIDs; var template RequestPrimitive v_createRequest; var ResponsePrimitive v_responsePrimitive; + var boolean v_resourceCreated := false; // Test control @@ -10104,6 +10248,14 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource"); } } + + //Check to see if the resource has NOT been created + if (f_isResourceNotCreated(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & ": Resource not created"); + } else { + setverdict(fail, testcasename() & ": Resource created"); + } + // Postamble f_cse_postamble_deleteResources(); @@ -10174,7 +10326,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while retrieving resource"); } } - + + //Check to see if the resource has NOT been created + if (f_isResourceNotCreated(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & ": Resource not created"); + } else { + setverdict(fail, testcasename() & ": Resource created"); + } // Postamble f_cse_postamble_deleteResources(); @@ -12382,7 +12540,14 @@ module OneM2M_Testcases { [] tc_ac.timeout { setverdict(inconc, testcasename() & ": No answer while creating resource"); } - } + } + + //Check to see if the resource has been created or not + if(f_isResourceNotCreated(v_resourceIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -12438,6 +12603,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource"); } } + + //Check to see if the resource has been created or not + if(f_isResourceNotCreated(v_contentInstanceResourceIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -12501,6 +12673,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource"); } } + + //Check to see if the resource has been created or not + if(f_isResourceNotCreated(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -12558,6 +12737,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource"); } } + + //Check to see if the resource has been created or not + if(f_isResourceNotCreated(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -12580,7 +12766,7 @@ module OneM2M_Testcases { var MsgIn v_response; var integer v_aeIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var template RequestPrimitive v_request; + var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; @@ -12599,7 +12785,7 @@ module OneM2M_Testcases { // Test Body v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription - mcaPort.send(m_request(valueof(v_request))); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { @@ -12619,6 +12805,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource"); } } + + //Check to see if the resource has been created or not + if(f_isResourceNotCreated(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -12641,7 +12834,7 @@ module OneM2M_Testcases { var MsgIn v_response; var integer v_aeIndex := -1; var template RequestPrimitive v_createRequest := m_createSubscriptionBase; - var template RequestPrimitive v_request; + var RequestPrimitive v_request; var CseTester v_notifyHandler; var integer v_ae2Index := -1; @@ -12660,7 +12853,7 @@ module OneM2M_Testcases { // Test Body v_request := f_getCreateRequestPrimitive(int23, v_createRequest, v_aeIndex);//Subscription - mcaPort.send(m_request(valueof(v_request))); + mcaPort.send(m_request(v_request)); tc_ac.start; alt { @@ -12680,6 +12873,13 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while creating resource"); } } + + //Check to see if the resource has been created or not + if(f_isResourceNotCreated(v_aeIndex, f_getResourceName(v_request.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -13918,6 +14118,7 @@ module OneM2M_Testcases { var RequestPrimitive v_createRequest := valueof(m_createAcpBase); var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"wait"}, int55)); + var integer v_resourceIndex := -1; // Test control // Test component configuration @@ -13945,6 +14146,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Response OK for retrieving"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_acpIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; @@ -13958,6 +14160,12 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while retrieving resource"); } } + + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -13983,6 +14191,7 @@ module OneM2M_Testcases { var RequestPrimitive v_createRequest := valueof(m_createAcpBase); var AccessControlRule v_accessControlRule_1 := valueof(m_createAcr({PX_SUPER_USER}, int63)); var AccessControlRule v_accessControlRule_2 := valueof(m_createAcr({"wait"}, int55)); + var integer v_resourceIndex := -1; // Test control // Test component configuration @@ -14010,6 +14219,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK(v_contentResponse))) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Response OK for retrieving"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_acpIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; @@ -14023,6 +14233,12 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while retrieving resource"); } } + + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } //Postamble f_cse_postamble_deleteResources(); @@ -14068,6 +14284,7 @@ module OneM2M_Testcases { var AccessControlRule v_accessControlRule_1; var RequestPrimitive v_updateRequest; var SetOfAcrs v_setOfArcs; + var integer v_resourceIndex := -1; // Test control @@ -14092,6 +14309,7 @@ module OneM2M_Testcases { [] mcaPort.receive(mw_response(mw_responsePrimitiveOK)) -> value v_response { tc_ac.stop; setverdict(pass, testcasename() & ": Successful operation on resource type int2 (Ae)"); + v_resourceIndex := f_setResource(v_response.primitive.responsePrimitive.primitiveContent, v_acpIndex); } [] mcaPort.receive(mw_response(mw_responsePrimitiveKO)) -> value v_response { tc_ac.stop; @@ -14128,6 +14346,12 @@ module OneM2M_Testcases { } } + if(f_isResourceCreated(v_resourceIndex)){ + setverdict(pass, testcasename() & "Resource created"); + } else { + setverdict(fail, testcasename() & "Resource not created"); + } + f_cse_postamble_deleteResources(); //Tear down @@ -14205,6 +14429,12 @@ module OneM2M_Testcases { setverdict(inconc, testcasename() & ": No answer while executing operation on resource type int2 (Ae)"); } } + + if(f_isResourceNotCreated(v_acpIndex, f_getResourceName(v_createRequest.primitiveContent))){ + setverdict(pass, testcasename() & "Resource not created"); + } else { + setverdict(fail, testcasename() & "Resource created"); + } //Postamble f_cse_postamble_deleteResources(); -- GitLab