Vadim Yanitskiy has uploaded this change for review. ( 
https://gerrit.osmocom.org/9372


Change subject: msc/USSD: add single *#100# request testcase
......................................................................

msc/USSD: add single *#100# request testcase

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



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

diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn
index f843839..cb29bc1 100644
--- a/msc/MSC_Tests.ttcn
+++ b/msc/MSC_Tests.ttcn
@@ -51,6 +51,10 @@
 import from SMPP_Templates all;
 import from SMPP_Emulation all;

+import from SS_Types all;
+import from USSD_Templates all;
+import from USSD_Helpers all;
+
 const integer NUM_BSC := 2;
 type record of BSSAP_Configuration BSSAP_Configurations;

@@ -2101,6 +2105,70 @@
        vc_conn.done;
 }
 
+/***********************************************************************
+ * USSD Testing
+ ***********************************************************************/
+
+private function f_tc_lu_and_ussd_single_req(charstring id, BSC_ConnHdlrPars 
pars)
+runs on BSC_ConnHdlr {
+       f_init_handler(pars);
+
+       /* Perform location update */
+       f_perform_lu();
+
+       /* Send CM Service Request for SS/USSD */
+       f_establish_fully(EST_TYPE_SS_ACT);
+
+       /* Compose a new SS/REGISTER message with request */
+       var template PDU_ML3_MS_NW ussd_req := ts_ML3_MO_SS_REGISTER(
+               tid := 1, /* We just need a single transaction */
+               ti_flag := c_TIF_ORIG, /* Sent from the side that originates 
the TI */
+               facility := f_USSD_FACILITY_IE_INVOKE(
+                       op_code := 59, /* ProcessUnstructuredSS-Request */
+                       ussd_string := "*#100#"
+               )
+       );
+
+       /* Compose SS/RELEASE_COMPLETE template with expected response */
+       var template PDU_ML3_NW_MS ussd_rsp := 
tr_ML3_MT_SS_RELEASE_COMPLETE_FACILITY(
+               tid := 1, /* Response should arrive within the same transaction 
*/
+               ti_flag := c_TIF_REPL, /* Sent to the side that originates the 
TI */
+               facility := ? /* Any Facility IE is acceptable */
+       );
+
+       /* Compose SS/RELEASE_COMPLETE without Facility IE */
+       var template PDU_ML3_NW_MS ussd_rsp_empty := 
tr_ML3_MT_SS_RELEASE_COMPLETE(
+               tid := 1, /* Response should arrive within the same transaction 
*/
+               ti_flag := c_TIF_REPL /* Sent to the side that originates the 
TI */
+       );
+
+       /* Request own number request */
+       BSSAP.send(ts_PDU_DTAP_MO(ussd_req));
+       alt {
+       /* We expect RELEASE_COMPLETE message with the response */
+       [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_rsp)) {
+               /* TODO: decode Facility IE and check our number */
+               setverdict(pass);
+               }
+       /* Incorrect: RELEASE_COMPLETE without Facility IE? */
+       [] BSSAP.receive(tr_PDU_DTAP_MT(ussd_rsp_empty)) {
+               setverdict(fail, "RELEASE_COMPLETE without Facility IE?");
+               }
+       [] BSSAP.receive {
+               setverdict(fail, "Unknown/unexpected BSSAP received");
+               self.stop;
+               }
+       }
+
+       f_expect_clear();
+}
+testcase TC_lu_and_ussd_single_req() runs on MTC_CT {
+       var BSC_ConnHdlr vc_conn;
+       f_init();
+       vc_conn := f_start_handler(refers(f_tc_lu_and_ussd_single_req), 46);
+       vc_conn.done;
+}
+
 /* TODO (SMS):
    * different user data lengths
    * SMPP transaction mode with unsuccessful delivery
@@ -2182,6 +2250,8 @@
        execute( TC_smpp_mo_sms() );
        execute( TC_smpp_mt_sms() );

+       execute( TC_lu_and_ussd_single_req() );
+
        /* Run this last: at the time of writing this test crashes the MSC */
        execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() );
 }
diff --git a/msc/expected-results.xml b/msc/expected-results.xml
index 0b192d0..af2d97f 100644
--- a/msc/expected-results.xml
+++ b/msc/expected-results.xml
@@ -76,4 +76,5 @@
   <testcase classname='MSC_Tests' name='TC_smpp_mo_sms' time='MASKED'/>
   <testcase classname='MSC_Tests' name='TC_smpp_mt_sms' time='MASKED'/>
   <testcase classname='MSC_Tests' 
name='TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug' time='MASKED'/>
+  <testcase classname='MSC_Tests' name='TC_lu_and_ussd_single_req' 
time='MASKED'/>
 </testsuite>

--
To view, visit https://gerrit.osmocom.org/9372
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: I82450c6f48f6c17bc33e0ec6c91f2a73e44793ad
Gerrit-Change-Number: 9372
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <[email protected]>

Reply via email to