From 93ecb4fed866aa295e8a5f21d6802fae43bd1e39 Mon Sep 17 00:00:00 2001 From: garciay <yann.garcia@fscom.fr> Date: Thu, 18 Nov 2021 11:34:57 +0100 Subject: [PATCH] Update support of 3GPP T8 interface --- LibOneM2M/OneM2M_Functions.ttcn | 63 ++- LibOneM2M/OneM2M_Pixits.ttcn | 2 +- LibOneM2M/OneM2M_Ports.ttcn | 7 +- LibOneM2M/OneM2M_Templates.ttcn | 263 ++++++--- LibOneM2M/OneM2M_TestSystem.ttcn | 10 +- LibOneM2M/OneM2M_TypesAndValues.ttcn | 4 +- LibOneM2M/OneM2M_Types_3GPP_T8.ttcn | 2 +- OneM2M_Testcases_CSE_Release_3.ttcn | 767 ++++++++++++++++++--------- 8 files changed, 772 insertions(+), 346 deletions(-) diff --git a/LibOneM2M/OneM2M_Functions.ttcn b/LibOneM2M/OneM2M_Functions.ttcn index 559a967..bc59c44 100644 --- a/LibOneM2M/OneM2M_Functions.ttcn +++ b/LibOneM2M/OneM2M_Functions.ttcn @@ -451,6 +451,31 @@ module OneM2M_Functions { } // end f_cf04UpCse2 + /** + @desc Ports mapping and default behaviour activation for Config 5 + */ + function f_cf05Up() runs on ScefSimu system ScefSystem { + + // Variables + + //Initialization of component variables + vc_config := e_cf05; + vc_testSystemRole := e_t8; + vc_aeSimuDesc := PX_TS_AE1; + vc_scefSimuDesc := PX_T8_SCEF; + + // Map + map(self:mcnPort, system:mcnPort) param (vc_scefSimuDesc.mcnPort); + map(self:mcnPortIn, system:mcnPortIn) param (vc_scefSimuDesc.mcnPortIn); + map(self:acPort, system:acPort); + + activate(a_default()); + + vc_ae1 := AeSimu.create("AE1") alive; + vc_ae1.start(f_cf01Up()); + vc_ae1.done; + } // end f_cf05Up + /** * @desc Ports mapping and default behaviour activation for Config 06 */ @@ -621,23 +646,6 @@ module OneM2M_Functions { } // End of function f_cf07Up - /** - @desc Ports mapping and default behaviour activation for Config 1 - */ - function f_cf01UpT8() runs on ScefSimu system ScefSystem { - - // Variables - - //Initialization of component variables - vc_scefSimuDesc := PX_T8_SCEF; - - // Map - map(self:mcnPort, system:mcnPort) param (vc_scefSimuDesc.mcnPort); - map(self:acPort, system:acPort); - - activate(a_default()); - } // end f_cf01UpT8 - /** * @desc Ports unmapping */ @@ -652,7 +660,7 @@ module OneM2M_Functions { } } - }// end f_cf01Down + }// end mcaPort /** * @desc Ports unmapping @@ -756,7 +764,18 @@ module OneM2M_Functions { }// end f_cf04DownCse2 - + function f_cf05Down() runs on ScefSimu system ScefSystem { + if(vc_ae1.alive) { + vc_ae1.start(f_cf01Down()); + vc_ae1.done; + } + + deactivate; + unmap(self:mcnPort, system:mcnPort); + unmap(self:mcnPortIn, system:mcnPortIn); + unmap(self:acPort, system:acPort); + } // end f_cf05Down + /** * @desc Ports unmapping for Config 06 */ @@ -801,12 +820,6 @@ module OneM2M_Functions { } // End of function f_cfDown - function f_cf01DownT8() runs on ScefSimu system ScefSystem { - deactivate; - unmap(self:mcnPort, system:mcnPort); - unmap(self:acPort, system:acPort); - } // end f_cf01DownT8 - }//end group configFunctions group InfoPortCommunication { diff --git a/LibOneM2M/OneM2M_Pixits.ttcn b/LibOneM2M/OneM2M_Pixits.ttcn index bb2c50a..4c23f67 100644 --- a/LibOneM2M/OneM2M_Pixits.ttcn +++ b/LibOneM2M/OneM2M_Pixits.ttcn @@ -476,7 +476,7 @@ module OneM2M_Pixits { modulepar Labels PX_LABELS := {"VALUE_1"}; modulepar boolean PX_IS_LOC_CONTAINER := false;//default //set it to true when the container is created to store location information - modulepar charstring PX_T8_API_ROOT := "127.0.0.1:30180"; + modulepar charstring PX_SCEF_ID := "scs_as_id_01"; } // end of module diff --git a/LibOneM2M/OneM2M_Ports.ttcn b/LibOneM2M/OneM2M_Ports.ttcn index c35eb5e..61fe7b7 100644 --- a/LibOneM2M/OneM2M_Ports.ttcn +++ b/LibOneM2M/OneM2M_Ports.ttcn @@ -37,16 +37,13 @@ module OneM2M_Ports { }; /** - * @desc Port to transport different underlying network primitives + * @desc Port to transport different underlying 3GPP T8 network primitives * @desc Output MsgOut * @desc Input MsgIn * @desc this port is allowed to extend for futher usage */ type port OneM2M_McnPort message { - in - T8Primitive; - out - T8Primitive; + inout T8Primitive; map param (in McnPortDesc p_mcnPortDesc); }; diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 0f268b0..c8f81f2 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -8589,6 +8589,34 @@ module OneM2M_Templates { queryParameters := p_queryParameters } // End of template m_uri_3gpp_nidd + template (present) OneM2M_Types_3GPP_T8.URI mw_uri_3gpp_nidd( + template (present) charstring p_apiRoot := ?, + template charstring p_apiSpecificSuffixes := *, + template OneM2M_Types_3GPP_T8.URI.queryParameters p_queryParameters := * + ) := { + apiRoot := p_apiRoot, + apiName := "3gpp-nidd", + apiVersion := "v1", + apiSpecificSuffixes := p_apiSpecificSuffixes, + queryParameters := p_queryParameters + } // End of template mw_uri_3gpp_nidd + + template (omit) OneM2M_Types_3GPP_T8.URI m_uri_3gpp_device_triggering( + in charstring p_apiRoot := "/", + in template (omit) charstring p_apiSpecificSuffixes := omit, + in template (omit) OneM2M_Types_3GPP_T8.URI.queryParameters p_queryParameters := omit + ) modifies m_uri_3gpp_nidd := { + apiName := "3gpp-device-triggering" + } // End of template m_uri_3gpp_device_triggering + + template (present) OneM2M_Types_3GPP_T8.URI mw_uri_3gpp_device_triggering( + template (present) charstring p_apiRoot := ?, + template charstring p_apiSpecificSuffixes := *, + template OneM2M_Types_3GPP_T8.URI.queryParameters p_queryParameters := * + ) modifies mw_uri_3gpp_nidd := { + apiName := "3gpp-device-triggering" + } // End of template mw_uri_3gpp_device_triggering + } // End of group t8_primitives group t8_request { @@ -8605,13 +8633,24 @@ module OneM2M_Templates { } // End of template m_t8_request_get template (omit) T8Request m_t8_request_post( - in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, - in template (value) RequestHeaders p_requestHeaders, - in template (omit) RequestBody p_requestBody := omit - ) modifies m_t8_request_get := { + in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, + in template (value) RequestHeaders p_requestHeaders, + in template (omit) RequestBody p_requestBody := omit + ) modifies m_t8_request_get := { resourceMethod := POST } // End of template m_t8_request_post + template (present) T8Request mw_t8_request_post( + template (present) OneM2M_Types_3GPP_T8.URI p_resourceUri := ?, + template (present) RequestHeaders p_requestHeaders := ?, + template (present) RequestBody p_requestBody := ? + ) := { + resourceMethod := POST, + resourceUri := p_resourceUri, + requestHeaders := p_requestHeaders, + requestBody := p_requestBody + } // End of template mw_t8_request_post + template (omit) T8Request m_t8_request_delete( in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, in template (value) RequestHeaders p_requestHeaders, @@ -8636,12 +8675,74 @@ module OneM2M_Templates { resourceMethod := PUT } // End of template m_t8_request_put + } // End of group t8_request + + group t8_response { + + template (omit) T8Response m_t8_response_200_ok( + in template (present) ResponseHeaders p_responseHeaders + ) := { + responseCode := 200, + responseHeaders := p_responseHeaders, + responseBody := omit + } // End of template m_t8_response_200_ok + + template T8Response mw_t8_response_200_ok( + template (present) ResponseHeaders p_responseHeaders := ?, + template ResponseBody p_responseBody := * + ) := { + responseCode := 200, + responseHeaders := p_responseHeaders, + responseBody := p_responseBody + } // End of template mw_t8_response_200_ok + + template T8Response mw_t8_response_201_created( + template (present) ResponseHeaders p_responseHeaders := ?, + template ResponseBody p_responseBody := * + ) modifies mw_t8_response_200_ok := { + responseCode := 201 + } // End of template mw_t8_response_201_ok + + template T8Response mw_t8_response_204_no_content( + template (present) ResponseHeaders p_responseHeaders := ?, + template ResponseBody p_responseBody := * + ) modifies mw_t8_response_200_ok := { + responseCode := 204, + responseBody := omit + } // End of template mw_t8_response_204_no_content + + template T8Response mw_t8_response_ko( + template (present) ResponseHeaders p_responseHeaders := ?, + template ProblemDetails p_problemDetails := ? + ) := { + responseCode := ?, + responseHeaders := p_responseHeaders, + responseBody := { problemDetails := p_problemDetails } + } // End of template mw_t8_response_ko + + template T8Response mw_t8_response_404_not_found( + template (present) ResponseHeaders p_responseHeaders := ?, + template ProblemDetails p_problemDetails := ? + ) modifies mw_t8_response_ko := { + responseCode := 404 + } // End of template mw_t8_response_404_not_found + + } // End of group t8_response + + group nidd { + template (value) RequestBody m_request_body_niddConfiguration( - in template (value) NiddConfiguration p_niddConfiguration - ) := { + in template (value) NiddConfiguration p_niddConfiguration + ) := { individualNiddConfiguration := p_niddConfiguration } // End of template m_request_body_niddConfiguration + template (present) RequestBody mw_request_body_deviceTriggeringDeliveryReportNotification( + template (present) DeviceTriggeringDeliveryReportNotification p_deviceTriggeringDeliveryReportNotification := ? + ) := { + deviceTriggeringDeliveryReportNotification := p_deviceTriggeringDeliveryReportNotification + } // End of template mw_request_body_deviceTriggeringDeliveryReportNotification + template (value) NiddConfiguration m_niddConfiguration := { self_ := "self_value", supportedFeatures := Notification_test_event, @@ -8661,9 +8762,9 @@ module OneM2M_Templates { status := ACTIVE } // End of template m_niddConfiguration - template NiddConfiguration mw_niddConfiguration( - template (present) Link p_notificationDestination := ? - ) := { + template (present) NiddConfiguration mw_niddConfiguration( + template (present) Link p_notificationDestination := ? + ) := { self_ := *, supportedFeatures := *, mtcProviderId := *, @@ -8682,51 +8783,21 @@ module OneM2M_Templates { status := * } // End of template mw_niddConfiguration - } // End of group t8_request - - group t8_response { - - template T8Response mw_t8_response_200_ok( - in template (present) ResponseHeaders p_responseHeaders := ?, - in template ResponseBody p_responseBody := * - ) := { - responseCode := 200, - responseHeaders := p_responseHeaders, - responseBody := p_responseBody - } // End of template mw_t8_response_200_ok - - template T8Response mw_t8_response_201_created( - in template (present) ResponseHeaders p_responseHeaders := ?, - in template ResponseBody p_responseBody := * - ) modifies mw_t8_response_200_ok := { - responseCode := 201 - } // End of template mw_t8_response_201_ok - - template T8Response mw_t8_response_204_no_content( - in template (present) ResponseHeaders p_responseHeaders := ?, - in template ResponseBody p_responseBody := * - ) modifies mw_t8_response_200_ok := { - responseCode := 204, - responseBody := omit - } // End of template mw_t8_response_204_no_content - - template T8Response mw_t8_response_ko( - in template (present) ResponseHeaders p_responseHeaders := ?, - in template ProblemDetails p_problemDetails := ? - ) := { - responseCode := ?, - responseHeaders := p_responseHeaders, - responseBody := { problemDetails := p_problemDetails } - } // End of template mw_t8_response_ko - - template T8Response mw_t8_response_404_not_found( - in template (present) ResponseHeaders p_responseHeaders := ?, - in template ProblemDetails p_problemDetails := ? - ) modifies mw_t8_response_ko := { - responseCode := 404 - } // End of template mw_t8_response_404_not_found - - + template (value) DeviceTriggeringDeliveryReportNotification m_deviceTriggeringDeliveryReportNotification( + in template (value) Link p_transaction, + in template (value) DeliveryResult p_result + ) := { + transaction := p_transaction, + result := p_result + } // End of template m_deviceTriggeringDeliveryReportNotification + + template (present) DeviceTriggeringDeliveryReportNotification mw_deviceTriggeringDeliveryReportNotification( + template (present) Link p_transaction := ?, + template (present) DeliveryResult p_result := ? + ) := { + transaction := p_transaction, + result := p_result + } // End of template mw_deviceTriggeringDeliveryReportNotification template (present) ResponseBody mw_response_body_niddConfigurations( template (present) NiddConfigurations p_niddConfigurations := ? @@ -8740,12 +8811,86 @@ module OneM2M_Templates { individualNiddConfiguration := p_individualNiddConfiguration } // End of template mw_response_body_individualNiddConfiguration - template (present) ResponseBody mw_response_body_problem_details( - template (present) ProblemDetails p_problemDetails := ? + } // End of group nidd + + group deviceTriggering { + + template (value) RequestBody m_request_body_deviceTriggering( + in template (value) DeviceTriggering p_deviceTriggeringTransaction + ) := { + individualDeviceTriggeringTransaction := p_deviceTriggeringTransaction + } // End of template m_request_body_deviceTriggering + + template (value) ResponseBody m_response_body_deviceTriggerings( + in template (value) DeviceTriggerings p_deviceTriggeringTransactions + ) := { + deviceTriggeringTransactions := p_deviceTriggeringTransactions + } // End of template m_response_body_deviceTriggerings + + template (present) ResponseBody mw_response_body_deviceTriggerings( + template (present) DeviceTriggerings p_deviceTriggeringTransactions := ? ) := { - problemDetails := p_problemDetails - } // End of template mw_response_body_problem_details + deviceTriggeringTransactions := p_deviceTriggeringTransactions + } // End of template mw_response_body_deviceTriggerings - } // End of group t8_response + template (present) ResponseBody mw_response_body_individualDeviceTriggering( + template (present) DeviceTriggering p_deviceTriggeringTransaction := ? + ) := { + individualDeviceTriggeringTransaction := p_deviceTriggeringTransaction + } // End of template mw_response_body_individualDeviceTriggering + + template (value) DeviceTriggering m_deviceTriggering_externalId( + in template (value) ExternalId p_externalId, + in template (value) DurationSec p_validityPeriod := 0, + in template (value) Priority p_priority := NO_PRIORITY, + in template (value) Port p_applicationPortId, + in template (value) Bytes p_triggerPayload, + in template (value) Link p_notificationDestination + ) := { + self_ := omit, + externalId := p_externalId, + msisdn := omit, + supportedFeatures := omit, + validityPeriod := p_validityPeriod, + priority := p_priority, + applicationPortId := p_applicationPortId, + appSrcPortId := omit, + triggerPayload := p_triggerPayload, + notificationDestination := p_notificationDestination, + requestTestNotification := omit, + websockNotifConfig := omit, + deliveryResult := omit + } // End of template m_deviceTriggering_externalId + + template (present) DeviceTriggering mw_deviceTriggering_externalId( + template (present) ExternalId p_externalId := ?, + template (present) DurationSec p_validityPeriod := ?, + template (present) Priority p_priority := ?, + template (present) Port p_applicationPortId := ?, + template (present) Bytes p_triggerPayload := ?, + template (present) Link p_notificationDestination := ? + ) := { + self_ := *, + externalId := p_externalId, + msisdn := omit, + supportedFeatures := *, + validityPeriod := p_validityPeriod, + priority := p_priority, + applicationPortId := p_applicationPortId, + appSrcPortId := *, + triggerPayload := p_triggerPayload, + notificationDestination := p_notificationDestination, + requestTestNotification := *, + websockNotifConfig := *, + deliveryResult := * + } // End of template mw_deviceTriggeringTransaction + + } // End of group deviceTriggering + + template (present) ResponseBody mw_response_body_problem_details( + template (present) ProblemDetails p_problemDetails := ? + ) := { + problemDetails := p_problemDetails + } // End of template mw_response_body_problem_details } // end of module diff --git a/LibOneM2M/OneM2M_TestSystem.ttcn b/LibOneM2M/OneM2M_TestSystem.ttcn index 208384c..5496914 100644 --- a/LibOneM2M/OneM2M_TestSystem.ttcn +++ b/LibOneM2M/OneM2M_TestSystem.ttcn @@ -113,11 +113,17 @@ module OneM2M_TestSystem { }; type component ScefSimu extends Tester { + //Attached components depending on config + var AeSimu vc_ae1; + var CseSimu vc_cse1; //Attached components depending on config //Ports port OneM2M_McnPort mcnPort; port OneM2M_McnPort mcnPortIn; //global variables + var AeSimuComponentDesc vc_aeSimuDesc; + var CseSimuComponentDesc vc_cseSimuDesc; + var CseTypeID vc_cseType; //cseType of the simulated CSE. IN =1, MN = 2 //About configuration of the component var ScefSimuComponentDesc vc_scefSimuDesc; //Resources list @@ -149,11 +155,9 @@ module OneM2M_TestSystem { port UpperTesterPort utPort; } - type component ScefSystem { + type component ScefSystem extends CseSystem { port OneM2M_McnPort mcnPort; port OneM2M_McnPort mcnPortIn; - port AdapterControlPort acPort; - port UpperTesterPort utPort; } }// end of module diff --git a/LibOneM2M/OneM2M_TypesAndValues.ttcn b/LibOneM2M/OneM2M_TypesAndValues.ttcn index fd024f3..a41a756 100644 --- a/LibOneM2M/OneM2M_TypesAndValues.ttcn +++ b/LibOneM2M/OneM2M_TypesAndValues.ttcn @@ -4100,6 +4100,7 @@ group OtherTypes { e_cf02CseSimuMaster, e_cf03, e_cf04, + e_cf05, e_cf06, e_cf06DasSimuMaster, e_cf07, @@ -4111,7 +4112,8 @@ group OtherTypes { e_ae, e_ae_ipe, e_das, - e_os + e_os, + e_t8 }; type NhURI ParentID; diff --git a/LibOneM2M/OneM2M_Types_3GPP_T8.ttcn b/LibOneM2M/OneM2M_Types_3GPP_T8.ttcn index 41c8736..a84dfcf 100644 --- a/LibOneM2M/OneM2M_Types_3GPP_T8.ttcn +++ b/LibOneM2M/OneM2M_Types_3GPP_T8.ttcn @@ -193,7 +193,7 @@ import from OneM2M_TypesAndValues {type Resource_2; type ResourceTypeList_1; typ type record DeviceTriggeringDeliveryReportNotification { Link transaction, - DeliveryResult Result + DeliveryResult result } }//end group of DeviceTriggering_API diff --git a/OneM2M_Testcases_CSE_Release_3.ttcn b/OneM2M_Testcases_CSE_Release_3.ttcn index 2eb18c2..4a6ddd3 100644 --- a/OneM2M_Testcases_CSE_Release_3.ttcn +++ b/OneM2M_Testcases_CSE_Release_3.ttcn @@ -16754,268 +16754,93 @@ module OneM2M_Testcases_CSE_Release_3 { }// end group Semantic - group t8_scef_tests { // FIXME To be removed, for Test System debug purpose - - // GET all confgurations from an SCEF - testcase TC_CSE_3GPP_SCEF_T8_001() runs on ScefSimu system ScefSystem { - f_cf01UpT8(); - - mcnPort.send( - m_t8Request( - m_t8_request_get( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations"), - { - { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, - { "User-Agent", "oneM2M Test Adapter - TTF001" }, - { "Accept", "*/*" }, - { "ContentType", "application/json" }, - { "Connection", "keep-alive" } - } - ))); - tc_ac.start; - alt { - [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_niddConfigurations(?/*{m_niddConfiguration}*/)))) { - tc_ac.stop; - setverdict(pass); - } - [] mcnPort.receive(mw_t8Response) { - tc_ac.stop; - setverdict(fail); - } - [] tc_ac.timeout { - setverdict(inconc); - } - } // End of 'alt' statement - - f_cf01DownT8(); - } - - // GET a specifc confguration from an SCEF - testcase TC_CSE_3GPP_SCEF_T8_002() runs on ScefSimu system ScefSystem { - f_cf01UpT8(); - - mcnPort.send( - m_t8Request( - m_t8_request_get( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations/cf_001"), - { - { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, - { "User-Agent", "oneM2M Test Adapter - TTF001" }, - { "Accept", "*/*" }, - { "ContentType", "application/json" }, - { "Connection", "keep-alive" } - } - ))); - tc_ac.start; - alt { - [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualNiddConfiguration))) { - tc_ac.stop; - setverdict(pass); - } - [] mcnPort.receive(mw_t8Response) { - tc_ac.stop; - setverdict(fail); - } - [] tc_ac.timeout { - setverdict(inconc); - } - } // End of 'alt' statement - - f_cf01DownT8(); - } - - // POST create a new Nidd confguration for an SCEF - testcase TC_CSE_3GPP_SCEF_T8_003() runs on ScefSimu system ScefSystem { - var T8Primitive v_response; - - f_cf01UpT8(); - - mcnPort.send( - m_t8Request( - m_t8_request_post( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations"), - { - { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, - { "User-Agent", "oneM2M Test Adapter - TTF001" }, - { "Accept", "*/*" }, - { "ContentType", "application/json" }, - { "Connection", "keep-alive" } - }, - m_request_body_niddConfiguration(m_niddConfiguration) - ))); - tc_ac.start; - alt { - [] mcnPort.receive(mw_t8Response(mw_t8_response_201_created(-, mw_response_body_individualNiddConfiguration))) -> value v_response { - var charstring v_location; - - tc_ac.stop; - // Check presence of Location HTTP header - for (var integer i := 0; i < lengthof(v_response.t8Response.responseHeaders); i := i + 1) { - if (v_response.t8Response.responseHeaders[i].header_name == "Location") { - v_location := v_response.t8Response.responseHeaders[i].header_value; - break; - } - } // End of 'for' statement - if (isbound(v_location)) { - f_delete_nidd_configuration(v_location); - setverdict(pass); - } else { - setverdict(fail); - } - } - [] mcnPort.receive(mw_t8Response) { - tc_ac.stop; - setverdict(fail); - } - [] tc_ac.timeout { - setverdict(inconc); - } - } // End of 'alt' statement - - f_cf01DownT8(); - } + group t8_scef_tests { // FIXME To be enhanced - // DELETE delete a new Nidd confguration for an SCEF - testcase TC_CSE_3GPP_SCEF_T8_004() runs on ScefSimu system ScefSystem { - var charstring v_location; - - f_cf01UpT8(); - - // Preamble - f_create_nidd_configuration(v_location); + group nidd { - // Test Body - mcnPort.send( - m_t8Request( - m_t8_request_delete( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations" & "/" & v_location), + // GET all confgurations from an SCEF + testcase TC_CSE_3GPP_SCEF_T8_001() runs on ScefSimu system ScefSystem { + f_cf05Up(); + + mcnPort.send( + m_t8Request( + m_t8_request_get( + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations"), { { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, { "User-Agent", "oneM2M Test Adapter - TTF001" }, { "Accept", "*/*" }, - { "ContentType", "application/json" }, + { "Content-Type", "application/json" }, { "Connection", "keep-alive" } } ))); - tc_ac.start; - alt { - [] mcnPort.receive(mw_t8Response(mw_t8_response_204_no_content)) { - tc_ac.stop; - setverdict(pass); - } - [] mcnPort.receive(mw_t8Response) { - tc_ac.stop; - setverdict(fail); - } - [] tc_ac.timeout { - setverdict(inconc); - } - } // End of 'alt' statement - - f_cf01DownT8(); - } + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_niddConfigurations(?/*{m_niddConfiguration}*/)))) { + tc_ac.stop; + setverdict(pass); + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_cf05Down(); + } - // DELETE delete a non existing Nidd confguration for an SCEF - testcase TC_CSE_3GPP_SCEF_T8_005() runs on ScefSimu system ScefSystem { - var charstring v_location := "unknown"; - - f_cf01UpT8(); - - // Preamble - - // Test Body - mcnPort.send( - m_t8Request( - m_t8_request_delete( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations" & "/" & v_location), + // GET a specifc confguration from an SCEF + testcase TC_CSE_3GPP_SCEF_T8_002() runs on ScefSimu system ScefSystem { + f_cf05Up(); + + mcnPort.send( + m_t8Request( + m_t8_request_get( + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations/cf_001"), { { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, { "User-Agent", "oneM2M Test Adapter - TTF001" }, { "Accept", "*/*" }, - { "ContentType", "application/json" }, + { "Content-Type", "application/json" }, { "Connection", "keep-alive" } } ))); - tc_ac.start; - alt { - [] mcnPort.receive(mw_t8Response(mw_t8_response_404_not_found)) { - tc_ac.stop; - setverdict(pass); - } - [] mcnPort.receive(mw_t8Response) { - tc_ac.stop; - setverdict(fail); - } - [] tc_ac.timeout { - setverdict(inconc); - } - } // End of 'alt' statement - - f_cf01DownT8(); - } - - // PATCH update an existing Nidd conf_create_nidd_configuration(v_location);fguration for an SCEF - testcase TC_CSE_3GPP_SCEF_T8_006() runs on ScefSimu system ScefSystem { - var charstring v_location; - var NiddConfiguration v_niddConfiguration; - var T8Primitive v_response; - - f_cf01UpT8(); - - // Preambule - f_create_nidd_configuration(v_location); - f_get_nidd_configuration(v_location, v_niddConfiguration); - - // TestBody - v_niddConfiguration.notificationDestination := v_niddConfiguration.notificationDestination & "_patched"; - mcnPort.send( - m_t8Request( - m_t8_request_patch( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations" & "/" & v_location), - { - { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, - { "User-Agent", "oneM2M Test Adapter - TTF001" }, - { "Accept", "*/*" }, - { "ContentType", "application/json" }, - { "Connection", "keep-alive" } - }, - m_request_body_niddConfiguration(v_niddConfiguration) - ))); - tc_ac.start; - alt { - [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualNiddConfiguration(v_niddConfiguration)))) -> value v_response { - - tc_ac.stop; - setverdict(pass); - } - [] mcnPort.receive(mw_t8Response) { - tc_ac.stop; - setverdict(fail); - } - [] tc_ac.timeout { - setverdict(inconc); - } - } // End of 'alt' statement - - f_delete_nidd_configuration(v_location); - - f_cf01DownT8(); - } + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualNiddConfiguration))) { + tc_ac.stop; + setverdict(pass); + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_cf05Down(); + } - group nidd_functions { - - function f_create_nidd_configuration(out charstring p_location) runs on ScefSimu system ScefSystem { + // POST create a new Nidd confguration for an SCEF + testcase TC_CSE_3GPP_SCEF_T8_003() runs on ScefSimu system ScefSystem { var T8Primitive v_response; + f_cf05Up(); + mcnPort.send( m_t8Request( m_t8_request_post( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations"), + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations"), { { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, { "User-Agent", "oneM2M Test Adapter - TTF001" }, { "Accept", "*/*" }, - { "ContentType", "application/json" }, + { "Content-Type", "application/json" }, { "Connection", "keep-alive" } }, m_request_body_niddConfiguration(m_niddConfiguration) @@ -17023,16 +16848,20 @@ module OneM2M_Testcases_CSE_Release_3 { tc_ac.start; alt { [] mcnPort.receive(mw_t8Response(mw_t8_response_201_created(-, mw_response_body_individualNiddConfiguration))) -> value v_response { + var charstring v_location; tc_ac.stop; // Check presence of Location HTTP header for (var integer i := 0; i < lengthof(v_response.t8Response.responseHeaders); i := i + 1) { if (v_response.t8Response.responseHeaders[i].header_name == "Location") { - p_location := v_response.t8Response.responseHeaders[i].header_value; + v_location := v_response.t8Response.responseHeaders[i].header_value; break; } } // End of 'for' statement - if (not(isbound(p_location))) { + if (isbound(v_location)) { + f_delete_nidd_configuration(v_location); + setverdict(pass); + } else { setverdict(fail); } } @@ -17045,18 +16874,28 @@ module OneM2M_Testcases_CSE_Release_3 { } } // End of 'alt' statement - } // End of function f_create_nidd_configuration + f_cf05Down(); + } - function f_delete_nidd_configuration(in charstring p_location) runs on ScefSimu system ScefSystem { + // DELETE delete a new Nidd confguration for an SCEF + testcase TC_CSE_3GPP_SCEF_T8_004() runs on ScefSimu system ScefSystem { + var charstring v_location; + + f_cf05Up(); + + // Preamble + f_create_nidd_configuration(v_location); + + // Test Body mcnPort.send( m_t8Request( m_t8_request_delete( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations" & "/" & p_location), + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations" & "/" & v_location), { { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, { "User-Agent", "oneM2M Test Adapter - TTF001" }, { "Accept", "*/*" }, - { "ContentType", "application/json" }, + { "Content-Type", "application/json" }, { "Connection", "keep-alive" } } ))); @@ -17064,6 +16903,7 @@ module OneM2M_Testcases_CSE_Release_3 { alt { [] mcnPort.receive(mw_t8Response(mw_t8_response_204_no_content)) { tc_ac.stop; + setverdict(pass); } [] mcnPort.receive(mw_t8Response) { tc_ac.stop; @@ -17073,28 +16913,229 @@ module OneM2M_Testcases_CSE_Release_3 { setverdict(inconc); } } // End of 'alt' statement - } // End of function f_delete_nidd_configuration + + f_cf05Down(); + } - function f_get_nidd_configuration(in charstring p_location, out NiddConfiguration p_niddConfiguration) runs on ScefSimu system ScefSystem { + // DELETE delete a non existing Nidd confguration for an SCEF + testcase TC_CSE_3GPP_SCEF_T8_005() runs on ScefSimu system ScefSystem { + var charstring v_location := "unknown"; + + f_cf05Up(); + + // Preamble + + // Test Body + mcnPort.send( + m_t8Request( + m_t8_request_delete( + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations" & "/" & v_location), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + } + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_404_not_found)) { + tc_ac.stop; + setverdict(pass); + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_cf05Down(); + } + + // PATCH update an existing Nidd conf_create_nidd_configuration(v_location);fguration for an SCEF + testcase TC_CSE_3GPP_SCEF_T8_006() runs on ScefSimu system ScefSystem { + var charstring v_location; + var NiddConfiguration v_niddConfiguration; var T8Primitive v_response; + f_cf05Up(); + + // Preambule + f_create_nidd_configuration(v_location); + f_get_nidd_configuration(v_location, v_niddConfiguration); + + // TestBody + v_niddConfiguration.notificationDestination := v_niddConfiguration.notificationDestination & "_patched"; + mcnPort.send( + m_t8Request( + m_t8_request_patch( + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations" & "/" & v_location), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }, + m_request_body_niddConfiguration(v_niddConfiguration) + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualNiddConfiguration(v_niddConfiguration)))) -> value v_response { + + tc_ac.stop; + setverdict(pass); + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_delete_nidd_configuration(v_location); + + f_cf05Down(); + } + + group nidd_functions { + + function f_create_nidd_configuration(out charstring p_location) runs on ScefSimu system ScefSystem { + var T8Primitive v_response; + + mcnPort.send( + m_t8Request( + m_t8_request_post( + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations"), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }, + m_request_body_niddConfiguration(m_niddConfiguration) + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_201_created(-, mw_response_body_individualNiddConfiguration))) -> value v_response { + + tc_ac.stop; + // Check presence of Location HTTP header + for (var integer i := 0; i < lengthof(v_response.t8Response.responseHeaders); i := i + 1) { + if (v_response.t8Response.responseHeaders[i].header_name == "Location") { + p_location := v_response.t8Response.responseHeaders[i].header_value; + break; + } + } // End of 'for' statement + if (not(isbound(p_location))) { + setverdict(fail); + } + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + } // End of function f_create_nidd_configuration + + function f_delete_nidd_configuration(in charstring p_location) runs on ScefSimu system ScefSystem { + mcnPort.send( + m_t8Request( + m_t8_request_delete( + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations" & "/" & p_location), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + } + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_204_no_content)) { + tc_ac.stop; + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + } // End of function f_delete_nidd_configuration + + function f_get_nidd_configuration(in charstring p_location, out NiddConfiguration p_niddConfiguration) runs on ScefSimu system ScefSystem { + var T8Primitive v_response; + + mcnPort.send( + m_t8Request( + m_t8_request_get( + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/configurations" & "/" & p_location), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + } + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualNiddConfiguration))) -> value v_response { + tc_ac.stop; + p_niddConfiguration := v_response.t8Response.responseBody.individualNiddConfiguration; + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + } // End of function f_get_nidd_configuration + + } // End of group nidd_functions + + } // End of group nidd + + group device_trigerring { + + // GET all transactons from an SCEF + testcase TC_CSE_3GPP_SCEF_T8_007() runs on ScefSimu system ScefSystem { + f_cf05Up(); + mcnPort.send( m_t8Request( m_t8_request_get( - m_uri_3gpp_nidd(PX_T8_API_ROOT, "scs_as_id_01/configurations" & "/" & p_location), + m_uri_3gpp_device_triggering(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/transactions"), { { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, { "User-Agent", "oneM2M Test Adapter - TTF001" }, { "Accept", "*/*" }, - { "ContentType", "application/json" }, + { "Content-Type", "application/json" }, { "Connection", "keep-alive" } } ))); tc_ac.start; alt { - [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualNiddConfiguration))) -> value v_response { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_deviceTriggerings(?)))) { tc_ac.stop; - p_niddConfiguration := v_response.t8Response.responseBody.individualNiddConfiguration; + setverdict(pass); } [] mcnPort.receive(mw_t8Response) { tc_ac.stop; @@ -17105,11 +17146,235 @@ module OneM2M_Testcases_CSE_Release_3 { } } // End of 'alt' statement - } // End of function f_get_nidd_configuration + f_cf05Down(); + } - } // End of group nidd_functions - - } // End of group t8_scef + // GET all transactons from an SCEF + testcase TC_CSE_3GPP_SCEF_T8_008() runs on ScefSimu system ScefSystem { + f_cf05Up(); + + mcnPort.send( + m_t8Request( + m_t8_request_get( + m_uri_3gpp_device_triggering(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/transactions/cf_001"), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + } + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualDeviceTriggering(mw_deviceTriggering_externalId)))) { + tc_ac.stop; + setverdict(pass); + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_cf05Down(); + } + + // POST create a new device transaction for an SCEF + testcase TC_CSE_3GPP_SCEF_T8_009() runs on ScefSimu system ScefSystem { + var T8Primitive v_response; + + f_cf05Up(); + + mcnPort.send( + m_t8Request( + m_t8_request_post( + m_uri_3gpp_device_triggering(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/transactions"), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }, + m_request_body_deviceTriggering(m_deviceTriggering_externalId("externl_id", -, -, 30123, "CAFEDECA", "link")) + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_201_created(-, mw_response_body_individualDeviceTriggering))) -> value v_response { + var charstring v_location; + + tc_ac.stop; + // Check presence of Location HTTP header + for (var integer i := 0; i < lengthof(v_response.t8Response.responseHeaders); i := i + 1) { + if (v_response.t8Response.responseHeaders[i].header_name == "Location") { + v_location := v_response.t8Response.responseHeaders[i].header_value; + break; + } + } // End of 'for' statement + if (isbound(v_location)) { + f_delete_device_triggering(v_location); + setverdict(pass); + } else { + setverdict(fail); + } + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_cf05Down(); + } + + // POST notification from an SCEF + testcase TC_CSE_3GPP_SCEF_T8_010() runs on ScefSimu system ScefSystem { + + f_cf05Up(); + + tc_ac.start; + alt { + [] mcnPortIn.receive(mw_t8Request(mw_t8_request_post(-, -, mw_request_body_deviceTriggeringDeliveryReportNotification(mw_deviceTriggeringDeliveryReportNotification)))) { + tc_ac.stop; + // Send the response 200 OK + mcnPortIn.send(m_t8Response(m_t8_response_200_ok({ + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }))); + setverdict(pass); + } + [] mcnPortIn.receive(mw_t8Request) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_cf05Down(); + } + + group device_triggering_functions { + + function f_create_device_triggering(out charstring p_location) runs on ScefSimu system ScefSystem { + var T8Primitive v_response; + + mcnPort.send( + m_t8Request( + m_t8_request_post( + m_uri_3gpp_device_triggering(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/transactions"), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }, + m_request_body_deviceTriggering(m_deviceTriggering_externalId("externl_id", -, -, 30123, "CAFEDECA", "link")) + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_201_created(-, mw_response_body_individualDeviceTriggering))) -> value v_response { + + tc_ac.stop; + // Check presence of Location HTTP header + for (var integer i := 0; i < lengthof(v_response.t8Response.responseHeaders); i := i + 1) { + if (v_response.t8Response.responseHeaders[i].header_name == "Location") { + p_location := v_response.t8Response.responseHeaders[i].header_value; + break; + } + } // End of 'for' statement + if (not(isbound(p_location))) { + setverdict(fail); + } + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + } // End of function f_create_device_triggering + + function f_delete_device_triggering(in charstring p_location) runs on ScefSimu system ScefSystem { + mcnPort.send( + m_t8Request( + m_t8_request_delete( + m_uri_3gpp_device_triggering(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/transactions" & "/" & p_location), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + } + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_204_no_content)) { + tc_ac.stop; + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + } // End of function f_delete_device_triggering + + function f_get_device_triggering(in charstring p_location, out DeviceTriggering p_deviceTriggering) runs on ScefSimu system ScefSystem { + var T8Primitive v_response; + + mcnPort.send( + m_t8Request( + m_t8_request_get( + m_uri_3gpp_device_triggering(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), PX_SCEF_ID & "/transactions" & "/" & p_location), + { + { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + } + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualDeviceTriggering))) -> value v_response { + tc_ac.stop; + p_deviceTriggering := v_response.t8Response.responseBody.individualDeviceTriggeringTransaction; + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + } // End of function f_get_device_triggering + + } // End of group device_triggering_functions + + } // End of group device_trigerring + + } // End of group t8_scef }//end group CSE -- GitLab