pespin has uploaded this change for review. ( 
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(-)



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

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(?, ?)) {

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41784?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ibce780009389b2cd06d1a6d79afa77d8e58187bc
Gerrit-Change-Number: 41784
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>

Reply via email to