Change in osmo-ttcn3-hacks[master]: BSC_Tests: test handling of EMERGENCY SETUP

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Wed Aug 12 10:22:29 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19302 )

Change subject: BSC_Tests: test handling of EMERGENCY SETUP
......................................................................

BSC_Tests: test handling of EMERGENCY SETUP

The EMERGENCY SETUP is an L3 message that normally gets passed through
transparently to the A interface. Nomrally the BSC will not look into L3
messages. However if EMERGENCY CALLS are allowed on a BTS or not is set
in the system information. Also osmo-bsc has the option to deny
EMERGENCY CALLS globally for all BTSs.

Since EMERGENCY CALLS are a crucial application, the BSC should not only
send the appropiate sysinfo messages that forbid emergency calling. It
should also make sure that any attempt to make an emergency call is
rejected early if emergency calls are denied.

Lets add some checks to verify that the allow/deny mechanisms for
EMERGENCY CALLS are working as expected.

Depends: osmo-bsc Ia6eb38370ce4165d221d2ffbe1cd105c0628313c
Change-Id: I486d99953529a1ce9f0a3950c9a97900922eee92
Related: OS#4548
---
M bsc/BSC_Tests.ttcn
1 file changed, 140 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 4442008..799d6a1 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -5961,6 +5961,142 @@
 	f_ctrs_msc_expect(2, "mscpool:subscr:new");
 }
 
+/* Allow/Deny emergency calls globally via VTY */
+private function f_vty_allow_emerg_msc(boolean allow) runs on test_CT {
+	f_vty_enter_cfg_msc(BSCVTY, 0);
+	if (allow) {
+		f_vty_transceive(BSCVTY, "allow-emergency allow");
+	} else {
+		f_vty_transceive(BSCVTY, "allow-emergency deny");
+	}
+	f_vty_transceive(BSCVTY, "exit");
+	f_vty_transceive(BSCVTY, "exit");
+}
+
+/* Allow/Deny emergency calls per BTS via VTY */
+private function f_vty_allow_emerg_bts(boolean allow, integer bts_nr) runs on test_CT {
+	f_vty_enter_cfg_bts(BSCVTY, bts_nr);
+	if (allow) {
+		f_vty_transceive(BSCVTY, "rach emergency call allowed 1");
+	} else {
+		f_vty_transceive(BSCVTY, "rach emergency call allowed 0");
+	}
+	f_vty_transceive(BSCVTY, "exit");
+	f_vty_transceive(BSCVTY, "exit");
+}
+
+/* Begin assignmet procedure and send an EMERGENCY SETUP (RR) */
+private function f_assignment_emerg_setup() runs on MSC_ConnHdlr {
+	var PDU_ML3_MS_NW emerg_setup;
+	var octetstring emerg_setup_enc;
+	var RSL_Message emerg_setup_data_ind;
+
+	f_establish_fully(omit, omit);
+
+	emerg_setup := valueof(ts_ML3_MO_CC_EMERG_SETUP(1, valueof(ts_Bcap_voice)));
+	emerg_setup_enc := enc_PDU_ML3_MS_NW(emerg_setup);
+	emerg_setup_data_ind := valueof(ts_RSL_DATA_IND(g_chan_nr, valueof(ts_RslLinkID_DCCH(0)), emerg_setup_enc));
+
+	RSL.send(emerg_setup_data_ind);
+}
+
+/* Test if the EMERGENCY SETUP gets passed on to the MSC via A when EMERGENCY
+ * CALLS are permitted by the BSC config. */
+private function f_TC_assignment_emerg_setup_allow(charstring id) runs on MSC_ConnHdlr {
+	var PDU_BSSAP emerg_setup_data_ind_bssap;
+	var PDU_ML3_MS_NW emerg_setup;
+	timer T := 3.0;
+
+	f_assignment_emerg_setup()
+
+	T.start;
+	alt {
+	[] BSSAP.receive(tr_BSSAP_DTAP) -> value emerg_setup_data_ind_bssap {
+		emerg_setup := dec_PDU_ML3_MS_NW(emerg_setup_data_ind_bssap.pdu.dtap);
+		if (not isbound(emerg_setup.msgs.cc.emergencySetup)) {
+			setverdict(fail, "no emergency setup");
+		}
+		}
+	[] BSSAP.receive {
+		setverdict(fail, "unexpected BSSAP message!");
+		}
+	[] T.timeout {
+		setverdict(fail, "timout waiting for EMERGENCY SETUP!");
+		}
+	}
+
+	setverdict(pass);
+}
+
+/* Test if the EMERGENCY SETUP gets blocked by the BSC if EMERGENCY CALLS are
+ * forbidden by the BSC config. */
+private function f_TC_assignment_emerg_setup_deny(charstring id) runs on MSC_ConnHdlr {
+	var PDU_BSSAP emerg_setup_data_ind_bssap;
+	timer T := 3.0;
+
+	f_assignment_emerg_setup()
+
+	T.start;
+	alt {
+	[] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr, ?, decmatch tr_RRM_RR_RELEASE)) {
+		setverdict(pass);
+		}
+	[] RSL.receive {
+		setverdict(fail, "unexpected RSL message!");
+		}
+	[] T.timeout {
+		setverdict(fail, "timout waiting for RR CHANNEL RELEASE!");
+		}
+	}
+}
+
+/* EMERGENCY CALL situation #1, allowed globally and by BTS */
+testcase TC_assignment_emerg_setup_allow() runs on test_CT {
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(1, true);
+	f_sleep(1.0);
+
+	f_vty_allow_emerg_msc(true);
+	f_vty_allow_emerg_bts(true, 0);
+	vc_conn := f_start_handler(refers(f_TC_assignment_emerg_setup_allow), pars);
+	vc_conn.done;
+}
+
+/* EMERGENCY CALL situation #2, forbidden globally but allowed by BTS */
+testcase TC_assignment_emerg_setup_deny_msc() runs on test_CT {
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
+	var MSC_ConnHdlr vc_conn;
+
+	f_init(1, true);
+	f_sleep(1.0);
+
+	f_vty_allow_emerg_msc(false);
+	f_vty_allow_emerg_bts(true, 0);
+	vc_conn := f_start_handler(refers(f_TC_assignment_emerg_setup_deny), pars);
+	vc_conn.done;
+}
+
+/* EMERGENCY CALL situation #3, allowed globally but forbidden by BTS */
+testcase TC_assignment_emerg_setup_deny_bts() runs on test_CT {
+	var TestHdlrParams pars := f_gen_test_hdlr_pars();
+	var MSC_ConnHdlr vc_conn;
+
+	/* Note: This simulates a spec violation by the MS, correct MS
+	 * implementations would not try to establish an emergency call because
+	 * the system information tells in advance that emergency calls are
+	 * not forbidden */
+
+	f_init(1, true);
+	f_sleep(1.0);
+
+	f_vty_allow_emerg_msc(true);
+	f_vty_allow_emerg_bts(false, 0);
+	vc_conn := f_start_handler(refers(f_TC_assignment_emerg_setup_deny), pars);
+	vc_conn.done;
+}
+
 /* Dyn PDCH todo:
    * activate OSMO as TCH/F
    * activate OSMO as TCH/H
@@ -6176,6 +6312,10 @@
 	execute( TC_early_conn_fail() );
 	execute( TC_late_conn_fail() );
 
+	/* Emergency call handling (deny / allow) */
+	execute( TC_assignment_emerg_setup_allow() );
+	execute( TC_assignment_emerg_setup_deny_msc() );
+	execute( TC_assignment_emerg_setup_deny_bts() );
 }
 
 }

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/19302
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: I486d99953529a1ce9f0a3950c9a97900922eee92
Gerrit-Change-Number: 19302
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200812/585d233d/attachment.htm>


More information about the gerrit-log mailing list