BTS: add test cases for Downlink and Uplink speech frames

Change-Id: I8d301dfa47c11d9314cdfca8adadcbcb4eee798d
This commit is contained in:
Vadim Yanitskiy 2021-07-04 04:15:58 +02:00 committed by laforge
parent dd228c4324
commit 18684881bd
1 changed files with 101 additions and 0 deletions

View File

@ -40,6 +40,7 @@ import from Osmocom_CTRL_Adapter all;
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 @@ testcase TC_speech_no_rtp_tchh() runs on test_CT {
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 @@ control {
execute( TC_speech_no_rtp_tchf() );
execute( TC_speech_no_rtp_tchh() );
execute( TC_speech_rtp_tchf() );
execute( TC_speech_rtp_tchh() );
}