dexter has uploaded this change for review.

View Change

eIM_Tests: use constants from SGP23_constants

The eIM tests define some custom constants for some values, Let's
use the constants from SGP23_constants.

Related: SYS#8203
Change-Id: I9d554a10d1f8e84bf86562448765962aa1f02518
---
M eim/eIM_Tests.ttcn
1 file changed, 34 insertions(+), 35 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/43842/1
diff --git a/eim/eIM_Tests.ttcn b/eim/eIM_Tests.ttcn
index 8675c99..1547eab 100644
--- a/eim/eIM_Tests.ttcn
+++ b/eim/eIM_Tests.ttcn
@@ -44,8 +44,7 @@
import from PIPEasp_PortType all;
import from PIPEasp_Types all;

-const octetstring eID := '89882119900000000000000000000005'O;
-const octetstring iccid := '123456789ABCDEFFAAAA'O;
+import from SGP23_Constants all;

type component MTC_CT {
timer g_Tguard;
@@ -508,17 +507,17 @@
* See also: GSMA SGP.32, section 3.2.3.2: Indirect Profile Download */
private function f_TC_proc_indirect_prfle_dwnld(charstring id) runs on eIM_ConnHdlr {
var charstring resource_id;
- var charstring smdpp_add := mp_es9p_ip & ":" & int2str(mp_es9p_port)
- var charstring activationCode := "1$" & smdpp_add & "$MyMatchingId"
+ var charstring smdpp_addr := mp_es9p_ip & ":" & int2str(mp_es9p_port)
+ var charstring activationCode := f_SGP23_ACTIVATION_CODE_1(test_dp_address := smdpp_addr);
var template EsipaMessageFromEimToIpa esipa_res;
var octetstring eimTransactionId;

/* Create a new download at the eIM */
- resource_id := f_rest_create_order("download", ts_JSON_REST_download_order(eID, activationCode));
+ resource_id := f_rest_create_order("download", ts_JSON_REST_download_order(SGP23_EID1, activationCode));

/* Check the eIM for new eIM packages, we expect to get a profileDownloadTriggerRequest that contains the
* activationCode that we have created the download with (see above) */
- esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(eID)),
+ esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(SGP23_EID1)),
tr_getEimPackageResponse_dnlTrigReq(tr_profileDownloadTriggerRequest(activationCode)));
eimTransactionId := valueof(esipa_res.getEimPackageResponse.profileDownloadTriggerRequest.eimTransactionId);

@@ -531,7 +530,7 @@
f_esipa_receive(tr_getBoundProfilePackageResponseEsipa);

/* Handle notification */
- f_esipa_send(valueof(ts_handleNotificationEsipa_pendingNotif(ts_SGP32_pendingNotification_prfleInstRslt(notificationAddress := smdpp_add))));
+ f_esipa_send(valueof(ts_handleNotificationEsipa_pendingNotif(ts_SGP32_pendingNotification_prfleInstRslt(notificationAddress := smdpp_addr))));
f_es9p_transceive_empty_response(tr_handleNotification);

f_rest_lookup_resource(resource_id, "download", tr_JSON_REST_success);
@@ -554,17 +553,17 @@
* See also: GSMA SGP.32, section 3.2.3.3: Cancel Session Procedure for Indirect Profile Download */
private function f_TC_proc_indirect_prfle_dwnld_cancel_session(charstring id) runs on eIM_ConnHdlr {
var charstring resource_id;
- var charstring smdpp_add := mp_es9p_ip & ":" & int2str(mp_es9p_port)
- var charstring activationCode := "1$" & smdpp_add & "$MyMatchingId"
+ var charstring smdpp_addr := mp_es9p_ip & ":" & int2str(mp_es9p_port)
+ var charstring activationCode := f_SGP23_ACTIVATION_CODE_1(test_dp_address := smdpp_addr);
var template EsipaMessageFromEimToIpa esipa_res;
var octetstring eimTransactionId;

/* Create a new download at the eIM */
- resource_id := f_rest_create_order("download", ts_JSON_REST_download_order(eID, activationCode));
+ resource_id := f_rest_create_order("download", ts_JSON_REST_download_order(SGP23_EID1, activationCode));

/* Check the eIM for new eIM packages, we expect to get a profileDownloadTriggerRequest that contains the
* activationCode that we have created the download with (see above) */
- esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(eID)),
+ esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(SGP23_EID1)),
tr_getEimPackageResponse_dnlTrigReq(tr_profileDownloadTriggerRequest(activationCode)));
eimTransactionId := valueof(esipa_res.getEimPackageResponse.profileDownloadTriggerRequest.eimTransactionId);

@@ -623,7 +622,7 @@
esipa_res.getEimPackageResponse.euiccPackageRequest.euiccPackageSigned.eimTransactionId;

/* Respond with a plausible EimPackage result */
- f_esipa_transceive(valueof(ts_provideEimPackageResult(eID, ts_eimPackageResult_ePRAndNotif(euiccPackageResult))),
+ f_esipa_transceive(valueof(ts_provideEimPackageResult(SGP23_EID1, ts_eimPackageResult_ePRAndNotif(euiccPackageResult))),
tr_provideEimPackageResultResponse_empty);

f_rest_lookup_resource(resource_id, facility, tr_JSON_REST_success);
@@ -635,7 +634,7 @@

/* (see also above) Test enable PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_enable_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_enable(eID, iccid, false));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_enable(SGP23_EID1, SGP23_ICCID_OP_PROF1, false));
var template EuiccPackage euiccPackage := tr_euiccPackage_enablePsmo;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_enablePsmo);
@@ -652,7 +651,7 @@

/* (see also above) Test disable PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_disable_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_disable(eID, iccid));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_disable(SGP23_EID1, SGP23_ICCID_OP_PROF1));
var template EuiccPackage euiccPackage := tr_euiccPackage_disablePsmo;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_disablePsmo);
@@ -669,7 +668,7 @@

/* (see also above) Test delete PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_delete_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_delete(eID, iccid));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_delete(SGP23_EID1, SGP23_ICCID_OP_PROF1));
var template EuiccPackage euiccPackage := tr_euiccPackage_deletePsmo;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_deletePsmo);
@@ -687,7 +686,7 @@
/* (see also above) Test disable and delete PSMO at the same time to make sure that eUICC packages with multiple PSMOs
* are also accepted and processed correctly. */
private function f_TC_proc_euicc_pkg_dwnld_exec_disable_and_delete_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_disable_and_delete(eID, iccid));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_disable_and_delete(SGP23_EID1, SGP23_ICCID_OP_PROF1));
var template EuiccPackage euiccPackage := tr_euiccPackage_disableAndDeletePsmo;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_disableAndDeletePsmo);
@@ -704,7 +703,7 @@

/* (see also above) Test listProfileInfo PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_listProfileInfo_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_listProfileInfo(eID, iccid));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_listProfileInfo(SGP23_EID1, SGP23_ICCID_OP_PROF1));
var template EuiccPackage euiccPackage := tr_euiccPackage_listProfileInfo;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_listProfileInfo);
@@ -721,7 +720,7 @@

/* (see also above) Test getRAT PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_getRAT_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_getRAT(eID));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_getRAT(SGP23_EID1));
var template EuiccPackage euiccPackage := tr_euiccPackage_getRAT;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_getRAT);
@@ -738,7 +737,7 @@

/* (see also above) Test configureImmediateEnable PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_configureImmediateEnable_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_configureImmediateEnable(eID));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_configureImmediateEnable(SGP23_EID1));
var template EuiccPackage euiccPackage := tr_euiccPackage_configureImmediateEnable;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_configureImmediateEnable);
@@ -755,7 +754,7 @@

/* (see also above) Test setFallbackAttribute PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_setFallbackAttribute_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_setFallbackAttribute(eID, iccid));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_setFallbackAttribute(SGP23_EID1, SGP23_ICCID_OP_PROF1));
var template EuiccPackage euiccPackage := tr_euiccPackage_setFallbackAttribute;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_setFallbackAttribute);
@@ -772,7 +771,7 @@

/* (see also above) Test unsetFallbackAttribute PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_unsetFallbackAttribute_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_unsetFallbackAttribute(eID));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_unsetFallbackAttribute(SGP23_EID1));
var template EuiccPackage euiccPackage := tr_euiccPackage_unsetFallbackAttribute;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_unsetFallbackAttribute);
@@ -789,7 +788,7 @@

/* (see also above) Test setDefaultDpAddress PSMO */
private function f_TC_proc_euicc_pkg_dwnld_exec_setDefaultDpAddress_psmo(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_setDefaultDpAddress(eID, "smdp.example.com"));
+ var JSON_REST_Resource psmo_order := valueof(ts_JSON_REST_psmo_order_setDefaultDpAddress(SGP23_EID1, "smdp.example.com"));
var template EuiccPackage euiccPackage := tr_euiccPackage_setDefaultDpAddress;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("psmo", id, psmo_order, euiccPackage,
ts_euiccPackageResultSigned_setDefaultDpAddress);
@@ -806,7 +805,7 @@

/* (see also above) Test addEim eCO */
private function f_TC_proc_euicc_pkg_dwnld_exec_addEim_eco(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource eco_order := valueof(ts_JSON_REST_eco_order_addEim(eID));
+ var JSON_REST_Resource eco_order := valueof(ts_JSON_REST_eco_order_addEim(SGP23_EID1));
var template EuiccPackage euiccPackage := tr_euiccPackage_addEim;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("eco", id, eco_order, euiccPackage,
ts_euiccPackageResultSigned_addEim);
@@ -823,7 +822,7 @@

/* (see also above) Test deleteEim eCO */
private function f_TC_proc_euicc_pkg_dwnld_exec_deleteEim_eco(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource eco_order := valueof(ts_JSON_REST_eco_order_deleteEim(eID));
+ var JSON_REST_Resource eco_order := valueof(ts_JSON_REST_eco_order_deleteEim(SGP23_EID1));
var template EuiccPackage euiccPackage := tr_euiccPackage_deleteEim;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("eco", id, eco_order, euiccPackage,
ts_euiccPackageResultSigned_deleteEim);
@@ -840,7 +839,7 @@

/* (see also above) Test updateEim eCO */
private function f_TC_proc_euicc_pkg_dwnld_exec_updateEim_eco(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource eco_order := valueof(ts_JSON_REST_eco_order_updateEim(eID));
+ var JSON_REST_Resource eco_order := valueof(ts_JSON_REST_eco_order_updateEim(SGP23_EID1));
var template EuiccPackage euiccPackage := tr_euiccPackage_updateEim;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("eco", id, eco_order, euiccPackage,
ts_euiccPackageResultSigned_updateEim);
@@ -857,7 +856,7 @@

/* (see also above) Test listEim eCO */
private function f_TC_proc_euicc_pkg_dwnld_exec_listEim_eco(charstring id) runs on eIM_ConnHdlr {
- var JSON_REST_Resource eco_order := valueof(ts_JSON_REST_eco_order_listEim(eID));
+ var JSON_REST_Resource eco_order := valueof(ts_JSON_REST_eco_order_listEim(SGP23_EID1));
var template EuiccPackage euiccPackage := tr_euiccPackage_listEim;
f_TC_proc_euicc_pkg_dwnld_exec_psmo_or_eco("eco", id, eco_order, euiccPackage,
ts_euiccPackageResultSigned_listEim);
@@ -880,15 +879,15 @@
var octetstring eimTransactionId;

/* Create a new download at the eIM */
- resource_id := f_rest_create_order("edr", ts_JSON_REST_edr_order(eID, '80BF20BF228384A5A688A9BF2B'O));
+ resource_id := f_rest_create_order("edr", ts_JSON_REST_edr_order(SGP23_EID1, '80BF20BF228384A5A688A9BF2B'O));

/* Check the eIM for new eIM packages, we expect to get a getEimPackageResponse that contains an
* ipaEuiccDataRequest */
- esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(eID)), tr_getEimPackageResponse_euiccDataReq);
+ esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(SGP23_EID1)), tr_getEimPackageResponse_euiccDataReq);
eimTransactionId := valueof(esipa_res.getEimPackageResponse.ipaEuiccDataRequest.eimTransactionId);

/* Provide a plausible ipaEuiccDataResponse to the eIM */
- f_esipa_transceive(valueof(ts_provideEimPackageResult(eID, ts_eimPackageResult_euiccDataResp(eimTransactionId))),
+ f_esipa_transceive(valueof(ts_provideEimPackageResult(SGP23_EID1, ts_eimPackageResult_euiccDataResp(eimTransactionId))),
tr_provideEimPackageResultResponse_empty);

f_rest_lookup_resource(resource_id, "edr", tr_JSON_REST_success);
@@ -914,15 +913,15 @@
{ { ipaEuiccDataError := "undefinedError" } };

/* Create a new download at the eIM */
- resource_id := f_rest_create_order("edr", ts_JSON_REST_edr_order(eID, '80BF20BF228384A5A688A9BF2B'O));
+ resource_id := f_rest_create_order("edr", ts_JSON_REST_edr_order(SGP23_EID1, '80BF20BF228384A5A688A9BF2B'O));

/* Check the eIM for new eIM packages, we expect to get a getEimPackageResponse that contains an
* ipaEuiccDataRequest */
- esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(eID)), tr_getEimPackageResponse_euiccDataReq);
+ esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(SGP23_EID1)), tr_getEimPackageResponse_euiccDataReq);
eimTransactionId := valueof(esipa_res.getEimPackageResponse.ipaEuiccDataRequest.eimTransactionId);

/* Provide a plausible ipaEuiccDataResponse to the eIM */
- f_esipa_transceive(valueof(ts_provideEimPackageResult(eID,
+ f_esipa_transceive(valueof(ts_provideEimPackageResult(SGP23_EID1,
ts_eimPackageResult_euiccDataResp_err(eimTransactionId, ipaEuiccDataErrorCode := 127))),
tr_provideEimPackageResultResponse_empty);

@@ -950,20 +949,20 @@
* empty list. */
euiccState.stateChangeCauseList := {};
outcome.euiccStateResult := { euiccState };
- resource_id := f_rest_create_order("euicc", ts_JSON_REST_euicc_set_order(eID, euiccState));
+ resource_id := f_rest_create_order("euicc", ts_JSON_REST_euicc_set_order(SGP23_EID1, euiccState));
f_sleep(1.5);
f_rest_lookup_resource(resource_id, "euicc", tr_JSON_REST_success({outcome}));
f_rest_delete_resource(resource_id, "euicc");

/* Check the eIM for new eIM packages and set notifyStateChange/stateChangeCause. Since we haven't issued any
* orders we expect an eimPackageError (noEimPackageAvailable) */
- esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(eID, notifyStateChange := NULL, stateChangeCause := 6)),
+ esipa_res := f_esipa_transceive(valueof(ts_getEimPackageRequest(SGP23_EID1, notifyStateChange := NULL, stateChangeCause := 6)),
tr_getEimPackageResponse_eimPkgErr(1));

/* After the getEimPackageRequest, we expect to find the stateChangeCause in the stateChangeCauseList */
euiccState.stateChangeCauseList := { "deviceChange" };
outcome.euiccStateResult := { euiccState };
- resource_id := f_rest_create_order("euicc", ts_JSON_REST_euicc_get_order(eID, "stateChangeCauseList"));
+ resource_id := f_rest_create_order("euicc", ts_JSON_REST_euicc_get_order(SGP23_EID1, "stateChangeCauseList"));
f_sleep(1.5);
f_rest_lookup_resource(resource_id, "euicc", tr_JSON_REST_success({outcome}));
f_rest_delete_resource(resource_id, "euicc");

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

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I9d554a10d1f8e84bf86562448765962aa1f02518
Gerrit-Change-Number: 43842
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>