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


Change subject: BSC_Tests_CBSP: add a new testcase TC_cbsp_write_rep_period_num
......................................................................

BSC_Tests_CBSP: add a new testcase TC_cbsp_write_rep_period_num

Change-Id: I169c482ea5de040df63db4c605ac9cae19f8d28f
Related: SYS#5905
---
M bsc/BSC_Tests_CBSP.ttcn
1 file changed, 56 insertions(+), 0 deletions(-)



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

diff --git a/bsc/BSC_Tests_CBSP.ttcn b/bsc/BSC_Tests_CBSP.ttcn
index 25f00d8..0d8fb38 100644
--- a/bsc/BSC_Tests_CBSP.ttcn
+++ b/bsc/BSC_Tests_CBSP.ttcn
@@ -696,6 +696,61 @@
        setverdict(pass);
 }

+/* Verify handling of the Repetition Period and the Number of Broadcasts */
+testcase TC_cbsp_write_rep_period_num() runs on cbsp_test_CT {
+       var CBSP_IE page := f_gen_page();
+       const integer rep_period := 2; /* units of 1.883s */
+       const integer rep_number := 5;
+       var integer msg_count := 0;
+       var float last_time := 0.0;
+       timer T;
+
+       g_pars := valueof(ts_CBSP_Pars_default(false, 9001, 9501));
+       f_init(guard_timeout := 60.0);
+
+       f_cbsp_write(g_cbsp_msg_id, g_cbsp_ser_no,
+                    cell_list := 
ts_BSSMAP_CIL_LAC_CI({bssmap_lac_ci(mp_cgi_bts0)}),
+                    rep_period := rep_period, num_bcast_req := rep_number,
+                    content := { page }, success_list := ?, fail_list := omit);
+
+       /* Count SMSCB messages during N=rep_number+2 repetition periods */
+       T.start(int2float(rep_period * (rep_number + 2)) * 1.883);
+       alt {
+       [] IPA_RSL[0].receive(tr_ASP_RSL_UD(f_page2rsl(page, g_cbsp_msg_id, 
g_cbsp_ser_no))) {
+               var float exp_period := int2float(rep_period) * 1.883;
+               var float calc_period := T.read - last_time;
+
+               log("Rx SMSCB message: count := ", msg_count + 1, ", ",
+                   "elapsed := ", T.read, "s, diff := ", calc_period, "s");
+
+               if (msg_count > 0) {
+                       /* Check the actual repetition period (+/- 0.5s) */
+                       var template float tr_exp_period := (exp_period - 0.5 
.. exp_period + 0.5);
+                       if (not match(calc_period, tr_exp_period)) {
+                               setverdict(fail, "Repetition period mismatch: ",
+                                          "calculated := ", calc_period, "s vs 
",
+                                          "expected := ", tr_exp_period, "s");
+                       }
+               }
+
+               msg_count := msg_count + 1;
+               last_time := T.read;
+               repeat;
+               }
+       [] T.timeout {
+               log("Received ", msg_count, " messages during ", last_time, 
"s");
+               }
+       }
+
+       if (msg_count != rep_number) {
+               setverdict(fail, "Received ", msg_count, " messages, ",
+                          "while we expected ", rep_number);
+       }
+
+       f_sleep(1.0);
+       setverdict(pass);
+}
+
 /* Replace a message that doesn't exist: failure */
 testcase TC_cbsp_replace_nonexist() runs on cbsp_test_CT {
        var CBSP_IEs pages := {f_gen_page()};
@@ -945,6 +1000,7 @@
        execute( TC_cbsp_write_lac() );

        execute( TC_cbsp_write_then_replace() );
+       execute( TC_cbsp_write_rep_period_num() );
        execute( TC_cbsp_replace_nonexist() );
        execute( TC_cbsp_write_too_many() );
        execute( TC_cbsp_kill_nonexist() );

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27605
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: I169c482ea5de040df63db4c605ac9cae19f8d28f
Gerrit-Change-Number: 27605
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange

Reply via email to