jolly has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43373?usp=email )
Change subject: IPAd: A test to verify proper session cancellation by eIM ......................................................................
IPAd: A test to verify proper session cancellation by eIM
When an error occurs (GetBoundProfilePackageRequestEsipa is rejected in this case), expect the IPAd to cancel the session towards the eUICC and also towards the eIM.
Related: SYS#8101 Change-Id: I6b2360b043e11c8a20eda7cda426b822c6876b45 --- M ipad/IPAd_Tests.ttcn M library/euicc/SGP32Definitions_Templates.ttcn 2 files changed, 76 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/73/43373/1
diff --git a/ipad/IPAd_Tests.ttcn b/ipad/IPAd_Tests.ttcn index 37a2ccd..1d0c0fa 100644 --- a/ipad/IPAd_Tests.ttcn +++ b/ipad/IPAd_Tests.ttcn @@ -1054,6 +1054,61 @@ setverdict(pass); }
+/* A testcase to trigger an indirect profile download. This download will fail because the eUICC indicates so. */ +private function f_TC_proc_indirect_prfle_dwnld_cancel_eim(charstring id) runs on IPAd_ConnHdlr { + var charstring eim_fqdn := mp_esipa_ip & ":" & int2str(mp_esipa_port); + + f_exec_ipad(); + f_es10x_init(); + f_http_register(); + + /* Prepare indirect profile download by responding with a download trigger request */ + f_esipa_transceive(valueof(ts_getEimPackageResponse_dnlTrigReq(ts_profileDownloadTriggerRequest(eimTransactionId := '42'O))), + tr_getEimPackageRequest); + + /* Expect the IPAd to query the eIM configuration data from the eUICC */ + f_vpcd_transceive(enc_GetEimConfigurationDataResponse(valueof(ts_getEimConfigurationDataResponse(eim_fqdn))), 'BF5500'O); + + f_proc_cmn_mtl_auth(); + + f_vpcd_transceive(enc_PrepareDownloadResponse(valueof(ts_prepareDownloadResponse))); + + /* eIM indicates an error in response to GetBoundProfilePackageResponseEsipa */ + f_esipa_transceive(valueof(ts_getBoundProfilePackageResponseEsipa_error), + tr_getBoundProfilePackageRequestEsipa()); + + /* Expect the IPAd to cancel download towards eUICC */ + var octetstring asn := f_vpcd_transceive(enc_CancelSessionResponse(valueof(ts_cancelSessionResponse)), ''O); + var CancelSessionRequest req := dec_CancelSessionRequest(asn); + if (not match(req, tr_cancelSessionRequest)) { + setverdict(fail, "Unexprected ES10b request: ", req); + } + + /* Expect the IPAd to cancel download towards eIM */ + f_esipa_transceive(valueof(ts_cancelSessionResponseEsipa), + tr_cancelSessionRequestEsipa(cancelSessionResponse := tr_SGP32_cancelSessionResponse)); + + /* IPAd will poll again. */ + f_terminate_poll_cycle(); + + /* Wait some time until the the last HTTP response is actually delivered */ + f_sleep(2.0); + + f_es10x_close(); + f_stop_ipad(); + + setverdict(pass); +} +testcase TC_proc_indirect_prfle_dwnld_cancel_eim() runs on MTC_CT { + var charstring id := testcasename(); + var IPAd_ConnHdlrPars pars := f_init_pars(); + var IPAd_ConnHdlr vc_conn; + f_init(id); + vc_conn := f_start_handler(refers(f_TC_proc_indirect_prfle_dwnld_cancel_eim), pars); + vc_conn.done; + setverdict(pass); +} + control { execute ( TC_proc_indirect_prfle_dwnld() ); execute ( TC_proc_euicc_pkg_dwnld_exec() ); @@ -1069,6 +1124,7 @@ execute ( TC_set_device_capabilities() ); execute ( TC_euiccPackageRequest_PSMO() ); execute ( TC_proc_indirect_prfle_dwnld_cancel_euicc() ); + execute ( TC_proc_indirect_prfle_dwnld_cancel_eim() ); }
} diff --git a/library/euicc/SGP32Definitions_Templates.ttcn b/library/euicc/SGP32Definitions_Templates.ttcn index 8be8b88..5f3754a 100644 --- a/library/euicc/SGP32Definitions_Templates.ttcn +++ b/library/euicc/SGP32Definitions_Templates.ttcn @@ -767,6 +767,14 @@ ts_SGP32_prepareDownloadResponse := { downloadResponseOk := ts_prepareDownloadResponseOk } +template (present) SGP32_PrepareDownloadResponse +tr_SGP32_prepareDownloadResponse_error := { + downloadResponseError := tr_prepareDownloadResponseError +} +template (value) SGP32_PrepareDownloadResponse +ts_SGP32_prepareDownloadResponse_error := { + downloadResponseError := ts_prepareDownloadResponseError +} template (present) EsipaMessageFromIpaToEim tr_getBoundProfilePackageRequestEsipa(template (present) octetstring transactionId := ?, template (present) SGP32_PrepareDownloadResponse prepareDownloadResponse := tr_SGP32_prepareDownloadResponse) := { @@ -805,6 +813,18 @@ } } } +template (present) EsipaMessageFromEimToIpa +tr_getBoundProfilePackageResponseEsipa_error(template (present) integer getBoundProfilePackageErrorEsipa := ?) := { + getBoundProfilePackageResponseEsipa := { + getBoundProfilePackageErrorEsipa := getBoundProfilePackageErrorEsipa + } +} +template (value) EsipaMessageFromEimToIpa +ts_getBoundProfilePackageResponseEsipa_error(template (value) integer getBoundProfilePackageErrorEsipa := 127) := { + getBoundProfilePackageResponseEsipa := { + getBoundProfilePackageErrorEsipa := getBoundProfilePackageErrorEsipa + } +}
/* GSMA SGP.32, section 5.9.1 */ template (present) EuiccPackageResult