Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2019-01-11 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..


Patch Set 9: Code-Review+2

Recovering Harald's +2.


--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 9
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Fri, 11 Jan 2019 22:44:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2019-01-11 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 9
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Fri, 11 Jan 2019 22:44:04 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2019-01-11 Thread Vadim Yanitskiy
Vadim Yanitskiy has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..

MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

The idea of this test case is to verify MT SMS transmission
initiated by ESME over GSUP. Basically, the algorythm is
the following:

  1.0 send MT-ForwardSM-Req on GSUP,
  1.1 expect Paging Request on RAN,
  1.2 establish a RAN connection,
  1.3 expect CP-DATA/RP-DATA on BSSAP/DTAP,
  2.1 send CP-DATA/RP-ACK on BSSAP/DTAP,
  2.2.a expect MT-ForwardSM-Res,
  2.2.b expect MT-ForwardSM-Err.

Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Related: OS#3587
---
M msc/MSC_Tests.ttcn
M msc/expected-results.xml
2 files changed, 151 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, approved



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 96ddc8d..b7a02a7 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -2196,6 +2196,153 @@
f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
 }

+/* Helper for sending MT SMS over GSUP */
+private function f_gsup_forwardSM_req(SmsParameters spars, OCT1 mms := '00'O)
+runs on BSC_ConnHdlr {
+   GSUP.send(ts_GSUP_MT_FORWARD_SM_REQ(
+   imsi := g_pars.imsi,
+   /* NOTE: MSC should assign RP-MR itself */
+   sm_rp_mr := 'FF'O,
+   /* FIXME: extract SM-RP-DA from spars.rp.dest */
+   /* TODO: fix encoding of ts_GSUP_SM_RP_DA_IMSI */
+   sm_rp_da := valueof(ts_GSUP_SM_RP_DA_MSISDN(g_pars.msisdn)),
+   sm_rp_oa := valueof(ts_GSUP_SM_RP_OA_SMSC_ADDR(g_pars.msisdn)),
+   /* Encoded SMS TPDU (taken from Wireshark)
+* FIXME: we should encode spars somehow */
+   sm_rp_ui := '0006802143658111328130858200'O,
+   sm_rp_mms := mms
+   ));
+}
+
+/* Test successful MT-SMS (RP-ACK) over GSUP */
+private function f_tc_gsup_mt_sms_ack(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+   var SmsParameters spars := valueof(t_SmsPars);
+
+   f_init_handler(pars);
+
+   /* We need to inspect GSUP activity */
+   f_create_gsup_expect(hex2str(g_pars.imsi));
+
+   /* Perform location update */
+   f_perform_lu();
+
+   /* Register an 'expect' for given IMSI (+TMSI) */
+   if (isvalue(g_pars.tmsi)) {
+   f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi);
+   } else {
+   f_bssmap_register_imsi(g_pars.imsi, ''O);
+   }
+
+   var template GSUP_PDU mt_forwardSM_res := tr_GSUP_MT_FORWARD_SM_RES(
+   imsi := g_pars.imsi,
+   /* NOTE: MSC should assign RP-MR itself */
+   sm_rp_mr := ?
+   );
+
+   /* Submit a MT SMS on GSUP */
+   f_gsup_forwardSM_req(spars);
+
+   /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */
+   BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi));
+   f_establish_fully(EST_TYPE_PAG_RESP);
+
+   /* Wait for MT SMS on DTAP */
+   f_mt_sms_expect(spars);
+
+   /* Send RP-ACK and expect MT-forwardSM-Res on GSUP */
+   f_mt_sms_send_rp_ack(spars);
+   alt {
+   [] GSUP.receive(mt_forwardSM_res) {
+   log("RX MT-forwardSM-Res (RP-ACK)");
+   setverdict(pass);
+   }
+   [] GSUP.receive {
+   log("RX unexpected GSUP message");
+   setverdict(fail);
+   mtc.stop;
+   }
+   }
+
+   f_expect_clear();
+}
+testcase TC_gsup_mt_sms_ack() runs on MTC_CT {
+   var BSC_ConnHdlrPars pars;
+   var BSC_ConnHdlr vc_conn;
+   f_init();
+   pars := f_init_pars(90);
+   f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+   vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_ack), 
pars);
+   vc_conn.done;
+   f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
+/* Test rejected MT-SMS (RP-ERROR) over GSUP */
+private function f_tc_gsup_mt_sms_err(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+   var SmsParameters spars := valueof(t_SmsPars);
+   var OCT1 sm_rp_cause := '78'O; /* dummy RP-Cause value */
+
+   f_init_handler(pars);
+
+   /* We need to inspect GSUP activity */
+   f_create_gsup_expect(hex2str(g_pars.imsi));
+
+   /* Perform location update */
+   f_perform_lu();
+
+   /* Register an 'expect' for given IMSI (+TMSI) */
+   if (isvalue(g_pars.tmsi)) {
+   f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi);
+   } else {
+   f_bssmap_register_imsi(g_pars.imsi, ''O);
+   }
+
+   var template GSUP_PDU mt_forwardSM_err := tr_GSUP_MT_FORWARD_SM_ERR(
+   imsi := g_pars.imsi,
+   /* NOTE: MSC should assign RP-MR itself */
+   sm_rp_mr := ?,
+

Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2018-12-17 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..


Patch Set 5: Code-Review+1

(2 comments)

https://gerrit.osmocom.org/#/c/11924/5//COMMIT_MSG
Commit Message:

https://gerrit.osmocom.org/#/c/11924/5//COMMIT_MSG@10
PS5, Line 10: initiated by ESME over GSUP. Basically, the algorythm is
spelling: "algorithm"


https://gerrit.osmocom.org/#/c/11924/5/msc/MSC_Tests.ttcn
File msc/MSC_Tests.ttcn:

https://gerrit.osmocom.org/#/c/11924/5/msc/MSC_Tests.ttcn@2160
PS5, Line 2160: sm_rp_ui := '0006802143658111328130858200'O,
What information is encoded in this string? It might be obvious to those 
familiar with the data structures involved, but a comment here could help 
readers who are unfamiliar with them.



--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Mon, 17 Dec 2018 11:05:31 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2018-12-14 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..


Patch Set 4:

(1 comment)

https://gerrit.osmocom.org/#/c/11924/4/msc/MSC_Tests.ttcn
File msc/MSC_Tests.ttcn:

https://gerrit.osmocom.org/#/c/11924/4/msc/MSC_Tests.ttcn@2158
PS4, Line 2158: sm_rp_da := 
valueof(ts_GSUP_SM_RP_DA_MSISDN(g_pars.msisdn)),
> I still had reservations about OA,DA encoding in that libosmocore patch...
Done, see https://gerrit.osmocom.org/#/c/osmo-ttcn3-hacks/+/12304/.



--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Fri, 14 Dec 2018 14:23:28 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2018-12-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..


Patch Set 4: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/11924/4/msc/MSC_Tests.ttcn
File msc/MSC_Tests.ttcn:

https://gerrit.osmocom.org/#/c/11924/4/msc/MSC_Tests.ttcn@2158
PS4, Line 2158: sm_rp_da := 
valueof(ts_GSUP_SM_RP_DA_MSISDN(g_pars.msisdn)),
I still had reservations about OA,DA encoding in that libosmocore patch...



-- 
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 11 Dec 2018 11:55:56 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2018-12-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..


Patch Set 4: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Sat, 08 Dec 2018 19:45:42 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2018-12-02 Thread Vadim Yanitskiy
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11924

to look at the new patch set (#4).

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..

MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

The idea of this test case is to verify MT SMS transmission
initiated by ESME over GSUP. Basically, the algorythm is
the following:

  1.0 send MT-ForwardSM-Req on GSUP,
  1.1 expect Paging Request on RAN,
  1.2 establish a RAN connection,
  1.3 expect CP-DATA/RP-DATA on BSSAP/DTAP,
  2.1 send CP-DATA/RP-ACK on BSSAP/DTAP,
  2.2.a expect MT-ForwardSM-Res,
  2.2.b expect MT-ForwardSM-Err.

Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Related: OS#3587
---
M msc/MSC_Tests.ttcn
M msc/expected-results.xml
2 files changed, 149 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/24/11924/4
--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 4
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

2018-12-02 Thread Vadim Yanitskiy
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11924

to look at the new patch set (#3).

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}
..

MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err}

The idea of this test case is to verify MT SMS transmission
initiated by ESME over GSUP. Basically, the algorythm is
the following:

  1.0 send MT-ForwardSM-Req on GSUP,
  1.1 expect Paging Request on RAN,
  1.2 establish a RAN connection,
  1.3 expect CP-DATA/RP-DATA on BSSAP/DTAP,
  2.1 send CP-DATA/RP-ACK on BSSAP/DTAP,
  2.2.a expect MT-ForwardSM-Res
  2.2.b expect MT-ForwardSM-Err

Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Related: OS#3587
---
M msc/MSC_Tests.ttcn
M msc/expected-results.xml
2 files changed, 149 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/24/11924/3
--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS over GSUP

2018-12-02 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS 
over GSUP
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/11924/2/msc/MSC_Tests.ttcn
File msc/MSC_Tests.ttcn:

https://gerrit.osmocom.org/#/c/11924/2/msc/MSC_Tests.ttcn@2149
PS2, Line 2149: FIXME
> Add info about what it should represent?
Well, the template definition already has a comment with the
spec. reference. I can clarify this comment anyway:

  /* FIXME: encoded SMS TPDU was taken from Wireshark */



--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Sun, 02 Dec 2018 09:44:07 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS over GSUP

2018-12-01 Thread Holger Freyther
Holger Freyther has posted comments on this change. ( 
https://gerrit.osmocom.org/11924 )

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS 
over GSUP
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/11924/2/msc/MSC_Tests.ttcn
File msc/MSC_Tests.ttcn:

https://gerrit.osmocom.org/#/c/11924/2/msc/MSC_Tests.ttcn@2149
PS2, Line 2149: FIXME
Add info about what it should represent?



--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Sat, 01 Dec 2018 23:56:52 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS over GSUP

2018-12-01 Thread Vadim Yanitskiy
Hello Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/11924

to look at the new patch set (#2).

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS 
over GSUP
..

MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS over GSUP

Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
---
M msc/MSC_Tests.ttcn
M msc/expected-results.xml
2 files changed, 148 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/24/11924/2
--
To view, visit https://gerrit.osmocom.org/11924
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
Gerrit-Change-Number: 11924
Gerrit-PatchSet: 2
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS over GSUP

2018-11-25 Thread Vadim Yanitskiy
Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/11924


Change subject: MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS 
over GSUP
..

MSC_Tests.ttcn: introduce TC_gsup_mt_sms_{ack|err} for MT SMS over GSUP

Change-Id: I63a25c8366cce0852df6b628365151661a22a25f
---
M msc/MSC_Tests.ttcn
M msc/expected-results.xml
2 files changed, 147 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/24/11924/1

diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index e2df249..124e915 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -2135,6 +2135,149 @@
vc_conn.done;
 }

+/* Helper for sending MT SMS over GSUP */
+private function f_gsup_forwardSM_req(SmsParameters spars)
+runs on BSC_ConnHdlr {
+   GSUP.send(ts_GSUP_MT_FORWARD_SM_REQ(
+   imsi := g_pars.imsi,
+   /* NOTE: MSC should assign RP-MR itself */
+   sm_rp_mr := 'FF'O,
+   /* FIXME: extract SM-RP-DA from spars.rp.dest */
+   /* TODO: fix encoding of ts_GSUP_SM_RP_DA_IMSI */
+   sm_rp_da := valueof(ts_GSUP_SM_RP_DA_MSISDN(g_pars.msisdn)),
+   sm_rp_oa := valueof(ts_GSUP_SM_RP_OA_SMSC_ADDR(g_pars.msisdn)),
+   /* FIXME: define coding rules for SmsParametersTp, and use 
'decmatch spars.tp' */
+   sm_rp_ui := '0006802143658111328130858200'O
+   ));
+}
+
+/* Test successful MT-SMS (RP-ACK) over GSUP */
+private function f_tc_gsup_mt_sms_ack(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+   var SmsParameters spars := valueof(t_SmsPars);
+
+   f_init_handler(pars);
+
+   /* We need to inspect GSUP activity */
+   f_create_gsup_expect(hex2str(g_pars.imsi));
+
+   /* Perform location update */
+   f_perform_lu();
+
+   /* Register an 'expect' for given IMSI (+TMSI) */
+   if (isvalue(g_pars.tmsi)) {
+   f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi);
+   } else {
+   f_bssmap_register_imsi(g_pars.imsi, ''O);
+   }
+
+   var template GSUP_PDU mt_forwardSM_res := tr_GSUP_MT_FORWARD_SM_RES(
+   imsi := g_pars.imsi,
+   /* NOTE: MSC should assign RP-MR itself */
+   sm_rp_mr := ?
+   );
+
+   /* Submit a MT SMS on GSUP */
+   f_gsup_forwardSM_req(spars);
+
+   /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */
+   BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi));
+   f_establish_fully(EST_TYPE_PAG_RESP);
+
+   /* Wait for MT SMS on DTAP */
+   f_mt_sms_expect(spars);
+
+   /* Send RP-ACK and expect MT-forwardSM-Res on GSUP */
+   f_mt_sms_send_rp_ack(spars);
+   alt {
+   [] GSUP.receive(mt_forwardSM_res) {
+   log("RX MT-forwardSM-Res (RP-ACK)");
+   setverdict(pass);
+   }
+   [] GSUP.receive {
+   log("RX unexpected GSUP message");
+   setverdict(fail);
+   mtc.stop;
+   }
+   }
+
+   f_expect_clear();
+}
+testcase TC_gsup_mt_sms_ack() runs on MTC_CT {
+   var BSC_ConnHdlrPars pars;
+   var BSC_ConnHdlr vc_conn;
+   f_init();
+   pars := f_init_pars(90);
+   f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+   vc_conn := f_start_handler_with_pars(refers(f_tc_gsup_mt_sms_ack), 
pars);
+   vc_conn.done;
+}
+
+/* Test rejected MT-SMS (RP-ERROR) over GSUP */
+private function f_tc_gsup_mt_sms_err(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+   var SmsParameters spars := valueof(t_SmsPars);
+   var OCT1 sm_rp_cause := '78'O; /* dummy RP-Cause value */
+
+   f_init_handler(pars);
+
+   /* We need to inspect GSUP activity */
+   f_create_gsup_expect(hex2str(g_pars.imsi));
+
+   /* Perform location update */
+   f_perform_lu();
+
+   /* Register an 'expect' for given IMSI (+TMSI) */
+   if (isvalue(g_pars.tmsi)) {
+   f_bssmap_register_imsi(g_pars.imsi, g_pars.tmsi);
+   } else {
+   f_bssmap_register_imsi(g_pars.imsi, ''O);
+   }
+
+   var template GSUP_PDU mt_forwardSM_err := tr_GSUP_MT_FORWARD_SM_ERR(
+   imsi := g_pars.imsi,
+   /* NOTE: MSC should assign RP-MR itself */
+   sm_rp_mr := ?,
+   sm_rp_cause := sm_rp_cause
+   );
+
+   /* Submit a MT SMS on GSUP */
+   f_gsup_forwardSM_req(spars);
+
+   /* Expect Paging Request and Establish DTAP / BSSAP / SCCP connection */
+   BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi));
+   f_establish_fully(EST_TYPE_PAG_RESP);
+
+   /* Wait for MT SMS on DTAP */
+   f_mt_sms_expect(spars);
+
+   /* Send RP-ERROR and expect MT-forwardSM-Err on GSUP */
+   f_mt_sms_send_rp_error(spars, oct2int(sm_rp_cause));
+   alt {
+   []