Change in ...osmo-ttcn3-hacks[master]: bsc: Introduce test TC_ctrl_location

pespin gerrit-no-reply at lists.osmocom.org
Fri Jun 7 17:50:24 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14407


Change subject: bsc: Introduce test TC_ctrl_location
......................................................................

bsc: Introduce test TC_ctrl_location

Related: OS#2012
Change-Id: I3640f6889e3b6adc3b4601082f948543c64a2fe3
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M bsc/regen_makefile.sh
M library/Osmocom_CTRL_Adapter.ttcn
4 files changed, 34 insertions(+), 1 deletion(-)



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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index 518f9e1..030d367 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1204,6 +1204,29 @@
 	setverdict(pass);
 }
 
+/* Verify that Upon receival of SET "location", BSC forwards a TRAP
+  "location-state" over the SCCPlite IPA conn */
+private function f_tc_ctrl_location(charstring id) runs on MSC_ConnHdlr {
+	g_pars := f_gen_test_hdlr_pars();
+	log("Waiting for TRAP on MSC side");
+	f_ctrl_exp_trap(CTRL, "bts.0.location-state", "1234567,fix3d,0.340000,0.560000,0.780000,operational,unlocked,on,001,01");
+}
+
+testcase TC_ctrl_location() runs on test_CT {
+	var MSC_ConnHdlr vc_conn;
+	var integer bts_nr := 0;
+
+	f_init(1, true);
+	f_sleep(1.0);
+
+	vc_conn := f_start_handler(refers(f_tc_ctrl_location));
+
+	f_ctrl_set_bts(IPA_CTRL, bts_nr, "location", "1234567,fix3d,0.340000,0.560000,0.780000");
+
+	vc_conn.done;
+	setverdict(pass);
+}
+
 function f_bssap_tx_ud(template PDU_BSSAP bssap) runs on test_CT {
 	BSSAP.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, bssap));
 }
@@ -1688,6 +1711,7 @@
 	}
 	connect(vc_conn:BSSAP, g_bssap.vc_RAN:CLIENT);
 	connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT);
+	connect(vc_conn:CTRL, g_bssap.vc_RAN:CTRL_CLIENT);
 }
 
 function f_start_handler(void_fn fn, template (omit) TestHdlrParams pars := omit)
@@ -3987,6 +4011,9 @@
 	execute( TC_ctrl_msc_connection_status() );
 	execute( TC_ctrl_msc0_connection_status() );
 	execute( TC_ctrl() );
+	if (mp_bssap_cfg.transport == BSSAP_TRANSPORT_SCCPlite_SERVER) {
+		execute( TC_ctrl_location() );
+	}
 
 	/* RSL DCHAN Channel ACtivation / Deactivation */
 	execute( TC_chan_act_noreply() );
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index c7f6495..0efe080 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -19,6 +19,7 @@
 import from BSSAP_Types all;
 import from RAN_Emulation all;
 import from BSSMAP_Templates all;
+import from IPA_Emulation all;
 
 import from IPL4asp_Types all;
 import from Native_Functions all;
@@ -357,6 +358,8 @@
 	port RAN_PROC_PT RAN;
 	port TELNETasp_PT BSCVTY;
 
+	port IPA_CTRL_PT CTRL;
+
 	var MediaState g_media;
 	var TestHdlrParams g_pars;
 
diff --git a/bsc/regen_makefile.sh b/bsc/regen_makefile.sh
index 06fa812..389aaed 100755
--- a/bsc/regen_makefile.sh
+++ b/bsc/regen_makefile.sh
@@ -4,6 +4,6 @@
 
 FILES="*.ttcn *.ttcnpp IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc Native_FunctionDefs.cc TELNETasp_PT.cc *.c"
 
-export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_MGCP -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DUSE_MTP3_DISTRIBUTOR"
+export CPPFLAGS_TTCN3="-DIPA_EMULATION_RSL -DIPA_EMULATION_MGCP -DIPA_EMULATION_CTRL -DIPA_EMULATION_SCCP -DRAN_EMULATION_BSSAP -DRAN_EMULATION_MGCP -DRAN_EMULATION_CTRL -DUSE_MTP3_DISTRIBUTOR"
 
 ../regen-makefile.sh $MAIN $FILES
diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn
index 93e893f..08195c8 100644
--- a/library/Osmocom_CTRL_Adapter.ttcn
+++ b/library/Osmocom_CTRL_Adapter.ttcn
@@ -61,6 +61,9 @@
 function f_ctrl_get_bts(IPA_CTRL_PT pt, integer bts_nr, charstring suffix) return CtrlValue {
 	return f_ctrl_get(pt, "bts." & int2str(bts_nr) & "." & suffix);
 }
+function f_ctrl_set_bts(IPA_CTRL_PT pt, integer bts_nr, charstring suffix, CtrlValue val) {
+	f_ctrl_set(pt, "bts." & int2str(bts_nr) & "." & suffix, val);
+}
 
 template charstring ts_bts(integer bts_nr) := "bts." & int2str(bts_nr) & ".";
 template charstring ts_bts_trx(integer bts_nr, integer trx_nr ) :=

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/14407
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: I3640f6889e3b6adc3b4601082f948543c64a2fe3
Gerrit-Change-Number: 14407
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190607/328fb5fb/attachment.html>


More information about the gerrit-log mailing list