jolly submitted this change.

View Change

Approvals: Jenkins Builder: Verified dexter: Looks good to me, approved
IPAd: Add support for testing IPAd polling multiple eIMs

A record is used to generate and send an EimConfigurationDataResponse to
the IPAd with multiple eIMs in the EimConfigurationData list. Tests can
use this to verify that all eIMs are polled correctly.

Note that all eIMs share the same FQDN by default. This makes the test
cases easier, because they don't require different HTTP servers at a
time or need to change the HTTP server address.

Related: SYS#8101
Change-Id: I14c3f09a4c21d5f643e6e499a095410b6c8f02ed
---
M ipad/IPAd_Tests.ttcn
M library/euicc/SGP32Definitions_Templates.ttcn
2 files changed, 57 insertions(+), 16 deletions(-)

diff --git a/ipad/IPAd_Tests.ttcn b/ipad/IPAd_Tests.ttcn
index 5fc6dfe..a3a9ea0 100644
--- a/ipad/IPAd_Tests.ttcn
+++ b/ipad/IPAd_Tests.ttcn
@@ -104,14 +104,21 @@
port PIPEasp_PT PIPE;
};

-type record IPAd_ConnHdlrPars {
- /* TODO: add some useful parameters */
+type record EimConfigParam {
+ charstring eim_id,
+ charstring eim_fqdn optional
};

-private function f_init_pars()
+type record of EimConfigParam EimConfigParamList;
+
+type record IPAd_ConnHdlrPars {
+ EimConfigParamList eim_list
+};
+
+private function f_init_pars(EimConfigParamList eim_list := { { eim_id := "myEIM", eim_fqdn := omit } })
runs on MTC_CT return IPAd_ConnHdlrPars {
var IPAd_ConnHdlrPars pars := {
- /* TODO: fill parameters with meaninful values */
+ eim_list := eim_list
};
return pars;
}
@@ -320,7 +327,6 @@
private function f_es10x_init(boolean iot := true,
boolean eim_init := true,
OCT1 dev_capa := '00'O) runs on IPAd_ConnHdlr {
- var charstring eim_fqdn := mp_esipa_ip & ":" & int2str(mp_esipa_port);
var octetstring term_capa;

/* If we decide not to use vpcd, then we must not initialize anything here */
@@ -353,14 +359,36 @@

/* Not all tests expect IPAd to query eUICC data and notfications before talking to eIM. */
if (eim_init) {
- /* Expect the IPAd to query the eIM configuration data from the eUICC */
- f_vpcd_transceive(enc_GetEimConfigurationDataResponse(valueof(ts_getEimConfigurationDataResponse(eim_fqdn))), 'BF5500'O);
-
- /* Expect the IPAd to query the eUICC for pending notifications, we respond with an empty list */
- f_vpcd_transceive(enc_RetrieveNotificationsListResponse(valueof(ts_retrieveNotificationsListResponse_empty)), 'BF2B00'O);
+ f_eim_init();
}
}

+private function f_eim_init() runs on IPAd_ConnHdlr {
+ var charstring default_eim_fqdn := mp_esipa_ip & ":" & int2str(mp_esipa_port);
+ var template (value) GetEimConfigurationDataResponse v_getEimConfigurationDataResponse := {
+ eimConfigurationDataList := {}
+ };
+ var integer i;
+
+ for (i := 0; i < sizeof(g_pars.eim_list); i := i + 1) {
+ var charstring eim_fqdn := default_eim_fqdn;
+
+ if (ispresent(g_pars.eim_list[i].eim_fqdn)) {
+ eim_fqdn := g_pars.eim_list[i].eim_fqdn;
+ }
+ v_getEimConfigurationDataResponse.eimConfigurationDataList[i] := ts_eimConfigurationData(
+ eimFqdn := eim_fqdn,
+ eimId := g_pars.eim_list[i].eim_id
+ );
+ }
+
+ /* Expect the IPAd to query the eIM configuration data from the eUICC */
+ f_vpcd_transceive(enc_GetEimConfigurationDataResponse(valueof(v_getEimConfigurationDataResponse)), 'BF5500'O);
+
+ /* Expect the IPAd to query the eUICC for pending notifications, we respond with an empty list */
+ f_vpcd_transceive(enc_RetrieveNotificationsListResponse(valueof(ts_retrieveNotificationsListResponse_empty)), 'BF2B00'O);
+}
+
/* Handle the closing of logical channel 1 */
private function f_es10x_close() runs on IPAd_ConnHdlr {

@@ -773,14 +801,26 @@
f_respond_empty_notifications();
}
private function f_TC_proc_euicc_data_req(charstring id) runs on IPAd_ConnHdlr {
+ var integer i;
+ var boolean do_next_eim := false;
+
f_exec_ipad();
f_es10x_init();
f_http_register();

- f_package_euicc_data_req(id);
+ for (i := 0; i < sizeof(g_pars.eim_list); i := i + 1) {
+ if (do_next_eim) {
+ /* Expect the IPAd to query the eUICC for pending notifications, we respond with an empty list */
+ f_respond_empty_notifications();
+ }

- /* IPAd will poll for eIM package. */
- f_terminate_poll_cycle();
+ f_package_euicc_data_req(id);
+
+ /* IPAd will poll for eIM package. */
+ f_terminate_poll_cycle();
+
+ do_next_eim := true;
+ }

/* Wait some time until the the last HTTP response is actually delivered */
f_sleep(2.0);
diff --git a/library/euicc/SGP32Definitions_Templates.ttcn b/library/euicc/SGP32Definitions_Templates.ttcn
index ab27369..3ca293d 100644
--- a/library/euicc/SGP32Definitions_Templates.ttcn
+++ b/library/euicc/SGP32Definitions_Templates.ttcn
@@ -1656,8 +1656,9 @@
indirectProfileDownload := *
}
template (value) EimConfigurationData
-ts_eimConfigurationData(template (omit) charstring eimFqdn := omit) := {
- eimId := "myEIM",
+ts_eimConfigurationData(template (omit) charstring eimFqdn := omit,
+ template (value) charstring eimId := "myEIM") := {
+ eimId := eimId,
eimFqdn := eimFqdn,
eimIdType := omit,
counterValue := omit,
@@ -1675,7 +1676,7 @@
template (value) GetEimConfigurationDataResponse
ts_getEimConfigurationDataResponse(template (value) charstring eimFqdn := "127.0.0.1") := {
eimConfigurationDataList := {
- ts_eimConfigurationData(eimFqdn)
+ ts_eimConfigurationData(eimFqdn := eimFqdn)
}
}


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

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I14c3f09a4c21d5f643e6e499a095410b6c8f02ed
Gerrit-Change-Number: 43656
Gerrit-PatchSet: 5
Gerrit-Owner: jolly <andreas@eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: jolly <andreas@eversberg.eu>
Gerrit-Reviewer: laforge <laforge@osmocom.org>