Change in osmo-bsc[master]: handover_test: Properly allocate MSC data struct.

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.org
Mon May 11 17:17:39 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/18189 )

Change subject: handover_test: Properly allocate MSC data struct.
......................................................................

handover_test: Properly allocate MSC data struct.

Without a properly allocated MSC struct, touching counters crashes
the test.

Change-Id: I7498d2891259be9b532845627f14ac75e98e703e
---
M tests/handover/handover_test.c
1 file changed, 1 insertion(+), 9 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c
index 0d98717..bdc18c3 100644
--- a/tests/handover/handover_test.c
+++ b/tests/handover/handover_test.c
@@ -217,19 +217,11 @@
 
 void create_conn(struct gsm_lchan *lchan)
 {
-	static struct bsc_msc_data fake_msc_data = {};
-	fake_msc_data.network = bsc_gsmnet;
 	static unsigned int next_imsi = 0;
 	char imsi[sizeof(lchan->conn->bsub->imsi)];
 	struct gsm_network *net = lchan->ts->trx->bts->network;
 	struct gsm_subscriber_connection *conn;
 	struct mgcp_client *fake_mgcp_client = (void*)talloc_zero(net, int);
-	uint8_t *amr_conf;
-
-	/* HACK: lchan_fsm.c requires some AMR codec rates to be enabled,
-	 * lets pretend that all AMR codec rates are allowed */
-	amr_conf = (uint8_t*) &fake_msc_data.amr_conf;
-        amr_conf[1] = 0xff;
 
 	conn = bsc_subscr_con_allocate(net);
 
@@ -239,7 +231,7 @@
 							   net->mgw.tdefs,
 							   "test",
 							   "fake endpoint");
-	conn->sccp.msc = &fake_msc_data;
+	conn->sccp.msc = osmo_msc_data_alloc(net, 0);
 
 	lchan->conn = conn;
 	conn->lchan = lchan;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/18189
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7498d2891259be9b532845627f14ac75e98e703e
Gerrit-Change-Number: 18189
Gerrit-PatchSet: 1
Gerrit-Owner: ipse <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: ipse <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: laforge <laforge at osmocom.org>
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/20200511/e66504fe/attachment.htm>


More information about the gerrit-log mailing list