aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2018-09-16 07:53:41 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-30 18:30:36 +0100
commitf4b2c4ca42cc530c38c9ac6f275e4d7da9315fa2 (patch)
tree0ef36d99c3cff24358083e4cccddb2ddfd54c2b3 /tests
parent73b2bf321575abe7ea31dedb1c061db430dfd95a (diff)
Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlr
osmo-hlr has recently (as of Change-Id Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library implementation of libosmo-gsup-client. We can remove the local implementation in osmo-sgsn and use the system-installed shared library instead. Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69
Diffstat (limited to 'tests')
-rw-r--r--tests/sgsn/Makefile.am5
-rw-r--r--tests/sgsn/sgsn_test.c22
2 files changed, 14 insertions, 13 deletions
diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am
index 0eb2100..956ef8d 100644
--- a/tests/sgsn/Makefile.am
+++ b/tests/sgsn/Makefile.am
@@ -9,6 +9,7 @@ AM_CFLAGS = \
$(LIBOSMOCORE_CFLAGS) \
$(LIBOSMOABIS_CFLAGS) \
$(LIBOSMOGSM_CFLAGS) \
+ $(LIBOSMOGSUPCLIENT_CFLAGS) \
$(LIBCARES_CFLAGS) \
$(LIBGTP_CFLAGS) \
$(NULL)
@@ -37,7 +38,7 @@ sgsn_test_LDFLAGS = \
-Wl,--wrap=sgsn_update_subscriber_data \
-Wl,--wrap=gprs_subscr_request_update_location \
-Wl,--wrap=gprs_subscr_request_auth_info \
- -Wl,--wrap=gsup_client_send \
+ -Wl,--wrap=osmo_gsup_client_send \
$(NULL)
sgsn_test_LDADD = \
@@ -62,11 +63,11 @@ sgsn_test_LDADD = \
$(top_builddir)/src/gprs/gprs_sndcp_pcomp.o \
$(top_builddir)/src/gprs/v42bis.o \
$(top_builddir)/src/gprs/gprs_sndcp_dcomp.o \
- $(top_builddir)/src/gprs/gsup_client.o \
$(LIBOSMOABIS_LIBS) \
$(LIBOSMOCORE_LIBS) \
$(LIBOSMOGSM_LIBS) \
$(LIBOSMOGB_LIBS) \
+ $(LIBOSMOGSUPCLIENT_LIBS) \
$(LIBCARES_LIBS) \
$(LIBGTP_LIBS) \
-lrt \
diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c
index 214d07b..111515e 100644
--- a/tests/sgsn/sgsn_test.c
+++ b/tests/sgsn/sgsn_test.c
@@ -25,7 +25,7 @@
#include <osmocom/sgsn/debug.h>
#include <osmocom/sgsn/gprs_subscriber.h>
#include <osmocom/gsm/gsup.h>
-#include <osmocom/sgsn/gsup_client.h>
+#include <osmocom/gsupclient/gsup_client.h>
#include <osmocom/sgsn/gprs_utils.h>
#include <osmocom/sgsn/gprs_gb_parse.h>
@@ -148,13 +148,13 @@ int __wrap_gprs_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_
};
/* override, requires '-Wl,--wrap=gsup_client_send' */
-int __real_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg);
-int (*gsup_client_send_cb)(struct gsup_client *gsupc, struct msgb *msg) =
- &__real_gsup_client_send;
+int __real_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg);
+int (*osmo_gsup_client_send_cb)(struct osmo_gsup_client *gsupc, struct msgb *msg) =
+ &__real_osmo_gsup_client_send;
-int __wrap_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg)
+int __wrap_osmo_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg)
{
- return (*gsup_client_send_cb)(gsupc, msg);
+ return (*osmo_gsup_client_send_cb)(gsupc, msg);
};
static int count(struct llist_head *head)
@@ -729,7 +729,7 @@ static void test_subscriber_gsup(void)
cleanup_test();
}
-int my_gsup_client_send_dummy(struct gsup_client *gsupc, struct msgb *msg)
+int my_gsup_client_send_dummy(struct osmo_gsup_client *gsupc, struct msgb *msg)
{
msgb_free(msg);
return 0;
@@ -1032,7 +1032,7 @@ int my_subscr_request_update_gsup_auth(struct sgsn_mm_ctx *mmctx) {
return rx_gsup_message(update_location_res, sizeof(update_location_res));
};
-int my_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg)
+int my_gsup_client_send(struct osmo_gsup_client *gsupc, struct msgb *msg)
{
struct osmo_gsup_message to_peer = {0};
struct osmo_gsup_message from_peer = {0};
@@ -1074,7 +1074,7 @@ int my_gsup_client_send(struct gsup_client *gsupc, struct msgb *msg)
return 0;
}
- reply_msg = gsup_client_msgb_alloc();
+ reply_msg = osmo_gsup_client_msgb_alloc();
reply_msg->l2h = reply_msg->data;
osmo_gsup_encode(reply_msg, &from_peer);
gprs_subscr_rx_gsup_message(reply_msg);
@@ -1451,7 +1451,7 @@ static void test_ggsn_selection(void)
printf("Testing GGSN selection\n");
- gsup_client_send_cb = my_gsup_client_send_dummy;
+ osmo_gsup_client_send_cb = my_gsup_client_send_dummy;
/* Check for emptiness */
OSMO_ASSERT(gprs_subscr_get_by_imsi(imsi1) == NULL);
@@ -1570,7 +1570,7 @@ static void test_ggsn_selection(void)
sgsn_ggsn_ctx_free(ggcs[1]);
sgsn_ggsn_ctx_free(ggcs[2]);
- gsup_client_send_cb = __real_gsup_client_send;
+ osmo_gsup_client_send_cb = __real_osmo_gsup_client_send;
cleanup_test();
}