summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-02-03 11:30:57 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2016-02-04 15:52:19 +0100
commitba2ec4eee0ee6992d54899c754f3c24379b5d864 (patch)
tree9837e0d7474b063cf5335ce89722b8f657a820a5
parentd9bf602a2544362dd572419b45430cce38d875dc (diff)
tests/sgsn: Fix compilation of sgsn_test
The sgsn test still fails, but at least it is compiling again..
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c58
1 files changed, 40 insertions, 18 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 859223f7a..31abf17b5 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -102,6 +102,28 @@ int bssgp_tx_dl_ud(struct msgb *msg, uint16_t pdu_lifetime,
return 0;
}
+/* Stubs for IU functions */
+int gprs_iu_tx(struct msgb *msg, uint8_t sapi, void *mm)
+{
+ return -1;
+}
+
+int gprs_transp_upd_key(struct sgsn_mm_ctx *mm)
+{
+ return -1;
+}
+
+int gprs_iu_rab_act(struct sgsn_pdp_ctx *pdp)
+{
+ return -1;
+}
+
+int gprs_iu_rab_deact(struct sgsn_mm_ctx *mm)
+{
+ return -1;
+}
+
+
/* override, requires '-Wl,--wrap=sgsn_update_subscriber_data' */
void __real_sgsn_update_subscriber_data(struct sgsn_mm_ctx *);
void (*update_subscriber_data_cb)(struct sgsn_mm_ctx *) =
@@ -175,7 +197,7 @@ static struct sgsn_mm_ctx *alloc_mm_ctx(uint32_t tlli, struct gprs_ra_id *raid)
lle = gprs_lle_get_or_create(tlli, 3);
ctx = sgsn_mm_ctx_alloc(tlli, raid);
ctx->mm_state = GMM_REGISTERED_NORMAL;
- ctx->llme = lle->llme;
+ ctx->gb.llme = lle->llme;
ictx = sgsn_mm_ctx_by_tlli(tlli, raid);
OSMO_ASSERT(ictx == ctx);
@@ -195,7 +217,7 @@ static void send_0408_message(struct gprs_llc_llme *llme, uint32_t tlli,
msg = create_msg(data, data_len);
msgb_tlli(msg) = tlli;
- gsm0408_gprs_rcvmsg(msg, llme);
+ gsm0408_gprs_rcvmsg_gb(msg, llme);
msgb_free(msg);
}
@@ -733,7 +755,7 @@ static void test_gmm_detach(void)
ctx = alloc_mm_ctx(local_tlli, &raid);
/* inject the detach */
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
detach_req, ARRAY_SIZE(detach_req));
/* verify that a single message (hopefully the Detach Accept) has been
@@ -774,7 +796,7 @@ static void test_gmm_detach_power_off(void)
ctx = alloc_mm_ctx(local_tlli, &raid);
/* inject the detach */
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
detach_req, ARRAY_SIZE(detach_req));
/* verify that no message (and therefore no Detach Accept) has been
@@ -968,14 +990,14 @@ static void test_gmm_attach(int retry)
OSMO_ASSERT(sgsn_tx_counter == 1);
/* inject the identity response (IMEI) */
- send_0408_message(ctx->llme, foreign_tlli,
+ send_0408_message(ctx->gb.llme, foreign_tlli,
ident_resp_imei, ARRAY_SIZE(ident_resp_imei));
/* we expect an identity request (IMSI) */
OSMO_ASSERT(sgsn_tx_counter == 1);
/* inject the identity response (IMSI) */
- send_0408_message(ctx->llme, foreign_tlli,
+ send_0408_message(ctx->gb.llme, foreign_tlli,
ident_resp_imsi, ARRAY_SIZE(ident_resp_imsi));
/* check that the MM context has not been removed due to a failed
@@ -997,7 +1019,7 @@ retry_attach_req:
/* we got an auth & ciph request */
/* inject the auth & ciph response */
- send_0408_message(ctx->llme, foreign_tlli,
+ send_0408_message(ctx->gb.llme, foreign_tlli,
auth_ciph_resp, ARRAY_SIZE(auth_ciph_resp));
/* check that the MM context has not been removed due to a
@@ -1019,7 +1041,7 @@ retry_attach_req:
local_tlli = gprs_tmsi2tlli(ptmsi1, TLLI_LOCAL);
/* inject the attach complete */
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
attach_compl, ARRAY_SIZE(attach_compl));
OSMO_ASSERT(ctx->mm_state == GMM_REGISTERED_NORMAL);
@@ -1028,7 +1050,7 @@ retry_attach_req:
OSMO_ASSERT(sgsn_tx_counter == 0);
/* inject the detach */
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
detach_req, ARRAY_SIZE(detach_req));
/* verify that things are gone */
@@ -1556,14 +1578,14 @@ static void test_gmm_cancel(void)
OSMO_ASSERT(sgsn_tx_counter == 1);
/* inject the identity response (IMEI) */
- send_0408_message(ctx->llme, foreign_tlli,
+ send_0408_message(ctx->gb.llme, foreign_tlli,
ident_resp_imei, ARRAY_SIZE(ident_resp_imei));
/* we expect an identity request (IMSI) */
OSMO_ASSERT(sgsn_tx_counter == 1);
/* inject the identity response (IMSI) */
- send_0408_message(ctx->llme, foreign_tlli,
+ send_0408_message(ctx->gb.llme, foreign_tlli,
ident_resp_imsi, ARRAY_SIZE(ident_resp_imsi));
/* check that the MM context has not been removed due to a failed
@@ -1581,7 +1603,7 @@ static void test_gmm_cancel(void)
local_tlli = gprs_tmsi2tlli(ptmsi1, TLLI_LOCAL);
/* inject the attach complete */
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
attach_compl, ARRAY_SIZE(attach_compl));
OSMO_ASSERT(ctx->mm_state == GMM_REGISTERED_NORMAL);
@@ -1708,7 +1730,7 @@ static void test_gmm_ptmsi_allocation(void)
OSMO_ASSERT(sgsn_tx_counter == 1);
/* inject the identity response (IMEI) */
- send_0408_message(ctx->llme, foreign_tlli,
+ send_0408_message(ctx->gb.llme, foreign_tlli,
ident_resp_imei, ARRAY_SIZE(ident_resp_imei));
/* check that the MM context has not been removed due to a failed
@@ -1741,7 +1763,7 @@ static void test_gmm_ptmsi_allocation(void)
/* inject the attach complete */
local_tlli = gprs_tmsi2tlli(ptmsi1, TLLI_LOCAL);
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
attach_compl, ARRAY_SIZE(attach_compl));
/* we don't expect a response */
@@ -1754,7 +1776,7 @@ static void test_gmm_ptmsi_allocation(void)
printf(" - Repeated RA Update Request\n");
/* inject the RA update request */
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
ra_upd_req, ARRAY_SIZE(ra_upd_req));
/* we expect an RA update accept */
@@ -1767,7 +1789,7 @@ static void test_gmm_ptmsi_allocation(void)
ptmsi2 = ctx->p_tmsi;
/* repeat the RA update request */
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
ra_upd_req, ARRAY_SIZE(ra_upd_req));
/* we expect an RA update accept */
@@ -1781,7 +1803,7 @@ static void test_gmm_ptmsi_allocation(void)
/* inject the RA update complete */
local_tlli = gprs_tmsi2tlli(ptmsi2, TLLI_LOCAL);
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
ra_upd_complete, ARRAY_SIZE(ra_upd_complete));
/* we don't expect a response */
@@ -1792,7 +1814,7 @@ static void test_gmm_ptmsi_allocation(void)
OSMO_ASSERT(ctx->p_tmsi == ptmsi2);
/* inject the detach */
- send_0408_message(ctx->llme, local_tlli,
+ send_0408_message(ctx->gb.llme, local_tlli,
detach_req, ARRAY_SIZE(detach_req));
/* verify that things are gone */