dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43182?usp=email )
Change subject: eim_Tests: Add testcase to test ESipa/ES9+: CancelSession ......................................................................
eim_Tests: Add testcase to test ESipa/ES9+: CancelSession
The testsuite never sends or receives any messages related to ESipa/ES9+ CancelSession, let's implement a varinat of the "Cancel Session Procedure for Indirect Profile Download" as described in SGP.32 section 3.2.3.3 to increase the coverage accordingly.
Related: SYS#8100 Change-Id: Iadc9010fcf08de98f7d8c2a5c68bb5ff71bfb1f6 --- M eim/eIM_Tests.ttcn 1 file changed, 59 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/82/43182/1
diff --git a/eim/eIM_Tests.ttcn b/eim/eIM_Tests.ttcn index f55af29..adf5411 100644 --- a/eim/eIM_Tests.ttcn +++ b/eim/eIM_Tests.ttcn @@ -580,6 +580,64 @@ setverdict(pass); }
+/* A testcase to try out an unsuccessful indirect profile download where the session gets canceled + * See also: GSMA SGP.32, section 3.2.3.3: Cancel Session Procedure for Indirect Profile Download */ +private function f_TC_proc_indirect_prfle_dwnld_cancel_session(charstring id) runs on eIM_ConnHdlr { + var charstring resource_id; + var HTTP_Adapter_Params http_adapter_pars; + var charstring smdpp_add := mp_es9p_ip & ":" & int2str(mp_es9p_port) + var charstring activationCode := "1$" & smdpp_add & "$MyMatchingId" + var template EsipaMessageFromEimToIpa esipa_res; + var octetstring eimTransactionId; + + f_http_register(); + + f_init_pipe(); + http_adapter_pars := { + http_host := mp_esipa_ip, + http_port := mp_esipa_port, + use_ssl := not mp_esipa_disable_ssl + }; + f_http_init(http_adapter_pars); + + /* Create a new download at the eIM */ + resource_id := f_rest_create_order("download", ts_JSON_REST_download_order(eID, activationCode)); + + /* Check the eIM for new eIM packages, we expect to get a profileDownloadTriggerRequest that contains the + * activationCode that we have created the download with (see above) */ + esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(eID)), + tr_getEimPackageResponse_dnlTrigReq(tr_profileDownloadTriggerRequest(activationCode))); + eimTransactionId := valueof(esipa_res.getEimPackageResponse.profileDownloadTriggerRequest.eimTransactionId); + + /* Perform common mutial authentication procedure */ + f_proc_cmn_mtl_auth(eimTransactionId); + + /* Request/download bound profile package */ + f_esipa_send(valueof(ts_getBoundProfilePackageRequestEsipa)); + f_es9p_transceive(valueof(ts_getBoundProfilePackageResponse), tr_getBoundProfilePackageRequest); + f_esipa_receive(tr_getBoundProfilePackageResponseEsipa); + + /* Cancel session */ + f_esipa_send(valueof(ts_cancelSessionRequestEsipa)); + f_es9p_transceive_empty_response(tr_cancelSessionRequestEs9); + + f_rest_lookup_resource(resource_id, "download", tr_JSON_REST_success); + f_rest_delete_resource(resource_id, "download"); + + f_sleep(2.0); + setverdict(pass); +} +testcase TC_proc_indirect_prfle_dwnld_cancel_session() runs on MTC_CT { + var charstring id := testcasename(); + var eIM_ConnHdlrPars pars := f_init_pars(); + var eIM_ConnHdlr vc_conn; + f_init(id); + vc_conn := f_start_handler(refers(f_TC_proc_indirect_prfle_dwnld_cancel_session), pars); + vc_conn.done; + setverdict(pass); +} + + /* A testcase to try out an the Generic eUICC Package Download and Execution Procedure (PSMO), * See also: GSMA SGP.32, section 3.3.1: Generic eUICC Package Download and Execution */ private function f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco(charstring facility, charstring id, @@ -1008,6 +1066,7 @@
control { execute ( TC_proc_indirect_prfle_dwnld() ); + execute ( TC_proc_indirect_prfle_dwnld_cancel_session() ); execute ( TC_proc_euicc_pkg_dwnld_exec_enable_psmo() ); execute ( TC_proc_euicc_pkg_dwnld_exec_disable_psmo() ); execute ( TC_proc_euicc_pkg_dwnld_exec_delete_psmo() );