diff options
author | Vadim Yanitskiy <vyanitskiy@sysmocom.de> | 2024-04-14 19:48:39 +0700 |
---|---|---|
committer | fixeria <vyanitskiy@sysmocom.de> | 2024-04-15 15:18:28 +0000 |
commit | 53f2be6b4e4e62bd7f4a6c8fc332fc570aa631c2 (patch) | |
tree | 86fa8f9a50b58eea8809d9f02191e275f13a4c0e | |
parent | eb81ca46dc0b187fda46e4070a88966d1adcc68a (diff) |
msc: derive altsteps from f_expect_paging() and use them
Change-Id: Ia0e787fc376acec09e8985a63862872eb89b53a4
-rw-r--r-- | msc/BSC_ConnectionHandler.ttcn | 33 | ||||
-rw-r--r-- | msc/MSC_Tests.ttcn | 62 |
2 files changed, 54 insertions, 41 deletions
diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index 5714fbf0..a9799536 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -1357,19 +1357,37 @@ runs on BSC_ConnHdlr { log("f_mt_call_complete DONE"); } +/* expect BSSMAP/RANAP Paging for any IMSI and/or TMSI */ +altstep as_paging_any() +runs on BSC_ConnHdlr { + [g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(?, *)); + [not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(?, ?)); +} + +/* expect BSSMAP/RANAP Paging for registered IMSI and the given TMSI */ +altstep as_paging_tmsi(template OCT4 tmsi := *) +runs on BSC_ConnHdlr { + [g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi, tmsi)); + [not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))); +} + +/* convenience wrapper for as_paging_tmsi() using g_pars.tmsi */ +altstep as_paging() +runs on BSC_ConnHdlr { + [] as_paging_tmsi(g_pars.tmsi); +} + +/* expect BSSMAP/RANAP Paging for registered IMSI and the given TMSI + * fail on BSSMAP/RANAP Paging for non-matching IMSI/TMSI + * wait up to Tval seconds before declaring timeout */ function f_expect_paging_tmsi(template OCT4 tmsi := *, float Tval := 4.0) runs on BSC_ConnHdlr { 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(?, ?)) { + [] as_paging_tmsi(tmsi) { setverdict(pass); } + [] as_paging_any() { setverdict(fail, "Paging message doesn't match expectations"); mtc.stop; } @@ -1380,6 +1398,7 @@ runs on BSC_ConnHdlr { } } +/* convenience wrapper for f_expect_paging_tmsi() using g_pars.tmsi */ function f_expect_paging(float Tval := 4.0) runs on BSC_ConnHdlr { f_expect_paging_tmsi(g_pars.tmsi, Tval); diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 513e3465..3effd524 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -2540,11 +2540,7 @@ friend function f_tc_lu_and_mt_sms_paging_and_nothing(charstring id, BSC_ConnHdl timer T := 20.0; T.start alt { - [pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { - setverdict(fail, "paging seems not to stop!"); - mtc.stop; - } - [not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) { + [] as_paging_any() { setverdict(fail, "paging seems not to stop!"); mtc.stop; } @@ -2597,13 +2593,18 @@ friend function f_tc_lu_and_mt_sms_paging_repeated(charstring id, BSC_ConnHdlrPa timer T := 5.0; T.start; alt { - [g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { - setverdict(fail, "GERAN should not repeat Paging, but received a second Paging"); - mtc.stop; + [] as_paging() { + if (g_pars.ran_is_geran) { + setverdict(fail, "GERAN should not repeat Paging, but received a second Paging"); + mtc.stop; + } else { + log("UTRAN: second Paging received, as expected"); + setverdict(pass); } - [not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) { - log("UTRAN: second Paging received, as expected"); - setverdict(pass); + } + [] as_paging_any() { + setverdict(fail, "Rx unexpected BSSMAP/RANAP Paging"); + mtc.stop; } [] T.timeout { if (g_pars.ran_is_geran) { @@ -3578,13 +3579,11 @@ runs on BSC_ConnHdlr { GSUP.send(gsup_req); T.start; alt { - [pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { - setverdict(pass); - } - [not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) { - setverdict(pass); + [] as_paging() { setverdict(pass); } + [] as_paging_any() { + setverdict(fail, "Rx unexpected BSSMAP/RANAP Paging"); + mtc.stop; } - /* We don't expect anything else */ [] as_unexp_gsup_or_bssap_msg(); [] T.timeout { setverdict(fail, "Timeout waiting for Paging Request"); @@ -4193,13 +4192,11 @@ runs on BSC_ConnHdlr { /* Send it to MSC and expect Paging Request */ TP.start; alt { - [pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { - setverdict(pass); - } - [not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) { - setverdict(pass); + [] as_paging() { setverdict(pass); } + [] as_paging_any() { + setverdict(fail, "Rx unexpected BSSMAP/RANAP Paging"); + mtc.stop; } - /* We don't expect anything else */ [] as_unexp_gsup_or_bssap_msg(); [] TP.timeout { setverdict(fail, "Timeout waiting for Paging Request"); @@ -4267,13 +4264,11 @@ runs on BSC_ConnHdlr { /* Expect Paging Request */ TP.start; alt { - [pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)) { - setverdict(pass); - } - [not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) { - setverdict(pass); + [] as_paging() { setverdict(pass); } + [] as_paging_any() { + setverdict(fail, "Rx unexpected BSSMAP/RANAP Paging"); + mtc.stop; } - /* We don't expect anything else */ [] as_unexp_gsup_or_bssap_msg(); [] TP.timeout { setverdict(fail, "Timeout waiting for Paging Request"); @@ -4592,11 +4587,10 @@ private function f_sgsap_bssmap_screening() runs on BSC_ConnHdlr { f_vty_transceive(MSCVTY, "subscriber imsi " & hex2str(g_pars.imsi) & " paging"); alt { - [g_pars.ran_is_geran] BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); { - setverdict(pass); - } - [not g_pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) { - setverdict(pass); + [] as_paging() { setverdict(pass); } + [] as_paging_any() { + setverdict(fail, "Rx unexpected BSSMAP/RANAP Paging"); + mtc.stop; } [] SGsAP.receive { setverdict(fail, "Received unexpected message on SGs"); |