From 82901e18cd94867994502b9f7fc5fffdac9b659e Mon Sep 17 00:00:00 2001 From: Bogdan Stanca-Kaposta <bogdan.stanca-kaposta@spirent.com> Date: Thu, 8 Mar 2018 18:07:57 +0100 Subject: [PATCH] send the required value to the codec and not override it in the adaptation for TC_CSE_DMR_CRE_005_MNI, TC_CSE_DMR_CRE_005_MBS and TC_CSE_DMR_CRE_005_MIA using invalid types to send update_invalid requests added templates for update_invalid types --- LibOneM2M/OneM2M_Templates.ttcn | 37 +++++++++++++++++++++++++++++ LibOneM2M/OneM2M_Types.ttcn | 12 +++++----- OneM2M_Testcases_CSE_Release_1.ttcn | 14 +++++------ 3 files changed, 50 insertions(+), 13 deletions(-) diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 2249014..4e9c3b5 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -675,6 +675,15 @@ module OneM2M_Templates { resourceType := int3, primitiveContent := {container := m_contentCreateContainer} }; + + /** + * @desc Base CREATE request primitive for Container resource using Container_update_invalid + */ + template (value) RequestPrimitive m_createContainerBaseInvalid modifies m_create := { + requestIdentifier := testcasename() & "-m_createContainer", + resourceType := int3, + primitiveContent := {container_update_invalid := m_contentCreateContainerInvalid} + }; /** * @desc Base CREATE request primitive for remoteCSE resource @@ -1840,6 +1849,34 @@ module OneM2M_Templates { choice := omit//NP }; + /** + * @desc Base primitiveContent for invalid CREATE operation for Container resource (using Container_update_invalid) + * @param p_name Resource name + */ + template (value) Container_update_invalid m_contentCreateContainerInvalid (in template (omit) XSD.String p_name := c_defaultContainerResourceName):= { + resourceName := p_name,//O + resourceType := omit,//NP + resourceID := omit,//NP + parentID := omit,//NP + creationTime := omit,//NP + lastModifiedTime := omit,//NP + labels := omit,//O + accessControlPolicyIDs := omit,//O + expirationTime := omit,//O + announceTo := omit,//O + announcedAttribute := omit,//O + stateTag := omit,//NP + creator := omit,//O + maxNrOfInstances := omit,//O + maxByteSize := omit,//O + maxInstanceAge := omit,//O + currentNrOfInstances := omit,//NP + currentByteSize := omit,//NP + locationID := omit,//O + ontologyRef := omit,//O + choice := omit//NP + }; + /** * @desc Base primitiveContent for CREATE operation for RemoteCSE resource * @param p_name Resource name diff --git a/LibOneM2M/OneM2M_Types.ttcn b/LibOneM2M/OneM2M_Types.ttcn index fc54591..ee5cfce 100644 --- a/LibOneM2M/OneM2M_Types.ttcn +++ b/LibOneM2M/OneM2M_Types.ttcn @@ -5402,13 +5402,13 @@ group invalidTypes { Timestamp expirationTime optional, ListOfURIs announceTo optional, record length(1 .. infinity) of XSD.NCName announcedAttribute optional, - XSD.NonNegativeInteger stateTag optional, + XSD.Integer stateTag optional, XSD.ID creator optional, - XSD.NonNegativeInteger maxNrOfInstances optional, - XSD.NonNegativeInteger maxByteSize optional, - XSD.NonNegativeInteger maxInstanceAge optional, - XSD.NonNegativeInteger currentNrOfInstances optional, - XSD.NonNegativeInteger currentByteSize optional, + XSD.Integer maxNrOfInstances optional, + XSD.Integer maxByteSize optional, + XSD.Integer maxInstanceAge optional, + XSD.Integer currentNrOfInstances optional, + XSD.Integer currentByteSize optional, XSD.AnyURI locationID optional, XSD.AnyURI ontologyRef optional, union { diff --git a/OneM2M_Testcases_CSE_Release_1.ttcn b/OneM2M_Testcases_CSE_Release_1.ttcn index 9c8941e..c23e106 100644 --- a/OneM2M_Testcases_CSE_Release_1.ttcn +++ b/OneM2M_Testcases_CSE_Release_1.ttcn @@ -3262,11 +3262,11 @@ module OneM2M_Testcases_CSE_Release_1 { */ testcase TC_CSE_DMR_CRE_005_MNI() runs on Tester system CseSystem { // Local variables - var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_createRequest := m_createContainerBaseInvalid; var AttributeAux v_invalidAttribute; var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_createRequest.primitiveContent.container.maxNrOfInstances := 0; + v_createRequest.primitiveContent.container_update_invalid.maxNrOfInstances := -1; v_invalidAttribute := {name := "maxNrOfInstances", value_ := "-1"}; v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); @@ -3275,11 +3275,11 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_DMR_CRE_005_MBS() runs on Tester system CseSystem { // Local variables - var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_createRequest := m_createContainerBaseInvalid; var AttributeAux v_invalidAttribute; var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_createRequest.primitiveContent.container.maxByteSize := 0; + v_createRequest.primitiveContent.container_update_invalid.maxByteSize := -1; v_invalidAttribute := {name := "maxByteSize", value_ := "-1"}; v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); @@ -3289,11 +3289,11 @@ module OneM2M_Testcases_CSE_Release_1 { testcase TC_CSE_DMR_CRE_005_MIA() runs on Tester system CseSystem { // Local variables - var template RequestPrimitive v_createRequest := m_createContainerBase; + var template RequestPrimitive v_createRequest := m_createContainerBaseInvalid; var AttributeAux v_invalidAttribute; var AeSimu v_ae1 := AeSimu.create("AE1") alive; - v_createRequest.primitiveContent.container.maxInstanceAge := 0; + v_createRequest.primitiveContent.container_update_invalid.maxInstanceAge := -1; v_invalidAttribute := {name := "maxInstanceAge", value_ := "-1"}; v_ae1.start(f_CSE_DMR_CRE_005(int3, v_createRequest, v_invalidAttribute)); @@ -3927,7 +3927,7 @@ module OneM2M_Testcases_CSE_Release_1 { var RequestPrimitive v_request; var integer v_aeIndex := -1; var integer v_containerIndex := -1; - const integer c_maxByteSize := 0; + const integer c_maxByteSize := 1; // Test control // Test component configuration -- GitLab