aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/sgsn/sgsn_test.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-08 23:25:31 +0200
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-05-09 00:26:01 +0200
commit6950d14c5bf301fbb3061f5a4fe67f5f57b76040 (patch)
tree1ae01412e3f15a6a7358ea5ad2a63cd6862a45f8 /openbsc/tests/sgsn/sgsn_test.c
parentcf2ca648e9f8b9ed753b4ffb588305b0a3430208 (diff)
parentcd5e52605cdb77bdc6f36fce81a6a1bac7fbda48 (diff)
Merge branch 'master' into sysmocom/iu, with tweakssysmocom/iu_orig_history
Numerous manual adjustments are included to make sense on the sysmocom/iu branch: * gsm_04_08_gprs.h has moved to libosmocore on the master branch, but sysmocom/iu has added some entries. Until it is clear whether to move the additions to libosmocore as well, keep gsm_04_08_gprs.h on sysmocom/iu with merely the additions. * Thus, keep using the old gsm_04_08_gprs.[hc] from openbsc in the Makefiles, but only where the sysmocom/iu additions are needed. * In openbsc's gsm_04_08_gprs.h, * include the libosmocore gsm_04_08_gprs.h, * use '#pragma once' instead of #ifndef and * add a TODO comment about moving the rest to libosmocore. * Apply the addition of an osmo_auth_vector to gsm_auth_tuple: in the Iu auth vector hacks, use the gsm_auth_tuple.vec instead of a local struct. See iu_hack__get_hardcoded_auth_tuple() and gsm48_rx_gmm_att_req(). * In the si2q tests, pass NULL as ctx to gsm_network_init(). * In cscn_main.c, add a debug log that was originally added to osmo-nitb. * openbsc/.gitignore: keep only one addition of 'writtenconfig' Conflicts: openbsc/include/openbsc/gprs_sgsn.h openbsc/include/openbsc/gsm_04_08_gprs.h openbsc/src/gprs/gsm_04_08_gprs.c openbsc/src/libmsc/gsm_04_08.c openbsc/src/osmo-cscn/cscn_main.c openbsc/tests/gsm0408/Makefile.am
Diffstat (limited to 'openbsc/tests/sgsn/sgsn_test.c')
-rw-r--r--openbsc/tests/sgsn/sgsn_test.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c
index 2c5e2b429..15c4c17d0 100644
--- a/openbsc/tests/sgsn/sgsn_test.c
+++ b/openbsc/tests/sgsn/sgsn_test.c
@@ -24,7 +24,7 @@
#include <openbsc/gprs_gmm.h>
#include <openbsc/debug.h>
#include <openbsc/gsm_subscriber.h>
-#include <openbsc/gprs_gsup_messages.h>
+#include <osmocom/gsm/gsup.h>
#include <openbsc/gprs_gsup_client.h>
#include <openbsc/gprs_utils.h>
#include <openbsc/gprs_gb_parse.h>
@@ -32,7 +32,6 @@
#include <osmocom/gprs/gprs_bssgp.h>
#include <osmocom/gsm/gsm_utils.h>
-#include <openbsc/gsm_04_08_gprs.h>
#include <osmocom/core/application.h>
#include <osmocom/core/msgb.h>
@@ -617,8 +616,8 @@ static void test_subscriber_gsup(void)
/* Inject InsertSubscrData GSUP message */
last_updated_subscr = NULL;
rc = rx_gsup_message(insert_data_req, sizeof(insert_data_req));
- OSMO_ASSERT(rc == -GMM_CAUSE_MSGT_NOTEXIST_NOTIMPL);
- OSMO_ASSERT(last_updated_subscr == NULL);
+ OSMO_ASSERT(rc = -ENOTSUP); /* not connected */
+ OSMO_ASSERT(last_updated_subscr == s1);
/* Inject DeleteSubscrData GSUP message */
last_updated_subscr = NULL;
@@ -1138,7 +1137,7 @@ static void test_gmm_attach_subscr_fake_auth(void)
int my_subscr_request_auth_info_real_auth(struct sgsn_mm_ctx *mmctx)
{
struct gsm_auth_tuple at = {
- .sres = {0x51, 0xe5, 0x51, 0xe5},
+ .vec.sres = {0x51, 0xe5, 0x51, 0xe5},
.key_seq = 0
};
@@ -1273,13 +1272,13 @@ static void test_gmm_attach_subscr_gsup_auth(int retry)
int my_gprs_gsup_client_send(struct gprs_gsup_client *gsupc, struct msgb *msg)
{
- struct gprs_gsup_message to_peer = {0};
- struct gprs_gsup_message from_peer = {0};
+ struct osmo_gsup_message to_peer = {0};
+ struct osmo_gsup_message from_peer = {0};
struct msgb *reply_msg;
int rc;
/* Simulate the GSUP peer */
- rc = gprs_gsup_decode(msgb_data(msg), msgb_length(msg), &to_peer);
+ rc = osmo_gsup_decode(msgb_data(msg), msgb_length(msg), &to_peer);
OSMO_ASSERT(rc >= 0);
OSMO_ASSERT(to_peer.imsi[0] != 0);
strncpy(from_peer.imsi, to_peer.imsi, sizeof(from_peer.imsi));
@@ -1288,16 +1287,16 @@ int my_gprs_gsup_client_send(struct gprs_gsup_client *gsupc, struct msgb *msg)
msgb_free(msg);
switch (to_peer.message_type) {
- case GPRS_GSUP_MSGT_UPDATE_LOCATION_REQUEST:
+ case OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST:
/* Send UPDATE_LOCATION_RESULT */
return my_subscr_request_update_gsup_auth(NULL);
- case GPRS_GSUP_MSGT_SEND_AUTH_INFO_REQUEST:
+ case OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST:
/* Send SEND_AUTH_INFO_RESULT */
return my_subscr_request_auth_info_gsup_auth(NULL);
- case GPRS_GSUP_MSGT_PURGE_MS_REQUEST:
- from_peer.message_type = GPRS_GSUP_MSGT_PURGE_MS_RESULT;
+ case OSMO_GSUP_MSGT_PURGE_MS_REQUEST:
+ from_peer.message_type = OSMO_GSUP_MSGT_PURGE_MS_RESULT;
break;
default:
@@ -1315,7 +1314,7 @@ int my_gprs_gsup_client_send(struct gprs_gsup_client *gsupc, struct msgb *msg)
reply_msg = gprs_gsup_msgb_alloc();
reply_msg->l2h = reply_msg->data;
- gprs_gsup_encode(reply_msg, &from_peer);
+ osmo_gsup_encode(reply_msg, &from_peer);
gprs_subscr_rx_gsup_message(reply_msg);
msgb_free(reply_msg);