Commit 0cf410e8 authored by Yann Garcia's avatar Yann Garcia
Browse files

Create MEC 040 codec

parent be058620
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -47,13 +47,13 @@ int json_codec_mec011::encode (const LibHttp__JsonMessageBodyTypes::JsonBody& ms
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_serviceLivenessUpdate)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceLivenessUpdate& service_liveness_update = msg.serviceLivenessUpdate();
    service_liveness_update.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::ServiceLivenessUpdate_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = char2oct(CHARSTRING("{\"serviceLivenessUpdate\": ")) + OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data()) + char2oct(CHARSTRING("}"));
    data = /*char2oct(CHARSTRING("{\"serviceLivenessUpdate\": ")) + */OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else if (msg.ischosen(LibHttp__JsonMessageBodyTypes::JsonBody::ALT_trafficRule)) {
    const EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule& traffic_rule = msg.trafficRule();
    traffic_rule.encode(EdgePlatformApplicationEnablementAPI__TypesAndValues::TrafficRule_descr_, encoding_buffer, TTCN_EncDec::CT_JSON);
    data = OCTETSTRING(encoding_buffer.get_len(), encoding_buffer.get_data())/* + char2oct(CHARSTRING("}"))*/;
  } else {
    loggers::get_instance().error("json_codec_mec011::encode: Not supported");
    return json_codec::encode(msg, data);
  }

  loggers::get_instance().log("<<< json_codec_mec011::encode");
@@ -186,8 +186,7 @@ int json_codec_mec011::decode (const OCTETSTRING& p_data, LibHttp__JsonMessageBo
    appInfo.decode(EdgePlatformApplicationEnablementAPI__TypesAndValues::AppInfo_descr_, decoding_buffer, TTCN_EncDec::CT_JSON);
    msg.appInfo__regapps() = appInfo;
  } else {
    loggers::get_instance().warning("json_codec_mec011::decode: Unsupported variant");
    return -1;
    return json_codec::decode(p_data, msg, p_params);
  }

  loggers::get_instance().log_msg("<<< json_codec_mec011::decode: ", (const Base_Type&)msg);
+5 −4
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ sources := \
  json_codec_mec011.cc \
  json_codec_mec013.cc \
  json_codec_mec030.cc \
  json_codec_mec040.cc \


includes := .
+1 −1
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ LibMec_Pics.PICS_ROOT_API := "/sbxykqjr17/mep1/" # Need to sign i
LibMec_Pics.PICS_MEC_PLAT := true

# Application Instance ID
EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "11e9eb9a-1ed6-40ea-94f4-7300b80554ce" # Copied from ETSI MEC Sandbox GUI
EdgePlatformApplicationEnablementAPI_Pixits.PX_APP_INSTANCE_ID := "8b49cf3a-b5ea-4bcf-ab20-35f92990a922" # Copied from ETSI MEC Sandbox GUI

# Callbacks

+39 −4
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@ LibHttp_Pics.PICS_USE_TOKEN_HEADER := true
# In this section you can specify the name of the log file and the classes of events
# you want to log into the file or display on console (standard error).

LogFile := "../logs/AtsMec/%e.%h-%r.%s"
LogFile := "../logs/AtsMec_FederationEnablement/%e.%h-%r.%s"
FileMask := LOG_ALL | USER | DEBUG | MATCHING
ConsoleMask := LOG_ALL | USER | DEBUG | MATCHING
#FileMask := ERROR | WARNING | USER | MATCHING | EXECUTOR_RUNTIME | VERDICTOP | PORTEVENT | TESTCASE
@@ -33,9 +33,9 @@ LogEventTypes:= Yes

[TESTPORT_PARAMETERS]
# In this section you can specify parameters that are passed to Test Ports.
system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=192.168.1.21,port=30030,use_ssl=0)"
#system.httpPort.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)"
system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)"
system.httpPort.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1,server=192.168.1.12,port=30030,use_ssl=0)"
#system.httpPort.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1,server=try-mec.etsi.org,port=443,use_ssl=1)"
system.httpPort_notif.params := "HTTP(codecs=json:json_codec_mec040)/TCP(debug=1,server_mode=1,local_port=80,use_ssl=0)"

[DEFINE]
# In this section you can create macro definitions,
@@ -62,6 +62,41 @@ system.httpPort_notif.params := "HTTP(codecs=json:json_codec)/TCP(debug=1,server
# In this section you can specify what parts of your test suite you want to execute.
#AtsMec_TestControl.control

# Check that the IUT responds with a list of all available systemInfo when requested by a MEC Orchestrator - No query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_01
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - SystemId query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_02
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple SystemId query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_03
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Empty SystemId query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_04
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - SystemName query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_05
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - SystemName query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_05
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple SystemName query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_06
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Empty SystemName query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_07
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - systemProvider query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_08
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple systemProvider query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_09
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Empty systemProvider query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_10
# Check that the IUT responds with a selection of all available systemInfo when requested by a MEC Orchestrator - Multiple query parameters
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_OK_11
# Check that the IUT responds with an error when selection is not applicable - SystemId
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_NF_01
# Check that the IUT responds with an error when selection is not applicable - SystemName
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_NF_02
# Check that the IUT responds with an error when selection is not applicable - SystemProvider
#AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_NF_03
# Check that the IUT responds with an error when request is malformed
AtsMec_FederationEnablementAPI_TestCases.TC_MEC_MEC040_SRV_MEF_001_BR




[GROUPS]
# In this section you can specify groups of hosts. These groups can be used inside the
+11 −19
Original line number Diff line number Diff line
@@ -34,9 +34,9 @@ module AtsMec_FederationEnablementAPI_TestCases {
        // Local variables
        var Headers v_headers;
        var SystemInfoList v_system_info_list := { 
                                                    valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1, PX_FED_SYSTEM_ID_1)),
                                                    valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2, PX_FED_SYSTEM_ID_2)), 
                                                    valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3, PX_FED_SYSTEM_ID_3))
                                                    valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_1, PX_FED_SYSTEM_NAME_1)),
                                                    valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_2, PX_FED_SYSTEM_NAME_2)), 
                                                    valueof(m_system_info(PX_FED_SYSTEM_PROVIDER_3, PX_FED_SYSTEM_NAME_3))
                                                  };
        
        // Test control
@@ -59,9 +59,7 @@ module AtsMec_FederationEnablementAPI_TestCases {
                                     m_http_request_get(
                                                        PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO,
                                                        v_headers
                                                        )
                                     )
                      );
                      )));
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
@@ -72,16 +70,12 @@ module AtsMec_FederationEnablementAPI_TestCases {
                                               mw_http_response_ok(
                                                                   mw_http_message_body_json(
                                                                                             mw_body_json_fed_system_info_list(
                                                                                                                               {
                                                                                                                                  *,
                                                                                                                               superset(
                                                                                                                                        mw_system_info(
                                                                                                                                                       PX_FED_SYSTEM_PROVIDER_1,
                                                                                                                                                       PX_FED_SYSTEM_NAME_1,
                                                                                                                                                       PX_FED_SYSTEM_ID_1
                                                                                                                                                 ),
                                                                                                                                  *
                                                                                                                               }
                              ))))) {
                              ))))))) {
            tc_ac.stop;
            
            log("*** " & testcasename() & ": PASS: IUT successfully responds with a SystemInfoList ***");
@@ -130,9 +124,7 @@ module AtsMec_FederationEnablementAPI_TestCases {
                                     m_http_request_get(
                                                        PICS_ROOT_API & PX_FED_API_LIST_SYSTEM_INFO & "?systemId=" & oct2char(unichar2oct(PX_FED_SYSTEM_ID_1, "UTF-8")),
                                                        v_headers
                                                        )
                                     )
                      );
                      )));
        f_selfOrClientSyncAndVerdict(c_prDone, e_success);
        
        // Test Body
Loading