msc: derive altsteps from f_expect_paging() and use them

Change-Id: Ia0e787fc376acec09e8985a63862872eb89b53a4
This commit is contained in:
Vadim Yanitskiy 2024-04-14 19:48:39 +07:00 committed by fixeria
parent eb81ca46dc
commit 53f2be6b4e
2 changed files with 54 additions and 41 deletions

View File

@ -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);

View File

@ -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);
[] as_paging() { setverdict(pass); }
[] as_paging_any() {
setverdict(fail, "Rx unexpected BSSMAP/RANAP Paging");
mtc.stop;
}
[not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) {
setverdict(pass);
}
/* 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);
[] as_paging() { setverdict(pass); }
[] as_paging_any() {
setverdict(fail, "Rx unexpected BSSMAP/RANAP Paging");
mtc.stop;
}
[not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) {
setverdict(pass);
}
/* 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);
[] as_paging() { setverdict(pass); }
[] as_paging_any() {
setverdict(fail, "Rx unexpected BSSMAP/RANAP Paging");
mtc.stop;
}
[not pars.ran_is_geran] BSSAP.receive(tr_RANAP_Paging(cs_domain, imsi_hex2oct(g_pars.imsi))) {
setverdict(pass);
}
/* 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");