fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36456?usp=email )

Change subject: msc: rework f_expect_paging(): handle mismatch and timeout
......................................................................

msc: rework f_expect_paging(): handle mismatch and timeout

When a received Paging mismatches, instead of waiting for Tguard
timeout, fail immediately.  Add a local timer and wait 4.0 seconds
by default.

Change-Id: I30273e3882e348a2ded88b7b96a5ec1473a56913
Tweaked-By: Vadim Yanitskiy <[email protected]>
---
M msc/BSC_ConnectionHandler.ttcn
1 file changed, 35 insertions(+), 7 deletions(-)

Approvals:
  Jenkins Builder: Verified
  neels: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve




diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn
index 75eb892..5714fbf 100644
--- a/msc/BSC_ConnectionHandler.ttcn
+++ b/msc/BSC_ConnectionHandler.ttcn
@@ -1357,18 +1357,32 @@
        log("f_mt_call_complete DONE");
 }

-function f_expect_paging_tmsi(template OCT4 tmsi := *)
+function f_expect_paging_tmsi(template OCT4 tmsi := *, float Tval := 4.0)
 runs on BSC_ConnHdlr {
-       if (g_pars.ran_is_geran) {
-               BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi, tmsi));
-       } else {
-               BSSAP.receive(tr_RANAP_Paging(cs_domain, 
imsi_hex2oct(g_pars.imsi)));
+       timer T;
+
+       T.start(Tval);
+       alt {
+       [g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi, 
tmsi));
+       [g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(?, *)) {
+               setverdict(fail, "Paging message doesn't match expectations");
+               mtc.stop;
+               }
+       [not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, 
imsi_hex2oct(g_pars.imsi)));
+       [not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(?, ?)) {
+               setverdict(fail, "Paging message doesn't match expectations");
+               mtc.stop;
+               }
+       [] T.timeout {
+               setverdict(fail, "Timeout waiting for paging");
+               mtc.stop;
+               }
        }
 }

-function f_expect_paging()
+function f_expect_paging(float Tval := 4.0)
 runs on BSC_ConnHdlr {
-       f_expect_paging_tmsi(g_pars.tmsi);
+       f_expect_paging_tmsi(g_pars.tmsi, Tval);
 }

 function f_mt_call_establish(inout CallParameters cpars)

--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/36456?usp=email
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: I30273e3882e348a2ded88b7b96a5ec1473a56913
Gerrit-Change-Number: 36456
Gerrit-PatchSet: 4
Gerrit-Owner: neels <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: neels <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to