This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24843 ) Change subject: BTS: add test cases for Downlink and Uplink speech frames ...................................................................... BTS: add test cases for Downlink and Uplink speech frames Change-Id: I8d301dfa47c11d9314cdfca8adadcbcb4eee798d --- M bts/BTS_Tests.ttcn 1 file changed, 101 insertions(+), 0 deletions(-) Approvals: laforge: Looks good to me, approved neels: Looks good to me, but someone else must approve pespin: Looks good to me, but someone else must approve Jenkins Builder: Verified diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn index 38490a0..61c40d4 100644 --- a/bts/BTS_Tests.ttcn +++ b/bts/BTS_Tests.ttcn @@ -40,6 +40,7 @@ import from Osmocom_CTRL_Functions all; import from RSL_Types all; +import from RTP_Types all; import from IPA_Types all; import from IPA_Emulation all; import from IPA_Testing all; @@ -7592,6 +7593,104 @@ vc_conn.done; } +/* Verify handling of Downlink and Uplink speech frames */ +private function f_TC_speech_rtp(charstring id) runs on ConnHdlr { + var L1ctlDlMessage l1_dl; + var PDU_RTP rtp_pdu; + var octetstring pl; + timer Td, Tu; + + f_l1_tune(L1CTL); + f_est_dchan(); + + /* Activate the RTP emulation */ + pl := f_rnd_octstring(6); + f_rtpem_activate(pl); + + /* Give the scheduler some time to fill up the buffers */ + f_sleep(2.0); + L1CTL.clear; + RSL.clear; + + /* Make sure that Downlink frames are received at the UE */ + Td.start(2.0); + alt { + [] L1CTL.receive(tr_L1CTL_TRAFFIC_IND(g_chan_nr, frame := pl)) -> value l1_dl { + log("TCH received: ", l1_dl.payload.traffic_ind.data); + L1CTL.send(ts_L1CTL_TRAFFIC_REQ(g_chan_nr, l1_dl.dl_info.link_id, + l1_dl.payload.traffic_ind.data)); + setverdict(pass); + } + [] L1CTL.receive(tr_L1CTL_TRAFFIC_IND(g_chan_nr, frame := ?)) -> value l1_dl { + setverdict(fail, "Rx unexpected Downlink speech frame ", + "(", l1_dl.payload.traffic_ind.data, ") ", + "expected (", pl, ")"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + [] as_l1_sacch(); + [] L1CTL.receive { repeat; } + [] Td.timeout { + setverdict(fail, "Timeout waiting for Downlink speech frames"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + } + + /* Make sure that Uplink frames are received at the BTS */ + RTPEM_DATA.clear; + Tu.start(2.0); + alt { + [] RTPEM_DATA.receive(PDU_RTP:?) -> value rtp_pdu { + if (rtp_pdu.data != pl) + { repeat; } + } + [] RTPEM_DATA.receive { repeat; } + [] Tu.timeout { + setverdict(fail, "Timeout waiting for Uplink speech frames"); + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); + } + } + + f_rtpem_mode(RTPEM_CTRL, RTPEM_MODE_NONE); + f_L1CTL_DM_REL_REQ(L1CTL, g_chan_nr); + f_rsl_chan_deact(); + f_rslem_unregister(0, g_chan_nr); +} +testcase TC_speech_rtp_tchf() runs on test_CT { + var ConnHdlr vc_conn; + var ConnHdlrPars pars; + + f_init(); + + /* TS1, TCH/F, V1 (FR codec) */ + pars := valueof(t_Pars(ts_RslChanNr_Bm(1), ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM1))); + vc_conn := f_start_handler(refers(f_TC_speech_rtp), pars); + vc_conn.done; + + /* TS1, TCH/F, V2 (EFR codec) */ + pars := valueof(t_Pars(ts_RslChanNr_Bm(1), ts_RSL_ChanMode(RSL_CHRT_TCH_F, RSL_CMOD_SP_GSM2))); + vc_conn := f_start_handler(refers(f_TC_speech_rtp), pars); + vc_conn.done; + + /* TODO: also test V3 (AMR codec) */ + + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); +} +testcase TC_speech_rtp_tchh() runs on test_CT { + var ConnHdlr vc_conn; + var ConnHdlrPars pars; + + f_init(); + + /* TS5, TCH/H0, V1 (HR codec) */ + pars := valueof(t_Pars(ts_RslChanNr_Lm(5, 0), ts_RSL_ChanMode(RSL_CHRT_TCH_H, RSL_CMOD_SP_GSM1))); + vc_conn := f_start_handler(refers(f_TC_speech_rtp), pars); + vc_conn.done; + + /* TODO: also test V3 (AMR codec) */ + + Misc_Helpers.f_shutdown(__BFILE__, __LINE__); +} + /* test generation of RLL ERR IND based on Um errors (TS 48.058 3.9) */ /* protocol error as per 44.006 */ /* link layer failure (repetition of I-frame N200 times without ACK */ @@ -7788,6 +7887,8 @@ execute( TC_speech_no_rtp_tchf() ); execute( TC_speech_no_rtp_tchh() ); + execute( TC_speech_rtp_tchf() ); + execute( TC_speech_rtp_tchh() ); } -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/24843 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I8d301dfa47c11d9314cdfca8adadcbcb4eee798d Gerrit-Change-Number: 24843 Gerrit-PatchSet: 4 Gerrit-Owner: fixeria <vyanitskiy at sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier at sysmocom.de> Gerrit-Reviewer: laforge <laforge at osmocom.org> Gerrit-Reviewer: neels <nhofmeyr at sysmocom.de> Gerrit-Reviewer: pespin <pespin at sysmocom.de> Gerrit-MessageType: merged -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210716/61716710/attachment.htm>