jolly submitted this change.

View Change

Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified
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(-)

diff --git a/ipad/IPAd_Tests.ttcn b/ipad/IPAd_Tests.ttcn
index f71b275..75e7be7 100644
--- a/ipad/IPAd_Tests.ttcn
+++ b/ipad/IPAd_Tests.ttcn
@@ -1066,6 +1066,61 @@
setverdict(pass);
}

+/* A testcase to trigger an indirect profile download. This download will fail because the eIM 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, "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_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() );
@@ -1081,6 +1136,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 0a708f9..a0f576d 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

To view, visit change 43373. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I6b2360b043e11c8a20eda7cda426b822c6876b45
Gerrit-Change-Number: 43373
Gerrit-PatchSet: 10
Gerrit-Owner: jolly <andreas@eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: jolly <andreas@eversberg.eu>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>