From 1adf0386d3880ab7d25925b1144163f58bbc1871 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Thu, 10 Dec 2020 16:04:06 +0100 Subject: [PATCH] handover_test: set a fake osmo_mgcpc_ep_ci pointer The handover_fsm activates voice on a target lchan only when the source lchan has an osmo_mgcpc_ep_ci pointer for the BTS side. Since that struct is opaque, set a fake pointer and override the osmo_mgcpc_ep_ci_name() function so that the pointer is never dereferenced. This more accurately models the RTP stream setup events during handover. Change-Id: Ibc22001bf9e9874dd3f44f0acac8b6a4c1069aa7 --- tests/handover/handover_test.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index 92d25da4e..cbe0cf37e 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -381,6 +381,8 @@ struct gsm_lchan *lchan_act(struct gsm_lchan *lchan, int full_rate, const char * lchan->fi->state = LCHAN_ST_ESTABLISHED; lchan->ts->fi->state = TS_ST_IN_USE; lchan->type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H; + /* Fake osmo_mgcpc_ep_ci to indicate that the lchan is used for voice */ + lchan->mgw_endpoint_ci_bts = (void*)1; if (lchan->ts->pchan_on_init == GSM_PCHAN_TCH_F_TCH_H_PDCH) lchan->ts->pchan_is = full_rate ? GSM_PCHAN_TCH_F : GSM_PCHAN_TCH_H; @@ -1346,3 +1348,11 @@ void osmo_bsc_sigtran_tx_reset_ack(void) {} void osmo_bsc_sigtran_reset(void) {} void bssmap_reset_alloc(void) {} void bssmap_reset_is_conn_ready(void) {} +const char *osmo_mgcpc_ep_name(const struct osmo_mgcpc_ep *ep) +{ + return "fake-ep"; +} +const char *osmo_mgcpc_ep_ci_name(const struct osmo_mgcpc_ep_ci *ci) +{ + return "fake-ci"; +}