aboutsummaryrefslogtreecommitdiffstats
path: root/bts
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-25 09:03:15 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-25 09:06:27 +0200
commitd66c9b8d1312c71fafd94c25f21f8eab59677ce7 (patch)
tree6e47ba16b8e08f9ff85490d45596e490c41942ea /bts
parent3453ab48d6428ee83ed4131c74993e40f3d7061b (diff)
bts: Add Test for receiving PCUIF_TIME_IND on BTS PCU interface
Diffstat (limited to 'bts')
-rw-r--r--bts/BTS_Tests.ttcn56
1 files changed, 55 insertions, 1 deletions
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 27ed81cc..a879f758 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -3538,6 +3538,60 @@ testcase TC_pcu_paging_from_rsl() runs on test_CT {
setverdict(pass);
}
+/* test for periodic TIME_IND; check number of FN expired and number of TIME_IND within frames */
+testcase TC_pcu_time_ind() runs on test_CT {
+ var PCUIF_send_data pcu_sd;
+ var integer num_time_ind := 0;
+ var integer first_fn, last_fn;
+ 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_TIME_IND(0, ?))) -> value pcu_sd {
+ num_time_ind := num_time_ind + 1;
+ if (not isbound(first_fn)) {
+ first_fn := pcu_sd.data.u.time_ind.fn;
+ }
+ last_fn := pcu_sd.data.u.time_ind.fn;
+ repeat;
+ }
+ [] PCU.receive(t_SD_PCUIF(g_pcu_conn_id, tr_PCUIF_TIME_IND(?, ?))) -> value pcu_sd {
+ setverdict(fail, "Received unexpected PCUIF_TIME_IND: ", pcu_sd.data);
+ repeat;
+ }
+ [] PCU.receive {
+ repeat;
+ }
+ [] T.timeout {}
+ }
+ var integer fn_expired := last_fn - first_fn;
+ log(fn_expired, " fn expired with ", num_time_ind, " PCU_TIME.ind");
+
+ /* 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);
+ }
+
+ /* There are three TIME.ind in every fn MOD 13 */
+ var float time_ind_expected := int2float(fn_expired) * 3.0 / 13.0;
+ /* Add some tolerance */
+ var template integer t_time_ind_exp := f_tolerance(float2int(time_ind_expected), 1, 100000, 5);
+ if (not match(num_time_ind, t_time_ind_exp)) {
+ setverdict(fail, "Number of TIME.ind (", num_time_ind, ") not matching ", t_time_ind_exp);
+ }
+
+ setverdict(pass);
+}
+
+
/***********************************************************************
* Osmocom Style Dynamic Timeslot Support
***********************************************************************/
@@ -4766,7 +4820,6 @@ testcase TC_chopped_ipa_payload() runs on test_CT {
* error handling
** IE duplicated?
* PCU interface
-** TIME_IND from BTS->PCU
** DATA_IND from BTS->PCU
** verification of PCU-originated DATA_REQ arrival on Um/MS side
@@ -4839,6 +4892,7 @@ control {
execute( TC_pcu_rach_content() );
execute( TC_pcu_ext_rach_content() );
execute( TC_pcu_paging_from_rsl() );
+ execute( TC_pcu_time_ind() );
} else {
log("PCU socket path not available, skipping PCU tests");
}