jolly submitted this change.
6 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
IPAd: Make tests work with testenv and current master of IPAd
The IPAd can now be tested using testenv.
Several minor changes are required to run them successfully. All tests
pass now.
Related: SYS#8101
Change-Id: Id4abf15feb179b17594bd11c6e7089469684900c
---
M ipad/IPAd_Tests.ttcn
A ipad/testenv.cfg
2 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/ipad/IPAd_Tests.ttcn b/ipad/IPAd_Tests.ttcn
index 7044217..a03fa3c 100644
--- a/ipad/IPAd_Tests.ttcn
+++ b/ipad/IPAd_Tests.ttcn
@@ -347,7 +347,7 @@
private function f_esipa_receive(template EsipaMessageFromIpaToEim expected_esipa_req := omit)
runs on IPAd_ConnHdlr return EsipaMessageFromIpaToEim {
var HTTPMessage esipa_req_encoded;
- timer T := 10.0;
+ timer T := 15.0;
var EsipaMessageFromIpaToEim esipa_req;
T.start;
@@ -375,6 +375,12 @@
HTTP_SRV[0].send(ts_http_resp(esipa_res_encoded));
}
+/* Close ESipa HTTP connection */
+private function f_esipa_close() runs on IPAd_ConnHdlr {
+ var template (value) Close abort_signal := { client_id := omit };
+ HTTP_SRV[0].send(abort_signal);
+}
+
/* Perform one ESipa HTTP request/response cycle */
private function f_esipa_transceive(EsipaMessageFromEimToIpa esipa_res,
template EsipaMessageFromIpaToEim expected_esipa_req := omit)
@@ -419,6 +425,16 @@
f_esipa_transceive(valueof(ts_authenticateClientResponseEsipa_dpe), tr_authenticateClientRequestEsipa);
}
+/* After processing notifications and eIM packages, IPAd will poll again.
+ * Respond with empty notification list and with no eIM package. */
+private function f_terminate_poll_cycle() runs on IPAd_ConnHdlr {
+ /* 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);
+
+ /* IPAd requests a package, we tell it that there is no package available */
+ f_esipa_transceive(valueof(ts_getEimPackageResponse_noEimPackageAvailable), tr_getEimPackageRequest);
+}
+
/* ********************************************* */
/* ********** BELOW ONLY TESTCASES! ************ */
/* ********************************************* */
@@ -487,6 +503,9 @@
/* Receive RemoveNotificationFromList from iPAD->eUICC */
f_vpcd_transceive(enc_NotificationSentResponse(valueof(ts_notificationSentResponse)));
+ /* IPAd will poll again. */
+ f_terminate_poll_cycle();
+
/* Wait some time until the the last HTTP response is actually delivered */
f_sleep(2.0);
@@ -531,6 +550,9 @@
f_vpcd_transceive(enc_NotificationSentResponse(valueof(ts_notificationSentResponse)));
f_vpcd_transceive(enc_NotificationSentResponse(valueof(ts_notificationSentResponse)));
+ /* IPAd will poll again. */
+ f_terminate_poll_cycle();
+
/* Wait some time until the the last HTTP response is actually delivered */
f_sleep(2.0);
@@ -565,8 +587,15 @@
/* Step #9 */
f_vpcd_transceive(enc_RetrieveNotificationsListResponse(valueof(ts_retrieveNotificationsListResponse_prfleInstRes)));
- /* We now ignore the response from the IPAd. The IPAd will interpret this as a disturbed IP connection. */
+ /* We now ignore the (4) responses from the IPAd. The IPAd will interpret this as a disturbed IP connection. */
f_esipa_receive();
+ f_esipa_close();
+ f_esipa_receive();
+ f_esipa_close();
+ f_esipa_receive();
+ f_esipa_close();
+ f_esipa_receive();
+ f_esipa_close();
/* To fix the problem, the IPAd will now try a profile rollback meneuver. */
f_vpcd_transceive(enc_ProfileRollbackResponse(valueof(ts_profileRollbackResponse)),
@@ -578,6 +607,9 @@
/* Step #9 */
f_vpcd_transceive(enc_RetrieveNotificationsListResponse(valueof(ts_retrieveNotificationsListResponse_prfleInstRes)));
+ /* Wait some time for the client to re-connect */
+ f_sleep(2.0);
+
/* Step #10-14 */
f_esipa_transceive(valueof(ts_provideEimPackageResultResponse_eimAck(eimAcknowledgements := {1,2,3,4})),
tr_provideEimPackageResult(*, tr_eimPackageResult_ePRAndNotif(euiccPackageResult := ?)));
@@ -589,6 +621,9 @@
f_vpcd_transceive(enc_NotificationSentResponse(valueof(ts_notificationSentResponse)));
f_vpcd_transceive(enc_NotificationSentResponse(valueof(ts_notificationSentResponse)));
+ /* IPAd will poll again. */
+ f_terminate_poll_cycle();
+
/* Wait some time until the the last HTTP response is actually delivered */
f_sleep(2.0);
@@ -630,6 +665,9 @@
f_esipa_transceive(valueof(ts_provideEimPackageResultResponse_eimAck(eimAcknowledgements := {1,2,3,4})),
tr_provideEimPackageResult(*, tr_eimPackageResult_euiccDataResp));
+ /* IPAd will poll again. */
+ f_terminate_poll_cycle();
+
/* Wait some time until the the last HTTP response is actually delivered */
f_sleep(2.0);
diff --git a/ipad/testenv.cfg b/ipad/testenv.cfg
new file mode 100644
index 0000000..71d1ea1
--- /dev/null
+++ b/ipad/testenv.cfg
@@ -0,0 +1,14 @@
+[testsuite]
+program=IPAd_Tests
+config=IPAd_Tests.cfg
+copy=example_ca
+
+[pcscd]
+prepare=require_vsmartcard_vpcd.sh
+program=pcscd -f -d $(pcscd --help 2>&1 | grep -q -- --disable-polkit && echo "--disable-polkit")
+make=no
+
+[ipad]
+program=sh -c 'while true; do onomondo-ipa -I; echo "Restart IPAd in one second..."; sleep 1; done'
+make=onomondo-ipa
+package=onomondo-ipa
To view, visit change 42967. To unsubscribe, or for help writing mail filters, visit settings.