diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 533f65df6..beea20a75 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -6707,12 +6707,9 @@ testcase TC_lapdm_selftest() runs on test_CT { ***********************************************************************/ private function f_test_l2_fill_frames(boolean dtxd) runs on ConnHdlr { var L1ctlDlMessage dl; - var octetstring l2_fill_frame := '0303012B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B'O; - var octetstring l2_fill_frame_sacch := substr(l2_fill_frame, 0, lengthof(l2_fill_frame) - 2); var GsmFrameNumber first_fn; var boolean is_first_frame := true; - var integer nfill_frames_sacch := 0; - var integer nfill_frames_nonsacch := 0; + var integer nfill_frames := 0; var integer expected_fill_frames := 10000; /* initial value causes test failure if not overridden */ /* Frames numbers (mod 104) for which a fill frame is expected on TCHF if DTX is enabled. */ var Integers required_tdma_frames_dtx_tchf := { 52, 53, 54, 55, 56, 57, 58, 59 }; @@ -6730,26 +6727,21 @@ private function f_test_l2_fill_frames(boolean dtxd) runs on ConnHdlr { /* activate TCHF signalling channel */ f_est_dchan(false); + /* A template for matching dummy LAPDm func=UA frames */ + var template L1ctlDlMessage tr_fill_frame := tr_L1CTL_DATA_IND( + chan_nr := g_chan_nr, link_id := tr_RslLinkID_DCCH(?), + l2_data := f_pad_oct('030301'O, 23, '2B'O)); + T.start; alt { - [] L1CTL.receive(tr_L1CTL_DATA_IND(g_chan_nr, ?)) -> value dl { + [] L1CTL.receive(tr_fill_frame) -> value dl { var GsmFrameNumber fn := dl.dl_info.frame_nr; - var octetstring l2 := dl.payload.data_ind.payload; if (is_first_frame) { is_first_frame := false; first_fn := dl.dl_info.frame_nr; } - if (dl.dl_info.link_id.c == SACCH) { - l2 := substr(l2, 2, lengthof(l2) - 2); /* remove L1 header */ - if (not match(l2_fill_frame_sacch, l2)) { - repeat; - } - } else if (not match(l2_fill_frame, l2)) { - repeat; - } - if (dtxd) { if (not match(g_chan_nr, t_RslChanNr_Bm(?))) { T.stop; @@ -6762,29 +6754,24 @@ private function f_test_l2_fill_frames(boolean dtxd) runs on ConnHdlr { f_rsl_chan_deact(); f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr); - /* With DTX enabled we can expect at least 3 fill frames for every 104 frames. - * 2 SACCH, 1 TCH/F */ - expected_fill_frames := 3; + /* With DTX enabled we can expect at least 3 fill frames for every 104 frames. */ + expected_fill_frames := 2; - if (nfill_frames_sacch + nfill_frames_nonsacch < expected_fill_frames) { - log("received only ", nfill_frames_sacch, "+", nfill_frames_nonsacch, - " (SACCH+other) out of ", expected_fill_frames, " expected fill frames"); + if (nfill_frames < expected_fill_frames) { + log("received only ", nfill_frames, " out of ", + expected_fill_frames, " expected fill frames"); Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Not enough fill frames received"); } else { setverdict(pass); } } else { - if (dl.dl_info.link_id.c == SACCH) { - nfill_frames_sacch := nfill_frames_sacch + 1; - repeat; - } /* On DTX TCH/F channels, fill frames occur only for specific frame numbers mod 104. * Furthermore, the L1SAP layer gives us frame numbers for the start of a block so * we should only see the subset of frames numbers which correspond to a block boundary. * TCH/F blocks are defined to start at 0,4,8,13,17,21 (modulo 26) */ for (var integer i := 0; i < lengthof(required_tdma_blocks_dtx_tchf); i := i + 1) { if (fn mod frame_dtx_tchf_mod == required_tdma_blocks_dtx_tchf[i]) { - nfill_frames_nonsacch := nfill_frames_nonsacch + 1; + nfill_frames := nfill_frames + 1; repeat; } } @@ -6796,22 +6783,18 @@ private function f_test_l2_fill_frames(boolean dtxd) runs on ConnHdlr { Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Unexpected L2 fill frame received on Um"); } } else { - if (dl.dl_info.link_id.c == SACCH) { - nfill_frames_sacch := nfill_frames_sacch + 1; - } else { - nfill_frames_nonsacch := nfill_frames_nonsacch + 1; - } + nfill_frames := nfill_frames + 1; if (fn > first_fn + frame_dtx_tchf_mod) { T.stop; select (g_chan_nr) { - /* TCH/F: we expect 25 fill frames (24 FACCH + 1 SACCH) for every 104 frames. */ - case (t_RslChanNr_Bm(?)) { expected_fill_frames := 25; } + /* TCH/F: we expect 24 fill frames for every 104 frames. */ + case (t_RslChanNr_Bm(?)) { expected_fill_frames := 24; } /* TCH/H: we expect 2 fill frames for every 104 frames. */ case (t_RslChanNr_Lm(?, ?)) { expected_fill_frames := 2; } /* SDCCH: we expect 5 fill frames for every 104 frames. */ - case (t_RslChanNr_SDCCH4(?, ?)) { expected_fill_frames := 5; } - case (t_RslChanNr_SDCCH8(?, ?)) { expected_fill_frames := 5; } + case (t_RslChanNr_SDCCH4(?, ?)) { expected_fill_frames := 4; } + case (t_RslChanNr_SDCCH8(?, ?)) { expected_fill_frames := 4; } case else { /* This shall not happen, just to be sure */ Misc_Helpers.f_shutdown(__BFILE__, __LINE__); @@ -6821,11 +6804,11 @@ private function f_test_l2_fill_frames(boolean dtxd) runs on ConnHdlr { f_rsl_chan_deact(); f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr); - if (nfill_frames_sacch + nfill_frames_nonsacch >= expected_fill_frames) { + if (nfill_frames >= expected_fill_frames) { setverdict(pass); } else { - log("received only ", nfill_frames_sacch, "+", nfill_frames_nonsacch, - " (SACCH+other) out of ", expected_fill_frames, " expected fill frames"); + log("received only ", nfill_frames, " out of ", + expected_fill_frames, " expected fill frames"); Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "Not enough fill frames received"); } } else {