From a00bacb09ca53c9ba6941135db7a56ad083f85b8 Mon Sep 17 00:00:00 2001 From: Elian Kraja Date: Mon, 23 Sep 2019 17:37:59 +0200 Subject: [PATCH] Added PkgManagement for MM1 --- ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn | 1260 +++++++++++++++++ .../Ams/ttcn/Ams_sEncdecDeclarations.ttcn | 22 + ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pics.ttcn | 8 + ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn | 50 + .../MeoPkgm/ttcn/MeoPkgm_Templates.ttcn | 351 +++++ .../MeoPkgm/ttcn/MeoPkgm_TypesAndValues.ttcn | 258 ++++ ttcn/LibMec/ttcn/LibMec_Pics.ttcn | 4 + ttcn/LibMec/ttcn/LibMec_Pixits.ttcn | 3 + 8 files changed, 1956 insertions(+) create mode 100644 ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn create mode 100644 ttcn/LibMec/Ams/ttcn/Ams_sEncdecDeclarations.ttcn create mode 100644 ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pics.ttcn create mode 100644 ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn create mode 100644 ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn create mode 100644 ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_TypesAndValues.ttcn diff --git a/ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn b/ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn new file mode 100644 index 0000000..d08a9e2 --- /dev/null +++ b/ttcn/AtsMec/AtsMec_MeoPkgm_TestCases.ttcn @@ -0,0 +1,1260 @@ +/** +* @author ETSI / STF569 +* @version $URL:$ +* $ID:$ +* @desc This module provides the MEC test cases. +* @copyright ETSI Copyright Notification +* No part may be reproduced except as authorized by written permission. +* The copyright and the foregoing restriction extend to reproduction in all media. +* All rights reserved. +* @see ETSI GS MEC 003, Draft ETSI GS MEC 013 V2.0.3 (2018-10) +*/ +module AtsMec_PkgMgmt_mm1_TestCases { + + // Libcommon + import from LibCommon_Sync all; + + // LibHttp + import from LibItsHttp_TypesAndValues all; + import from LibItsHttp_Functions all; + import from LibItsHttp_Templates all; + import from LibItsHttp_JsonTemplates all; + import from LibItsHttp_TestSystem all; + + + import from MeoPkgm_Templates all; + import from MeoPkgm_Pics all; + import from MeoPkgm_Pixits all; + + // LibMec + import from LibMec_Functions all; + import from LibMec_Pics all; + import from LibMec_Pixits all; + + group appPackageManagement { + + /** + * @desc: Check that MEO creates a new App Package when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.1.3.1, + * ETSI GS MEC 010-2 2.0.10, Table 6.2.3.3.2-1, //OnboardedAppPkgInfo + * ETSI GS MEC 010-2 2.0.10, Table 6.2.3.2.2-1 //AppPkg + */ + testcase TP_MEC_MEO_PKGM_001_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI, + v_headers, + m_http_message_body_json( + m_body_json_package_management( + m_package_management( + PX_APP_PKG_NAME, + PX_APP_PKG_VERSION, + PX_CHECKSUM, + PX_APP_PKG_PATH + ) + ) + ) + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_pkg_mgmt_response( + mw_package_management_list( + -, + PX_APP_PKG_NAME, + PX_APP_PKG_VERSION, + PX_CHECKSUM, + PX_OPERATIONAL_STATE, + PX_USAGE_STATE + ) + ))))) -> value v_response { + tc_ac.stop; + + if (v_response.response.statuscode == 201) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Onboarded App Package ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_001_OK + + + + /** + * @desc: Check that MEO responds with an error when it receives a malformed request for creating a new App Package + * ETSI GS MEC 010-2 2.0.10, clause 7.3.1.3.1 + * ETSI GS MEC 010-2 2.0.10, Table 6.2.3.2.2-1 //AppPkg + */ + testcase TP_MEC_MEO_PKGM_001_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI, + v_headers, + m_http_message_body_json( + m_body_json_package_management_with_error( + m_package_management_with_error( + PX_APP_PKG_VERSION, + PX_CHECKSUM, + PX_APP_PKG_PATH + ) + ) + ) + + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request( + ))) -> value v_response { + tc_ac.stop; + + if (v_response.response.statuscode == 400) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a Bad response ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_001_BR + + + /** + * @desc: Check that MEO returns the list of App Packages when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.1.3.2 + * ETSI GS MEC 010-2 2.0.10, Table 6.2.3.3.2-1 //OnboardedAppPkgInfo + */ + testcase TP_MEC_MEO_PKGM_002_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI, + v_headers, + - + + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_pkg_mgmt_response( + mw_package_management_list( + -, + PX_APP_PKG_NAME, + PX_APP_PKG_VERSION, + PX_CHECKSUM, + PX_OPERATIONAL_STATE, + PX_USAGE_STATE + ) + ) + ) + ) + ) + ) -> value v_response { + tc_ac.stop; + if (v_response.response.statuscode == 200) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a list of OnboardedAppPkgInfo and 200 status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_002_OK + + + /** + * @desc: Check that MEO responds with an error when it receives a malformed request for retrieving the list of existing App Packages + * ETSI GS MEC 010-2 2.0.10, clause 7.3.1.3.2 + * ETSI GS MEC 010-2 2.0.10, Table 6.2.3.3.2-1 //OnboardedAppPkgInfo + */ + testcase TP_MEC_MEO_PKGM_002_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & "?operationalStatus=ENABLED", + v_headers, + - + + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_pkg_mgmt_response( + mw_package_management_list( + -, + PX_APP_PKG_NAME, + PX_APP_PKG_VERSION, + PX_CHECKSUM, + PX_OPERATIONAL_STATE, + PX_USAGE_STATE + ) + ) + ) + ) + ) + ) -> value v_response { + tc_ac.stop; + if (v_response.response.statuscode == 400) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 400 Bad Request status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_002_BR + + + + /** + * @desc: Check that MEO returns the an App Package when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.2.3.2 + * ETSI GS MEC 010-2 2.0.10, Table 6.2.3.3.2-1 //OnboardedAppPkgInfo + */ + testcase TP_MEC_MEO_PKGM_003_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_ON_BOARDED_APP_PKG_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_pkg_mgmt_response( + mw_package_management_list( + PX_ON_BOARDED_APP_PKG_ID, + PX_APP_PKG_NAME, + PX_APP_PKG_VERSION, + PX_CHECKSUM, + PX_OPERATIONAL_STATE, + PX_USAGE_STATE + ) + ) + ) + ) + )) -> value v_response { + tc_ac.stop; + //@TODO: How to check Location??? + if (v_response.response.statuscode == 201) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with an Onboarded App Package info and 200 status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_003_OK + + + /** + * @desc: Check that MEO responds with an error when it receives a request for retrieving a App Package referred with a wrong ID + * ETSI GS MEC 010-2 2.0.10, clause 7.3.2.3.2 + * ETSI GS MEC 010-2 2.0.10, Table 6.2.3.3.2-1 //OnboardedAppPkgInfo + */ + testcase TP_MEC_MEO_PKGM_003_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_PKG_ID, "UTF-8")), + v_headers, + - + + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found( + ))) -> value v_response { + tc_ac.stop; + + if (v_response.response.statuscode == 404) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 not found status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_003_NF + + + /** + * @desc: Check that MEO deletes an App Package when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.2.3.4 + */ + testcase TP_MEC_MEO_PKGM_004_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_ON_BOARDED_APP_PKG_ID, "UTF-8")), + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content( + ))) -> value v_response { + tc_ac.stop; + if (v_response.response.statuscode == 204) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 204 no content status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_004_OK + + + /** + * @desc: Check that MEO responds with an error when it receives a request for deleting an App Package referred with a wrong ID + * ETSI GS MEC 010-2 2.0.10, clause 7.3.2.3.4 + * ETSI GS MEC 010-2 2.0.10, Table 6.2.3.3.2-1 //OnboardedAppPkgInfo + */ + testcase TP_MEC_MEO_PKGM_004_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_PKG_ID, "UTF-8")), + v_headers, + - + + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found( + ))) -> value v_response { + tc_ac.stop; + + if (v_response.response.statuscode == 404) { + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 not found status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_004_NF + + + /** + * @desc: Check that MEO changes the status of an App Package from INITIAL_OP_STATE with an operation of type OPERATION_VALUE when requested, with the following possible combinations: + * - ENABLED, DISABLE + * - DISABLED, ENABLE + * - DELETION_PENDING, ABORT + * ETSI GS MEC 010-2 2.0.10, clause 7.3.2.3.3 + */ + testcase TP_MEC_MEO_PKGM_005_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_put( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_ON_BOARDED_APP_PKG_ID, "UTF-8")) & "?appPkgOperation=DISABLE", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + ))) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 200 ok status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_005_OK + + + /** + * @desc: Check that MEO sends an error when it receives a malformed request to modify the operational state of an application package + * ETSI GS MEC 010-2 2.0.10, clause 7.3.2.3.3 + */ + testcase TP_MEC_MEO_PKGM_005_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_ON_BOARDED_APP_PKG_ID, "UTF-8")) & "?appPkgOperation=DISAB", + v_headers, + - + + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request( + ))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 400 Bad request status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_005_BR + + + /** + * @desc: Check that MEO responds with an error when it receives a request for updating an App Package referred with a wrong ID + * ETSI GS MEC 010-2 2.0.10, clause 7.3.2.3.3 + */ + testcase TP_MEC_MEO_PKGM_005_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_PKG_ID, "UTF-8")) & "?appPkgOperation=DISABLE", + v_headers, + - + + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request( + ))) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 400 Bad Request status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_005_NF + + + /** + * @desc: Check that MEO returns the Application Descriptor contained on a on-boarded Application Package when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.6.3.2 + */ + testcase TP_MEC_MEO_PKGM_006_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_ON_BOARDED_APP_PKG_ID, "UTF-8")) & "/appDId", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + //@TODO: The response should contain a file. Is it possible to check? + ))) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 200 ok status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_006_OK + + + /** + * @desc: Check that MEO responds with an error when it receives a request to retrieve an application descriptor referred with a wrong app package ID + * ETSI GS MEC 010-2 2.0.10, clause 7.3.6.3.2 + */ + testcase TP_MEC_MEO_PKGM_006_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_URI & oct2char(unichar2oct(PX_NON_EXISTENT_APP_PKG_ID, "UTF-8")) & "/appDId", + v_headers + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found( + ))) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 404 not found status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_006_NF + + + +} // End of packageManagement + +group pkg_mgmt_subscriptions { + + /** + * @desc: Check that MEO service sends a Application Package Subscription when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.3.3.1 + */ + testcase TP_MEC_MEO_PKGM_007_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + "/" & PICS_ROOT_API & PX_MEO_PKGM_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_pkgm_subscription( + m_app_package_subscription( + PX_CALLBACK_URI, + PX_SUBSCRIPTION_TYPE + ) + ) + ) + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_pkgm_subscription_info( + mw_app_package_subscription_info( + -, + PX_SUBSCRIPTION_TYPE, + PX_CALLBACK_URI + ) + ))))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a App Package Subscription Info ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_007_OK + + /** + * @desc: Check that MEO service sends an error when it receives a malformed request for creating a new subscription on AppPackages + * ETSI GS MEC 010-2 2.0.10, clause 7.3.3.3.1 + */ + testcase TP_MEC_MEO_PKGM_007_BR() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_post( + "/" & PICS_ROOT_API & PX_MEO_PKGM_SUBS, + v_headers, + m_http_message_body_json( + m_body_json_pkgm_subscription_with_error( + m_app_package_subscription_with_error( + PX_CALLBACK_URI, + PX_SUBSCRIPTION_TYPE_WITH_ERROR + ) + ) + ) + + ))); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_400_bad_request( + ))) -> value v_response { + tc_ac.stop; + log("*** " & testcasename() & ": PASS: IUT successfully responds with a 400 Bad Request status code ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_007_BR + + /** + * @desc: Check that MEO service returns the list of Application Package Subscriptions when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.3.3.2 + */ + testcase TP_MEC_MEO_PKGM_008_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_SUBS, + v_headers + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_pkgm_subscription_info_list( + { + *, + mw_app_package_subscription_info( + -, + PX_SUBSCRIPTION_TYPE, + PX_CALLBACK_URI + ), + * + } + ))))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a App Package Subscription Info List ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_008_OK + + + /** + * @desc: Check that MEO service returns an Application Package Subscription when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.4.3.2 + */ + testcase TP_MEC_MEO_PKGM_009_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_ok( + mw_http_message_body_json( + mw_body_json_pkgm_subscription_info( + mw_app_package_subscription_info( + PX_SUBSCRIPTION_ID, + PX_SUBSCRIPTION_TYPE, + PX_CALLBACK_URI + ) + ))))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with a App Package Subscription Info identified by the given ID ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_009_OK + + + /** + * @desc: Check that MEO service sends an error when it receives a query + * for a subscription on AppPackages with a wrong identifier + * ETSI GS MEC 010-2 2.0.10, clause 7.3.4.3.2 + */ + testcase TP_MEC_MEO_PKGM_009_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_get( + "/" & PICS_ROOT_API & PX_MEO_PKGM_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found( + ))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with 404 not found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_009_NF + + /** + * @desc: Check that MEO service deletes an Application Package Subscription when requested + * ETSI GS MEC 010-2 2.0.10, clause 7.3.4.3.4 + */ + testcase TP_MEC_MEO_PKGM_010_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + "/" & PICS_ROOT_API & PX_MEO_PKGM_SUBS & "/" & oct2char(unichar2oct(PX_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_204_no_content( + ))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds 204 No Content removing the AppPkgSubscription identified by the given ID ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_010_OK + + + /** + * @desc: Check that MEO service sends an error when it receives a deletion + * request for a subscription on AppPackages with a wrong identifier + * ETSI GS MEC 010-2 2.0.10, clause 7.3.4.3.4 + */ + testcase TP_MEC_MEO_PKGM_010_NF() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + var HttpMessage v_response; + + // Test control + if (not(PIC_APP_PACKAGE_MANAGEMENT)){ + log("*** " & testcasename() & ": PIC_APP_PACKAGE_MANAGEMENT required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_up(); + + // Preamble + f_init_default_headers_list(-, -, v_headers); + httpPort.send( + m_http_request( + m_http_request_delete( + "/" & PICS_ROOT_API & PX_MEO_PKGM_SUBS & "/" & oct2char(unichar2oct(PX_NON_EXISTENT_SUBSCRIPTION_ID, "UTF-8")), + v_headers + ) + )); + + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_ac.start; + alt { + [] httpPort.receive( + mw_http_response( + mw_http_response_404_not_found( + ))) -> value v_response { + tc_ac.stop; + + log("*** " & testcasename() & ": PASS: IUT successfully responds with 404 not found ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_ac.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + } // End of testcase TP_MEC_MEO_PKGM_010_NF + +} // end of group pkg_mgmt_subscriptions + +group pkg_management_notification { + + /** + * @desc Check that the MEO service sends a application package notification + * if the MEO service has an associated subscription and the event is generated + * @see ETSI GS MEC 010-2 2.0.10, clause 7.3.5.1 + */ + testcase TP_MEC_MEO_PKGM_011_OK() runs on HttpComponent system HttpTestAdapter { + // Local variables + var HeaderLines v_headers; + + // Test control + if (not(PIC_APP_PACKAGE_NOTIFICATIONS)) { + log("*** " & testcasename() & ": PIC_APP_PACKAGE_NOTIFICATIONS required for executing the TC ***"); + setverdict(inconc); + stop; + } + + // Test component configuration + f_cf_01_http_notif_up(); + + // Test adapter configuration + + // Preamble + f_init_default_headers_list(-, -, v_headers); + action("Trigger a expire notification event"); + f_selfOrClientSyncAndVerdict(c_prDone, e_success); + + // Test Body + tc_wait.start; + alt { + [] httpPort_notif.receive( + mw_http_request( + mw_http_request_post( + unichar2char(PX_CALLBACK_URI), + -, + mw_http_message_body_json( + mw_body_json_app_package_notification( + mw_app_package_notification( + -, + PX_NOTIFICATION_TYPE, + PX_SUBSCRIPTION_ID, + PX_CALLBACK_URI) + ) + ) + ) + ) + ) { + tc_wait.stop; + log("*** " & testcasename() & ": INFO: IUT successfully sends notification ***"); + + // Send 204 No Content + httpPort_notif.send(m_http_response(m_http_response_204_no_content(v_headers))); + + log("*** " & testcasename() & ": PASS: IUT successfully sends notification ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_success); + } + [] tc_wait.timeout { + log("*** " & testcasename() & ": INCONC: Expected message not received ***"); + f_selfOrClientSyncAndVerdict(c_tbDone, e_timeout); + } + } // End of 'alt' statement + + // Postamble + f_cf_01_http_notif_down(); + } + + +} // end of group pkg_management_notification + + +} // End of module AtsMec_PkgMgmt_mm1_TestCases + + + + + + + diff --git a/ttcn/LibMec/Ams/ttcn/Ams_sEncdecDeclarations.ttcn b/ttcn/LibMec/Ams/ttcn/Ams_sEncdecDeclarations.ttcn new file mode 100644 index 0000000..72d71c7 --- /dev/null +++ b/ttcn/LibMec/Ams/ttcn/Ams_sEncdecDeclarations.ttcn @@ -0,0 +1,22 @@ +module Ams_EncdecDeclarations { + + import from Ams_TypesAndValues all; + + external function enc_AppMobilityServiceInfo(in AppMobilityServiceInfo p_app_mobility_service_info) return octetstring + with { extension "prototype (convert) encode(JSON)"; extension "printing(pretty)" }; + external function dec_AppMobilityServiceInfo(in octetstring p_pdu) return AppMobilityServiceInfo + with { extension "prototype (convert) decode(JSON)" }; + + external function enc_RegistrationRequest(in RegistrationRequest p_registration_request) return octetstring + with { extension "prototype (convert) encode(JSON)"; extension "printing(pretty)" }; + external function dec_RegistrationRequest(in octetstring p_pdu) return RegistrationRequest + with { extension "prototype (convert) decode(JSON)" }; + + + external function enc_RegistrationInfo(in RegistrationInfo p_registration_info) return octetstring + with { extension "prototype (convert) encode(JSON)"; extension "printing(pretty)" }; + external function dec_Registrationinfo(in octetstring p_pdu) return RegistrationInfo + with { extension "prototype (convert) decode(JSON)" }; + + +} // End of module LocationAPI_EncdecDeclarations diff --git a/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pics.ttcn b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pics.ttcn new file mode 100644 index 0000000..79f155d --- /dev/null +++ b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pics.ttcn @@ -0,0 +1,8 @@ +module MeoPkgm_Pics { + + /** + * @desc Does the IUT support LocationAPI? + */ + modulepar boolean PICS_PKGMGMT_API_SUPPORTED := true; + +} // End of module LocationAPI_Pics diff --git a/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn new file mode 100644 index 0000000..55ed740 --- /dev/null +++ b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Pixits.ttcn @@ -0,0 +1,50 @@ +module MeoPkgm_Pixits { + + // JSON + import from JSON all; + + // LibMec/LocationAPI + import from MeoPkgm_TypesAndValues all; + + modulepar JSON.String PX_APP_PKG_NAME := "APP_PKG_NAME" + + modulepar JSON.String PX_APP_PKG_VERSION := "APP_PKG_VERSION" + + modulepar JSON.String PX_CHECKSUM := "CHECKSUM" + + modulepar JSON.String PX_APP_PKG_PATH := "APP_PKG_PATH" + + modulepar OperationalState PX_OPERATIONAL_STATE := ENABLED + + modulepar UsageState PX_USAGE_STATE := NOT_IN_USE + + modulepar JSON.String PX_ON_BOARDED_APP_PKG_ID := "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f" + + modulepar JSON.String PX_NON_EXISTENT_APP_PKG_ID := "NON_EXISTENT_APP_PKG_ID" + + modulepar JSON.AnyURI PX_CALLBACK_URI := "http://127.0.0.1/callback" + + modulepar SubscriptionType PX_SUBSCRIPTION_TYPE := ON_BOARDING + + modulepar SubscriptionTypeWithError PX_SUBSCRIPTION_TYPE_WITH_ERROR := ONBOARDING + + modulepar JSON.String PX_SUBSCRIPTION_ID := "e0deee2b-6e50-4f33-ab09-8bf0585025d3" + + modulepar JSON.String PX_NON_EXISTENT_SUBSCRIPTION_ID := "NON_EXISTENT_SUBSCRIPTION_ID" + + modulepar NotificationType PX_NOTIFICATION_TYPE := ON_BOARDING + +// modulepar JSON.String PX_APP_MOBILITY_SERVICE_ID := "KtRGymNQ84dG3mQfRepa" +// +// modulepar JSON.String PX_APP_INS_ID := "5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f" +// +// modulepar SubscriptionType PX_SUBSCRIPTION_TYPE := MobilityProcedureSubscription +// +// +// +// modulepar JSON.String PX_CALLBACK_REFERENCE := "http://127.0.0.1/callback" +// +// +// modulepar JSON.String PX_MEP_ID := ""; + +} // End of module LocationAPI_Pixits diff --git a/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn new file mode 100644 index 0000000..58909e8 --- /dev/null +++ b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_Templates.ttcn @@ -0,0 +1,351 @@ +module MeoPkgm_Templates { + + // JSON + import from JSON all; + + // LibCommon + import from LibCommon_BasicTypesAndValues all; + + import from MeoPkgm_TypesAndValues all; + import from MeoPkgm_Pixits all; + + template AppPkg m_package_management ( + in String p_appPkgName, + in String p_appPkgVersion, + in String p_checksum, + in String p_appPkgPath + ) := { + appPkgName := p_appPkgName, + appPkgVersion := p_appPkgVersion, + checksum := p_checksum, + appPkgPath := p_appPkgPath + } + + + template AppPkgWithError m_package_management_with_error ( + in String p_appPkgVersion, + in String p_checksum, + in String p_appPkgPath + ) := { + appPkgVersion := p_appPkgVersion, + checksum := p_checksum, + appPkgPath := p_appPkgPath + } + + template (omit) OnboardedAppPkgInfoList mw_package_management_list ( + in template (omit) String p_appPkgId := omit, + in String p_appName, + in String p_appDVersion, + in String p_checksum, + in OperationalState p_operationalState, + in UsageState p_usageState + ) := { + + } + + + template (omit) AppPkgSubscription m_app_package_subscription ( + in template (omit) AnyURI p_callbackUri := omit, + in template(omit) SubscriptionType p_subscription_type := omit + ) := { + callbackUri := p_callbackUri, + subscriptionType := p_subscription_type + } + + template (omit) AppPkgSubscriptionWithError m_app_package_subscription_with_error ( + in template (omit) AnyURI p_callbackUri := omit, + in template(omit) SubscriptionTypeWithError p_subscription_type := omit + ) := { + callbackUri := p_callbackUri, + subscriptionType := p_subscription_type + } + + + template (present) AppPkgSubscriptionInfo mw_app_package_subscription_info ( + in template (present) String p_subscriptionId := ?, + in template (present) SubscriptionType p_subscription_type := ?, + in template (present) AnyURI p_callbackUri := ? + ) := { + subscriptionId := p_subscriptionId ifpresent, + subscriptionType := p_subscription_type, + callbackUri := p_callbackUri + } + + template (present) AppPkgNotification mw_app_package_notification ( + in template (present) String p_notificationId := ?, + in template (present) NotificationType p_notificationType := ?, + in template (present) String p_subscriptionId := ?, + in template (present) AnyURI p_links := ? + ) := { + notificationType := p_notificationType, + subscriptionId := p_subscriptionId, + links := p_links + } + + + +// template (omit) AppMobilityServiceInfo m_app_mobility_service_info( +// in String p_app_mobility_service_id := PX_APP_MOBILITY_SERVICE_ID, +// in template (omit) RegistrationInfos p_registration_info := omit +// ) := { +// registeredAppMobilityService := p_registration_info, +// appMobilityServiceId := p_app_mobility_service_id +// } // End of template m_app_mobility_service_info +// +// +// template (present) AppMobilityServiceInfo mw_app_mobility_service_info( +// template (present) RegistrationInfos p_registration_info := ?, +// template (present) String p_app_mobility_service_id := ? +// ) := { +// registeredAppMobilityService := p_registration_info, +// appMobilityServiceId := p_app_mobility_service_id +// } +// +// template (omit) RegistrationInfo m_app_mobility_registration_info( +// in template (value) ServiceConsumerId p_serviceConsumerId, +// in template (omit) DeviceInformations p_deviceInformation := omit, +// in template (omit) UInt32 p_expiryTime := omit +// ) := { +// serviceConsumerId := p_serviceConsumerId, +// deviceInformation := p_deviceInformation, +// expiryTime := p_expiryTime +// } +// +// template RegistrationInfo mw_app_mobility_registration_info( +// template (present) ServiceConsumerId p_serviceConsumerId := ?, +// template DeviceInformations p_deviceInformation := *, +// template UInt32 p_expiryTime := * +// ) := { +// serviceConsumerId := p_serviceConsumerId, +// deviceInformation := p_deviceInformation, +// expiryTime := p_expiryTime +// } +// +// template (omit) ServiceConsumerId m_service_consumer_id( +// in template (omit) String p_appInstanceId := omit, +// in template (omit) String p_mepId := omit +// ) := { +// appInstanceId := p_appInstanceId, +// mepId := p_mepId +// } +// +// template (omit) ServiceConsumer m_service_consumer_error( +// in template (omit) String p_appInstance := omit, +// in template (omit) String p_mepId := omit +// ) := { +// appInstance := p_appInstance, +// mepId := p_mepId +// } +// +// template ServiceConsumerId mw_service_consumer_id( +// template String p_appInstanceId := *, +// template String p_mepId := * +// ) := { +// appInstanceId := p_appInstanceId, +// mepId := p_mepId +// } +// +// template (omit) RegistrationRequest m_registration_request ( +// in template (omit) ServiceConsumerId p_service_consumer_id := omit, +// in template (omit) DeviceInformations p_device_info := omit, +// in template (omit) UInt32 p_expire_time := omit +// ) := { +// serviceConsumerId := p_service_consumer_id, +// deviceInformation := p_device_info, +// expiryTime := p_expire_time +// } +// +// +// template (omit) RegistrationRequest m_registration_request_error ( +// in template (omit) ServiceConsumer p_service_consumer := omit, +// in template (omit) DeviceInformations p_device_info := omit, +// in template (omit) UInt32 p_expire_time := omit +// ) := { +// serviceConsumerId := p_service_consumer, +// deviceInformation := p_device_info, +// expiryTime := p_expire_time +// } +// +// +// template RegistrationRequest mw_registration_request( +// template ServiceConsumerId p_service_consumer_id := ?, +// template DeviceInformations p_device_info := omit, +// template UInt32 p_expire_time := omit +// ) := { +// serviceConsumerId := p_service_consumer_id, +// deviceInformation := p_device_info, +// expiryTime := p_expire_time +// } +// +// +// template (value) RegistrationInfo m_registration_info ( +// in template (omit) ServiceConsumerId p_service_consumer_id := omit, +// in template (omit) DeviceInformations p_device_info := omit, +// in UInt32 p_expire_time +// ) := { +// serviceConsumerId := p_service_consumer_id, +// deviceInformation := p_device_info, +// expiryTime := p_expire_time +// } +// +// template (present) RegistrationInfos mw_registration_info( +// template (present) ServiceConsumerId p_service_consumer_id := ?, +// template (present) DeviceInformations p_device_info := ?, +// template (present) UInt32 p_expire_time := ? +// ) := { +// +// } +// +// +// template (value) ServiceConsumer m_service_consumer ( +// in String p_app_instance, +// in String p_mep_id +// ) := { +// appInstance := p_app_instance, +// mepId := p_mep_id +// } +// +// template (omit) ServiceConsumer mw_service_consumer ( +// in String p_app_instance, +// in template (omit) String p_mep_id := omit +// ) := { +// appInstance := p_app_instance, +// mepId := p_mep_id +// } +// +// template (value) DeviceInformation m_device_info ( +// in String p_associate_id +// ) := { +// associateId := p_associate_id +// } +// +// template (omit) DeviceInformation mw_device_info ( +// in String p_associate_id +// ) := { +// associateId := p_associate_id +// } +// type record AmsSubscriptionLinkList { +// JSON.AnyURI links, +// Subscription subscription +// } +// +// template (value) AdjacentAppInfoSubscription mw_adjacent_application_info_notification ( +// in template (omit) SubscriptionType p_subscriptionType := omit, +// in JSON.AnyURI p_callbackReference, +// in template (omit) JSON.AnyURI p_links := omit, +// in template (omit) AdjacentFilterCriteria p_filterCriteria := omit, +// in template (omit) TimeStamp p_expiryDeadline := omit +// +// ) := { +// subscriptionType := p_subscriptionType , +// callbackReference := p_callbackReference, +// links := p_links, +// filterCriteria := p_filterCriteria, +// expiryDeadline := p_expiryDeadline +// } +// +// +// template (value) MobilityProcedureSubscription m_ams_subscription ( +// in SubscriptionType p_subscriptionType := PX_SUBSCRIPTION_TYPE, +// in JSON.AnyURI p_callbackReference, +// in template (omit) JSON.AnyURI p_links := omit, +// in template (omit) FilterCriteria p_filterCriteria := omit, +// in template (omit) TimeStamp p_expiryDeadline := omit +// +// ) := { +// subscriptionType := p_subscriptionType , +// callbackReference := p_callbackReference, +// links := p_links, +// filterCriteria := p_filterCriteria, +// expiryDeadline := p_expiryDeadline +// } +// +// +// +// template (value) MobilityProcedureSubscription mw_mobility_procedure_notification ( +// in template (omit) SubscriptionType p_subscriptionType := omit, +// in JSON.AnyURI p_callbackReference, +// in template (omit) JSON.AnyURI p_links := omit, +// in template (omit) FilterCriteria p_filterCriteria := omit, +// in template (omit) TimeStamp p_expiryDeadline := omit +// +// ) := { +// subscriptionType := p_subscriptionType , +// callbackReference := p_callbackReference, +// links := p_links, +// filterCriteria := p_filterCriteria, +// expiryDeadline := p_expiryDeadline +// } +// +// template (value) MobilityProcedureSubscriptionError m_ams_subscription_error ( +// in SubscriptionType p_subscriptionType, +// in JSON.AnyURI p_callbackReference, +// in template (omit) JSON.AnyURI p_links := omit, +// in template (omit) FilterCriteria p_filterCriteria := omit, +// in template (omit) TimeStamp p_expiryDeadline := omit +// +// ) := { +// subscriptionType := p_subscriptionType, +// callbackReference := p_callbackReference, +// links := p_links, +// filterCriteria := p_filterCriteria, +// expiryDeadline := p_expiryDeadline +// } +// +// template (present) MobilityProcedureSubscription mw_ams_subscription ( +// in SubscriptionType p_subscriptionType, +// in template (omit) JSON.AnyURI p_callbackReference := omit, +// in template (omit) JSON.AnyURI p_links := omit, +// in template (omit) FilterCriteria p_filterCriteria := omit, +// in template (omit) TimeStamp p_expiryDeadline := omit +// ) := { +// subscriptionType := p_subscriptionType , +// callbackReference := p_callbackReference, +// links := p_links, +// filterCriteria := p_filterCriteria, +// expiryDeadline := p_expiryDeadline +// } +// +// template (present) ExpiryNotification mw_expire_notification ( +// in template (omit) TimeStamp p_timestamp := omit, +// in template (omit) JSON.AnyURI p_links := omit, +// in TimeStamp p_expiryDeadline +// ) := { +// timeStamp := p_timestamp, +// links := p_links, +// expiryDeadline := p_expiryDeadline +// } +// +// +// +// template (value) ProblemDetails m_problem_details( +// in JSON.String p_type, +// in JSON.String p_title, +// in UInt32 p_status, +// in JSON.String p_detail, +// in JSON.String p_instance +// ) := { +// type_ := p_type, +// title := p_title, +// status := p_status, +// detail := p_detail, +// instance := p_instance +// } // End of template m_problem_details +// +// template (present) ProblemDetails mw_problem_details( +// template (present) JSON.String p_type := ?, +// template (present) JSON.String p_title := ?, +// template (present) UInt32 p_status := ?, +// template (present) JSON.String p_detail := ?, +// template (present) JSON.String p_instance := ? +// ) := { +// type_ := p_type, +// title := p_title, +// status := p_status, +// detail := p_detail, +// instance := p_instance +// } // End of template mw_problem_details + + + +} // End of module LocationAPI_Templates diff --git a/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_TypesAndValues.ttcn b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_TypesAndValues.ttcn new file mode 100644 index 0000000..b60e8f6 --- /dev/null +++ b/ttcn/LibMec/MeoPkgm/ttcn/MeoPkgm_TypesAndValues.ttcn @@ -0,0 +1,258 @@ +module MeoPkgm_TypesAndValues { + +// JSON +import from JSON all; + +// LibCommon +import from LibCommon_BasicTypesAndValues all; + + +type record AppPkg { + JSON.String appPkgName, + JSON.String appPkgVersion, + JSON.String checksum, + JSON.String appPkgPath +} + +type record AppPkgWithError { + JSON.String appPkgVersion, + JSON.String checksum, + JSON.String appPkgPath +} + +type record of OnboardedAppPkgInfo OnboardedAppPkgInfoList; +type record OnboardedAppPkgInfo { + JSON.String appPkgId, + JSON.String appName, + JSON.String appDVersion, + JSON.String checksum, + OperationalState operationalState, + UsageState usageState +} + +type enumerated AppPkgOperation { + DISABLE, + ENABLE, + ABORT +} + +type enumerated OperationalState { + ENABLED, + DISABLED, + DELETION_PENDING +} + +type enumerated UsageState { + IN_USE, + NOT_IN_USE +} + + +type enumerated SubscriptionType { + ON_BOARDING, + OP_CHANGE +} + +type enumerated SubscriptionTypeWithError { + ONBOARDING, + OP_CHANGE +} + + +type record of AppPkgSubscriptionInfo AppPkgSubscriptionInfoList; +type record AppPkgSubscriptionInfo { + JSON.String subscriptionId, + SubscriptionType subscriptionType, + JSON.AnyURI callbackUri +} + +type record AppPkgSubscription { + JSON.AnyURI callbackUri, + SubscriptionType subscriptionType +} + +type record AppPkgSubscriptionWithError { + JSON.AnyURI callbackUri, + SubscriptionTypeWithError subscriptionType +} + + +type enumerated NotificationType { + ON_BOARDING, + OP_CHANGE +} + + +type record AppPkgNotification { + NotificationType notificationType, + JSON.String subscriptionId, + //@TODO: links should be named _links but getting error. + //@TODO: links shuld be a record, but cannot contain self cause self is a key for ttnc + JSON.AnyURI links +} + + +// +// +//type record of AppMobilityServiceInfo AppMobilityServiceInfos; +//type record AppMobilityServiceInfo { +// RegistrationInfos registeredAppMobilityService , +// String appMobilityServiceId +//} +// +//type record of RegistrationInfo RegistrationInfos; +//type record RegistrationInfo { +// ServiceConsumerId serviceConsumerId, +// DeviceInformations deviceInformation optional, +// UInt32 expiryTime optional +//} +// +// +// +// +// +//type record of ServiceConsumerId ServiceConsumerIds; +//type record ServiceConsumerId { +// String appInstanceId optional, +// String mepId optional +//} +// +//// Erroneous parameter: appInstance should be appInstanceId +//type record of ServiceConsumer ServiceConsumers; +//type record ServiceConsumer { +// String appInstance optional, +// String mepId optional +//} +// +//type record of DeviceInformation DeviceInformations; +//type record DeviceInformation { +// String associateId +//} +// +// +//type JSON.AnyURI links; +// +//type enumerated SubscriptionType { +// MobilityProcedureSubscription, +// AdjacentAppInfoSubscription +//} +// +//type record Subscription { +// JSON.AnyURI href, +// SubscriptionType subscriptionType +//} +// +// +//type record of AmsSubscriptionLinkList AmsSubscriptionLinkLists; +//type record AmsSubscriptionLinkList { +// JSON.AnyURI links, +// Subscription subscription +//} +// +// +//type record MobilityProcedureSubscriptionError { +// SubscriptionType subscriptionType, +// JSON.AnyURI callbackReference, +// JSON.AnyURI links optional, +// FilterCriteria filterCriteria, +// TimeStamp expiryDeadline optional +//} +// +// +// +// +//type record of MobilityProcedureSubscription MobilityProcedureSubscriptions; +//type record MobilityProcedureSubscription { +// SubscriptionType subscriptionType, +// JSON.AnyURI callbackReference, +// JSON.AnyURI links optional, +// FilterCriteria filterCriteria, +// TimeStamp expiryDeadline optional +//} +// +//type enumerated MobilityStatusType { +// INTERHOST_MOVEOUT_TRIGGERED, +// TARGET_APPINST_CONFIRMED, +// TARGET_TRAFFIC_RULE_ACTIVATED, +// INTERHOST_MOVEOUT_COMPLETED, +// INTERHOST_MOVEOUT_FAILED +//} +// +//type record AssociateIdList { +// String associateId +//} +// +//type record of FilterCriteria FilterCriterias; +//type record FilterCriteria { +// String appInstanceId optional, +// AssociateIdList associateId optional, +// MobilityStatusType mobilityStatus +//} +// +// +// +//type record AdjacentFilterCriteria { +// String appInstanceId optional +//} +// +// +//type record of ExpiryNotification ExpiryNotifications; +//type record ExpiryNotification { +// TimeStamp timeStamp, +// JSON.AnyURI links optional, +// TimeStamp expiryDeadline +//} +// +//type record of AdjacentAppInfoSubscription AdjacentAppInfoSubscriptions; +//type record AdjacentAppInfoSubscription { +// SubscriptionType subscriptionType, +// JSON.AnyURI callbackReference, +// JSON.AnyURI links optional, +// AdjacentFilterCriteria filterCriteria, +// TimeStamp expiryDeadline optional +//} + + /** + * @desc + * @member seconds The seconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + * @member nanoSeconds The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + */ + type record TimeStamp { + Seconds seconds, + NanoSeconds nanoSeconds + } + + + /** + * @desc The seconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + */ + type UInt32 Seconds; + + /** + * @desc The nanoseconds part of the Time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC + */ + type UInt32 NanoSeconds; + +/** +* @desc Problem Details for HTTP APIs +* @member type_ A URI reference according to IETF RFC 3986 that identifies the problem type +* @member title A short, human-readable summary of the problem type +* @member status The HTTP status code for this occurrence of the problem +* @member detail A human-readable explanation specific to this occurrence of the problem +* @member instance A URI reference that identifies the specific occurrence of the problem +* @see IETF RFC 7807 Clause 3. The Problem Details JSON Object +*/ +type record ProblemDetails { + JSON.String type_, + JSON.String title, + UInt32 status, + JSON.String detail, + JSON.String instance +} with { + variant (type_) "name as 'type'"; +} + + +} with { +encode "JSON" +} diff --git a/ttcn/LibMec/ttcn/LibMec_Pics.ttcn b/ttcn/LibMec/ttcn/LibMec_Pics.ttcn index d0817f7..6bc3e5c 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pics.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pics.ttcn @@ -35,6 +35,10 @@ module LibMec_Pics { modulepar boolean PICS_AMS_NOTIFICATIONS := false; modulepar boolean PIC_GRANTS_MANAGEMENT := true; + + modulepar boolean PIC_APP_PACKAGE_MANAGEMENT := true; + + modulepar boolean PIC_APP_PACKAGE_NOTIFICATIONS := false; modulepar charstring PICS_ROOT_API := "exampleAPI"; diff --git a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn index 36ae13f..5050f9a 100644 --- a/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn +++ b/ttcn/LibMec/ttcn/LibMec_Pixits.ttcn @@ -29,6 +29,9 @@ module LibMec_Pixits { modulepar charstring PX_ME_APP_AMS_SUBS := "/amsi/v1/subscriptions" modulepar charstring PX_MEO_GRANT_URI := "/granting/v1/grants" + + modulepar charstring PX_MEO_PKGM_URI := "/apmi/v1/app_packages" + modulepar charstring PX_MEO_PKGM_SUBS := "/apmi/v1/subscriptions" } // End of module LibMec_Pixits -- GitLab