Change in osmo-ttcn3-hacks[master]: bts: Add TC_pcu_rts_req() to verify PCUIF_RTS_REQ

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat May 25 12:58:36 UTC 2019


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/14182


Change subject: bts: Add TC_pcu_rts_req() to verify PCUIF_RTS_REQ
......................................................................

bts: Add TC_pcu_rts_req() to verify PCUIF_RTS_REQ

This new test verifies that the expected amount of PCUIF_RTS_REQ are
observed on the PCU Interface for both PTCCH and PDTCH.

Change-Id: Ic27cdd4f4adf11f871b84bd72692a03280274fe2
Related: OS#4023
---
M bts/BTS_Tests.ttcn
1 file changed, 74 insertions(+), 0 deletions(-)



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

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index c89eeb1..12e1a3a 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -3595,6 +3595,79 @@
 	setverdict(pass);
 }
 
+/* test for periodic RTS_REQ; check number of FN expired and number of RTS_IND per SAPI */
+testcase TC_pcu_rts_req() runs on test_CT {
+	var PCUIF_send_data pcu_sd;
+	var integer first_fn, last_fn;
+	var integer num_rts_pdtch := 0;
+	var integer num_rts_ptcch := 0;
+	var float test_duration := 5.0;
+	timer T;
+
+	f_init_pcu_test();
+	f_TC_pcu_act_req(0, 0, 7, true);
+
+	PCU.clear;
+	T.start(test_duration);
+	alt {
+	[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(0, 0, 7, PCU_IF_SAPI_PDTCH, ?, ?)))
+			-> value pcu_sd {
+		num_rts_pdtch := num_rts_pdtch + 1;
+		if (not isbound(first_fn)) {
+			first_fn := pcu_sd.data.u.rts_req.fn;
+		}
+		last_fn := pcu_sd.data.u.rts_req.fn;
+		repeat;
+		}
+	[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ(0, 0, 7, PCU_IF_SAPI_PTCCH, ?, ?)))
+			-> value pcu_sd {
+		num_rts_ptcch := num_rts_ptcch + 1;
+		if (not isbound(first_fn)) {
+			first_fn := pcu_sd.data.u.rts_req.fn;
+		}
+		last_fn := pcu_sd.data.u.rts_req.fn;
+		repeat;
+		}
+	[] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_RTS_REQ)) -> value pcu_sd {
+		setverdict(fail, "Received unexpected PCUIF_RTS_REQ: ", pcu_sd.data);
+		repeat;
+		}
+	[] PCU.receive {
+		repeat;
+		}
+	[] T.timeout {}
+	}
+	var integer fn_expired := last_fn - first_fn;
+	log(fn_expired, " fn expired with num_rts_pdtch=", num_rts_pdtch,
+		", num_rts_ptcch=", num_rts_ptcch);
+
+	/* verify the number of frames expired matches our expectation */
+	const float c_GSM_FN_DURATION_MS := 4.61538;
+	var float fn_expected := test_duration * 1000.0 / c_GSM_FN_DURATION_MS;
+	var template integer t_fn_expected := f_tolerance(float2int(fn_expected), 1, 100000, 10);
+	if (not match(fn_expired, t_fn_expected)) {
+		setverdict(fail, "Number of TDMA Frames (", fn_expired, ") not matching ", t_fn_expected);
+	}
+
+	/* PTCCH is in pos. 12 + 38 of 52-multiframe, but four slots/bursts required per block */
+	var float ptcch_expected := int2float(fn_expired) / 52.0 * 0.5;
+	var template integer t_ptcch_exp := f_tolerance(float2int(ptcch_expected), 1, 100000, 1);
+	if (not match(num_rts_ptcch, t_ptcch_exp)) {
+		setverdict(fail, "Number of RTS.ind for PTCCH (", num_rts_ptcch, ") not matching ",
+				t_ptcch_exp);
+	}
+
+	/* We have 12 PDTCH blocks every 52-multiframe */
+	var float pdtch_expected := int2float(fn_expired) / 52.0 * 12.0;
+	var template integer t_pdtch_exp := f_tolerance(float2int(pdtch_expected), 1, 100000, 2);
+	if (not match(num_rts_pdtch, t_pdtch_exp)) {
+		setverdict(fail, "Number of RTS.ind for PDTCH (", num_rts_pdtch, ") not matching ",
+				t_pdtch_exp);
+	}
+
+	setverdict(pass);
+}
+
 /* test for generating Abis side OML ALERT from the PCU */
 testcase TC_pcu_oml_alert() runs on test_CT {
 	var PCUIF_send_data pcu_sd;
@@ -4921,6 +4994,7 @@
 		execute( TC_pcu_ext_rach_content() );
 		execute( TC_pcu_paging_from_rsl() );
 		execute( TC_pcu_time_ind() );
+		execute( TC_pcu_rts_req() );
 		execute( TC_pcu_oml_alert() );
 	} else {
 		log("PCU socket path not available, skipping PCU tests");

-- 
To view, visit https://gerrit.osmocom.org/14182
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: Ic27cdd4f4adf11f871b84bd72692a03280274fe2
Gerrit-Change-Number: 14182
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190525/e0199471/attachment.htm>


More information about the gerrit-log mailing list