diff --git a/LibOneM2M/OneM2M_Templates.ttcn b/LibOneM2M/OneM2M_Templates.ttcn index 2ada7772ba9678ee3a5a896a9a5699cbdb85cf11..e4ae75bb890105efc5dd04545ee391dbd6d45633 100644 --- a/LibOneM2M/OneM2M_Templates.ttcn +++ b/LibOneM2M/OneM2M_Templates.ttcn @@ -8659,6 +8659,16 @@ module OneM2M_Templates { resourceMethod := DELETE } // End of template m_t8_request_delete + template (present) T8Request mw_t8_request_delete( + template (present) OneM2M_Types_3GPP_T8.URI p_resourceUri := ?, + template (present) RequestHeaders p_requestHeaders := ? + ) := { + resourceMethod := DELETE, + resourceUri := p_resourceUri, + requestHeaders := p_requestHeaders, + requestBody := omit + } // End of template mw_t8_request_delete + template (omit) T8Request m_t8_request_patch( in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, in template (value) RequestHeaders p_requestHeaders, @@ -8667,6 +8677,17 @@ module OneM2M_Templates { resourceMethod := PATCH } // End of template m_t8_request_patch + template (present) T8Request mw_t8_request_patch( + template (present) OneM2M_Types_3GPP_T8.URI p_resourceUri := ?, + template (present) RequestHeaders p_requestHeaders := ?, + template (present) RequestBody p_requestBody := ? + ) := { + resourceMethod := PATCH, + resourceUri := p_resourceUri, + requestHeaders := p_requestHeaders, + requestBody := p_requestBody + } // End of template mw_t8_request_patch + template (omit) T8Request m_t8_request_put( in template (value) OneM2M_Types_3GPP_T8.URI p_resourceUri, in template (value) RequestHeaders p_requestHeaders, @@ -8675,16 +8696,28 @@ module OneM2M_Templates { resourceMethod := PUT } // End of template m_t8_request_put + template (present) T8Request mw_t8_request_put( + template (present) OneM2M_Types_3GPP_T8.URI p_resourceUri := ?, + template (present) RequestHeaders p_requestHeaders := ?, + template (present) RequestBody p_requestBody := ? + ) := { + resourceMethod := PUT, + resourceUri := p_resourceUri, + requestHeaders := p_requestHeaders, + requestBody := p_requestBody + } // End of template mw_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 + in template (value) ResponseHeaders p_responseHeaders, + in template (omit) ResponseBody p_responseBody := omit ) := { responseCode := 200, responseHeaders := p_responseHeaders, - responseBody := omit + responseBody := p_responseBody } // End of template m_t8_response_200_ok template T8Response mw_t8_response_200_ok( @@ -8696,6 +8729,13 @@ module OneM2M_Templates { responseBody := p_responseBody } // End of template mw_t8_response_200_ok + template (omit) T8Response m_t8_response_201_created( + in template (value) ResponseHeaders p_responseHeaders, + in template (omit) ResponseBody p_responseBody := omit + ) modifies m_t8_response_200_ok := { + responseCode := 201 + } // End of template m_t8_response_201_ok + template T8Response mw_t8_response_201_created( template (present) ResponseHeaders p_responseHeaders := ?, template ResponseBody p_responseBody := * @@ -8711,31 +8751,48 @@ module OneM2M_Templates { 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 := ? - ) := { + template (value) T8Response m_t8_response_ko( + in template (value) ResponseHeaders p_responseHeaders, + in template (value) ProblemDetails p_problemDetails + ) := { + responseCode := 400, + responseHeaders := p_responseHeaders, + responseBody := { problemDetails := p_problemDetails } + } // End of template m_t8_response_ko + + template (present) T8Response mw_t8_response_ko( + template (present) ResponseHeaders p_responseHeaders := ?, + template (present) ProblemDetails p_problemDetails := ? + ) := { responseCode := ?, responseHeaders := p_responseHeaders, responseBody := { problemDetails := p_problemDetails } } // End of template mw_t8_response_ko - template (omit) T8Response m_t8_response_400_bad_request( - in template (present) ResponseHeaders p_responseHeaders - ) modifies m_t8_response_200_ok := { - responseCode := 400 + template (value) T8Response m_t8_response_400_bad_request( + in template (value) ResponseHeaders p_responseHeaders, + in template (value) ProblemDetails p_problemDetails + ) modifies m_t8_response_ko := { } // End of template m_t8_response_400_bad_request - template (omit) T8Response m_t8_response_404_not_found( - in template (present) ResponseHeaders p_responseHeaders - ) modifies m_t8_response_200_ok := { + template (present) T8Response mw_t8_response_400_bad_request( + template (present) ResponseHeaders p_responseHeaders := ?, + template (present) ProblemDetails p_problemDetails := ? + ) modifies mw_t8_response_ko := { + responseCode := 400 + } // End of template mw_t8_response_400_bad_request + + template (value) T8Response m_t8_response_404_not_found( + in template (value) ResponseHeaders p_responseHeaders, + in template (value) ProblemDetails p_problemDetails + ) modifies m_t8_response_ko := { responseCode := 404 } // End of template m_t8_response_404_not_found - template T8Response mw_t8_response_404_not_found( - template (present) ResponseHeaders p_responseHeaders := ?, - template ProblemDetails p_problemDetails := ? - ) modifies mw_t8_response_ko := { + template (present) T8Response mw_t8_response_404_not_found( + template (present) ResponseHeaders p_responseHeaders := ?, + template (present) ProblemDetails p_problemDetails := ? + ) modifies mw_t8_response_ko := { responseCode := 404 } // End of template mw_t8_response_404_not_found @@ -8749,12 +8806,6 @@ module OneM2M_Templates { 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, @@ -8795,22 +8846,6 @@ module OneM2M_Templates { status := * } // End of template mw_niddConfiguration - 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 := ? ) := { @@ -8833,6 +8868,18 @@ module OneM2M_Templates { individualDeviceTriggeringTransaction := p_deviceTriggeringTransaction } // End of template m_request_body_deviceTriggering + template (present) RequestBody mw_request_body_deviceTriggering( + template (present) DeviceTriggering p_deviceTriggeringTransaction := ? + ) := { + individualDeviceTriggeringTransaction := p_deviceTriggeringTransaction + } // End of template mw_request_body_deviceTriggering + + template (present) RequestBody mw_request_body_deviceTriggeringDeliveryReportNotification( + template (present) DeviceTriggeringDeliveryReportNotification p_deviceTriggeringDeliveryReportNotification := ? + ) := { + deviceTriggeringDeliveryReportNotification := p_deviceTriggeringDeliveryReportNotification + } // End of template mw_request_body_deviceTriggeringDeliveryReportNotification + template (value) ResponseBody m_response_body_deviceTriggerings( in template (value) DeviceTriggerings p_deviceTriggeringTransactions ) := { @@ -8845,6 +8892,12 @@ module OneM2M_Templates { deviceTriggeringTransactions := p_deviceTriggeringTransactions } // End of template mw_response_body_deviceTriggerings + template (value) ResponseBody m_response_body_individualDeviceTriggering( + in template (value) DeviceTriggering p_deviceTriggeringTransaction + ) := { + individualDeviceTriggeringTransaction := p_deviceTriggeringTransaction + } // End of template m_response_body_individualDeviceTriggering + template (present) ResponseBody mw_response_body_individualDeviceTriggering( template (present) DeviceTriggering p_deviceTriggeringTransaction := ? ) := { @@ -8897,12 +8950,62 @@ module OneM2M_Templates { deliveryResult := * } // End of template mw_deviceTriggeringTransaction + 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 + } // 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 + group problemDetails { + + template (omit) ProblemDetails m_problemDetails( + in charstring p_title, + in integer p_status, + in template (omit) charstring p_type := omit, + in template (omit) charstring p_detail := omit, + in template (omit) charstring p_instance := omit, + in template (omit) charstring p_cause := omit, + in template (omit) InvalidParams p_invalidParams := omit + ) := { + type_ := p_type, + title := p_title, + status := p_status, + detail := p_detail, + instance := p_instance, + cause := p_cause, + invalidParams := p_invalidParams + } // End of template m_problemDetails + + template ProblemDetails mw_problemDetails( + template charstring p_type := *, + template charstring p_title := *, + template integer p_status := *, + template charstring p_detail := *, + template charstring p_instance := *, + template charstring p_cause := *, + template InvalidParams p_invalidParams := * + ) := { + type_ := p_type, + title := p_title, + status := p_status, + detail := p_detail, + instance := p_instance, + cause := p_cause, + invalidParams := p_invalidParams + } // End of template mw_problemDetails + + } // End of group problemDetails } // end of module diff --git a/OneM2M_Testcases_CSE_Release_3.ttcn b/OneM2M_Testcases_CSE_Release_3.ttcn index a41de0f7793ff16687dbb22b8b238da16ff2b6e9..a2e44ae8f121b32eb1714c0822cb0acbf35aafe9 100644 --- a/OneM2M_Testcases_CSE_Release_3.ttcn +++ b/OneM2M_Testcases_CSE_Release_3.ttcn @@ -16755,17 +16755,143 @@ module OneM2M_Testcases_CSE_Release_3 { }// end group Semantic group Interworking_3GPP { + // See https://jdegre.github.io/editor/?url=https://raw.githubusercontent.com/jdegre/5GC_APIs/master/TS29122_DeviceTriggering.yaml + + group nidd { + + // 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), vc_scefSimuDesc.scefId & "/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" } + } + ))); + 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(); + } + + // 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), vc_scefSimuDesc.scefId & "/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", "*/*" }, + { "Content-Type", "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_cf05Down(); + } + + // 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(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), vc_scefSimuDesc.scefId & "/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 { + 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_cf05Down(); + } - group nidd { + // 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; - // 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), vc_scefSimuDesc.scefId & "/configurations"), + f_cf05Up(); + + // Preamble + f_create_nidd_configuration(v_location); + + // 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), vc_scefSimuDesc.scefId & "/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" }, @@ -16774,32 +16900,37 @@ module OneM2M_Testcases_CSE_Release_3 { { "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_cf05Down(); - } + 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_cf05Down(); + } - // 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), vc_scefSimuDesc.scefId & "/configurations/cf_001"), + // 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), vc_scefSimuDesc.scefId & "/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" }, @@ -16808,30 +16939,77 @@ module OneM2M_Testcases_CSE_Release_3 { { "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_cf05Down(); - } + 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(); + } - // POST create a new Nidd confguration for an SCEF - testcase TC_CSE_3GPP_SCEF_T8_003() runs on ScefSimu system ScefSystem { + // 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), vc_scefSimuDesc.scefId & "/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; - f_cf05Up(); - mcnPort.send( m_t8Request( m_t8_request_post( @@ -16848,20 +17026,16 @@ 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") { - v_location := v_response.t8Response.responseHeaders[i].header_value; + p_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 { + if (not(isbound(p_location))) { setverdict(fail); } } @@ -16874,23 +17048,13 @@ module OneM2M_Testcases_CSE_Release_3 { } } // End of 'alt' statement - f_cf05Down(); - } + } // End of function f_create_nidd_configuration - // 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 + 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), vc_scefSimuDesc.scefId & "/configurations" & "/" & v_location), + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), vc_scefSimuDesc.scefId & "/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" }, @@ -16903,7 +17067,6 @@ 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; @@ -16913,36 +17076,28 @@ module OneM2M_Testcases_CSE_Release_3 { setverdict(inconc); } } // End of 'alt' statement - - f_cf05Down(); - } + } // End of function f_delete_nidd_configuration - // 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 + function f_get_nidd_configuration(in charstring p_location, out NiddConfiguration p_niddConfiguration) runs on ScefSimu system ScefSystem { + var T8Primitive v_response; - // 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), vc_scefSimuDesc.scefId & "/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_t8_request_get( + m_uri_3gpp_nidd(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), vc_scefSimuDesc.scefId & "/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_404_not_found)) { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_individualNiddConfiguration))) -> value v_response { tc_ac.stop; - setverdict(pass); + p_niddConfiguration := v_response.t8Response.responseBody.individualNiddConfiguration; } [] mcnPort.receive(mw_t8Response) { tc_ac.stop; @@ -16953,175 +17108,241 @@ module OneM2M_Testcases_CSE_Release_3 { } } // End of 'alt' statement - f_cf05Down(); - } + } // End of function f_get_nidd_configuration - // 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), vc_scefSimuDesc.scefId & "/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; + } // 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_device_triggering(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.tsAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort), vc_scefSimuDesc.scefId & "/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" } + } + ))); + tc_ac.start; + alt { + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, mw_response_body_deviceTriggerings(?)))) { + 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(); + } + + // 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), vc_scefSimuDesc.scefId & "/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), vc_scefSimuDesc.scefId & "/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); - } - [] mcnPort.receive(mw_t8Response) { - tc_ac.stop; + } else { setverdict(fail); } - [] tc_ac.timeout { - setverdict(inconc); - } - } // End of 'alt' statement - - f_delete_nidd_configuration(v_location); - - f_cf05Down(); - } + } + [] mcnPort.receive(mw_t8Response) { + tc_ac.stop; + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement - 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), vc_scefSimuDesc.scefId & "/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), vc_scefSimuDesc.scefId & "/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), vc_scefSimuDesc.scefId & "/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 + f_cf05Down(); + } + + testcase TC_CSE_3GPP_SCEF_T8_009_01() runs on ScefSimu system ScefSystem { + var T8Primitive v_request; + + f_cf05Up(); + + tc_ac.start; + alt { + [] mcnPortIn.receive(mw_t8Request(mw_t8_request_post(mw_uri_3gpp_device_triggering(-, "/scs_as_id_01/transactions", omit), -, mw_request_body_deviceTriggering(mw_deviceTriggering_externalId)))) -> value v_request { + tc_ac.stop; + // Set self field + v_request.t8Request.requestBody.individualDeviceTriggeringTransaction.self_ := "todo/cf_001"; + // Send the response 201 created + mcnPortIn.send(m_t8Response(m_t8_response_201_created({ + { "Host", vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.localPort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }, + m_response_body_individualDeviceTriggering(v_request.t8Request.requestBody.individualDeviceTriggeringTransaction) + ))); + setverdict(pass); + } + [] mcnPortIn.receive(mw_t8Request) { + tc_ac.stop; + // Send the response 400 Bad Request + mcnPortIn.send(m_t8Response(m_t8_response_400_bad_request({ + { "Host", vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.localPort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }, + m_problemDetails("Unmatch", 400) + ))); + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_cf05Down(); + } - } // End of group nidd + // 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_uri_3gpp_device_triggering(-, "scs_as_id_05/transactions/cf_001", omit), -, 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.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.localPort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }))); + setverdict(pass); + } + [] mcnPortIn.receive(mw_t8Request(mw_t8_request_post(mw_uri_3gpp_device_triggering))) { + tc_ac.stop; + // Send the response 404 Not Found + mcnPortIn.send(m_t8Response(m_t8_response_404_not_found({ + { "Host", vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.localPort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }, + m_problemDetails("Unmatch", 404) + ))); + setverdict(fail); + } + [] mcnPortIn.receive(mw_t8Request) { + tc_ac.stop; + // Send the response 400 Bad Request + mcnPortIn.send(m_t8Response(m_t8_response_400_bad_request({ + { "Host", vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.localPort) }, + { "User-Agent", "oneM2M Test Adapter - TTF001" }, + { "Accept", "*/*" }, + { "Content-Type", "application/json" }, + { "Connection", "keep-alive" } + }, + m_problemDetails("Unmatch", 400) + ))); + setverdict(fail); + } + [] tc_ac.timeout { + setverdict(inconc); + } + } // End of 'alt' statement + + f_cf05Down(); + } - group device_trigerring { + group device_triggering_functions { - // GET all transactons from an SCEF - testcase TC_CSE_3GPP_SCEF_T8_007() runs on ScefSimu system ScefSystem { - f_cf05Up(); + 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_get( + 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), vc_scefSimuDesc.scefId & "/transactions"), { { "Host", vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPort.t8PortDesc.binding.httpBindingDesc.bindingDesc.remotePort) }, @@ -17129,13 +17350,24 @@ module OneM2M_Testcases_CSE_Release_3 { { "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_200_ok(-, mw_response_body_deviceTriggerings(?)))) { + [] mcnPort.receive(mw_t8Response(mw_t8_response_201_created(-, mw_response_body_individualDeviceTriggering))) -> value v_response { + tc_ac.stop; - setverdict(pass); + // 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; @@ -17146,30 +17378,25 @@ module OneM2M_Testcases_CSE_Release_3 { } } // End of 'alt' statement - f_cf05Down(); - } + } // End of function f_create_device_triggering - // GET all transactons from an SCEF - testcase TC_CSE_3GPP_SCEF_T8_008() runs on ScefSimu system ScefSystem { - f_cf05Up(); - + function f_delete_device_triggering(in charstring p_location) runs on ScefSimu system ScefSystem { 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), vc_scefSimuDesc.scefId & "/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" } - } - ))); + 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), vc_scefSimuDesc.scefId & "/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(mw_deviceTriggering_externalId)))) { + [] mcnPort.receive(mw_t8Response(mw_t8_response_204_no_content)) { tc_ac.stop; - setverdict(pass); } [] mcnPort.receive(mw_t8Response) { tc_ac.stop; @@ -17179,48 +17406,28 @@ module OneM2M_Testcases_CSE_Release_3 { setverdict(inconc); } } // End of 'alt' statement - - f_cf05Down(); - } + } // End of function f_delete_device_triggering - // POST create a new device transaction for an SCEF - testcase TC_CSE_3GPP_SCEF_T8_009() runs on ScefSimu system ScefSystem { + function f_get_device_triggering(in charstring p_location, out DeviceTriggering p_deviceTriggering) 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), vc_scefSimuDesc.scefId & "/transactions"), + 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), vc_scefSimuDesc.scefId & "/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" } - }, - 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; - + [] mcnPort.receive(mw_t8Response(mw_t8_response_200_ok(-, 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") { - 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); - } + p_deviceTriggering := v_response.t8Response.responseBody.individualDeviceTriggeringTransaction; } [] mcnPort.receive(mw_t8Response) { tc_ac.stop; @@ -17231,170 +17438,13 @@ module OneM2M_Testcases_CSE_Release_3 { } } // 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_uri_3gpp_device_triggering(-, "scs_as_id_05/transactions/cf_001", omit), -, 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.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.localPort) }, - { "User-Agent", "oneM2M Test Adapter - TTF001" }, - { "Accept", "*/*" }, - { "Content-Type", "application/json" }, - { "Connection", "keep-alive" } - }))); - setverdict(pass); - } - [] mcnPortIn.receive(mw_t8Request(mw_t8_request_post(mw_uri_3gpp_device_triggering))) { - tc_ac.stop; - // Send the response 404 Not Found - mcnPortIn.send(m_t8Response(m_t8_response_404_not_found({ - { "Host", vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.localPort) }, - { "User-Agent", "oneM2M Test Adapter - TTF001" }, - { "Accept", "*/*" }, - { "Content-Type", "application/json" }, - { "Connection", "keep-alive" } - }))); - setverdict(fail); - } - [] mcnPortIn.receive(mw_t8Request) { - tc_ac.stop; - // Send the response 400 Bad Request - mcnPortIn.send(m_t8Response(m_t8_response_400_bad_request({ - { "Host", vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.sutAddress & ":" & int2str(vc_scefSimuDesc.mcnPortIn.t8PortDesc.binding.httpBindingDesc.bindingDesc.localPort) }, - { "User-Agent", "oneM2M Test Adapter - TTF001" }, - { "Accept", "*/*" }, - { "Content-Type", "application/json" }, - { "Connection", "keep-alive" } - }))); - setverdict(fail); - } - [] tc_ac.timeout { - setverdict(inconc); - } - } // End of 'alt' statement - - f_cf05Down(); - } + } // End of function f_get_device_triggering - 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), vc_scefSimuDesc.scefId & "/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), vc_scefSimuDesc.scefId & "/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), vc_scefSimuDesc.scefId & "/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_triggering - - } // End of group Interworking_3GPP + } // End of group device_triggering_functions + + } // End of group device_triggering + + } // End of group Interworking_3GPP }//end group CSE