summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2019-05-11 02:29:38 +0200
committerAlexander Couzens <lynxis@fe80.eu>2019-05-11 02:52:42 +0200
commit2950b5d16685314354a56f0e62d7a7344c356bda (patch)
treecdda443dd06b0ecb3dcbf88c4b04036f8f818de8
parent7d66c9720f861d585f7f0e4d821fb583acfb679c (diff)
SGSN_Tests: check for superflous packets after receiving a DETACH ACCEPTlynxis/sgsn_power_off
When doing a normal DETACH the SGSN should not sent any further LLC frames to the MS. Change-Id: Id936a02a8afb0d687f69d3e365bc0d6718205737
-rw-r--r--sgsn/SGSN_Tests.ttcn18
1 files changed, 16 insertions, 2 deletions
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index cf82f65..b07f807 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -882,12 +882,14 @@ testcase TC_attach_rau() runs on test_CT {
/* general GPRS DETACH helper */
function f_detach_mo(BIT3 detach_type, boolean power_off, boolean expect_purge, integer bssgp_index := 0) runs on BSSGP_ConnHdlr {
var BssgpDecoded bd;
+ var boolean rx_detach_accept := false;
timer T := 5.0;
f_send_l3_gmm_llc(ts_GMM_DET_REQ_MO(detach_type, power_off), bssgp_index);
if (expect_purge) {
GSUP.receive(tr_GSUP_PURGE_MS_REQ(g_pars.imsi, OSMO_GSUP_CN_DOMAIN_PS));
GSUP.send(ts_GSUP_PURGE_MS_RES(g_pars.imsi));
}
+
T.start;
alt {
[not expect_purge] GSUP.receive(tr_GSUP_PURGE_MS_REQ(?)) {
@@ -905,17 +907,29 @@ function f_detach_mo(BIT3 detach_type, boolean power_off, boolean expect_purge,
mtc.stop;
}
[power_off] T.timeout {
+ g_pars.ra := omit;
setverdict(pass);
+ mtc.stop;
}
+ /* Normal GMM Detach - Don't stop after receiving the DETACH ACCEPT.
+ * Use a timeout to check for any superflous packets which could come after DETACH ACCEPT */
[not power_off] BSSGP[bssgp_index].receive(tr_BD_L3_MT(tr_GMM_DET_ACCEPT_MT)) -> value bd {
- g_pars.ra := omit;
- setverdict(pass);
+ if (not rx_detach_accept) {
+ g_pars.ra := omit;
+ setverdict(pass);
+ rx_detach_accept := true;
+ repeat;
+ } else {
+ setverdict(fail, "Doublicated DETACH ACCEPT received");
+ mtc.stop;
+ }
/* TODO: check if any PDP contexts are deactivated on network side? */
}
[not power_off] BSSGP[bssgp_index].receive(tr_BD_L3_MT(?)) -> value bd {
setverdict(fail, "Unexpected Layer 3 package received in normal DETACH");
mtc.stop;
}
+ [not power_off] T.timeout { /* stop */ }
[] BSSGP[bssgp_index].receive { repeat; }
}
}