jolly has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43372?usp=email )
(
5 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: IPAd: A test to verify proper session cancellation by eUICC ......................................................................
IPAd: A test to verify proper session cancellation by eUICC
When an error occurs (PepareDownloadRequest 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: I9776cd88d332b74c1f627cc284d214e0be251b0a --- M ipad/IPAd_Tests.ttcn M library/euicc/RSPDefinitions_Templates.ttcn M library/euicc/RSPDefinitions_Types.ttcn 3 files changed, 90 insertions(+), 2 deletions(-)
Approvals: dexter: Looks good to me, approved Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve
diff --git a/ipad/IPAd_Tests.ttcn b/ipad/IPAd_Tests.ttcn index 1dfe90a..f71b275 100644 --- a/ipad/IPAd_Tests.ttcn +++ b/ipad/IPAd_Tests.ttcn @@ -1014,6 +1014,58 @@ 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_euicc(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(); + + /* eUICC indicates an error in response to PepareDownloadRequest */ + f_vpcd_transceive(enc_PrepareDownloadResponse(valueof(ts_prepareDownloadResponse_error))); + + /* 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, "Unexpected 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_euicc() 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_euicc), pars); + vc_conn.done; + setverdict(pass); +} + control { execute ( TC_proc_indirect_prfle_dwnld() ); execute ( TC_proc_euicc_pkg_dwnld_exec() ); @@ -1028,6 +1080,7 @@ execute ( TC_func_get_conn_params_error() ); execute ( TC_set_device_capabilities() ); execute ( TC_euiccPackageRequest_PSMO() ); + execute ( TC_proc_indirect_prfle_dwnld_cancel_euicc() ); }
} diff --git a/library/euicc/RSPDefinitions_Templates.ttcn b/library/euicc/RSPDefinitions_Templates.ttcn index b940453..448f9f6 100644 --- a/library/euicc/RSPDefinitions_Templates.ttcn +++ b/library/euicc/RSPDefinitions_Templates.ttcn @@ -484,6 +484,25 @@ downloadResponseOk := ts_prepareDownloadResponseOk }
+template (present) PrepareDownloadResponseError +tr_prepareDownloadResponseError := { + transactionId := ?, + downloadErrorCode := ? +} +template (value) PrepareDownloadResponseError +ts_prepareDownloadResponseError := { + transactionId := 'ABCDEF'O, + downloadErrorCode := 127 // undefinedError +} +template (present) PrepareDownloadResponse +tr_prepareDownloadResponse_error := { + downloadResponseError := tr_prepareDownloadResponseError +} +template (value) PrepareDownloadResponse +ts_prepareDownloadResponse_error := { + downloadResponseError := ts_prepareDownloadResponseError +} + /* GSMA SGP.22, section 5.7.7 (ES10x) */ template (present) GetEuiccChallengeResponse tr_GetEuiccChallengeResponse := { @@ -635,7 +654,18 @@ } }
-/* GSMA SGP.22, section 5.7.13 (ES10x) */ +/* GSMA SGP.22, section 5.7.14 (ES10x) */ +template (present) CancelSessionRequest +tr_cancelSessionRequest := { + transactionId := ?, + reason := ? +} +template (value) CancelSessionRequest +ts_cancelSessionRequest := { + transactionId := 'ABCDEF'O, + reason := 127 // undefinedReason +} + template (present) CancelSessionResponseOk tr_cancelSessionResponseOk := { euiccCancelSessionSigned := { @@ -648,7 +678,7 @@ template (value) CancelSessionResponseOk ts_cancelSessionResponseOk := { euiccCancelSessionSigned := { - transactionId := 'AABBCC'O, + transactionId := 'ABCDEF'O, smdpOid := id_rspRole_euicc, reason := 5 }, diff --git a/library/euicc/RSPDefinitions_Types.ttcn b/library/euicc/RSPDefinitions_Types.ttcn index 5a33b45..b355e95 100644 --- a/library/euicc/RSPDefinitions_Types.ttcn +++ b/library/euicc/RSPDefinitions_Types.ttcn @@ -23,6 +23,11 @@ external function enc_AuthenticateServerResponse(in AuthenticateServerResponse msg) return octetstring with { extension "prototype(convert) encode(BER:BER_ENCODE_DER)" };
+external function dec_CancelSessionRequest(in octetstring stream) return CancelSessionRequest +with { extension "prototype(convert) decode(BER:BER_ACCEPT_ALL)" }; +external function enc_CancelSessionRequest(in CancelSessionRequest msg) return octetstring +with { extension "prototype(convert) encode(BER:BER_ENCODE_DER)" }; + external function dec_CancelSessionResponse(in octetstring stream) return CancelSessionResponse with { extension "prototype(convert) decode(BER:BER_ACCEPT_ALL)" }; external function enc_CancelSessionResponse(in CancelSessionResponse msg) return octetstring