summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2020-10-19 20:19:14 +0200
committerlaforge <laforge@osmocom.org>2020-10-21 11:52:23 +0000
commit820b4746ebc542051cf788f2636e122c58798a8e (patch)
tree7a69975d6e98b8f7e9e4cf4f75dbd6739b527347
parent5fa8561b99f3f39a48f5e07535b5671fa2538769 (diff)
bts-lapdm: Introduce test TC_normal_reestablishment
-rw-r--r--bts/BTS_Tests_LAPDm.ttcn63
1 files changed, 63 insertions, 0 deletions
diff --git a/bts/BTS_Tests_LAPDm.ttcn b/bts/BTS_Tests_LAPDm.ttcn
index d16aa11..7f5017d 100644
--- a/bts/BTS_Tests_LAPDm.ttcn
+++ b/bts/BTS_Tests_LAPDm.ttcn
@@ -1330,6 +1330,68 @@ testcase TC_sabm_incorrect_c() runs on test_CT {
f_testmatrix_each_chan(pars, refers(f_TC_sabm_incorrect_c));
}
+/* Test procedure for normal reestablishment, as per:
+ * OS#4819
+ * 3GPP TS 44.006 8.4.1.2 "Normal establishment procedure"
+ * 3GPP TS 44.006 8.4.2.1 "General requirements"
+ * 3GPP TS 44.006 8.6.3 "Procedures for re-establishment"
+ * */
+private function f_TC_normal_reestablishment(charstring id) runs on ConnHdlr {
+ var RslLinkId link_id := valueof(ts_RslLinkID_DCCH(0))
+ var octetstring l3_mo := f_rnd_octstring(c_TS0406_MAX_L3_OCTETS);
+ var default d;
+ timer T := 3.0;
+ var boolean use_sacch := false;
+ var boolean received_estind := false;
+ var boolean received_ua := false;
+
+ fp_common_init();
+
+ /* some common altstep for meas res and other background noise */
+ d := activate(as_ignore_background(true));
+ RSL.clear;
+ LAPDM.clear;
+
+ f_establish_mo(link_id);
+
+ deactivate(d);
+
+ var LapdmDlState dls := valueof(t_init_LapdmDlState);
+ f_lapdm_transceive_mo(dls, link_id, l3_mo);
+
+ LAPDM.send(t_PH_DATA(link_id.sapi, use_sacch, ts_LAPDm_SABM(link_id.sapi, c_r:=cr_MO_CMD, p:=true, l3:=''O)));
+ T.start
+ alt {
+ [] LAPDM.receive(t_PH_DATA(?, use_sacch, tr_LAPDm_UA(link_id.sapi, cr_MT_RSP, f:=true, l3:=''O))) {
+ received_ua := true;
+ if (not received_estind) {
+ repeat;
+ }
+ }
+ [] RSL.receive(tr_RSL_EST_IND_NOL3(g_chan_nr, link_id)) {
+ received_estind := true;
+ if (not received_ua) {
+ repeat;
+ }
+ }
+ [] RSL.receive { repeat; }
+ [] LAPDM.receive { repeat; }
+ [] T.timeout { setverdict(fail, "Timeout waiting for UA"); }
+ }
+
+ /* Test we can still send data afterwards */
+ l3_mo := f_rnd_octstring(c_TS0406_MAX_L3_OCTETS);
+ dls := valueof(t_init_LapdmDlState);
+ f_lapdm_transceive_mo(dls, link_id, l3_mo);
+
+
+ fp_common_fini();
+}
+testcase TC_normal_reestablishment() runs on test_CT {
+ var ConnHdlrPars pars := valueof(t_Pars(t_RslChanNr_Bm(1), ts_RSL_ChanMode_SIGN));
+ f_testmatrix_each_chan(pars, refers(f_TC_normal_reestablishment));
+}
+
control {
execute(TC_sabm_ua_dcch_sapi0());
execute(TC_sabm_ua_dcch_sapi0_nopayload());
@@ -1352,6 +1414,7 @@ control {
execute(TC_rr_response_frame_loss());
execute(TC_incorrect_cr());
execute(TC_sabm_incorrect_c());
+ execute(TC_normal_reestablishment());
}
}