From f819f89c5c0e27d4c71bdf18a1b1bf302b139d0d Mon Sep 17 00:00:00 2001 From: acverdugo <acverdugo@at4wireless.com> Date: Wed, 22 Nov 2017 13:38:52 +0100 Subject: [PATCH] Generation of new PIXIT PX_UT_IMPLEMENTED. It implies modification of function f_sendUtPrimitive --- LibOneM2M/OneM2M_Functions.ttcn | 69 +++++++++++++++++++++++---------- LibOneM2M/OneM2M_Pixits.ttcn | 2 + OneM2M_Testcases_CSE.ttcn | 26 ++++++++----- 3 files changed, 68 insertions(+), 29 deletions(-) diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 34c8c53..05386ab 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -1802,12 +1802,13 @@ module OneM2M_Functions { var PrimitiveContent v_modifiedResource; var integer v_resourceIndex, v_parentIndex; var RequestPrimitive v_rp; + var charstring v_action := "Please, register the AE on the Tester"; if(not(ispresent(p_utRequest.primitiveContent))) { p_utRequest.primitiveContent.aE := m_contentCreateAe(omit, omit, omit, omit); } - f_sendUtPrimitive(p_utRequest); + f_sendUtPrimitive(p_utRequest, v_action); tc_ac.start; alt { @@ -1851,12 +1852,13 @@ module OneM2M_Functions { var PrimitiveContent v_modifiedResource; var integer v_resourceIndex, v_parentIndex; var RequestPrimitive v_rp; + var charstring v_action := "Please, create a Container resource on the Tester"; if(not(ispresent(p_utRequest.primitiveContent))) { p_utRequest.primitiveContent.container := m_contentCreateContainer; } - f_sendUtPrimitive(p_utRequest); + f_sendUtPrimitive(p_utRequest, v_action); tc_ac.start; alt { @@ -2718,6 +2720,23 @@ 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 + * @verdict + */ + function f_bool2str(in boolean p_bool) runs on Tester return charstring { + + var charstring v_bool; + if (p_bool){ + v_bool := "true"; + }else{ + v_bool := "false"; + } + return v_bool; + } + /** * @desc Sending of an Adapter Control primitive * @param event Action to be performed by TA @@ -2806,27 +2825,37 @@ module OneM2M_Functions { } - function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest) runs on Tester { + function f_sendUtPrimitive(template UtTriggerPrimitive p_utRequest, in charstring p_action) runs on Tester { - p_utRequest.from_ := "UNINITIALIZED"; - p_utRequest.requestIdentifier := "m_uttriggerPrimitive" & f_rnd(1, 1000000); - - utPort.send(valueof(p_utRequest)); - - tc_wait.start; - alt{ - [] utPort.receive(mw_utResponseOK) { - tc_wait.stop; - setverdict(pass, __SCOPE__, " : Triggering message is successfully received!"); - } - [] utPort.receive(mw_utResponseKO) { - tc_wait.stop; - setverdict(inconc, __SCOPE__, " : Error while receiving Triggering message!"); - } - [] tc_wait.timeout{ - setverdict(inconc, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + if (PX_UT_IMPLEMENTED){ + + p_utRequest.from_ := "UNINITIALIZED"; + p_utRequest.requestIdentifier := "m_uttriggerPrimitive" & f_rnd(1, 1000000); + + utPort.send(valueof(p_utRequest)); + + tc_wait.start; + alt{ + [] utPort.receive(mw_utResponseOK) { + tc_wait.stop; + setverdict(pass, __SCOPE__, " : Triggering message is successfully received!"); + } + [] utPort.receive(mw_utResponseKO) { + tc_wait.stop; + setverdict(inconc, __SCOPE__, " : Error while receiving Triggering message!"); + } + [] tc_wait.timeout{ + setverdict(inconc, __SCOPE__, " : Timeout due to no response received from requested SUT!"); + } } + + }else{ + + action(__SCOPE__ & ":" & p_action); + } + + } diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index 08646ae..05f89fc 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -27,6 +27,8 @@ module OneM2M_Pixits { modulepar charstring PX_SUT_ADDRESS := "127.0.0.1:8080"; + modulepar boolean PX_UT_IMPLEMENTED := false; + /** * @desc IUT CSE Name */ diff --git a/OneM2M_Testcases_CSE.ttcn b/OneM2M_Testcases_CSE.ttcn index 207c1f9..3c85212 100644 --- a/OneM2M_Testcases_CSE.ttcn +++ b/OneM2M_Testcases_CSE.ttcn @@ -2742,9 +2742,10 @@ 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; // Test control - if(not(PICS_MN_CSE)) { + if(not(PICS_MN_CSE)) { setverdict(inconc, __SCOPE__ & ": IUT shall be MN-CSE to run this test case"); stop; } @@ -2760,7 +2761,7 @@ module OneM2M_Testcases_CSE { //Send Trigger Message v_utRequest := m_utRetrieveResource(f_getLocalResourceAddress(vc_remoteCseIndex), PX_CSE_ID); v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest); + f_sendUtPrimitive(v_utRequest, v_action); tc_ac.start; alt { @@ -3020,10 +3021,11 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_REG_UPD_003_ET() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; - const AttributeAux c_optionalAttribute := {"expirationTime", omit}; + var AttributeAux c_optionalAttribute; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.expirationTime := "20301231T012345"; + c_optionalAttribute := {"expirationTime", valueof(v_updateRequest).primitiveContent.remoteCSE.expirationTime}; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; @@ -3033,10 +3035,11 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_REG_UPD_003_LBL() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; - const AttributeAux c_optionalAttribute := {"labels", omit}; + var AttributeAux c_optionalAttribute; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.labels := {"MyLabel"}; + c_optionalAttribute := {"labels", valueof(v_updateRequest).primitiveContent.remoteCSE.labels[0]}; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; @@ -3046,10 +3049,11 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_REG_UPD_003_POA() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; - const AttributeAux c_optionalAttribute := {"pointofAccess", omit}; + var AttributeAux c_optionalAttribute; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.pointOfAccess := {"http://" & PX_CSE1_ADDRESS & "/"}; + c_optionalAttribute := {"pointofAccess", valueof(v_updateRequest).primitiveContent.remoteCSE.pointOfAccess[0]}; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; @@ -3059,10 +3063,11 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_REG_UPD_003_NL() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; - const AttributeAux c_optionalAttribute := {"nodeLink", omit}; + var AttributeAux c_optionalAttribute; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.nodeLink := c_defaultNodeID; + c_optionalAttribute := {"nodeLink", valueof(v_updateRequest).primitiveContent.remoteCSE.nodeLink}; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; @@ -3072,10 +3077,11 @@ module OneM2M_Testcases_CSE { testcase TC_CSE_REG_UPD_003_RR() runs on Tester system CseSystem { // Local variables var template RequestPrimitive v_updateRequest := m_updateRemoteCSEBase; - const AttributeAux c_optionalAttribute := {"requestReachability", omit}; + var AttributeAux c_optionalAttribute; var CseSimu v_cse1 := CseSimu.create("CSE1") alive; v_updateRequest.primitiveContent.remoteCSE.requestReachability := true; + c_optionalAttribute := {"requestReachability", f_bool2str(valueof(v_updateRequest).primitiveContent.remoteCSE.requestReachability)}; v_cse1.start(f_CSE_REG_UPD_003(v_updateRequest, c_optionalAttribute)); v_cse1.done; @@ -3089,6 +3095,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_; // Test control if(not(PICS_MN_CSE)) { @@ -3107,7 +3114,7 @@ module OneM2M_Testcases_CSE { //Send Trigger Message v_utRequest.to_ := f_getResourceAddress(); v_utRequest.from_ := "UNINITIALIZED"; - f_sendUtPrimitive(v_utRequest); + f_sendUtPrimitive(v_utRequest, v_action); // Test Body v_request := f_getUpdateRequestPrimitive(int16, vc_remoteCseIndex, p_requestPrimitive); @@ -3312,6 +3319,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; // Test control // Test component configuration @@ -3326,7 +3334,7 @@ module OneM2M_Testcases_CSE { 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); + f_sendUtPrimitive(v_utRequest, v_action); // Test Body tc_ac.start; -- GitLab