Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP

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

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP
..

MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP

The idea of this test case is to verify MO SMS transmission
over GSUP towards HLR. Basically, the algorythm is the following:

  1.0 establish a RAN connection,
  2.1 send CP-DATA/RP-DATA on BSSAP/DTAP,
  2.2 expect MO-ForwardSM-Req on GSUP,
  3.1 send MO-ForwardSM-Res on GSUP,
  3.2 expect CP-DATA/RP-ACK on BSSAP/DTAP.

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

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index 0ac61bc..202bce7 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -44,6 +44,7 @@

 import from MobileL3_Types all;
 import from MobileL3_CommonIE_Types all;
+import from MobileL3_SMS_Types all;
 import from L3_Templates all;
 import from L3_Common all;

@@ -2028,6 +2029,75 @@
f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "no default-route");
 }

+/* Test MO-SMS from MS/BTS/BSC towards HLR (via GSUP) */
+private function f_tc_gsup_mo_sms(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+   var SmsParameters spars := valueof(t_SmsPars);
+   var GSUP_PDU gsup_msg_rx;
+   var octetstring sm_tpdu;
+
+   f_init_handler(pars);
+
+   /* We need to inspect GSUP activity */
+   f_create_gsup_expect(hex2str(g_pars.imsi));
+
+   /* Perform location update */
+   f_perform_lu();
+
+   /* Send CM Service Request for SMS */
+   f_establish_fully(EST_TYPE_MO_SMS);
+
+   /* Prepare expected SM-RP-UI (SM TPDU) */
+   enc_TPDU_RP_DATA_MS_SGSN_fast(
+   valueof(ts_SMS_SUBMIT(spars.tp.msg_ref,
+   spars.tp.da, spars.tp.pid, spars.tp.dcs,
+   spars.tp.udl, spars.tp.ud)),
+   sm_tpdu);
+
+   var template GSUP_PDU mo_forwardSM := tr_GSUP_MO_FORWARD_SM_REQ(
+   imsi := g_pars.imsi,
+   sm_rp_mr := spars.rp.msg_ref,
+   /* FIXME: extract SM-RP-DA from spars.rp.dest */
+   sm_rp_da := tr_GSUP_SM_RP_DA_SMSC_ADDR(?),
+   /* FIXME: MSISDN coding troubles */
+   sm_rp_oa := tr_GSUP_SM_RP_OA_MSISDN(?),
+   /* TODO: can we use decmatch here? */
+   sm_rp_ui := sm_tpdu
+   );
+
+   /* Submit an SMS on DTAP and expect MO-forwardSM-Req on GSUP */
+   f_mo_sms_submit(spars);
+   alt {
+   [] GSUP.receive(mo_forwardSM) -> value gsup_msg_rx {
+   log("RX MO-forwardSM-Req");
+   log(gsup_msg_rx);
+   setverdict(pass);
+   }
+   [] GSUP.receive {
+   log("RX unexpected GSUP message");
+   setverdict(fail);
+   mtc.stop;
+   }
+   }
+
+   /* Trigger RP-ACK by sending MO-forwardSM-Res */
+   GSUP.send(valueof(ts_GSUP_MO_FORWARD_SM_RES(
+   imsi := g_pars.imsi,
+   sm_rp_mr := spars.rp.msg_ref)));
+   /* Expect RP-ACK on DTAP */
+   f_mo_sms_wait_rp_ack(spars);
+
+   f_expect_clear();
+}
+testcase TC_gsup_mo_sms() runs on MTC_CT {
+   var BSC_ConnHdlr vc_conn;
+   f_init();
+   f_vty_config(MSCVTY, "msc", "sms-over-gsup");
+   vc_conn := f_start_handler(refers(f_tc_gsup_mo_sms), 88);
+   vc_conn.done;
+   f_vty_config(MSCVTY, "msc", "no sms-over-gsup");
+}
+
 /* convert GSM L3 TON to SMPP_TON enum */
 function f_sm_ton_from_gsm(BIT3 ton) return SMPP_TON {
select (ton) {
@@ -2913,6 +2983,8 @@
execute( TC_smpp_mo_sms() );
execute( TC_smpp_mt_sms() );

+   execute( TC_gsup_mo_sms() );
+
execute( TC_lu_and_mo_ussd_single_request() );
execute( TC_lu_and_mt_ussd_notification() );
execute( TC_lu_and_mo_ussd_during_mt_call() );
diff --git a/msc/expected-results.xml b/msc/expected-results.xml
index 83c8010..49ca1e3 100644
--- a/msc/expected-results.xml
+++ b/msc/expected-results.xml
@@ -63,6 +63,7 @@
   
   
   
+  
   
   
   

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id14bbd8bd51558cdacefea0fe042769cd69ed5c8
Gerrit-Change-Number: 11718
Gerrit-PatchSet: 7
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP

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

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11718
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: Id14bbd8bd51558cdacefea0fe042769cd69ed5c8
Gerrit-Change-Number: 11718
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sat, 08 Dec 2018 19:43:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP

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

Change subject: MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11718
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: Id14bbd8bd51558cdacefea0fe042769cd69ed5c8
Gerrit-Change-Number: 11718
Gerrit-PatchSet: 5
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Sun, 02 Dec 2018 22:11:32 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ttcn3-hacks[master]: MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP

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


Change subject: MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP
..

MSC_Tests.ttcn: introduce TC_gsup_mo_sms for MO SMS over GSUP

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



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

diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index c0cd9d3..4db5b29 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -2022,6 +2022,67 @@
f_vty_config2(MSCVTY, { "smpp", "esme msc_tester"}, "no default-route");
 }

+/* Test MO-SMS from MS/BTS/BSC towards HLR (via GSUP) */
+private function f_tc_gsup_mo_sms(charstring id, BSC_ConnHdlrPars pars)
+runs on BSC_ConnHdlr {
+   var SmsParameters spars := valueof(t_SmsPars);
+   var GSUP_PDU gsup_msg_rx;
+
+   f_init_handler(pars);
+
+   /* We need to inspect GSUP activity */
+   f_create_gsup_expect(hex2str(g_pars.imsi));
+
+   /* Perform location update */
+   f_perform_lu();
+
+   /* Send CM Service Request for SMS */
+   f_establish_fully(EST_TYPE_MO_SMS);
+
+   var template GSUP_PDU mo_forwardSM := tr_GSUP_MO_FORWARD_SM_REQ(
+   imsi := g_pars.imsi,
+   sid := ?, state := ?,
+   sm_rp_mr := spars.rp.msg_ref,
+   /* FIXME: extract SM-RP-DA from spars.rp.dest */
+   sm_rp_da := tr_GSUP_SM_RP_DA_SMSC_ADDR(?),
+   sm_rp_oa := tr_GSUP_SM_RP_OA_NULL,
+   /* FIXME: define coding rules for SmsParametersTp, and use 
'decmatch spars.tp' */
+   sm_rp_ui := '052305002143F500'O
+   );
+
+   /* Submit an SMS on DTAP and expect MO-forwardSM-Req on GSUP */
+   f_mo_sms_submit(spars);
+   alt {
+   [] GSUP.receive(mo_forwardSM) -> value gsup_msg_rx {
+   log("RX MO-forwardSM-Req");
+   log(gsup_msg_rx);
+   setverdict(pass);
+   }
+   [] GSUP.receive {
+   log("RX unexpected GSUP message");
+   setverdict(fail);
+   mtc.stop;
+   }
+   }
+
+   /* Trigger RP-ACK by sending MO-forwardSM-Res */
+   GSUP.send(valueof(ts_GSUP_MO_FORWARD_SM_RES(
+   imsi := g_pars.imsi,
+   sid := gsup_msg_rx.ies[1].val.session_id,
+   state := gsup_msg_rx.ies[2].val.session_state,
+   sm_rp_mr := gsup_msg_rx.ies[3].val.sm_rp_mr)));
+   /* Expect RP-ACK on DTAP */
+   f_mo_sms_wait_rp_ack(spars);
+
+   f_expect_clear();
+}
+testcase TC_gsup_mo_sms() runs on MTC_CT {
+   var BSC_ConnHdlr vc_conn;
+   f_init();
+   vc_conn := f_start_handler(refers(f_tc_gsup_mo_sms), 88);
+   vc_conn.done;
+}
+
 /* convert GSM L3 TON to SMPP_TON enum */
 function f_sm_ton_from_gsm(BIT3 ton) return SMPP_TON {
select (ton) {
@@ -2777,6 +2838,8 @@
execute( TC_smpp_mo_sms() );
execute( TC_smpp_mt_sms() );

+   execute( TC_gsup_mo_sms() );
+
execute( TC_lu_and_mo_ussd_single_request() );
execute( TC_lu_and_mt_ussd_notification() );
execute( TC_lu_and_mo_ussd_during_mt_call() );
diff --git a/msc/expected-results.xml b/msc/expected-results.xml
index 8d9180f..f8e7eb3 100644
--- a/msc/expected-results.xml
+++ b/msc/expected-results.xml
@@ -63,6 +63,7 @@
   
   
   
+  
   
   
   

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

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id14bbd8bd51558cdacefea0fe042769cd69ed5c8
Gerrit-Change-Number: 11718
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy