[PATCH] osmo-ttcn3-hacks[master]: Add a test for OS#2714, "close RSL connections from unknown ...

Stefan Sperling gerrit-no-reply at lists.osmocom.org
Tue Feb 13 13:25:17 UTC 2018


Review at  https://gerrit.osmocom.org/6406

Add a test for OS#2714, "close RSL connections from unknown Unit ID"

Change-Id: I6a947d7411a016e4d7650031396cae3575756453
---
M bsc/BSC_Tests.ttcn
1 file changed, 42 insertions(+), 0 deletions(-)


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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 086830a..3c2cf41 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -28,6 +28,7 @@
 import from BSSAP_CodecPort all;
 import from BSSMAP_Templates all;
 import from IPA_Emulation all;
+import from IPA_CodecPort all;
 import from IPA_Types all;
 import from RSL_Types all;
 import from RSL_Emulation all;
@@ -61,6 +62,7 @@
 	var BTS_State bts[NUM_BTS];
 	/* array of per-BTS RSL test ports */
 	port IPA_RSL_PT IPA_RSL[NUM_BTS];
+	port IPA_CODEC_PT IPA; /* Required for compilation of TC_rsl_unknown_unit_id() */
 
 	var MGCP_Emulation_CT vc_MGCP;
 
@@ -1236,6 +1238,45 @@
 
 /* TODO: Test OML link drop causes counter increment */
 
+/* BSC should close an RSL connection from a BTS with unknown unit ID (OS#2714). */
+testcase TC_rsl_unknown_unit_id() runs on test_CT {
+	timer T := 10.0;
+
+	bts[0].rsl.id := "IPA-0-RSL";
+	bts[0].rsl.vc_IPA := IPA_Emulation_CT.create(bts[0].rsl.id & "-IPA");
+	bts[0].rsl.ccm_pars := c_IPA_default_ccm_pars;
+	bts[0].rsl.ccm_pars.name := "Osmocom TTCN-3 BTS Simulator";
+	bts[0].rsl.ccm_pars.unit_id := "0/0/0"; /* value which is unknown at BTS */
+
+	/* Call a function of our 'parent component' BSSAP_Adapter_CT to start the
+	 * MSC-side BSSAP emulation */
+	f_bssap_init("VirtMSC", omit);
+
+	f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port);
+
+	f_init_mgcp("VirtMSC");
+
+	/* start RSL connection */
+	map(bts[0].rsl.vc_IPA:IPA_PORT, system:IPA);
+	connect(bts[0].rsl.vc_IPA:IPA_RSL_PORT, self:IPA_RSL[0]);
+	bts[0].rsl.vc_IPA.start(IPA_Emulation.main_client(mp_bsc_ip, mp_bsc_rsl_port, "", 10000, bts[0].rsl.ccm_pars));
+
+	/* wait for IPA RSL link to connect and then disconnect */
+	T.start;
+	alt {
+	[] IPA_RSL[0].receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_DOWN}) {
+		T.stop;
+		setverdict(pass);
+	}
+	[] IPA_RSL[0].receive { repeat }
+	[] T.timeout {
+		setverdict(fail, "Timeout RSL waiting for connection to close");
+		self.stop;
+		}
+	}
+}
+
+
 /***********************************************************************
  * "New world" test cases using RSL_Emulation + BSSMAP_Emulation
  ***********************************************************************/
@@ -1594,6 +1635,7 @@
 	execute( TC_paging_imsi_load() );
 
 	execute( TC_rsl_drop_counter() );
+	execute( TC_rsl_unknown_unit_id() );
 
 	execute( TC_classmark() );
 	execute( TC_unsol_ass_fail() );

-- 
To view, visit https://gerrit.osmocom.org/6406
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a947d7411a016e4d7650031396cae3575756453
Gerrit-PatchSet: 1
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling <ssperling at sysmocom.de>


More information about the gerrit-log mailing list