pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41784?usp=email )
Change subject: bts: Validate no TIME.ind block gaps in TC_pcu_time_ind ......................................................................
bts: Validate no TIME.ind block gaps in TC_pcu_time_ind
Change-Id: Ibce780009389b2cd06d1a6d79afa77d8e58187bc --- M bts/BTS_Tests.ttcn 1 file changed, 17 insertions(+), 2 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index bf59eb8..1df5aa5 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -6056,6 +6056,13 @@ }
/* test for periodic TIME_IND; check number of FN expired and number of TIME_IND within frames */ +private function f_next_pcuif_time_ind_block(GsmFrameNumber fn) return GsmFrameNumber +{ + var uint32_t bn := ((fn mod 13) / 4) + 1; + fn := fn - (fn mod 13); + fn := fn + bn * 4 + bn / 3; + return fn mod GsmMaxFrameNumber; +} testcase TC_pcu_time_ind() runs on test_CT { var integer num_time_ind := 0; var integer first_fn, last_fn; @@ -6072,10 +6079,18 @@ alt { [] as_pcuif_msg(msg, tr_PCUIF_TIME_IND(0, ?)) { num_time_ind := num_time_ind + 1; - if (not isbound(first_fn)) { + if (isbound(first_fn)) { + var integer exp_fn := f_next_pcuif_time_ind_block(last_fn); + if (msg.u.time_ind.fn != exp_fn) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx TIME.ind for FN ", msg.u.time_ind.fn, + " vs exp ", exp_fn, " (last_fn " , last_fn, ")")); + } + last_fn := msg.u.time_ind.fn; + } else { first_fn := msg.u.time_ind.fn; + last_fn := msg.u.time_ind.fn; } - last_fn := msg.u.time_ind.fn; repeat; } [] as_pcuif_msg(msg, tr_PCUIF_TIME_IND(?, ?)) {