summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorThorsten Alteholz <debian@alteholz.de>2018-06-19 15:20:25 +0200
committerThorsten Alteholz <debian@alteholz.de>2018-06-19 15:20:25 +0200
commit8e5f4267a07a2d69c1632eb9830e553fab5c6b79 (patch)
tree92b7a01c296a76d3d939cc0889222fbed14d9ab6 /tests
parent043f448cc17b8de857ed633cf04bd83e6f9c4566 (diff)
Import Upstream version 0.9.0
Diffstat (limited to 'tests')
-rw-r--r--tests/sccp/sccp_test.c14
-rw-r--r--tests/ss7/ss7_test.c5
-rw-r--r--tests/xua/xua_test.c3
-rw-r--r--tests/xua/xua_test.ok38
4 files changed, 35 insertions, 25 deletions
diff --git a/tests/sccp/sccp_test.c b/tests/sccp/sccp_test.c
index 6043cff..ed485bc 100644
--- a/tests/sccp/sccp_test.c
+++ b/tests/sccp/sccp_test.c
@@ -450,6 +450,7 @@ void sccp_write_cb(struct sccp_connection *conn, struct msgb *data, void *gctx,
}
write_called = 1;
+ msgb_free(data);
}
void sccp_c_read(struct sccp_connection *connection, struct msgb *msgb, unsigned int len)
@@ -502,6 +503,7 @@ static void sccp_udt_write_cb(struct sccp_connection *conn, struct msgb *data, v
}
matched = 1;
+ msgb_free(data);
}
static void test_sccp_system(void)
@@ -884,15 +886,17 @@ static void test_sccp_parsing(void)
FAIL("GTI length is wrong: %d\n", result.called.gti_len);
}
- if (memcmp(&parse_result[current_test].dst_gti_data[0],
- result.called.gti_data, result.called.gti_len) != 0) {
+ if (parse_result[current_test].dst_gti_data
+ && memcmp(&parse_result[current_test].dst_gti_data[0],
+ result.called.gti_data, result.called.gti_len) != 0) {
FAIL("GTI data is wrong: %d '%s'\n",
result.called.gti_len,
osmo_hexdump(result.called.gti_data, result.called.gti_len));
}
- if (memcmp(&parse_result[current_test].src_gti_data[0],
- result.calling.gti_data, result.calling.gti_len) != 0) {
+ if (parse_result[current_test].src_gti_data
+ && memcmp(&parse_result[current_test].src_gti_data[0],
+ result.calling.gti_data, result.calling.gti_len) != 0) {
FAIL("GTI data is wrong: %d\n", result.calling.gti_len);
}
}
@@ -981,6 +985,8 @@ static void test_sccp_address(void)
osmo_hexdump(msg->data, ret));
}
}
+
+ talloc_free(msg);
}
static const struct log_info_cat default_categories[] = {
diff --git a/tests/ss7/ss7_test.c b/tests/ss7/ss7_test.c
index 7c51767..0c0cf25 100644
--- a/tests/ss7/ss7_test.c
+++ b/tests/ss7/ss7_test.c
@@ -280,8 +280,9 @@ static void init_logging(void)
{
const int log_cats[] = { DLSS7, DLSUA, DLM3UA, DLSCCP, DLINP };
unsigned int i;
-
- osmo_init_logging(&log_info);
+ void *tall_ctx = talloc_named_const(NULL, 1, "example");
+ msgb_talloc_ctx_init(tall_ctx, 0);
+ osmo_init_logging2(tall_ctx, &log_info);
log_set_print_filename(osmo_stderr_target, 0);
diff --git a/tests/xua/xua_test.c b/tests/xua/xua_test.c
index 5a9d0ab..3e370fe 100644
--- a/tests/xua/xua_test.c
+++ b/tests/xua/xua_test.c
@@ -564,6 +564,9 @@ static void test_rkm(void)
OSMO_ASSERT(nested);
OSMO_ASSERT(xua_msg_get_u32(nested, M3UA_IEI_LOC_RKEY_ID) == 1);
OSMO_ASSERT(xua_msg_get_u32(nested, M3UA_IEI_DEST_PC) == 23);
+
+ talloc_free(nested);
+ talloc_free(xua);
}
diff --git a/tests/xua/xua_test.ok b/tests/xua/xua_test.ok
index 6b0cb33..83b8b8d 100644
--- a/tests/xua/xua_test.ok
+++ b/tests/xua/xua_test.ok
@@ -7,8 +7,8 @@ sccp_addr_parse test case 1
expected: RI=1,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992)
parsed: RI=1,SSN=8,GTI=4,GT=(TT=0,NPL=1,NAI=4,DIG=919869299992)
sccp_addr_parse test case 2
-expected: RI=2,SSN=254,GTI=0
-parsed: RI=2,SSN=254,GTI=0
+expected: RI=2,SSN=254
+parsed: RI=2,SSN=254
Testing Decoded GT -> SUA encoding
IN: TT=0,NPL=1,NAI=4,DIG=919969679389
0400000001000000040000003931393936393637393338390000000000000000000000000000000000000000
@@ -24,7 +24,7 @@ Decoded SUA: HDR=(CL:CLDT,V=0,LEN=0),
PART(T=Source Address,L=12,D=0002000180030008000000fe),
PART(T=Data,L=6,D=000430040120)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 09 00 03 05 07 02 42 fe 02 42 fe 06 00 04 30 04 01 20
+SCCP Output: [L2]> 09 00 03 05 07 02 42 fe 02 42 fe 06 00 04 30 04 01 20
=> BSSMAP-RESET-ACK
SCCP Input: [L2]> 09 00 03 07 0b 04 43 01 00 fe 04 43 5c 00 fe 03 00 01 31
@@ -35,7 +35,7 @@ Decoded SUA: HDR=(CL:CLDT,V=0,LEN=0),
PART(T=Source Address,L=20,D=00020003800200080000005c80030008000000fe),
PART(T=Data,L=3,D=000131)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 09 00 03 07 0b 04 43 01 00 fe 04 43 5c 00 fe 03 00 01 31
+SCCP Output: [L2]> 09 00 03 07 0b 04 43 01 00 fe 04 43 5c 00 fe 03 00 01 31
=> BSSMAP-PAGING
SCCP Input: [L2]> 09 00 03 07 0b 04 43 01 00 fe 04 43 5c 00 fe 10 00 0e 52 08 08 29 47 10 02 01 31 97 61 1a 01 06
@@ -46,7 +46,7 @@ Decoded SUA: HDR=(CL:CLDT,V=0,LEN=0),
PART(T=Source Address,L=20,D=00020003800200080000005c80030008000000fe),
PART(T=Data,L=16,D=000e52080829471002013197611a0106)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 09 00 03 07 0b 04 43 01 00 fe 04 43 5c 00 fe 10 00 0e 52 08 08 29 47 10 02 01 31 97 61 1a 01 06
+SCCP Output: [L2]> 09 00 03 07 0b 04 43 01 00 fe 04 43 5c 00 fe 10 00 0e 52 08 08 29 47 10 02 01 31 97 61 1a 01 06
=> BSSMAP-UDT
SCCP Input: [L2]> 09 00 03 05 07 02 42 fe 02 42 fe 10 00 0e 52 08 08 29 47 10 02 01 31 97 61 1a 01 06
@@ -57,7 +57,7 @@ Decoded SUA: HDR=(CL:CLDT,V=0,LEN=0),
PART(T=Source Address,L=12,D=0002000180030008000000fe),
PART(T=Data,L=16,D=000e52080829471002013197611a0106)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 09 00 03 05 07 02 42 fe 02 42 fe 10 00 0e 52 08 08 29 47 10 02 01 31 97 61 1a 01 06
+SCCP Output: [L2]> 09 00 03 05 07 02 42 fe 02 42 fe 10 00 0e 52 08 08 29 47 10 02 01 31 97 61 1a 01 06
=> BSSMAP-CR
SCCP Input: [L2]> 01 01 02 03 02 02 04 02 42 fe 0f 1f 00 1d 57 05 08 00 72 f4 80 20 12 c3 50 17 10 05 24 11 03 33 19 a2 08 29 47 10 02 01 31 97 61 00
@@ -68,7 +68,7 @@ Decoded SUA: HDR=(CO:CORE,V=0,LEN=0),
PART(T=Destination Address,L=12,D=0002000180030008000000fe),
PART(T=Data,L=31,D=001d5705080072f4802012c3501710052411033319a2082947100201319761)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 01 01 02 03 02 02 04 02 42 fe 0f 1f 00 1d 57 05 08 00 72 f4 80 20 12 c3 50 17 10 05 24 11 03 33 19 a2 08 29 47 10 02 01 31 97 61 00
+SCCP Output: [L2]> 01 01 02 03 02 02 04 02 42 fe 0f 1f 00 1d 57 05 08 00 72 f4 80 20 12 c3 50 17 10 05 24 11 03 33 19 a2 08 29 47 10 02 01 31 97 61 00
=> BSSMAP-CC
SCCP Input: [L2]> 02 01 02 03 00 00 03 02 01 00
@@ -78,7 +78,7 @@ Decoded SUA: HDR=(CO:COAK,V=0,LEN=0),
PART(T=Destination Reference,L=4,D=00010203),
PART(T=Source Reference,L=4,D=00000003)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 02 01 02 03 00 00 03 02 01 00
+SCCP Output: [L2]> 02 01 02 03 00 00 03 02 01 00
=> BSSMAP-DTAP
SCCP Input: [L2]> 06 00 00 03 00 01 0f 01 00 0c 03 05 5c 08 11 81 33 66 02 13 45 f4
@@ -88,7 +88,7 @@ Decoded SUA: HDR=(CO:CODT,V=0,LEN=0),
PART(T=Segmentation,L=4,D=00000000),
PART(T=Data,L=15,D=01000c03055c0811813366021345f4)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 06 00 00 03 00 01 0f 01 00 0c 03 05 5c 08 11 81 33 66 02 13 45 f4
+SCCP Output: [L2]> 06 00 00 03 00 01 0f 01 00 0c 03 05 5c 08 11 81 33 66 02 13 45 f4
=> BSSMAP-CLEAR
SCCP Input: [L2]> 06 00 00 03 00 01 06 00 04 20 04 01 09
@@ -98,7 +98,7 @@ Decoded SUA: HDR=(CO:CODT,V=0,LEN=0),
PART(T=Segmentation,L=4,D=00000000),
PART(T=Data,L=6,D=000420040109)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 06 00 00 03 00 01 06 00 04 20 04 01 09
+SCCP Output: [L2]> 06 00 00 03 00 01 06 00 04 20 04 01 09
=> BSSMAP-RELEASED
SCCP Input: [L2]> 04 00 00 03 01 02 03 00 01 0f 02 23 42 00
@@ -109,7 +109,7 @@ Decoded SUA: HDR=(CO:RELRE,V=0,LEN=0),
PART(T=Cause,L=4,D=00000300),
PART(T=Data,L=2,D=2342)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 04 00 00 03 01 02 03 00 01 0f 02 23 42 00
+SCCP Output: [L2]> 04 00 00 03 01 02 03 00 01 0f 02 23 42 00
=> BSSMAP-RELEASE_COMPLETE
SCCP Input: [L2]> 05 01 02 03 00 00 03
@@ -118,7 +118,7 @@ Decoded SUA: HDR=(CO:RELCO,V=0,LEN=0),
PART(T=Destination Reference,L=4,D=00010203),
PART(T=Source Reference,L=4,D=00000003)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 05 01 02 03 00 00 03
+SCCP Output: [L2]> 05 01 02 03 00 00 03
=> TCAP
SCCP Input: [L2]> 09 81 03 0d 18 0a 12 07 00 12 04 53 84 09 00 17 0b 12 06 00 12 04 44 87 20 00 20 65 9a 65 81 97 48 04 26 00 01 98 49 04 51 01 03 df 6c 81 88 a1 81 85 02 01 44 02 01 07 30 80 a7 80 a0 80 04 01 2b 30 80 30 12 83 01 10 84 01 07 85 07 91 44 57 76 67 16 97 86 01 20 30 06 82 01 18 84 01 04 00 00 00 00 a3 06 04 01 42 84 01 05 a3 06 04 01 51 84 01 05 a3 06 04 01 31 84 01 05 a3 09 04 01 12 84 01 05 82 01 02 a3 09 04 01 11 84 01 05 81 01 01 a3 06 04 01 14 84 01 00 a3 0b 04 01 41 84 01 04 30 03 83 01 10 a3 0b 04 01 41 84 01 04 30 03 82 01 18 00 00 00 00
@@ -129,31 +129,31 @@ Decoded SUA: HDR=(CL:CLDT,V=0,LEN=0),
PART(T=Source Address,L=32,D=0001000580010014000000040c00010444872000206500008003000800000006),
PART(T=Data,L=154,D=6581974804260001984904510103df6c8188a181850201440201073080a780a08004012b30803012830110840107850791445776671697860120300682011884010400000000a306040142840105a306040151840105a306040131840105a309040112840105820102a309040111840105810101a306040114840100a30b0401418401043003830110a30b040141840104300382011800000000)
Re-Encoding decoded SUA to SCCP
-SCCP Output: 09 81 03 0d 18 0a 12 07 00 12 04 53 84 09 00 17 0b 12 06 00 12 04 44 87 20 00 20 65 9a 65 81 97 48 04 26 00 01 98 49 04 51 01 03 df 6c 81 88 a1 81 85 02 01 44 02 01 07 30 80 a7 80 a0 80 04 01 2b 30 80 30 12 83 01 10 84 01 07 85 07 91 44 57 76 67 16 97 86 01 20 30 06 82 01 18 84 01 04 00 00 00 00 a3 06 04 01 42 84 01 05 a3 06 04 01 51 84 01 05 a3 06 04 01 31 84 01 05 a3 09 04 01 12 84 01 05 82 01 02 a3 09 04 01 11 84 01 05 81 01 01 a3 06 04 01 14 84 01 00 a3 0b 04 01 41 84 01 04 30 03 83 01 10 a3 0b 04 01 41 84 01 04 30 03 82 01 18 00 00 00 00
+SCCP Output: [L2]> 09 81 03 0d 18 0a 12 07 00 12 04 53 84 09 00 17 0b 12 06 00 12 04 44 87 20 00 20 65 9a 65 81 97 48 04 26 00 01 98 49 04 51 01 03 df 6c 81 88 a1 81 85 02 01 44 02 01 07 30 80 a7 80 a0 80 04 01 2b 30 80 30 12 83 01 10 84 01 07 85 07 91 44 57 76 67 16 97 86 01 20 30 06 82 01 18 84 01 04 00 00 00 00 a3 06 04 01 42 84 01 05 a3 06 04 01 51 84 01 05 a3 06 04 01 31 84 01 05 a3 09 04 01 12 84 01 05 82 01 02 a3 09 04 01 11 84 01 05 81 01 01 a3 06 04 01 14 84 01 00 a3 0b 04 01 41 84 01 04 30 03 83 01 10 a3 0b 04 01 41 84 01 04 30 03 82 01 18 00 00 00 00
Parsing M3UA Message
Parsing Nested M3UA Routing Key IE
Testing SCCP Address Encode/Decode
=> NOGT-PC1024
-input addr: RI=2,PC=1024,GTI=0
+input addr: RI=2,PC=1024
rc=3, expected rc=3
encoded addr: 410004
expected addr: 410004
-decod addr: RI=2,PC=1024,GTI=0
+decod addr: RI=2,PC=1024
=> NOGT-PC16383
-input addr: RI=2,PC=16383,GTI=0
+input addr: RI=2,PC=16383
rc=3, expected rc=3
encoded addr: 41ff3f
expected addr: 41ff3f
-decod addr: RI=2,PC=16383,GTI=0
+decod addr: RI=2,PC=16383
=> NOGT-PC16383-SSN90
-input addr: RI=2,PC=16383,SSN=90,GTI=0
+input addr: RI=2,PC=16383,SSN=90
rc=4, expected rc=4
encoded addr: 43ff3f5a
expected addr: 43ff3f5a
-decod addr: RI=2,PC=16383,SSN=90,GTI=0
+decod addr: RI=2,PC=16383,SSN=90
=> GT-PC16383-NAIONLY
input addr: RI=2,PC=16383,GTI=1,GT=()