summaryrefslogtreecommitdiffstats
path: root/tests/gsup
diff options
context:
space:
mode:
Diffstat (limited to 'tests/gsup')
-rw-r--r--tests/gsup/gsup_test.c20
-rw-r--r--tests/gsup/gsup_test.err71
2 files changed, 85 insertions, 6 deletions
diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c
index 42e7b81e..a950ca3e 100644
--- a/tests/gsup/gsup_test.c
+++ b/tests/gsup/gsup_test.c
@@ -134,9 +134,9 @@ static void test_gsup_messages_dec_enc(void)
0x25, 0x10, /* AUTN (UMTS) */
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
- 0x25, 0x08, /* RES (UMTS) */
+ 0x27, 0x08, /* RES (UMTS) */
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
- 0x03, 0x22, /* Auth tuple */
+ 0x03, 0x62, /* Auth tuple */
0x20, 0x10, /* rand */
0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8,
0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0x10,
@@ -153,17 +153,17 @@ static void test_gsup_messages_dec_enc(void)
0x25, 0x10, /* AUTN (UMTS) */
0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8,
0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff, 0xf0,
- 0x25, 0x08, /* RES (UMTS) */
+ 0x27, 0x08, /* RES (UMTS) */
0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98,
};
static const uint8_t send_auth_info_req_auts[] = {
0x08,
TEST_IMSI_IE,
- 0x26, 0x0e,
+ 0x26, 0x0e, /* AUTS (UMTS) */
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e,
- 0x20, 0x10,
+ 0x20, 0x10, /* rand */
0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
};
@@ -198,7 +198,7 @@ static void test_gsup_messages_dec_enc(void)
{"Purge MS Result",
purge_ms_res, sizeof(purge_ms_res)},
{"Send Authentication Info Result with IK, CK, AUTN and RES (UMTS)",
- send_auth_info_req_auts, sizeof(send_auth_info_req_auts)},
+ send_auth_info_res_umts, sizeof(send_auth_info_res_umts)},
{"Send Authentication Info Request with AUTS and RAND (UMTS)",
send_auth_info_req_auts, sizeof(send_auth_info_req_auts)},
};
@@ -264,6 +264,10 @@ static void test_gsup_messages_dec_enc(void)
test_idx, counter, parse_err);
}
+ /* Don't log thousands of message modification errors */
+ LOGP(DLGSUP, LOGL_NOTICE, "Stopping DLGSUP logging\n");
+ log_set_category_filter(osmo_stderr_target, DLGSUP, 0, 0);
+
/* message modification test (relies on ASAN or valgrind being used) */
for (test_idx = 0; test_idx < ARRAY_SIZE(test_messages); test_idx++) {
int j;
@@ -309,6 +313,10 @@ static struct log_info info = {
int main(int argc, char **argv)
{
osmo_init_logging(&info);
+ log_set_print_filename(osmo_stderr_target, 0);
+ log_set_print_timestamp(osmo_stderr_target, 0);
+ log_set_use_color(osmo_stderr_target, 0);
+ log_set_print_category(osmo_stderr_target, 1);
test_gsup_messages_dec_enc();
diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err
new file mode 100644
index 00000000..6cd8627c
--- /dev/null
+++ b/tests/gsup/gsup_test.err
@@ -0,0 +1,71 @@
+ generated message: 08 01 08 21 43 65 87 09 21 43 f5
+ original message: 08 01 08 21 43 65 87 09 21 43 f5
+ IMSI: 123456789012345
+ generated message: 09 01 08 21 43 65 87 09 21 43 f5 02 01 07
+ original message: 09 01 08 21 43 65 87 09 21 43 f5 02 01 07
+ IMSI: 123456789012345
+ generated message: 0a 01 08 21 43 65 87 09 21 43 f5 03 22 20 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 21 04 21 22 23 24 22 08 31 32 33 34 35 36 37 38 03 22 20 10 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 21 04 a1 a2 a3 a4 22 08 b1 b2 b3 b4 b5 b6 b7 b8
+ original message: 0a 01 08 21 43 65 87 09 21 43 f5 03 22 20 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 21 04 21 22 23 24 22 08 31 32 33 34 35 36 37 38 03 22 20 10 81 82 83 84 85 86 87 88 89 8a 8b 8c 8d 8e 8f 90 21 04 a1 a2 a3 a4 22 08 b1 b2 b3 b4 b5 b6 b7 b8
+ IMSI: 123456789012345
+ generated message: 04 01 08 21 43 65 87 09 21 43 f5
+ original message: 04 01 08 21 43 65 87 09 21 43 f5
+ IMSI: 123456789012345
+ generated message: 05 01 08 21 43 65 87 09 21 43 f5 02 01 07
+ original message: 05 01 08 21 43 65 87 09 21 43 f5 02 01 07
+ IMSI: 123456789012345
+ generated message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 15 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e
+ original message: 06 01 08 21 43 65 87 09 21 43 f5 08 07 91 94 61 46 32 24 43 09 07 91 83 52 38 48 83 93 04 00 05 15 10 01 01 11 02 f1 21 12 09 04 74 65 73 74 03 61 70 6e 13 01 02 05 11 10 01 02 11 02 f1 21 12 08 03 66 6f 6f 03 61 70 6e
+ IMSI: 123456789012345
+ generated message: 1c 01 08 21 43 65 87 09 21 43 f5 06 01 00
+ original message: 1c 01 08 21 43 65 87 09 21 43 f5 06 01 00
+ IMSI: 123456789012345
+ generated message: 1d 01 08 21 43 65 87 09 21 43 f5 02 01 03
+ original message: 1d 01 08 21 43 65 87 09 21 43 f5 02 01 03
+ IMSI: 123456789012345
+ generated message: 1e 01 08 21 43 65 87 09 21 43 f5
+ original message: 1e 01 08 21 43 65 87 09 21 43 f5
+ IMSI: 123456789012345
+ generated message: 0c 01 08 21 43 65 87 09 21 43 f5
+ original message: 0c 01 08 21 43 65 87 09 21 43 f5
+ IMSI: 123456789012345
+ generated message: 0d 01 08 21 43 65 87 09 21 43 f5 02 01 03
+ original message: 0d 01 08 21 43 65 87 09 21 43 f5 02 01 03
+ IMSI: 123456789012345
+ generated message: 0e 01 08 21 43 65 87 09 21 43 f5 07 00
+ original message: 0e 01 08 21 43 65 87 09 21 43 f5 07 00
+ IMSI: 123456789012345
+ generated message: 0a 01 08 21 43 65 87 09 21 43 f5 03 62 20 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 21 04 21 22 23 24 22 08 31 32 33 34 35 36 37 38 23 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 24 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 25 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 27 08 01 02 03 04 05 06 07 08 03 62 20 10 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af 10 21 04 b1 b2 b3 b4 22 08 c1 c2 c3 c4 c5 c6 c7 c8 23 10 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df d0 24 10 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef e0 25 10 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff f0 27 08 91 92 93 94 95 96 97 98
+ original message: 0a 01 08 21 43 65 87 09 21 43 f5 03 62 20 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 21 04 21 22 23 24 22 08 31 32 33 34 35 36 37 38 23 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 24 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 25 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 27 08 01 02 03 04 05 06 07 08 03 62 20 10 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af 10 21 04 b1 b2 b3 b4 22 08 c1 c2 c3 c4 c5 c6 c7 c8 23 10 d1 d2 d3 d4 d5 d6 d7 d8 d9 da db dc dd de df d0 24 10 e1 e2 e3 e4 e5 e6 e7 e8 e9 ea eb ec ed ee ef e0 25 10 f1 f2 f3 f4 f5 f6 f7 f8 f9 fa fb fc fd fe ff f0 27 08 91 92 93 94 95 96 97 98
+ IMSI: 123456789012345
+ generated message: 08 01 08 21 43 65 87 09 21 43 f5 26 0e 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 20 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10
+ original message: 08 01 08 21 43 65 87 09 21 43 f5 26 0e 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 20 10 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10
+ IMSI: 123456789012345
+ message 0: tested 11 truncations, 11 parse failures
+ message 1: tested 14 truncations, 13 parse failures
+ message 2: tested 83 truncations, 81 parse failures
+ message 3: tested 11 truncations, 11 parse failures
+ message 4: tested 14 truncations, 13 parse failures
+ message 5: tested 73 truncations, 68 parse failures
+ message 6: tested 14 truncations, 13 parse failures
+ message 7: tested 14 truncations, 13 parse failures
+ message 8: tested 11 truncations, 11 parse failures
+ message 9: tested 11 truncations, 11 parse failures
+ message 10: tested 14 truncations, 13 parse failures
+ message 11: tested 13 truncations, 12 parse failures
+ message 12: tested 211 truncations, 209 parse failures
+ message 13: tested 45 truncations, 43 parse failures
+DLGSUP Stopping DLGSUP logging
+ message 0: tested 2816 modifications, 510 parse failures
+ message 1: tested 3584 modifications, 768 parse failures
+ message 2: tested 21248 modifications, 2571 parse failures
+ message 3: tested 2816 modifications, 510 parse failures
+ message 4: tested 3584 modifications, 768 parse failures
+ message 5: tested 18688 modifications, 3505 parse failures
+ message 6: tested 3584 modifications, 769 parse failures
+ message 7: tested 3584 modifications, 768 parse failures
+ message 8: tested 2816 modifications, 510 parse failures
+ message 9: tested 2816 modifications, 510 parse failures
+ message 10: tested 3584 modifications, 768 parse failures
+ message 11: tested 3328 modifications, 767 parse failures
+ message 12: tested 54016 modifications, 4622 parse failures
+ message 13: tested 11520 modifications, 1026 parse failures