pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35883?usp=email )

Change subject: epdg: Expect GSUP CancelLocationReq as consequence of 
DeleteBearerReq
......................................................................

epdg: Expect GSUP CancelLocationReq as consequence of DeleteBearerReq

Change-Id: Ibc37a9ef53315edab18f7b97a55cf504a40a4bf1
---
M epdg/EPDG_Tests.ttcn
M library/GSUP_Templates.ttcn
2 files changed, 46 insertions(+), 1 deletion(-)

Approvals:
  pespin: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/epdg/EPDG_Tests.ttcn b/epdg/EPDG_Tests.ttcn
index becf2e9..e5cdafd 100644
--- a/epdg/EPDG_Tests.ttcn
+++ b/epdg/EPDG_Tests.ttcn
@@ -504,6 +504,7 @@
 private function f_GTP2C_DeleteBearer_success() runs on EPDG_ConnHdlr {
        var integer proc_trans_id := 3;
        GTP2.send(ts_GTP2C_DeleteBearerReq(g_pars.teic_remote, proc_trans_id, 
g_pars.bearer.ebi, Access_changed_from_Non_3GPP_to_3GPP));
+       as_GSUP_CancelLocation_success();
        as_GTP2C_DeleteBearer_success();
 }

@@ -585,6 +586,18 @@
        setverdict(pass);
 }

+/* Expect CancelLocationReq */
+private altstep as_GSUP_CancelLocation_success() runs on EPDG_ConnHdlr {
+       var GSUP_PDU rx_gsup;
+
+       [] GSUP.receive(tr_GSUP_CL_REQ(g_pars.imsi)) -> value rx_gsup {
+               GSUP.send(ts_GSUP_CL_RES(g_pars.imsi));
+       }
+       [] GSUP.receive(GSUP_PDU:?) -> value rx_gsup {
+               Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, 
log2str("Unexpected GSUP msg rx: ", rx_gsup));
+       }
+}
+
 private function f_initial_attach() runs on EPDG_ConnHdlr {
        f_GSUP_AI_success();
        f_GSUP_LU_success();
diff --git a/library/GSUP_Templates.ttcn b/library/GSUP_Templates.ttcn
index 291b59a..3a616a6 100644
--- a/library/GSUP_Templates.ttcn
+++ b/library/GSUP_Templates.ttcn
@@ -403,6 +403,14 @@
 template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) :=
        tr_GSUP_IMSI(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, imsi);

+template (present) GSUP_PDU tr_GSUP_CL_REQ(template (present) hexstring imsi 
:= ?,
+                                          template GSUP_CnDomain dom := omit,
+                                          template GSUP_CancelType ctype := 
omit) :=
+       tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST,
+               f_gen_tr_ies(imsi,
+                            cancel_type := ctype,
+                            cn_domain := dom));
+
 template (value) GSUP_PDU ts_GSUP_CL_REQ(hexstring imsi, GSUP_CancelType 
ctype) :=
        ts_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST, {
                valueof(ts_GSUP_IE_IMSI(imsi)), 
valueof(ts_GSUP_IE_CancelType(ctype)) });
@@ -410,6 +418,9 @@
 template GSUP_PDU tr_GSUP_CL_RES(template hexstring imsi) :=
        tr_GSUP_IMSI(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT, imsi);

+template (value) GSUP_PDU ts_GSUP_CL_RES(template (value) hexstring imsi) :=
+       ts_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT, 
{valueof(ts_GSUP_IE_IMSI(imsi))});
+
 template GSUP_PDU tr_GSUP_CL_ERR(template hexstring imsi, template integer 
cause := ?) :=
        tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR, {
                        tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause), * });
@@ -548,7 +559,7 @@
        val := val
 }

-template (value) GSUP_IE ts_GSUP_IE_IMSI(hexstring imsi) := {
+template (value) GSUP_IE ts_GSUP_IE_IMSI(template (value) hexstring imsi) := {
        tag := OSMO_GSUP_IMSI_IE,
        len := 0, /* overwritten */
        val := {
@@ -1184,8 +1195,10 @@
                              template GSUP_IEs pdp_info := omit,
                              template GSUP_Message_Class message_class := omit,
                              template integer cause := omit,
+                             template GSUP_CancelType cancel_type := omit,
                              template hexstring msisdn := omit,
                              template GSUP_IMEIResult imei_result := omit,
+                             template GSUP_CnDomain cn_domain := omit,
                              template octetstring source_name := omit,
                              template octetstring destination_name := omit
                             ) return template GSUP_IEs {
@@ -1204,6 +1217,11 @@
                idx := idx + 1;
        }

+       if (not istemplatekind(cancel_type, "omit")) {
+               ies[idx] := tr_GSUP_IE_CancelType(cancel_type);
+               idx := idx + 1;
+       }
+
        if (not istemplatekind(pdp_info_compl, "omit")) {
                ies[idx] := tr_GSUP_IE_PdpInfoCompl;
                idx := idx + 1;
@@ -1214,6 +1232,11 @@
                idx := idx + 1;
        }

+       if (not istemplatekind(cn_domain, "omit")) {
+               ies[idx] := tr_GSUP_IE_CnDomain(cn_domain);
+               idx := idx + 1;
+       }
+
        if (not istemplatekind(imei_result, "omit")) {
                ies[idx] := tr_GSUP_IE_IMEI_Result(imei_result);
                idx := idx + 1;

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/35883?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibc37a9ef53315edab18f7b97a55cf504a40a4bf1
Gerrit-Change-Number: 35883
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to