Harald Welte | c8a0b93 | 2012-08-24 21:27:26 +0200 | [diff] [blame] | 1 | Test `CSD 9600/V.110/transparent' passed |
| 2 | Test `Speech, all codecs' passed |
Holger Hans Peter Freyther | cd252e3 | 2013-07-03 09:56:53 +0200 | [diff] [blame] | 3 | Simple TMSI encoding test....passed |
Max | d55d7d4 | 2018-02-15 11:27:18 +0100 | [diff] [blame] | 4 | Simple IMSI encoding test....passed: [10] 17 08 99 10 07 00 00 00 64 02 |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 5 | |
| 6 | Testing Mobile Identity conversions |
| 7 | - IMSI 123456789012345 |
| 8 | -> MI-TLV-hex='17081932547698103254' |
| 9 | -> MI-str="123456789012345" rc=16 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 10 | -> MI-name="IMSI-123456789012345" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 11 | - IMSI 12345678901234 |
| 12 | -> MI-TLV-hex='170811325476981032f4' |
| 13 | -> MI-str="12345678901234" rc=15 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 14 | -> MI-name="IMSI-12345678901234" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 15 | - IMSI 423423 |
| 16 | -> MI-TLV-hex='1704413224f3' |
| 17 | -> MI-str="423423" rc=7 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 18 | -> MI-name="IMSI-423423" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 19 | - unknown 0x9 423423 |
Harald Welte | a13fb75 | 2020-06-16 08:44:42 +0200 | [diff] [blame] | 20 | -> MI-TLV-hex='1704413224f3' |
| 21 | -> MI-str="423423" rc=7 |
| 22 | -> MI-name="IMSI-423423" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 23 | - IMSI 4234235 |
| 24 | -> MI-TLV-hex='170449322453' |
| 25 | -> MI-str="4234235" rc=8 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 26 | -> MI-name="IMSI-4234235" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 27 | - IMSI 4234235 |
| 28 | -> MI-TLV-hex='170449322453' |
Neels Hofmeyr | 627e011 | 2018-12-05 21:32:40 +0100 | [diff] [blame] | 29 | -> MI-str="423" rc=4 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 30 | -> MI-name="IMSI-4234235" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 31 | - IMEI 123456789012345 |
| 32 | -> MI-TLV-hex='17081a32547698103254' |
| 33 | -> MI-str="123456789012345" rc=16 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 34 | -> MI-name="IMEI-123456789012345" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 35 | - IMEI 98765432109876 |
| 36 | -> MI-TLV-hex='170892785634129078f6' |
| 37 | -> MI-str="98765432109876" rc=15 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 38 | -> MI-name="IMEI-98765432109876" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 39 | - IMEI 987654321098765 |
| 40 | -> MI-TLV-hex='17089a78563412907856' |
| 41 | -> MI-str="987654321098765" rc=16 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 42 | -> MI-name="IMEI-987654321098765" |
Harald Welte | 1317771 | 2019-01-20 13:41:26 +0100 | [diff] [blame] | 43 | - IMEI-SV 9876543210987654 |
| 44 | -> MI-TLV-hex='17099378563412907856f4' |
| 45 | -> MI-str="9876543210987654" rc=17 |
| 46 | -> MI-name="IMEI-SV-9876543210987654" |
| 47 | - IMEI-SV 9876543210987654 |
| 48 | -> MI-TLV-hex='17099378563412907856f4' |
| 49 | -> MI-str="9876543210987654" rc=17 |
| 50 | -> MI-name="IMEI-SV-9876543210987654" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 51 | - TMSI 305419896 |
| 52 | -> MI-TLV-hex='1705f412345678' |
| 53 | -> MI-str="305419896" rc=9 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 54 | -> MI-name="TMSI-0x12345678" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 55 | - TMSI 12648430 |
| 56 | -> MI-TLV-hex='1705f400c0ffee' |
| 57 | -> MI-str="12648430" rc=8 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 58 | -> MI-name="TMSI-0x00C0FFEE" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 59 | - TMSI 0 |
| 60 | -> MI-TLV-hex='1705f400000000' |
| 61 | -> MI-str="0" rc=1 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 62 | -> MI-name="TMSI-0x00000000" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 63 | - TMSI 305419896 |
| 64 | -> MI-TLV-hex='1705f412345678' |
| 65 | -> MI-str="3054" rc=9 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 66 | -> MI-name="TMSI-0x12345678" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 67 | - NONE 123 |
Harald Welte | a13fb75 | 2020-06-16 08:44:42 +0200 | [diff] [blame] | 68 | -> MI-TLV-hex='17021832' |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 69 | -> MI-str="" rc=1 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 70 | -> MI-name="unknown" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 71 | - NONE 1234 |
Harald Welte | a13fb75 | 2020-06-16 08:44:42 +0200 | [diff] [blame] | 72 | -> MI-TLV-hex='17031032f4' |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 73 | -> MI-str="" rc=1 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 74 | -> MI-name="unknown" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 75 | - unknown 0x8 1234 |
Harald Welte | a13fb75 | 2020-06-16 08:44:42 +0200 | [diff] [blame] | 76 | -> MI-TLV-hex='17031032f4' |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 77 | -> MI-str="" rc=1 |
Neels Hofmeyr | 02fd83d | 2019-01-05 00:38:54 +0100 | [diff] [blame] | 78 | -> MI-name="unknown" |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 79 | |
| 80 | Decoding zero length Mobile Identities |
| 81 | - MI type: IMSI |
| 82 | - writing to zero-length string: |
Neels Hofmeyr | 627e011 | 2018-12-05 21:32:40 +0100 | [diff] [blame] | 83 | rc=0 |
| 84 | nothing written |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 85 | - writing to 1-byte-length string: |
| 86 | rc=1 |
Neels Hofmeyr | 627e011 | 2018-12-05 21:32:40 +0100 | [diff] [blame] | 87 | returned empty string |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 88 | - decode zero-length mi: |
Neels Hofmeyr | 627e011 | 2018-12-05 21:32:40 +0100 | [diff] [blame] | 89 | rc=1 |
| 90 | returned empty string |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 91 | - MI type: TMSI |
| 92 | - writing to zero-length string: |
Neels Hofmeyr | ea2a0ab | 2018-12-05 23:30:08 +0100 | [diff] [blame] | 93 | rc=0 |
| 94 | nothing written |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 95 | - writing to 1-byte-length string: |
| 96 | rc=1 |
| 97 | returned empty string |
| 98 | - decode zero-length mi: |
| 99 | rc=1 |
| 100 | returned empty string |
| 101 | - MI type: NONE |
| 102 | - writing to zero-length string: |
Neels Hofmeyr | ea2a0ab | 2018-12-05 23:30:08 +0100 | [diff] [blame] | 103 | rc=0 |
| 104 | nothing written |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 105 | - writing to 1-byte-length string: |
| 106 | rc=1 |
| 107 | returned empty string |
| 108 | - decode zero-length mi: |
| 109 | rc=1 |
| 110 | returned empty string |
| 111 | - MI type: IMSI | GSM_MI_ODD |
| 112 | - writing to zero-length string: |
Neels Hofmeyr | 627e011 | 2018-12-05 21:32:40 +0100 | [diff] [blame] | 113 | rc=0 |
| 114 | nothing written |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 115 | - writing to 1-byte-length string: |
| 116 | rc=1 |
Neels Hofmeyr | 627e011 | 2018-12-05 21:32:40 +0100 | [diff] [blame] | 117 | returned empty string |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 118 | - decode zero-length mi: |
Neels Hofmeyr | 627e011 | 2018-12-05 21:32:40 +0100 | [diff] [blame] | 119 | rc=1 |
| 120 | returned empty string |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 121 | - MI type: TMSI | GSM_MI_ODD |
| 122 | - writing to zero-length string: |
Neels Hofmeyr | ea2a0ab | 2018-12-05 23:30:08 +0100 | [diff] [blame] | 123 | rc=0 |
| 124 | nothing written |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 125 | - writing to 1-byte-length string: |
| 126 | rc=1 |
| 127 | returned empty string |
| 128 | - decode zero-length mi: |
| 129 | rc=1 |
| 130 | returned empty string |
| 131 | - MI type: NONE | GSM_MI_ODD |
| 132 | - writing to zero-length string: |
Neels Hofmeyr | ea2a0ab | 2018-12-05 23:30:08 +0100 | [diff] [blame] | 133 | rc=0 |
| 134 | nothing written |
Neels Hofmeyr | 4968628 | 2018-12-05 21:32:21 +0100 | [diff] [blame] | 135 | - writing to 1-byte-length string: |
| 136 | rc=1 |
| 137 | returned empty string |
| 138 | - decode zero-length mi: |
| 139 | rc=1 |
| 140 | returned empty string |
| 141 | |
Neels Hofmeyr | 83025bf | 2020-05-26 02:45:23 +0200 | [diff] [blame] | 142 | test_struct_mobile_identity() |
| 143 | LU with IMSI 901700000004620: rc = 0, mi = IMSI-901700000004620 ok |
| 144 | LU with TMSI 0x0980ad8a: rc = 0, mi = TMSI-0x0980AD8A ok |
| 145 | LU with invalid MI type: rc = -22 ok |
| 146 | LU with truncated IMSI MI: rc = -74 ok |
| 147 | LU with too short IMSI MI (12345): rc = -74 ok |
| 148 | LU with just long enough IMSI MI 123456: rc = 0, mi = IMSI-123456 ok |
| 149 | LU with max length IMSI MI 123456789012345: rc = 0, mi = IMSI-123456789012345 ok |
| 150 | LU with just too long IMSI MI 1234567890123456: rc = -74 ok |
| 151 | LU with truncated TMSI MI: rc = -74 ok |
| 152 | LU with odd length TMSI: rc = -74 ok |
| 153 | LU with too long TMSI MI: rc = -74 ok |
| 154 | LU with too short TMSI: rc = -74 ok |
| 155 | CM Service Request with IMSI 123456: rc = 0, mi = IMSI-123456 ok |
| 156 | CM Service Request with TMSI 0x5a42e404: rc = 0, mi = TMSI-0x5A42E404 ok |
| 157 | CM Service Request with shorter CM2, with IMSI 123456: rc = 0, mi = IMSI-123456 ok |
| 158 | CM Service Request with longer CM2, with IMSI 123456: rc = 0, mi = IMSI-123456 ok |
| 159 | CM Service Request with shorter CM2, with TMSI 0x00000000: rc = 0, mi = TMSI-0x00000000 ok |
| 160 | CM Service Request with invalid MI type: rc = -22 ok |
| 161 | CM Service Request with truncated IMSI MI: rc = -74 ok |
| 162 | CM Service Request with truncated TMSI MI: rc = -74 ok |
| 163 | CM Service Request with odd length TMSI: rc = -74 ok |
| 164 | CM Service Request with too long TMSI MI: rc = -74 ok |
| 165 | CM Service Request with too short TMSI: rc = -74 ok |
| 166 | CM Service Reestablish Request with TMSI 0x5a42e404: rc = 0, mi = TMSI-0x5A42E404 ok |
| 167 | Paging Response with IMSI 1234567: rc = 0, mi = IMSI-1234567 ok |
| 168 | Paging Response with TMSI 0xb48883de: rc = 0, mi = TMSI-0xB48883DE ok |
| 169 | Paging Response with TMSI, with unused nibble not 0xf: rc = -74 ok |
| 170 | Paging Response with too short IMEI (1234567): rc = -74 ok |
| 171 | Paging Response with IMEI 123456789012345: rc = 0, mi = IMEI-123456789012345 ok |
| 172 | Paging Response with IMEI 12345678901234 (no Luhn checksum): rc = 0, mi = IMEI-12345678901234 ok |
| 173 | Paging Response with IMEISV 1234567890123456: rc = 0, mi = IMEI-SV-1234567890123456 ok |
| 174 | Paging Response with too short IMEISV 123456789012345: rc = -74 ok |
| 175 | Paging Response with too long IMEISV 12345678901234567: rc = -74 ok |
| 176 | Paging Response with IMSI 123456789012345 and flipped ODD bit: rc = -74 ok |
| 177 | IMSI-Detach with IMSI 901700000004620: rc = 0, mi = IMSI-901700000004620 ok |
| 178 | IMSI-Detach with TMSI 0x0980ad8a: rc = 0, mi = TMSI-0x0980AD8A ok |
| 179 | IMSI-Detach with invalid MI type: rc = -22 ok |
| 180 | IMSI-Detach with truncated IMSI MI: rc = -74 ok |
| 181 | IMSI-Detach with too short IMSI MI (12345): rc = -74 ok |
| 182 | IMSI-Detach with just long enough IMSI MI 123456: rc = 0, mi = IMSI-123456 ok |
| 183 | IMSI-Detach with max length IMSI MI 123456789012345: rc = 0, mi = IMSI-123456789012345 ok |
| 184 | IMSI-Detach with just too long IMSI MI 1234567890123456: rc = -74 ok |
| 185 | IMSI-Detach with truncated TMSI MI: rc = -74 ok |
| 186 | IMSI-Detach with odd length TMSI: rc = -74 ok |
| 187 | IMSI-Detach with too long TMSI MI: rc = -74 ok |
| 188 | IMSI-Detach with too short TMSI: rc = -74 ok |
| 189 | Identity Response with IMSI 901700000004620: rc = 0, mi = IMSI-901700000004620 ok |
| 190 | Identity Response with IMEI 123456789012345: rc = 0, mi = IMEI-123456789012345 ok |
| 191 | Identity Response with IMEISV 9876543210987654: rc = 0, mi = IMEI-SV-9876543210987654 ok |
| 192 | |
Vadim Yanitskiy | aa0683d | 2019-05-25 23:14:00 +0700 | [diff] [blame] | 193 | BSD number encoding / decoding test |
| 194 | - Running test: regular 9-digit MSISDN |
| 195 | - Encoding ASCII (buffer limit=0) '123456789'... |
| 196 | - Expected: (rc=6) '0521436587f9' |
| 197 | - Actual: (rc=6) '0521436587f9' |
| 198 | - Decoding HEX (buffer limit=0) '0521436587f9'... |
| 199 | - Expected: (rc=0) '123456789' |
| 200 | - Actual: (rc=0) '123456789' |
| 201 | - Running test: regular 6-digit MSISDN with optional header (LHV) |
| 202 | - Encoding ASCII (buffer limit=0) '123456'... |
Vadim Yanitskiy | 1dc8264 | 2019-05-27 00:53:54 +0700 | [diff] [blame] | 203 | - Expected: (rc=8) '07ffffffff214365' |
| 204 | - Actual: (rc=8) '07ffffffff214365' |
Vadim Yanitskiy | aa0683d | 2019-05-25 23:14:00 +0700 | [diff] [blame] | 205 | - Decoding HEX (buffer limit=0) '07deadbeef214365'... |
| 206 | - Expected: (rc=0) '123456' |
| 207 | - Actual: (rc=0) '123456' |
| 208 | - Running test: long 15-digit (maximum) MSISDN |
| 209 | - Encoding ASCII (buffer limit=0) '123456789012345'... |
| 210 | - Expected: (rc=9) '0821436587092143f5' |
| 211 | - Actual: (rc=9) '0821436587092143f5' |
| 212 | - Decoding HEX (buffer limit=0) '0821436587092143f5'... |
| 213 | - Expected: (rc=0) '123456789012345' |
| 214 | - Actual: (rc=0) '123456789012345' |
| 215 | - Running test: long 15-digit (maximum) MSISDN, limited buffer |
| 216 | - Encoding ASCII (buffer limit=9) '123456789012345'... |
| 217 | - Expected: (rc=9) '0821436587092143f5' |
| 218 | - Actual: (rc=9) '0821436587092143f5' |
| 219 | - Decoding HEX (buffer limit=16) '0821436587092143f5'... |
| 220 | - Expected: (rc=0) '123456789012345' |
Vadim Yanitskiy | 2cd1dda | 2019-05-26 00:14:16 +0700 | [diff] [blame] | 221 | - Actual: (rc=0) '123456789012345' |
Vadim Yanitskiy | aa0683d | 2019-05-25 23:14:00 +0700 | [diff] [blame] | 222 | - Running test: to be truncated 20-digit MSISDN |
| 223 | - Encoding ASCII (buffer limit=9) '12345678901234567890'... |
| 224 | - Expected: (rc=-5) '' |
| 225 | - Actual: (rc=-5) '' |
| 226 | - Decoding HEX (buffer limit=16) '0a21436587092143658709'... |
Vadim Yanitskiy | 7194087 | 2019-05-26 00:49:57 +0700 | [diff] [blame] | 227 | - Expected: (rc=-28) '123456789012345' |
| 228 | - Actual: (rc=-28) '123456789012345' |
Vadim Yanitskiy | aa0683d | 2019-05-25 23:14:00 +0700 | [diff] [blame] | 229 | - Running test: LV incorrect length |
| 230 | - Decoding HEX (buffer limit=0) '05214365'... |
Vadim Yanitskiy | e4799f5 | 2019-05-26 00:55:20 +0700 | [diff] [blame] | 231 | - Expected: (rc=-22) '(none)' |
| 232 | - Actual: (rc=-22) '(none)' |
Vadim Yanitskiy | aa0683d | 2019-05-25 23:14:00 +0700 | [diff] [blame] | 233 | - Running test: empty input buffer |
| 234 | - Encoding ASCII (buffer limit=0) ''... |
| 235 | - Expected: (rc=1) '00' |
| 236 | - Actual: (rc=1) '00' |
| 237 | - Decoding HEX (buffer limit=0) ''... |
| 238 | - Expected: (rc=-5) '(none)' |
| 239 | - Actual: (rc=-5) '(none)' |
Oliver Smith | 186f878 | 2019-06-06 16:11:32 +0200 | [diff] [blame] | 240 | - Running test: decoding buffer is one byte too small (OS#4049) |
| 241 | - Decoding HEX (buffer limit=4) '022143'... |
| 242 | - Expected: (rc=-28) '123' |
| 243 | - Actual: (rc=-28) '123' |
Vadim Yanitskiy | aa0683d | 2019-05-25 23:14:00 +0700 | [diff] [blame] | 244 | |
Max | f1ad60e | 2018-01-05 14:19:33 +0100 | [diff] [blame] | 245 | Constructed RA: |
Neels Hofmeyr | c38b32d | 2018-02-20 15:13:18 +0100 | [diff] [blame] | 246 | 077-121-666-5 |
| 247 | MCC+MNC in BCD: 70 17 21 |
Neels Hofmeyr | dbb2513 | 2018-02-20 15:12:23 +0100 | [diff] [blame] | 248 | 077-121-666-5 (3-digit MNC) |
Max | 99377c2 | 2017-08-30 19:17:50 +0200 | [diff] [blame] | 249 | RA test...passed |
Max | f1ad60e | 2018-01-05 14:19:33 +0100 | [diff] [blame] | 250 | Constructed RA: |
Neels Hofmeyr | c38b32d | 2018-02-20 15:13:18 +0100 | [diff] [blame] | 251 | 084-98-11-89 |
| 252 | MCC+MNC in BCD: 80 f4 89 |
| 253 | 084-98-11-89 |
Max | 99377c2 | 2017-08-30 19:17:50 +0200 | [diff] [blame] | 254 | RA test...passed |
Neels Hofmeyr | b9fd7eb | 2018-02-20 15:14:03 +0100 | [diff] [blame] | 255 | Constructed RA: |
| 256 | 000-00-0-0 |
| 257 | MCC+MNC in BCD: 00 f0 00 |
| 258 | 000-00-0-0 |
| 259 | RA test...passed |
| 260 | Constructed RA: |
Neels Hofmeyr | 6c7b3e2 | 2018-02-20 22:20:42 +0100 | [diff] [blame] | 261 | 000-000-0-0 (3-digit MNC) |
| 262 | MCC+MNC in BCD: 00 00 00 |
| 263 | 000-000-0-0 (3-digit MNC) |
| 264 | RA test...passed |
| 265 | Constructed RA: |
Neels Hofmeyr | b9fd7eb | 2018-02-20 15:14:03 +0100 | [diff] [blame] | 266 | 999-999-65535-255 |
| 267 | MCC+MNC in BCD: 99 99 99 |
Neels Hofmeyr | dbb2513 | 2018-02-20 15:12:23 +0100 | [diff] [blame] | 268 | 999-999-65535-255 (3-digit MNC) |
Neels Hofmeyr | b9fd7eb | 2018-02-20 15:14:03 +0100 | [diff] [blame] | 269 | RA test...passed |
Neels Hofmeyr | 6c7b3e2 | 2018-02-20 22:20:42 +0100 | [diff] [blame] | 270 | Constructed RA: |
| 271 | 001-02-23-42 |
| 272 | MCC+MNC in BCD: 00 f1 20 |
| 273 | 001-02-23-42 |
| 274 | RA test...passed |
| 275 | Constructed RA: |
| 276 | 001-002-23-42 (3-digit MNC) |
| 277 | MCC+MNC in BCD: 00 21 00 |
| 278 | 001-002-23-42 (3-digit MNC) |
| 279 | RA test...passed |
| 280 | Constructed RA: |
| 281 | 012-34-56-78 |
| 282 | MCC+MNC in BCD: 10 f2 43 |
| 283 | 012-34-56-78 |
| 284 | RA test...passed |
| 285 | Constructed RA: |
| 286 | 012-034-23-42 (3-digit MNC) |
| 287 | MCC+MNC in BCD: 10 42 30 |
| 288 | 012-034-23-42 (3-digit MNC) |
| 289 | RA test...passed |
| 290 | Constructed RA: |
| 291 | 123-456-23-42 |
| 292 | MCC+MNC in BCD: 21 63 54 |
| 293 | 123-456-23-42 (3-digit MNC) |
| 294 | RA test...passed |
| 295 | Constructed RA: |
| 296 | 123-456-23-42 (3-digit MNC) |
| 297 | MCC+MNC in BCD: 21 63 54 |
| 298 | 123-456-23-42 (3-digit MNC) |
| 299 | RA test...passed |
Neels Hofmeyr | d5a577b | 2018-02-20 21:48:07 +0100 | [diff] [blame] | 300 | - gsm48_generate_lai() from 077-121-666-0 |
| 301 | Encoded 70 17 21 02 9a |
| 302 | gsm48_decode_lai() gives 077-121-666-0 |
| 303 | passed |
Neels Hofmeyr | 4566f4e | 2018-02-20 22:19:56 +0100 | [diff] [blame] | 304 | - gsm48_generate_lai2() from 077-121-666 |
| 305 | Encoded 70 17 21 02 9a |
| 306 | gsm48_decode_lai2() gives 077-121-666 (3-digit MNC) |
| 307 | passed |
Neels Hofmeyr | d5a577b | 2018-02-20 21:48:07 +0100 | [diff] [blame] | 308 | - gsm48_generate_lai() from 084-98-11-0 |
| 309 | Encoded 80 f4 89 00 0b |
| 310 | gsm48_decode_lai() gives 084-98-11-0 |
| 311 | passed |
Neels Hofmeyr | 4566f4e | 2018-02-20 22:19:56 +0100 | [diff] [blame] | 312 | - gsm48_generate_lai2() from 084-98-11 |
| 313 | Encoded 80 f4 89 00 0b |
| 314 | gsm48_decode_lai2() gives 084-98-11 |
| 315 | passed |
Neels Hofmeyr | d5a577b | 2018-02-20 21:48:07 +0100 | [diff] [blame] | 316 | - gsm48_generate_lai() from 000-00-0-0 |
| 317 | Encoded 00 f0 00 00 00 |
| 318 | gsm48_decode_lai() gives 000-00-0-0 |
| 319 | passed |
Neels Hofmeyr | 4566f4e | 2018-02-20 22:19:56 +0100 | [diff] [blame] | 320 | - gsm48_generate_lai2() from 000-00-0 |
| 321 | Encoded 00 f0 00 00 00 |
| 322 | gsm48_decode_lai2() gives 000-00-0 |
| 323 | passed |
Neels Hofmeyr | 6c7b3e2 | 2018-02-20 22:20:42 +0100 | [diff] [blame] | 324 | - gsm48_generate_lai() from 000-000-0-0 (3-digit MNC) |
| 325 | Encoded 00 f0 00 00 00 |
| 326 | gsm48_decode_lai() gives 000-00-0-0 |
| 327 | passed |
| 328 | - gsm48_generate_lai2() from 000-000-0 (3-digit MNC) |
| 329 | Encoded 00 00 00 00 00 |
| 330 | gsm48_decode_lai2() gives 000-000-0 (3-digit MNC) |
| 331 | passed |
Neels Hofmeyr | d5a577b | 2018-02-20 21:48:07 +0100 | [diff] [blame] | 332 | - gsm48_generate_lai() from 999-999-65535-0 |
| 333 | Encoded 99 99 99 ff ff |
| 334 | gsm48_decode_lai() gives 999-999-65535-0 |
| 335 | passed |
Neels Hofmeyr | 4566f4e | 2018-02-20 22:19:56 +0100 | [diff] [blame] | 336 | - gsm48_generate_lai2() from 999-999-65535 |
| 337 | Encoded 99 99 99 ff ff |
| 338 | gsm48_decode_lai2() gives 999-999-65535 (3-digit MNC) |
| 339 | passed |
Neels Hofmeyr | 6c7b3e2 | 2018-02-20 22:20:42 +0100 | [diff] [blame] | 340 | - gsm48_generate_lai() from 001-02-23-0 |
| 341 | Encoded 00 f1 20 00 17 |
| 342 | gsm48_decode_lai() gives 001-02-23-0 |
| 343 | passed |
| 344 | - gsm48_generate_lai2() from 001-02-23 |
| 345 | Encoded 00 f1 20 00 17 |
| 346 | gsm48_decode_lai2() gives 001-02-23 |
| 347 | passed |
| 348 | - gsm48_generate_lai() from 001-002-23-0 (3-digit MNC) |
| 349 | Encoded 00 f1 20 00 17 |
| 350 | gsm48_decode_lai() gives 001-02-23-0 |
| 351 | passed |
| 352 | - gsm48_generate_lai2() from 001-002-23 (3-digit MNC) |
| 353 | Encoded 00 21 00 00 17 |
| 354 | gsm48_decode_lai2() gives 001-002-23 (3-digit MNC) |
| 355 | passed |
| 356 | - gsm48_generate_lai() from 012-34-56-0 |
| 357 | Encoded 10 f2 43 00 38 |
| 358 | gsm48_decode_lai() gives 012-34-56-0 |
| 359 | passed |
| 360 | - gsm48_generate_lai2() from 012-34-56 |
| 361 | Encoded 10 f2 43 00 38 |
| 362 | gsm48_decode_lai2() gives 012-34-56 |
| 363 | passed |
| 364 | - gsm48_generate_lai() from 012-034-23-0 (3-digit MNC) |
| 365 | Encoded 10 f2 43 00 17 |
| 366 | gsm48_decode_lai() gives 012-34-23-0 |
| 367 | passed |
| 368 | - gsm48_generate_lai2() from 012-034-23 (3-digit MNC) |
| 369 | Encoded 10 42 30 00 17 |
| 370 | gsm48_decode_lai2() gives 012-034-23 (3-digit MNC) |
| 371 | passed |
| 372 | - gsm48_generate_lai() from 123-456-23-0 |
| 373 | Encoded 21 63 54 00 17 |
| 374 | gsm48_decode_lai() gives 123-456-23-0 |
| 375 | passed |
| 376 | - gsm48_generate_lai2() from 123-456-23 |
| 377 | Encoded 21 63 54 00 17 |
| 378 | gsm48_decode_lai2() gives 123-456-23 (3-digit MNC) |
| 379 | passed |
| 380 | - gsm48_generate_lai() from 123-456-23-0 (3-digit MNC) |
| 381 | Encoded 21 63 54 00 17 |
| 382 | gsm48_decode_lai() gives 123-456-23-0 |
| 383 | passed |
| 384 | - gsm48_generate_lai2() from 123-456-23 (3-digit MNC) |
| 385 | Encoded 21 63 54 00 17 |
| 386 | gsm48_decode_lai2() gives 123-456-23 (3-digit MNC) |
| 387 | passed |
Stefan Sperling | fdf8b7b | 2018-07-27 12:19:15 +0200 | [diff] [blame] | 388 | Element is: 2 => freqs[i] = 121 |
| 389 | Element is: 2 => freqs[i] = 1 |
| 390 | Element is: 0 => freqs[i] = 68 |
| 391 | w[0]=122 |
| 392 | w[1]=2 |
| 393 | w[2]=69 |
| 394 | w[3]=204 |
| 395 | w[4]=75 |
| 396 | w[5]=66 |
| 397 | w[6]=60 |
| 398 | w[7]=70 |
| 399 | w[8]=83 |
| 400 | w[9]=3 |
| 401 | w[10]=24 |
| 402 | w[11]=67 |
| 403 | w[12]=54 |
| 404 | w[13]=64 |
| 405 | w[14]=70 |
| 406 | w[15]=9 |
| 407 | Range512: 89 4b 2a 95 65 95 55 2c a9 55 aa 55 6a 95 59 55 |
| 408 | Range test 0: range 511, num ARFCNs 12 |
| 409 | range=511, arfcns_used=11, f0=1, f0_included=1 |
| 410 | chan_list = 88 00 98 34 85 36 7c 50 22 dc 5e ec 00 00 00 00 |
| 411 | Decoded freqs 12 (expected 12) |
| 412 | Decoded: 1 12 31 51 57 91 97 98 113 117 120 125 |
| 413 | Range test 1: range 511, num ARFCNs 17 |
| 414 | range=511, arfcns_used=16, f0=1, f0_included=1 |
| 415 | chan_list = 88 00 82 7f 01 3f 7e 04 0b ff ff fc 10 41 07 e0 |
| 416 | Decoded freqs 17 (expected 17) |
| 417 | Decoded: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
| 418 | Range test 2: range 511, num ARFCNs 18 |
| 419 | range=511, arfcns_used=17, f0=1, f0_included=1 |
| 420 | chan_list = 88 00 82 7f 01 7f 7e 04 0b ff ff fc 10 41 07 ff |
| 421 | Decoded freqs 18 (expected 18) |
| 422 | Decoded: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
| 423 | Range test 3: range 511, num ARFCNs 18 |
| 424 | range=511, arfcns_used=17, f0=1, f0_included=1 |
| 425 | chan_list = 88 00 94 3a 44 32 d7 2a 43 2a 13 94 e5 38 39 f6 |
| 426 | Decoded freqs 18 (expected 18) |
| 427 | Decoded: 1 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 417 511 |
| 428 | Range test 4: range 511, num ARFCNs 6 |
| 429 | range=511, arfcns_used=5, f0=1, f0_included=1 |
| 430 | chan_list = 88 00 8b 3c 88 b9 6b 00 00 00 00 00 00 00 00 00 |
| 431 | Decoded freqs 6 (expected 6) |
| 432 | Decoded: 1 17 31 45 58 79 |
| 433 | Range test 5: range 511, num ARFCNs 6 |
| 434 | range=511, arfcns_used=5, f0=10, f0_included=1 |
| 435 | chan_list = 88 05 08 fc 88 b9 6b 00 00 00 00 00 00 00 00 00 |
| 436 | Decoded freqs 6 (expected 6) |
| 437 | Decoded: 10 17 31 45 58 79 |
| 438 | Range test 6: range 1023, num ARFCNs 17 |
| 439 | range=1023, arfcns_used=16, f0=0, f0_included=1 |
| 440 | chan_list = 84 71 e4 ab b9 58 05 cb 39 17 fd b0 75 62 0f 2f |
| 441 | Decoded freqs 17 (expected 17) |
| 442 | Decoded: 0 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 1023 |
| 443 | Range test 7: range 1023, num ARFCNs 16 |
| 444 | range=1023, arfcns_used=16, f0=0, f0_included=0 |
| 445 | chan_list = 80 71 e4 ab b9 58 05 cb 39 17 fd b0 75 62 0f 2f |
| 446 | Decoded freqs 16 (expected 16) |
| 447 | Decoded: 17 31 45 58 79 81 97 113 127 213 277 287 311 331 391 1023 |
| 448 | Random range test: range 127, max num ARFCNs 29 |
| 449 | Random range test: range 255, max num ARFCNs 22 |
| 450 | Random range test: range 511, max num ARFCNs 18 |
| 451 | Random range test: range 1023, max num ARFCNs 16 |