summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-08-16 12:22:29 +0200
committerlaforge <laforge@osmocom.org>2019-12-09 10:54:30 +0000
commit49ddef610a003f1000422284bf31a653249cf09e (patch)
treee1234acf31e43886976baa9f3ca643f406472f59 /tests
parent278a6c8fcfc04084cd459a990ad93077b2a9cab0 (diff)
gsup: Introduce OSMO_GSUP_NUM_VECTORS_REQ_IE
This is a bit of a hack, as we want to maintain binary compatibility without breaking existing users of libosmocore. To do so, we use the 'num_auth_vectors' field in two ways now: * In the existing use case as part of SEND_AUTH_INFO_RESPONSE, it indicates the number of vectors stored in the 'auth_vectors' field * In the new use case as part of SEND_AUTH_INFO_REQUEST, it indicates the number of vectors actually requested by the MSC/SGSN/MME. Change-Id: Iaecc47280f8ce54f3e3a888c1cfc160735483d0f
Diffstat (limited to 'tests')
-rw-r--r--tests/gsup/gsup_test.c10
-rw-r--r--tests/gsup/gsup_test.err5
-rw-r--r--tests/gsup/gsup_test.ok2
3 files changed, 17 insertions, 0 deletions
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index b84c88f0..f34ac7a6 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -19,6 +19,7 @@
#define TEST_AN_APDU_IE 0x62, 0x05, 0x01, 0x42, 0x42, 0x42, 0x42
#define TEST_SOURCE_NAME_IE 0x60, 0x05, 'M', 'S', 'C', '-', 'A'
#define TEST_DESTINATION_NAME_IE 0x61, 0x05, 'M', 'S', 'C', '-', 'B'
+#define TEST_NUM_VEC_IE(x) 0x52, 1, x
static void test_gsup_messages_dec_enc(void)
{
@@ -32,6 +33,13 @@ static void test_gsup_messages_dec_enc(void)
TEST_CLASS_SUBSCR_IE
};
+ static const uint8_t send_auth_info_req10[] = {
+ 0x08,
+ TEST_IMSI_IE,
+ TEST_NUM_VEC_IE(10),
+ TEST_CLASS_SUBSCR_IE
+ };
+
static const uint8_t send_auth_info_err[] = {
0x09,
TEST_IMSI_IE,
@@ -612,6 +620,8 @@ static void test_gsup_messages_dec_enc(void)
send_e_abort, sizeof(send_e_abort)},
{"E Routing Error",
send_e_routing_error, sizeof(send_e_routing_error)},
+ {"Send Authentication Info Request (10 Vectors)",
+ send_auth_info_req10, sizeof(send_auth_info_req10)},
};
printf("Test GSUP message decoding/encoding\n");
diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err
index 1da39649..7b2fda97 100644
--- a/tests/gsup/gsup_test.err
+++ b/tests/gsup/gsup_test.err
@@ -115,6 +115,9 @@
generated message: 4e 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42
original message: 4e 01 08 21 43 65 87 09 21 43 f5 30 04 de ad be ef 31 01 03 0a 01 04 60 05 4d 53 43 2d 41 61 05 4d 53 43 2d 42
IMSI: 123456789012345
+ generated message: 08 01 08 21 43 65 87 09 21 43 f5 52 01 0a 0a 01 01
+ original message: 08 01 08 21 43 65 87 09 21 43 f5 52 01 0a 0a 01 01
+ IMSI: 123456789012345
message 0: tested 14 truncations, 13 parse failures
message 1: tested 14 truncations, 13 parse failures
message 2: tested 83 truncations, 81 parse failures
@@ -154,6 +157,7 @@
message 36: tested 37 truncations, 32 parse failures
message 37: tested 26 truncations, 22 parse failures
message 38: tested 37 truncations, 32 parse failures
+ message 39: tested 17 truncations, 15 parse failures
DLGSUP Stopping DLGSUP logging
message 0: tested 3584 modifications, 771 parse failures
message 1: tested 3584 modifications, 770 parse failures
@@ -194,3 +198,4 @@ DLGSUP Stopping DLGSUP logging
message 36: tested 9472 modifications, 1803 parse failures
message 37: tested 6656 modifications, 1546 parse failures
message 38: tested 9472 modifications, 1803 parse failures
+ message 39: tested 4352 modifications, 1030 parse failures
diff --git a/tests/gsup/gsup_test.ok b/tests/gsup/gsup_test.ok
index db8bc2f6..ef2aec67 100644
--- a/tests/gsup/gsup_test.ok
+++ b/tests/gsup/gsup_test.ok
@@ -77,4 +77,6 @@ Test GSUP message decoding/encoding
E Abort OK
Testing E Routing Error
E Routing Error OK
+ Testing Send Authentication Info Request (10 Vectors)
+ Send Authentication Info Request (10 Vectors) OK
Done.