fixeria has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40863?usp=email )
Change subject: msc: add TC_silent_call_{start_stop,active_conn} ......................................................................
msc: add TC_silent_call_{start_stop,active_conn}
This patch adds testcases for the silent-call feature:
* MSC_Tests.TC_silent_call_start_stop Test starting and stopping silent call via the VTY. * MSC_Tests.TC_silent_call_active_conn Test initiating a silent call while there's an active connection. The MSC is expected to be smart and reject such an attempt.
Change-Id: I3ef22fbb5a05f69cc8aea7f42e05f6e1d6c4a8b6 Related: osmo-msc.git I93913d189800d71f82c013b6e946bd63db362f65 Related: osmo-msc.git I52b3be26c61cadacc4783b5c324809ecd6906b36 --- M msc/MSC_Tests.ttcn M msc/expected-results.xml 2 files changed, 101 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified fixeria: Looks good to me, approved pespin: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve
diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 4a7acdc..3f4afe4 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -7710,6 +7710,101 @@ setverdict(pass); }
+/* Test starting and stopping silent call via the VTY */ +private function f_TC_silent_call_start_stop(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + var charstring cmd, resp; + timer T; + + f_init_handler(pars); + + cmd := "subscriber imsi " & hex2str(g_pars.imsi) & " silent-call "; + + f_perform_lu(); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); + + /* Start silent call via the VTY */ + MSCVTY.send(cmd & "start any signalling"); + resp := f_vty_wait_for_prompt(MSCVTY); + if (resp != "% Silent call initiated") { + setverdict(fail, "VTY: Unexpected response: ", resp); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + + /* MSC->BSC: expect PAGING from the MSC */ + f_expect_paging(); + /* MS -> MSC: PAGING RESPONSE */ + f_establish_fully(EST_TYPE_PAG_RESP); + + /* Hold the call for some time */ + T.start(3.0); + alt { + [] BSSAP.receive(tr_BSSMAP_AssignmentReq) { + BSSAP.send(ts_BSSMAP_AssignmentComplete); + repeat; + } + [] as_unexp_bssap_msg(); + [] T.timeout { setverdict(pass); } + } + + /* Stop silent call via the VTY */ + MSCVTY.send(cmd & "stop"); + resp := f_vty_wait_for_prompt(MSCVTY); + if (resp != "% Silent call ended\n% Silent call stopped") { + setverdict(fail, "VTY: Unexpected response: ", resp); + } + + f_expect_clear(); +} +testcase TC_silent_call_start_stop() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_TC_silent_call_start_stop), 30); + vc_conn.done; +} + +/* Test initiating a silent call while there's an active connection. + * The MSC is expected to be smart and reject such an attempt. */ +private function f_TC_silent_call_active_conn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + var charstring cmd, resp; + + f_init_handler(pars); + + cmd := "subscriber imsi " & hex2str(g_pars.imsi) & " silent-call "; + + f_perform_lu(); + f_ran_register_imsi(g_pars.imsi, g_pars.tmsi); + + /* The MS establishes a connection (e.g. for periodic Location Updating) */ + f_establish_fully(); + + /* Try initiating a silent call via the VTY */ + MSCVTY.send(cmd & "start any signalling"); + resp := f_vty_wait_for_prompt(MSCVTY); + select (resp) { + case ("% Subscriber already has an active connection") { + setverdict(pass); + } + case ("% Silent call initiated") { + setverdict(fail, "The MSC initiated silent call despite an active connection"); + f_expect_paging(); + } + case else { + setverdict(fail, "Unexpected VTY response: ", resp); + } + } + + BSSAP.send(ts_BSSMAP_ClearRequest(0)); + f_expect_clear(); +} +testcase TC_silent_call_active_conn() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_TC_silent_call_active_conn), 30); + vc_conn.done; +} + control { execute( TC_cr_before_reset() ); execute( TC_lu_imsi_noauth_tmsi() ); @@ -7910,6 +8005,9 @@ if (Misc_Helpers.f_osmo_repo_is("nightly")) { execute( TC_stat_bsc_sctp_disconnected() ); } + + execute( TC_silent_call_start_stop() ); + execute( TC_silent_call_active_conn() ); }
diff --git a/msc/expected-results.xml b/msc/expected-results.xml index 7a5066d..65f6d8e 100644 --- a/msc/expected-results.xml +++ b/msc/expected-results.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<testsuite name='Titan' tests='229' failures='10' errors='0' skipped='0' inconc='0' time='MASKED'> +<testsuite name='Titan' tests='239' failures='5' errors='0' skipped='0' inconc='0' time='MASKED'> <testcase classname='MSC_Tests' name='TC_cr_before_reset' time='MASKED'/> <testcase classname='MSC_Tests' name='TC_lu_imsi_noauth_tmsi' time='MASKED'/> <testcase classname='MSC_Tests' name='TC_lu_imsi_noauth_notmsi' time='MASKED'/> @@ -177,6 +177,8 @@ <testcase classname='MSC_Tests' name='TC_lu_and_mt_csd' time='MASKED'/> <testcase classname='MSC_Tests' name='TC_lu_and_mo_call_reass_for_mt_codec' time='MASKED'/> <testcase classname='MSC_Tests' name='TC_stat_bsc_sctp_disconnected' time='MASKED'/> + <testcase classname='MSC_Tests' name='TC_silent_call_start_stop' time='MASKED'/> + <testcase classname='MSC_Tests' name='TC_silent_call_active_conn' time='MASKED'/> <!-- MSC_Tests_Iu testcases start here --> <testcase classname='MSC_Tests_Iu' name='TC_iu_lu_imsi_reject' time='MASKED'/> <testcase classname='MSC_Tests_Iu' name='TC_iu_lu_imsi_timeout_gsup' time='MASKED'/>