Commit d72baeb6 authored by Yann Garcia's avatar Yann Garcia
Browse files

CAPIF: Add new TC; Add missing types & templates for subscription

parent 2a7dc956
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -56,6 +56,10 @@ int json_codec_mec011::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription& service_api_description = msg.service__api__description();
    service_api_description.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_service__api__description)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch& service_api_description_patch = msg.service__api__description__patch();
    service_api_description_patch.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else {
    return json_codec::encode(msg, data);
  }
@@ -197,6 +201,10 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo
    EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription service_api_description;
    service_api_description.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescription_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.service__api__description() = service_api_description;
  } else if (it->second.find("\"serviceAPICategory\"") != std::string::npos) {
    EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch service_api_description_patch;
    service_api_description_patch.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceAPIDescriptionPatch_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.service__api__description__patch() = service_api_description_patch;
  } else {
    return json_codec::decode(p_data, msg, p_params);
  }
+13 −0
Original line number Diff line number Diff line
@@ -222,6 +222,19 @@ AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROF
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01
# Check that the IUT responds with an error when applying a filter on an unknown serviceApiId
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02
# Check that the IUT updates the publishing of a new API when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_OK
# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_NF
# Check that the IUT changes the publishing of a new API when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_OK
# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_NF
# Check that the IUT acknowledges the removing of a published API when queried by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK
# Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
#AtsMec_EdgePlatformApplicationEnablementAPI_TestCases.TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF


[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+442 −36

File changed.

Preview size limit exceeded, changes collapsed.

+13 −0
Original line number Diff line number Diff line
@@ -105,13 +105,26 @@ module AtsMec_EdgePlatformApplicationEnablementAPI_TestControl {
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_OK_05());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_BR());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_001_NF());

        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_OK());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_002_NF());

        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_OK());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_003_BR());

        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_OK());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_01());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_004_NF_02());

        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_OK());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_005_NF());

        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_OK());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_006_NF());

        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_OK());
        execute(TC_MEC_MEC011_SRV_MEC_PROFILE_FOR_CAPIF_007_NF());

      }
    }

+31 −0
Original line number Diff line number Diff line
@@ -540,4 +540,35 @@ module EdgePlatformApplicationEnablementAPI_Functions {

  } // End of function f_publish_api

  function f_delete_published_api(
                                  in Json.String  p_service_instance_id,
                                  in Json.String  p_service_app_id
                                  ) runs on HttpComponent {
    var Headers v_headers;
    var HttpMessage v_response;

    f_init_default_headers_list(-, -, v_headers);
    httpPort.send(
                  m_http_request(
                                  m_http_request_post(
                                                      PICS_ROOT_API & PX_ME_CAPIF_PUBLISH_API_URI & "/" & oct2char(unichar2oct(p_service_instance_id, "UTF-8")) & "/service-apis/" & oct2char(unichar2oct(p_service_app_id, "UTF-8")),
                                                      v_headers
                  )));
    tc_ac.start;
    alt {
      [] httpPort.receive(
                          mw_http_response(
                                           mw_http_response_204_no_content
                          )) -> value v_response {
        tc_ac.stop;

        log("*** " & testcasename() & ": Info: IUT successfully responds with the HTTP code 204 ***");
      }
      [] tc_ac.timeout {
        log("*** " & testcasename() & ": INCONC: Expected message not received ***");
      }
    } // End of 'alt' statement

  } // End of function f_delete_published_api

} // End of module EdgePlatformApplicationEnablementAPI_Functions
Loading