Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 1 | module MSC_Tests { |
| 2 | |
| 3 | import from General_Types all; |
| 4 | import from Osmocom_Types all; |
| 5 | |
| 6 | import from M3UA_Types all; |
| 7 | import from M3UA_Emulation all; |
| 8 | |
| 9 | import from MTP3asp_Types all; |
| 10 | import from MTP3asp_PortType all; |
| 11 | |
| 12 | import from SCCPasp_Types all; |
| 13 | import from SCCP_Types all; |
| 14 | import from SCCP_Emulation all; |
| 15 | |
| 16 | import from SCTPasp_Types all; |
| 17 | import from SCTPasp_PortType all; |
| 18 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 19 | import from Osmocom_CTRL_Functions all; |
| 20 | import from Osmocom_CTRL_Types all; |
| 21 | import from Osmocom_CTRL_Adapter all; |
| 22 | |
Harald Welte | 3ca1c90 | 2018-01-24 18:51:27 +0100 | [diff] [blame] | 23 | import from TELNETasp_PortType all; |
| 24 | import from Osmocom_VTY_Functions all; |
| 25 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 26 | import from MNCC_Emulation all; |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 27 | import from MNCC_Types all; |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 28 | |
Harald Welte | 4aa970c | 2018-01-26 10:38:09 +0100 | [diff] [blame] | 29 | import from MGCP_Emulation all; |
| 30 | import from MGCP_Types all; |
| 31 | import from MGCP_Templates all; |
| 32 | import from SDP_Types all; |
| 33 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 34 | import from GSUP_Emulation all; |
| 35 | import from GSUP_Types all; |
| 36 | import from IPA_Emulation all; |
| 37 | |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 38 | import from BSSAP_Types all; |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 39 | import from BSSAP_Adapter all; |
| 40 | import from BSSAP_CodecPort all; |
| 41 | import from BSSMAP_Templates all; |
| 42 | import from BSSMAP_Emulation all; |
| 43 | import from BSC_ConnectionHandler all; |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 44 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 45 | import from MobileL3_Types all; |
| 46 | import from MobileL3_CommonIE_Types all; |
| 47 | import from L3_Templates all; |
Harald Welte | 158a7ca | 2018-02-16 18:11:31 +0100 | [diff] [blame] | 48 | import from L3_Common all; |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 49 | |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 50 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 51 | type component MTC_CT extends CTRL_Adapter_CT { |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 52 | var boolean g_initialized := false; |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 53 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 54 | var BSSAP_Adapter g_bssap; |
| 55 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 56 | /* no 'adapter_CT' for MNCC or GSUP */ |
| 57 | var MNCC_Emulation_CT vc_MNCC; |
Harald Welte | 4aa970c | 2018-01-26 10:38:09 +0100 | [diff] [blame] | 58 | var MGCP_Emulation_CT vc_MGCP; |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 59 | var GSUP_Emulation_CT vc_GSUP; |
| 60 | var IPA_Emulation_CT vc_GSUP_IPA; |
| 61 | |
| 62 | /* only to get events from IPA underneath GSUP */ |
| 63 | port IPA_CTRL_PT GSUP_IPA_EVENT; |
Harald Welte | 3ca1c90 | 2018-01-24 18:51:27 +0100 | [diff] [blame] | 64 | /* VTY to MSC */ |
| 65 | port TELNETasp_PT MSCVTY; |
Philipp Maier | 328d166 | 2018-03-07 10:40:27 +0100 | [diff] [blame] | 66 | |
| 67 | /* A port to directly send BSSAP messages. This port is used for |
| 68 | * tests that require low level access to sen arbitrary BSSAP |
| 69 | * messages. Run f_init_bssap_direct() to connect and initialize */ |
| 70 | port BSSAP_CODEC_PT BSSAP_DIRECT; |
| 71 | |
| 72 | /* When BSSAP messages are directly sent, then the connection |
| 73 | * handler is not active, which means that also no guard timer is |
| 74 | * set up. The following timer will serve as a replacement */ |
| 75 | timer Tguard_direct := 60.0; |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | modulepar { |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 79 | /* remote parameters of IUT */ |
| 80 | charstring mp_msc_ip := "127.0.0.1"; |
| 81 | integer mp_msc_ctrl_port := 4255; |
| 82 | integer mp_msc_vty_port := 4254; |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 83 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 84 | /* local parameters of emulated HLR */ |
| 85 | charstring mp_hlr_ip := "127.0.0.1"; |
| 86 | integer mp_hlr_port := 4222; |
Harald Welte | 6126fb0 | 2018-01-27 20:08:24 +0100 | [diff] [blame] | 87 | charstring mp_mgw_ip := "127.0.0.1"; |
| 88 | integer mp_mgw_port := 2427; |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 89 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 90 | charstring mp_msc_mncc := "/tmp/mncc"; |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 91 | |
| 92 | BSSAP_Configuration mp_bssap_cfg := { |
| 93 | sccp_service_type := "mtp3_itu", |
| 94 | sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }, |
| 95 | own_pc := 185, |
| 96 | own_ssn := 254, |
| 97 | peer_pc := 187, |
| 98 | peer_ssn := 254 |
| 99 | }; |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 100 | } |
| 101 | |
Philipp Maier | 328d166 | 2018-03-07 10:40:27 +0100 | [diff] [blame] | 102 | /* altstep for the global guard timer (only used when BSSAP_DIRECT |
| 103 | * is used for communication */ |
| 104 | private altstep as_Tguard_direct() runs on MTC_CT { |
| 105 | [] Tguard_direct.timeout { |
| 106 | setverdict(fail, "Tguard timeout"); |
| 107 | self.stop; |
| 108 | } |
| 109 | } |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 110 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 111 | function f_init_mncc(charstring id) runs on MTC_CT { |
| 112 | id := id & "-MNCC"; |
| 113 | var MnccOps ops := { |
| 114 | create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), |
| 115 | unitdata_cb := refers(MNCC_Emulation.DummyUnitdataCallback) |
| 116 | } |
| 117 | |
| 118 | vc_MNCC := MNCC_Emulation_CT.create(id); |
| 119 | map(vc_MNCC:MNCC, system:MNCC_CODEC_PT); |
| 120 | vc_MNCC.start(MNCC_Emulation.main(ops, id, mp_msc_mncc)); |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 121 | } |
| 122 | |
Harald Welte | 4aa970c | 2018-01-26 10:38:09 +0100 | [diff] [blame] | 123 | function f_init_mgcp(charstring id) runs on MTC_CT { |
| 124 | id := id & "-MGCP"; |
| 125 | var MGCPOps ops := { |
| 126 | create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), |
| 127 | unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) |
| 128 | } |
| 129 | var MGCP_conn_parameters pars := { |
Harald Welte | 6126fb0 | 2018-01-27 20:08:24 +0100 | [diff] [blame] | 130 | callagent_ip := mp_msc_ip, |
Harald Welte | 4aa970c | 2018-01-26 10:38:09 +0100 | [diff] [blame] | 131 | callagent_udp_port := -1, |
Harald Welte | 6126fb0 | 2018-01-27 20:08:24 +0100 | [diff] [blame] | 132 | mgw_ip := mp_mgw_ip, |
| 133 | mgw_udp_port := mp_mgw_port |
Harald Welte | 4aa970c | 2018-01-26 10:38:09 +0100 | [diff] [blame] | 134 | } |
| 135 | |
| 136 | vc_MGCP := MGCP_Emulation_CT.create(id); |
| 137 | map(vc_MGCP:MGCP, system:MGCP_CODEC_PT); |
| 138 | vc_MGCP.start(MGCP_Emulation.main(ops, pars, id)); |
| 139 | } |
| 140 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 141 | function f_init_gsup(charstring id) runs on MTC_CT { |
| 142 | id := id & "-GSUP"; |
| 143 | var GsupOps ops := { |
| 144 | create_cb := refers(GSUP_Emulation.ExpectedCreateCallback) |
| 145 | } |
| 146 | |
| 147 | vc_GSUP_IPA := IPA_Emulation_CT.create(id & "-IPA"); |
| 148 | vc_GSUP := GSUP_Emulation_CT.create(id); |
| 149 | |
| 150 | map(vc_GSUP_IPA:IPA_PORT, system:IPA_CODEC_PT); |
| 151 | connect(vc_GSUP:GSUP, vc_GSUP_IPA:IPA_GSUP_PORT); |
| 152 | /* we use this hack to get events like ASP_IPA_EVENT_UP */ |
| 153 | connect(vc_GSUP_IPA:IPA_CTRL_PORT, self:GSUP_IPA_EVENT); |
| 154 | |
| 155 | vc_GSUP.start(GSUP_Emulation.main(ops, id)); |
| 156 | vc_GSUP_IPA.start(IPA_Emulation.main_server(mp_hlr_ip, mp_hlr_port)); |
| 157 | |
| 158 | /* wait for incoming connection to GSUP port before proceeding */ |
| 159 | timer T := 10.0; |
| 160 | T.start; |
| 161 | alt { |
| 162 | [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } |
| 163 | [] T.timeout { |
| 164 | setverdict(inconc, "No connection to GSUP Port"); |
| 165 | self.stop |
| 166 | } |
| 167 | } |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 168 | } |
| 169 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 170 | function f_init() runs on MTC_CT { |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 171 | |
| 172 | if (g_initialized == true) { |
| 173 | return; |
| 174 | } |
| 175 | g_initialized := true; |
| 176 | |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 177 | f_bssap_init(g_bssap, mp_bssap_cfg, "MSC_Test", BSC_BssmapOps); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 178 | f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); |
| 179 | f_init_mncc("MSC_Test"); |
Harald Welte | 4aa970c | 2018-01-26 10:38:09 +0100 | [diff] [blame] | 180 | f_init_mgcp("MSC_Test"); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 181 | f_init_gsup("MSC_Test"); |
Harald Welte | 3ca1c90 | 2018-01-24 18:51:27 +0100 | [diff] [blame] | 182 | |
| 183 | map(self:MSCVTY, system:MSCVTY); |
| 184 | f_vty_set_prompts(MSCVTY); |
| 185 | f_vty_transceive(MSCVTY, "enable"); |
Harald Welte | b14c77a | 2018-01-25 17:25:44 +0100 | [diff] [blame] | 186 | |
| 187 | /* set some defaults */ |
| 188 | f_vty_config(MSCVTY, "network", "authentication optional"); |
| 189 | f_vty_config(MSCVTY, "msc", "assign-tmsi"); |
| 190 | f_vty_config(MSCVTY, "network", "encryption a5 0"); |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 191 | } |
| 192 | |
Philipp Maier | 328d166 | 2018-03-07 10:40:27 +0100 | [diff] [blame] | 193 | /* Initialize for a direct connection to BSSAP. This function is an alternative |
| 194 | * to f_init() when the high level functions of the BSC_ConnectionHandler are |
| 195 | * not needed. */ |
| 196 | function f_init_bssap_direct() runs on MTC_CT { |
| 197 | f_bssap_init(g_bssap, mp_bssap_cfg, "MSC_Test", omit); |
| 198 | connect(g_bssap.vc_SCCP:SCCP_SP_PORT, self:BSSAP_DIRECT); |
| 199 | |
| 200 | /* Start guard timer and activate it as default */ |
| 201 | Tguard_direct.start |
| 202 | activate(as_Tguard_direct()); |
| 203 | } |
| 204 | |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 205 | template PDU_BSSAP ts_BSSAP_BSSMAP := { |
| 206 | discriminator := '0'B, |
| 207 | spare := '0000000'B, |
| 208 | dlci := omit, |
| 209 | lengthIndicator := 0, /* overwritten by codec */ |
| 210 | pdu := ? |
| 211 | } |
| 212 | |
| 213 | template PDU_BSSAP tr_BSSAP_BSSMAP := { |
| 214 | discriminator := '0'B, |
| 215 | spare := '0000000'B, |
| 216 | dlci := omit, |
| 217 | lengthIndicator := ?, |
| 218 | pdu := { |
| 219 | bssmap := ? |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | |
| 224 | type integer BssmapCause; |
| 225 | |
| 226 | template (value) BSSMAP_IE_Cause ts_BSSMAP_IE_Cause(BssmapCause val) := { |
| 227 | elementIdentifier := '04'O, |
| 228 | lengthIndicator := 0, |
| 229 | causeValue := int2bit(val, 7), |
| 230 | extensionCauseValue := '0'B, |
| 231 | spare1 := omit |
| 232 | } |
| 233 | |
| 234 | template (value) PDU_BSSAP ts_BSSMAP_Reset(BssmapCause cause) modifies ts_BSSAP_BSSMAP := { |
| 235 | pdu := { |
| 236 | bssmap := { |
| 237 | reset := { |
| 238 | messageType := '30'O, |
| 239 | cause := ts_BSSMAP_IE_Cause(cause), |
| 240 | a_InterfaceSelectorForReset := omit |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | template (value) PDU_BSSAP ts_BSSMAP_ResetAck modifies ts_BSSAP_BSSMAP := { |
| 247 | pdu := { |
| 248 | bssmap := { |
| 249 | resetAck := { |
| 250 | messageType := '31'O, |
| 251 | a_InterfaceSelectorForReset := omit |
| 252 | } |
| 253 | } |
| 254 | } |
| 255 | } |
| 256 | |
| 257 | template PDU_BSSAP tr_BSSMAP_ResetAck modifies tr_BSSAP_BSSMAP := { |
| 258 | pdu := { |
| 259 | bssmap := { |
| 260 | resetAck := { |
| 261 | messageType := '31'O, |
| 262 | a_InterfaceSelectorForReset := * |
| 263 | } |
| 264 | } |
| 265 | } |
| 266 | } |
| 267 | |
| 268 | template BSSMAP_IE_CellIdentifier ts_BSSMAP_IE_CellID := { |
| 269 | elementIdentifier := '05'O, |
| 270 | lengthIndicator := 0, |
| 271 | cellIdentifierDiscriminator := '0000'B, |
| 272 | spare1_4 := '0000'B, |
| 273 | cellIdentification := ? |
| 274 | } |
| 275 | |
| 276 | type uint16_t BssmapLAC; |
| 277 | type uint16_t BssmapCI; |
| 278 | |
| 279 | /* |
| 280 | template BSSMAP_IE_CellIdentifier ts_CellId_CGI(mcc, mnc, lac, ci) |
| 281 | modifies ts_BSSMAP_IE_CellID := { |
| 282 | cellIdentification := { |
| 283 | cI_LAC_CGI := { |
| 284 | mnc_mcc := FIXME, |
| 285 | lac := int2oct(lac, 2), |
| 286 | ci := int2oct(ci, 2) |
| 287 | } |
| 288 | } |
| 289 | } |
| 290 | */ |
| 291 | |
| 292 | template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) |
| 293 | modifies ts_BSSMAP_IE_CellID := { |
| 294 | cellIdentification := { |
| 295 | cI_LAC_CI := { |
| 296 | lac := int2oct(lac, 2), |
| 297 | ci := int2oct(ci, 2) |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | |
| 302 | template BSSMAP_IE_CellIdentifier ts_CellId_CI(BssmapCI ci) |
| 303 | modifies ts_BSSMAP_IE_CellID := { |
| 304 | cellIdentification := { |
| 305 | cI_CI := int2oct(ci, 2) |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | template BSSMAP_IE_CellIdentifier ts_CellId_none |
| 310 | modifies ts_BSSMAP_IE_CellID := { |
| 311 | cellIdentification := { |
| 312 | cI_noCell := ''O |
| 313 | } |
| 314 | } |
| 315 | |
| 316 | |
| 317 | template BSSMAP_IE_Layer3Information ts_BSSMAP_IE_L3Info(octetstring l3info) := { |
| 318 | elementIdentifier := '17'O, |
| 319 | lengthIndicator := 0, |
| 320 | layer3info := l3info |
| 321 | } |
| 322 | |
| 323 | template PDU_BSSAP ts_BSSMAP_ComplL3(BSSMAP_IE_CellIdentifier cell_id, octetstring l3_info) |
| 324 | modifies ts_BSSAP_BSSMAP := { |
| 325 | pdu := { |
| 326 | bssmap := { |
| 327 | completeLayer3Information := { |
| 328 | messageType := '57'O, |
| 329 | cellIdentifier := cell_id, |
| 330 | layer3Information := ts_BSSMAP_IE_L3Info(l3_info), |
| 331 | chosenChannel := omit, |
| 332 | lSAIdentifier := omit, |
| 333 | aPDU := omit, |
| 334 | codecList := omit, |
| 335 | redirectAttemptFlag := omit, |
| 336 | sendSequenceNumber := omit, |
| 337 | iMSI := omit |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | } |
| 342 | |
| 343 | template PDU_BSSAP ts_BSSMAP_HandoReq(BssmapCause cause, BSSMAP_IE_CellIdentifierList cid_list) |
| 344 | modifies ts_BSSAP_BSSMAP := { |
| 345 | pdu := { |
| 346 | bssmap := { |
| 347 | handoverRequired := { |
| 348 | messageType := '11'O, |
| 349 | cause := ts_BSSMAP_IE_Cause(cause), |
| 350 | responseRequest := omit, |
| 351 | cellIdentifierList := cid_list, |
| 352 | circuitPoolList := omit, |
| 353 | currentChannelType1 := omit, |
| 354 | speechVersion := omit, |
| 355 | queueingIndicator := omit, |
| 356 | oldToNewBSSInfo := omit, |
| 357 | sourceToTargetRNCTransparentInfo := omit, |
| 358 | sourceToTargetRNCTransparentInfoCDMA := omit, |
| 359 | gERANClassmark := omit, |
| 360 | talkerPriority := omit, |
| 361 | speechCodec := omit, |
| 362 | cSG_Identifier := omit |
| 363 | } |
| 364 | } |
| 365 | } |
| 366 | } |
| 367 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 368 | type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 369 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 370 | /* FIXME: move into BSC_ConnectionHandler? */ |
Neels Hofmeyr | 9adaa70 | 2018-03-01 20:23:19 +0100 | [diff] [blame] | 371 | function f_init_pars(integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlrPars { |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 372 | var BSC_ConnHdlrNetworkPars net_pars := { |
| 373 | kc_support := '0A'O, /* A5/1 and A5/3 enabled */ |
| 374 | expect_tmsi := true, |
| 375 | expect_auth := false, |
| 376 | expect_ciph := false |
| 377 | }; |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 378 | var BSC_ConnHdlrPars pars := { |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 379 | sccp_addr_own := g_bssap.sccp_addr_own, |
| 380 | sccp_addr_peer := g_bssap.sccp_addr_peer, |
Harald Welte | edbab81 | 2018-03-18 16:02:25 +0100 | [diff] [blame] | 381 | cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)), |
Harald Welte | 81b7f9d | 2018-01-24 19:06:24 +0100 | [diff] [blame] | 382 | imei := f_gen_imei(imsi_suffix), |
| 383 | imsi := f_gen_imsi(imsi_suffix), |
| 384 | msisdn := f_gen_msisdn(imsi_suffix), |
Harald Welte | 256571e | 2018-01-24 18:47:19 +0100 | [diff] [blame] | 385 | tmsi := omit, |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 386 | cm1 := valueof(ts_CM1), |
Harald Welte | 8260057 | 2018-01-21 20:54:08 +0100 | [diff] [blame] | 387 | cm2 := valueof(ts_CM2_default), |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 388 | cm3 := omit, |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 389 | vec := omit, |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 390 | net := net_pars, |
| 391 | send_early_cm := true |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 392 | }; |
Neels Hofmeyr | 9adaa70 | 2018-03-01 20:23:19 +0100 | [diff] [blame] | 393 | return pars; |
| 394 | } |
| 395 | |
| 396 | function f_start_handler_with_pars(void_fn fn, BSC_ConnHdlrPars pars) runs on MTC_CT return BSC_ConnHdlr { |
| 397 | var BSC_ConnHdlr vc_conn; |
| 398 | var charstring id := testcasename(); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 399 | |
| 400 | vc_conn := BSC_ConnHdlr.create(id); |
| 401 | /* BSSMAP part / A interface */ |
Harald Welte | a4ca446 | 2018-02-09 00:17:14 +0100 | [diff] [blame] | 402 | connect(vc_conn:BSSAP, g_bssap.vc_BSSMAP:CLIENT); |
| 403 | connect(vc_conn:BSSAP_PROC, g_bssap.vc_BSSMAP:PROC); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 404 | /* MNCC part */ |
| 405 | connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); |
| 406 | connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); |
Harald Welte | 4aa970c | 2018-01-26 10:38:09 +0100 | [diff] [blame] | 407 | /* MGCP part */ |
| 408 | connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); |
| 409 | connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 410 | /* GSUP part */ |
| 411 | connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); |
| 412 | connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); |
| 413 | |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 414 | /* We cannot use vc_conn.start(f_init_handler(fn, id, pars)); as we cannot have |
| 415 | * a stand-alone 'derefers()' call, see https://www.eclipse.org/forums/index.php/t/1091364/ */ |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 416 | vc_conn.start(derefers(fn)(id, pars)); |
| 417 | return vc_conn; |
| 418 | } |
| 419 | |
Neels Hofmeyr | 9adaa70 | 2018-03-01 20:23:19 +0100 | [diff] [blame] | 420 | function f_start_handler(void_fn fn, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { |
| 421 | return f_start_handler_with_pars(fn, f_init_pars(imsi_suffix)); |
| 422 | } |
| 423 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 424 | private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 425 | f_init_handler(pars); |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 426 | f_perform_lu(); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 427 | } |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 428 | testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { |
| 429 | var BSC_ConnHdlr vc_conn; |
| 430 | f_init(); |
| 431 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 432 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), 1); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 433 | vc_conn.done; |
| 434 | } |
| 435 | |
| 436 | private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 437 | pars.net.expect_tmsi := false; |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 438 | f_init_handler(pars); |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 439 | f_perform_lu(); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 440 | } |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 441 | testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { |
| 442 | var BSC_ConnHdlr vc_conn; |
| 443 | f_init(); |
Harald Welte | 3ca1c90 | 2018-01-24 18:51:27 +0100 | [diff] [blame] | 444 | f_vty_config(MSCVTY, "msc", "no assign-tmsi"); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 445 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 446 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), 2); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 447 | vc_conn.done; |
| 448 | } |
| 449 | |
| 450 | /* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */ |
| 451 | private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 452 | f_init_handler(pars); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 453 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); |
| 454 | |
| 455 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 456 | f_bssap_compl_l3(l3_lu); |
| 457 | GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); |
| 458 | GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 23)); |
| 459 | alt { |
| 460 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej(int2oct(23,1)))) { } |
| 461 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { |
| 462 | setverdict(fail, "Expecting LU REJ, but got ACCEPT"); |
| 463 | self.stop; |
| 464 | } |
| 465 | } |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 466 | f_expect_clear(); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 467 | } |
| 468 | testcase TC_lu_imsi_reject() runs on MTC_CT { |
| 469 | var BSC_ConnHdlr vc_conn; |
| 470 | f_init(); |
| 471 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 472 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), 3); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 473 | vc_conn.done; |
| 474 | } |
| 475 | |
| 476 | /* Do LU by IMSI, timeout on GSUP */ |
| 477 | private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 478 | f_init_handler(pars); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 479 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); |
| 480 | |
| 481 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 482 | f_bssap_compl_l3(l3_lu); |
| 483 | GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); |
| 484 | /* Normally the HLR would need to respond here, but we decide to force a timeout here */ |
| 485 | alt { |
| 486 | /* FIXME: Expect specific reject cause */ |
| 487 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } |
| 488 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { |
| 489 | setverdict(fail, "Expecting LU REJ, but got ACCEPT"); |
| 490 | self.stop; |
| 491 | } |
| 492 | } |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 493 | f_expect_clear(); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 494 | } |
| 495 | testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { |
| 496 | var BSC_ConnHdlr vc_conn; |
| 497 | f_init(); |
| 498 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 499 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), 4); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 500 | vc_conn.done; |
| 501 | } |
| 502 | |
Harald Welte | 7b1b281 | 2018-01-22 21:23:06 +0100 | [diff] [blame] | 503 | private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 504 | pars.net.expect_auth := true; |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 505 | f_init_handler(pars); |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 506 | f_perform_lu(); |
Harald Welte | 7b1b281 | 2018-01-22 21:23:06 +0100 | [diff] [blame] | 507 | } |
| 508 | testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { |
| 509 | var BSC_ConnHdlr vc_conn; |
| 510 | f_init(); |
Harald Welte | 3ca1c90 | 2018-01-24 18:51:27 +0100 | [diff] [blame] | 511 | f_vty_config(MSCVTY, "network", "authentication required"); |
Harald Welte | 7b1b281 | 2018-01-22 21:23:06 +0100 | [diff] [blame] | 512 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 513 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi), 5); |
Harald Welte | 7b1b281 | 2018-01-22 21:23:06 +0100 | [diff] [blame] | 514 | vc_conn.done; |
| 515 | } |
| 516 | |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 517 | |
| 518 | /* Send CM SERVICE REQ for IMSI that has never performed LU before */ |
| 519 | private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) |
| 520 | runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 521 | f_init_handler(pars); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 522 | |
| 523 | var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
Harald Welte | edbab81 | 2018-03-18 16:02:25 +0100 | [diff] [blame] | 524 | var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '42'H, 23, 42)); |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 525 | var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 526 | |
| 527 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 528 | |
| 529 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 530 | f_bssap_compl_l3(l3_info); |
| 531 | |
| 532 | timer T := 10.0; |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 533 | T.start; |
| 534 | alt { |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 535 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } |
| 536 | //[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)) { } |
| 537 | [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } |
| 538 | [] GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) { |
| 539 | setverdict(fail, "Unexpected GSUP UL REQ"); |
| 540 | } |
Daniel Willmann | 90829d6 | 2018-02-15 17:45:14 +0100 | [diff] [blame] | 541 | [] T.timeout { setverdict(fail, "Timeout waiting for CM SERV REQ"); } |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 542 | } |
| 543 | |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 544 | f_expect_clear(); |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 545 | } |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 546 | testcase TC_cmserv_imsi_unknown() runs on MTC_CT { |
| 547 | var BSC_ConnHdlr vc_conn; |
| 548 | f_init(); |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 549 | vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), 6); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 550 | vc_conn.done; |
| 551 | } |
| 552 | |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 553 | private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 554 | f_init_handler(pars); |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 555 | var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); |
| 556 | cpars.bss_rtp_port := 1110; |
| 557 | cpars.mgcp_connection_id_bss := '22222'H; |
| 558 | cpars.mgcp_connection_id_mss := '33333'H; |
Philipp Maier | f1e02bb | 2018-03-15 16:30:00 +0100 | [diff] [blame] | 559 | cpars.mgcp_ep := "rtpbridge/1@mgw"; |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 560 | |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 561 | f_perform_lu(); |
Harald Welte | b71901a | 2018-01-26 19:16:05 +0100 | [diff] [blame] | 562 | f_mo_call(cpars); |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 563 | } |
| 564 | testcase TC_lu_and_mo_call() runs on MTC_CT { |
| 565 | var BSC_ConnHdlr vc_conn; |
| 566 | f_init(); |
| 567 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 568 | vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), 7); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 569 | vc_conn.done; |
| 570 | } |
| 571 | |
| 572 | /* Test LU (with authentication enabled), where HLR times out sending SAI response */ |
| 573 | private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 574 | f_init_handler(pars); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 575 | |
| 576 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) |
| 577 | var PDU_DTAP_MT dtap_mt; |
| 578 | |
| 579 | /* tell GSUP dispatcher to send this IMSI to us */ |
| 580 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 581 | |
| 582 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 583 | f_bssap_compl_l3(l3_lu); |
| 584 | |
| 585 | /* Send Early Classmark, just for the fun of it */ |
| 586 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 587 | |
| 588 | GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); |
| 589 | /* The HLR would normally return an auth vector here, but we fail to do so. */ |
| 590 | |
| 591 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 592 | f_expect_clear(); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 593 | } |
| 594 | testcase TC_lu_auth_sai_timeout() runs on MTC_CT { |
| 595 | var BSC_ConnHdlr vc_conn; |
| 596 | f_init(); |
Harald Welte | 3ca1c90 | 2018-01-24 18:51:27 +0100 | [diff] [blame] | 597 | f_vty_config(MSCVTY, "network", "authentication required"); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 598 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 599 | vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), 8); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 600 | vc_conn.done; |
| 601 | } |
| 602 | |
| 603 | /* Test LU (with authentication enabled), where HLR rejects sending SAI error */ |
| 604 | private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 605 | f_init_handler(pars); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 606 | |
| 607 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) |
| 608 | var PDU_DTAP_MT dtap_mt; |
| 609 | |
| 610 | /* tell GSUP dispatcher to send this IMSI to us */ |
| 611 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 612 | |
| 613 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 614 | f_bssap_compl_l3(l3_lu); |
| 615 | |
| 616 | /* Send Early Classmark, just for the fun of it */ |
| 617 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 618 | |
| 619 | GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); |
| 620 | GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13)); |
| 621 | |
| 622 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 623 | f_expect_clear(); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 624 | } |
| 625 | testcase TC_lu_auth_sai_err() runs on MTC_CT { |
| 626 | var BSC_ConnHdlr vc_conn; |
| 627 | f_init(); |
Harald Welte | 3ca1c90 | 2018-01-24 18:51:27 +0100 | [diff] [blame] | 628 | f_vty_config(MSCVTY, "network", "authentication required"); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 629 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 630 | vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), 9); |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 631 | vc_conn.done; |
| 632 | } |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 633 | |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 634 | /* Test LU but BSC will send a clear request in the middle */ |
| 635 | private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 636 | f_init_handler(pars); |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 637 | |
| 638 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) |
| 639 | var PDU_DTAP_MT dtap_mt; |
| 640 | |
| 641 | /* tell GSUP dispatcher to send this IMSI to us */ |
| 642 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 643 | |
| 644 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 645 | f_bssap_compl_l3(l3_lu); |
| 646 | |
| 647 | /* Send Early Classmark, just for the fun of it */ |
| 648 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 649 | |
| 650 | f_sleep(1.0); |
| 651 | /* send clear request in the middle of the LU */ |
| 652 | BSSAP.send(ts_BSSMAP_ClearRequest(0)); |
| 653 | BSSAP.receive(tr_BSSMAP_ClearCommand); |
| 654 | BSSAP.send(ts_BSSMAP_ClearComplete); |
Harald Welte | 89a3249 | 2018-01-27 19:07:28 +0100 | [diff] [blame] | 655 | alt { |
| 656 | /* See https://osmocom.org/issues/2862 */ |
| 657 | [] BSSAP.receive(tr_BSSMAP_ClearCommand) { repeat; } |
| 658 | [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} |
| 659 | } |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 660 | setverdict(pass); |
| 661 | } |
| 662 | testcase TC_lu_clear_request() runs on MTC_CT { |
| 663 | var BSC_ConnHdlr vc_conn; |
| 664 | f_init(); |
| 665 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 666 | vc_conn := f_start_handler(refers(f_tc_lu_clear_request), 10); |
Harald Welte | bc88178 | 2018-01-23 20:09:15 +0100 | [diff] [blame] | 667 | vc_conn.done; |
| 668 | } |
| 669 | |
Harald Welte | 66af9e6 | 2018-01-24 17:28:21 +0100 | [diff] [blame] | 670 | /* Test LU but BSC will send a clear request in the middle */ |
| 671 | private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 672 | f_init_handler(pars); |
Harald Welte | 66af9e6 | 2018-01-24 17:28:21 +0100 | [diff] [blame] | 673 | |
| 674 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) |
| 675 | var PDU_DTAP_MT dtap_mt; |
| 676 | |
| 677 | /* tell GSUP dispatcher to send this IMSI to us */ |
| 678 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 679 | |
| 680 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 681 | f_bssap_compl_l3(l3_lu); |
| 682 | |
| 683 | /* Send Early Classmark, just for the fun of it */ |
| 684 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 685 | |
| 686 | f_sleep(1.0); |
| 687 | /* send clear request in the middle of the LU */ |
| 688 | BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); |
| 689 | setverdict(pass); |
| 690 | } |
| 691 | testcase TC_lu_disconnect() runs on MTC_CT { |
| 692 | var BSC_ConnHdlr vc_conn; |
| 693 | f_init(); |
| 694 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 695 | vc_conn := f_start_handler(refers(f_tc_lu_disconnect), 11); |
Harald Welte | 66af9e6 | 2018-01-24 17:28:21 +0100 | [diff] [blame] | 696 | vc_conn.done; |
| 697 | } |
| 698 | |
| 699 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 700 | /* Test LU but with illegal mobile identity type = IMEI */ |
| 701 | private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 702 | f_init_handler(pars); |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 703 | |
Harald Welte | 256571e | 2018-01-24 18:47:19 +0100 | [diff] [blame] | 704 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imei) |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 705 | var PDU_DTAP_MT dtap_mt; |
| 706 | |
| 707 | /* tell GSUP dispatcher to send this IMSI to us */ |
| 708 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 709 | |
| 710 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 711 | f_bssap_compl_l3(l3_lu); |
| 712 | |
| 713 | /* Send Early Classmark, just for the fun of it */ |
| 714 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 715 | /* wait for LU reject, ignore any ID REQ */ |
| 716 | alt { |
| 717 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } |
| 718 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_ID_Req)) { repeat; } |
| 719 | } |
| 720 | /* wait for normal teardown */ |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 721 | f_expect_clear(); |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 722 | } |
| 723 | testcase TC_lu_by_imei() runs on MTC_CT { |
| 724 | var BSC_ConnHdlr vc_conn; |
| 725 | f_init(); |
| 726 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 727 | vc_conn := f_start_handler(refers(f_tc_lu_by_imei), 12); |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 728 | vc_conn.done; |
| 729 | } |
| 730 | |
| 731 | /* Test LU by TMSI with unknown TMSI, expect (and answer) ID REQ. */ |
| 732 | private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 733 | f_init_handler(pars); |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 734 | |
| 735 | var PDU_ML3_MS_NW l3_lu := f_build_lu_tmsi('01020304'O); /* FIXME: Random */ |
| 736 | var PDU_DTAP_MT dtap_mt; |
| 737 | |
| 738 | /* tell GSUP dispatcher to send this IMSI to us */ |
| 739 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 740 | |
| 741 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 742 | f_bssap_compl_l3(l3_lu); |
| 743 | |
| 744 | /* Send Early Classmark, just for the fun of it */ |
| 745 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 746 | |
| 747 | /* Wait for + respond to ID REQ (IMSI) */ |
| 748 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_ID_Req('001'B))); |
| 749 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_MM_ID_Rsp_IMSI(g_pars.imsi))); |
| 750 | |
| 751 | /* Expect MSC to do UpdateLocation to HLR; respond to it */ |
| 752 | GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); |
| 753 | GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); |
| 754 | GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); |
| 755 | GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); |
| 756 | |
| 757 | alt { |
Harald Welte | 7ec4fa8 | 2018-01-27 10:57:40 +0100 | [diff] [blame] | 758 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { |
| 759 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); |
| 760 | } |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 761 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { |
| 762 | setverdict(fail, "Expected LU ACK, but received REJ"); |
| 763 | } |
| 764 | } |
| 765 | |
| 766 | /* wait for normal teardown */ |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 767 | f_expect_clear(); |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 768 | } |
| 769 | testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { |
| 770 | var BSC_ConnHdlr vc_conn; |
| 771 | f_init(); |
| 772 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 773 | vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), 13); |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 774 | vc_conn.done; |
| 775 | } |
| 776 | |
| 777 | |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 778 | /* Test IMSI DETACH (MI=IMSI) */ |
| 779 | private function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 780 | f_init_handler(pars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 781 | |
| 782 | var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
| 783 | |
| 784 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 785 | f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); |
| 786 | |
| 787 | /* Send Early Classmark, just for the fun of it? */ |
| 788 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 789 | |
| 790 | /* wait for normal teardown */ |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 791 | f_expect_clear(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 792 | } |
| 793 | testcase TC_imsi_detach_by_imsi() runs on MTC_CT { |
| 794 | var BSC_ConnHdlr vc_conn; |
| 795 | f_init(); |
| 796 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 797 | vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), 14); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 798 | vc_conn.done; |
| 799 | } |
| 800 | |
| 801 | /* Test IMSI DETACH (MI=TMSI) */ |
| 802 | private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 803 | f_init_handler(pars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 804 | |
| 805 | var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O)); |
| 806 | |
| 807 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 808 | f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); |
| 809 | |
| 810 | /* Send Early Classmark, just for the fun of it? */ |
| 811 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 812 | |
| 813 | /* wait for normal teardown */ |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 814 | f_expect_clear(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 815 | } |
| 816 | testcase TC_imsi_detach_by_tmsi() runs on MTC_CT { |
| 817 | var BSC_ConnHdlr vc_conn; |
| 818 | f_init(); |
| 819 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 820 | vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), 15); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 821 | vc_conn.done; |
| 822 | } |
| 823 | |
| 824 | /* Test IMSI DETACH (MI=IMEI), which is illegal */ |
| 825 | private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 826 | f_init_handler(pars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 827 | |
Harald Welte | 256571e | 2018-01-24 18:47:19 +0100 | [diff] [blame] | 828 | var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 829 | |
| 830 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 831 | f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); |
| 832 | |
| 833 | /* Send Early Classmark, just for the fun of it? */ |
| 834 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 835 | |
| 836 | /* wait for normal teardown */ |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 837 | f_expect_clear(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 838 | } |
| 839 | testcase TC_imsi_detach_by_imei() runs on MTC_CT { |
| 840 | var BSC_ConnHdlr vc_conn; |
| 841 | f_init(); |
| 842 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 843 | vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), 16); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 844 | vc_conn.done; |
| 845 | } |
| 846 | |
| 847 | |
| 848 | /* helper function for an emergency call. caller passes in mobile identity to use */ |
| 849 | private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr { |
Harald Welte | 0bef21e | 2018-02-10 09:48:23 +0100 | [diff] [blame] | 850 | var CallParameters cpars := valueof(t_CallParams('112'H, 0)); |
| 851 | cpars.emergency := true; |
Philipp Maier | f1e02bb | 2018-03-15 16:30:00 +0100 | [diff] [blame] | 852 | cpars.mgcp_ep := "rtpbridge/1@mgw"; |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 853 | |
Harald Welte | 0bef21e | 2018-02-10 09:48:23 +0100 | [diff] [blame] | 854 | f_mo_call(cpars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 855 | } |
| 856 | |
| 857 | /* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ |
| 858 | private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 859 | f_init_handler(pars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 860 | |
Harald Welte | 256571e | 2018-01-24 18:47:19 +0100 | [diff] [blame] | 861 | var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 862 | var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 863 | f_bssap_compl_l3(l3_info); |
| 864 | BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 865 | f_expect_clear(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 866 | } |
| 867 | testcase TC_emerg_call_imei_reject() runs on MTC_CT { |
| 868 | var BSC_ConnHdlr vc_conn; |
| 869 | f_init(); |
| 870 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 871 | vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), 17); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 872 | vc_conn.done; |
| 873 | } |
| 874 | |
Harald Welte | d5b9140 | 2018-01-24 18:48:16 +0100 | [diff] [blame] | 875 | /* establish an emergency call by IMSI, SIM inserted (and hence IMSI) */ |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 876 | private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 877 | f_init_handler(pars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 878 | /* First perform location update to ensure subscriber is known */ |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 879 | f_perform_lu(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 880 | /* Then issue emergency call identified by IMSI */ |
| 881 | f_emerg_call(valueof(ts_MI_IMSI_LV(g_pars.imsi))); |
| 882 | } |
| 883 | testcase TC_emerg_call_imsi() runs on MTC_CT { |
| 884 | var BSC_ConnHdlr vc_conn; |
| 885 | f_init(); |
| 886 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 887 | vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), 18); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 888 | vc_conn.done; |
| 889 | } |
| 890 | |
| 891 | /* CM Service Request for VGCS -> reject */ |
| 892 | private function f_tc_cm_serv_req_vgcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 893 | f_init_handler(pars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 894 | |
| 895 | /* First perform location update to ensure subscriber is known */ |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 896 | f_perform_lu(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 897 | |
| 898 | var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 899 | var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 900 | f_bssap_compl_l3(l3_info); |
| 901 | BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 902 | f_expect_clear(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 903 | } |
| 904 | testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { |
| 905 | var BSC_ConnHdlr vc_conn; |
| 906 | f_init(); |
| 907 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 908 | vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), 19); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 909 | vc_conn.done; |
| 910 | } |
| 911 | |
| 912 | /* CM Service Request for VBS -> reject */ |
| 913 | private function f_tc_cm_serv_req_vbs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 914 | f_init_handler(pars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 915 | |
| 916 | /* First perform location update to ensure subscriber is known */ |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 917 | f_perform_lu(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 918 | |
| 919 | var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 920 | var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 921 | f_bssap_compl_l3(l3_info); |
| 922 | BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 923 | f_expect_clear(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 924 | } |
| 925 | testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { |
| 926 | var BSC_ConnHdlr vc_conn; |
| 927 | f_init(); |
| 928 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 929 | vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), 20); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 930 | vc_conn.done; |
| 931 | } |
| 932 | |
| 933 | /* CM Service Request for LCS -> reject */ |
| 934 | private function f_tc_cm_serv_req_lcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 935 | f_init_handler(pars); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 936 | |
| 937 | /* First perform location update to ensure subscriber is known */ |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 938 | f_perform_lu(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 939 | |
| 940 | var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
Harald Welte | 6ed6bf9 | 2018-01-24 21:09:15 +0100 | [diff] [blame] | 941 | var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 942 | f_bssap_compl_l3(l3_info); |
| 943 | BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 944 | f_expect_clear(); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 945 | } |
| 946 | testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { |
| 947 | var BSC_ConnHdlr vc_conn; |
| 948 | f_init(); |
| 949 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 950 | vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), 21); |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 951 | vc_conn.done; |
| 952 | } |
| 953 | |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 954 | /* CM Re-Establishment Request */ |
| 955 | private function f_tc_cm_reest_req_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 956 | f_init_handler(pars); |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 957 | |
| 958 | /* First perform location update to ensure subscriber is known */ |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 959 | f_perform_lu(); |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 960 | |
| 961 | var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
| 962 | var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); |
| 963 | f_bssap_compl_l3(l3_info); |
| 964 | BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 965 | f_expect_clear(); |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 966 | } |
| 967 | testcase TC_cm_reest_req_reject() runs on MTC_CT { |
| 968 | var BSC_ConnHdlr vc_conn; |
| 969 | f_init(); |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 970 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 971 | vc_conn := f_start_handler(refers(f_tc_cm_reest_req_reject), 22); |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 972 | vc_conn.done; |
| 973 | } |
| 974 | |
Harald Welte | c638f4d | 2018-01-24 22:00:36 +0100 | [diff] [blame] | 975 | /* Test LU (with authentication enabled), with wrong response from MS */ |
| 976 | private function f_tc_lu_auth_2G_fail(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 977 | f_init_handler(pars); |
Harald Welte | c638f4d | 2018-01-24 22:00:36 +0100 | [diff] [blame] | 978 | |
| 979 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) |
| 980 | |
| 981 | /* tell GSUP dispatcher to send this IMSI to us */ |
| 982 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 983 | |
| 984 | /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ |
| 985 | f_bssap_compl_l3(l3_lu); |
| 986 | |
| 987 | /* Send Early Classmark, just for the fun of it */ |
| 988 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 989 | |
| 990 | var AuthVector vec := f_gen_auth_vec_2g(); |
| 991 | var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); |
| 992 | GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); |
| 993 | GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); |
| 994 | |
| 995 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(vec.rand))); |
| 996 | /* Send back wrong auth response */ |
| 997 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G('00000000'O))); |
| 998 | |
| 999 | /* Expect GSUP AUTH FAIL REP to HLR */ |
| 1000 | GSUP.receive(tr_GSUP_AUTH_FAIL_IND(g_pars.imsi)); |
| 1001 | |
| 1002 | /* Expect LU REJECT with Cause == Illegal MS */ |
| 1003 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej('03'O))); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 1004 | f_expect_clear(); |
Harald Welte | c638f4d | 2018-01-24 22:00:36 +0100 | [diff] [blame] | 1005 | } |
| 1006 | testcase TC_lu_auth_2G_fail() runs on MTC_CT { |
| 1007 | var BSC_ConnHdlr vc_conn; |
| 1008 | f_init(); |
| 1009 | f_vty_config(MSCVTY, "network", "authentication required"); |
Harald Welte | c638f4d | 2018-01-24 22:00:36 +0100 | [diff] [blame] | 1010 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1011 | vc_conn := f_start_handler(refers(f_tc_lu_auth_2G_fail), 23); |
Harald Welte | c638f4d | 2018-01-24 22:00:36 +0100 | [diff] [blame] | 1012 | vc_conn.done; |
| 1013 | } |
| 1014 | |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 1015 | /* A5/1 + A5/3 permitted on network side, and MS capable to do it */ |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1016 | private function f_tc_lu_imsi_auth_tmsi_encr_13_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 1017 | pars.net.expect_auth := true; |
| 1018 | pars.net.expect_ciph := true; |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 1019 | f_init_handler(pars); |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1020 | f_perform_lu(); |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1021 | } |
| 1022 | testcase TC_lu_imsi_auth_tmsi_encr_13_13() runs on MTC_CT { |
| 1023 | var BSC_ConnHdlr vc_conn; |
| 1024 | f_init(); |
| 1025 | f_vty_config(MSCVTY, "network", "authentication required"); |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1026 | f_vty_config(MSCVTY, "network", "encryption a5 1 3"); |
| 1027 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1028 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_13_13), 24); |
Harald Welte | 1611428 | 2018-01-24 22:41:21 +0100 | [diff] [blame] | 1029 | vc_conn.done; |
| 1030 | } |
| 1031 | |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1032 | /* Test Complete L3 without payload */ |
| 1033 | private function f_tc_cl3_no_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 1034 | f_init_handler(pars); |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1035 | |
| 1036 | /* Send Complete L3 Info with empty L3 frame */ |
| 1037 | BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, |
| 1038 | valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, ''O)))); |
| 1039 | |
Harald Welte | f466eb4 | 2018-01-27 14:26:54 +0100 | [diff] [blame] | 1040 | timer T := 5.0; |
| 1041 | T.start; |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1042 | alt { |
| 1043 | [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} |
| 1044 | /* Expect LU REJECT with Cause == Illegal MS */ |
| 1045 | [] BSSAP.receive(tr_BSSMAP_ClearCommand) { |
| 1046 | BSSAP.send(ts_BSSMAP_ClearComplete); |
| 1047 | BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); |
| 1048 | } |
Harald Welte | bdb3c45 | 2018-03-18 22:43:06 +0100 | [diff] [blame] | 1049 | [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } |
| 1050 | [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } |
Harald Welte | f466eb4 | 2018-01-27 14:26:54 +0100 | [diff] [blame] | 1051 | [] T.timeout { |
Daniel Willmann | 90829d6 | 2018-02-15 17:45:14 +0100 | [diff] [blame] | 1052 | setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); |
Harald Welte | f466eb4 | 2018-01-27 14:26:54 +0100 | [diff] [blame] | 1053 | self.stop; |
| 1054 | } |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1055 | } |
| 1056 | setverdict(pass); |
| 1057 | } |
| 1058 | testcase TC_cl3_no_payload() runs on MTC_CT { |
| 1059 | var BSC_ConnHdlr vc_conn; |
| 1060 | f_init(); |
| 1061 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1062 | vc_conn := f_start_handler(refers(f_tc_cl3_no_payload), 25); |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1063 | vc_conn.done; |
| 1064 | } |
| 1065 | |
| 1066 | /* Test Complete L3 with random payload */ |
| 1067 | private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 1068 | f_init_handler(pars); |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1069 | |
| 1070 | var integer len := float2int(rnd() * 256.0); |
| 1071 | var octetstring payl := f_rnd_octstring(len); |
| 1072 | |
| 1073 | /* Send Complete L3 Info with empty L3 frame */ |
| 1074 | BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, |
| 1075 | valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, payl)))); |
| 1076 | |
Harald Welte | f466eb4 | 2018-01-27 14:26:54 +0100 | [diff] [blame] | 1077 | timer T := 5.0; |
| 1078 | T.start; |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1079 | alt { |
| 1080 | /* Immediate disconnect */ |
| 1081 | [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} |
| 1082 | /* Expect LU REJECT with Cause == Illegal MS */ |
| 1083 | [] BSSAP.receive(tr_BSSMAP_ClearCommand) { |
| 1084 | BSSAP.send(ts_BSSMAP_ClearComplete); |
| 1085 | BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); |
| 1086 | } |
| 1087 | [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } |
Harald Welte | bdb3c45 | 2018-03-18 22:43:06 +0100 | [diff] [blame] | 1088 | [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) { repeat; } |
Harald Welte | f466eb4 | 2018-01-27 14:26:54 +0100 | [diff] [blame] | 1089 | [] T.timeout { |
Daniel Willmann | 90829d6 | 2018-02-15 17:45:14 +0100 | [diff] [blame] | 1090 | setverdict(fail, "Timeout waiting for ClearCommand or SCCP Release"); |
Harald Welte | f466eb4 | 2018-01-27 14:26:54 +0100 | [diff] [blame] | 1091 | self.stop; |
| 1092 | } |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1093 | } |
| 1094 | setverdict(pass); |
| 1095 | } |
| 1096 | testcase TC_cl3_rnd_payload() runs on MTC_CT { |
| 1097 | var BSC_ConnHdlr vc_conn; |
| 1098 | f_init(); |
| 1099 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1100 | vc_conn := f_start_handler(refers(f_tc_cl3_rnd_payload), 26); |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1101 | vc_conn.done; |
| 1102 | } |
| 1103 | |
Harald Welte | 116e433 | 2018-01-26 22:17:48 +0100 | [diff] [blame] | 1104 | /* Test Complete L3 with random payload */ |
| 1105 | private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 1106 | f_init_handler(pars); |
Harald Welte | 116e433 | 2018-01-26 22:17:48 +0100 | [diff] [blame] | 1107 | |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1108 | f_perform_lu(); |
Harald Welte | 116e433 | 2018-01-26 22:17:48 +0100 | [diff] [blame] | 1109 | |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 1110 | f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 1111 | f_expect_clear(); |
Harald Welte | 116e433 | 2018-01-26 22:17:48 +0100 | [diff] [blame] | 1112 | } |
| 1113 | testcase TC_establish_and_nothing() runs on MTC_CT { |
| 1114 | var BSC_ConnHdlr vc_conn; |
| 1115 | f_init(); |
| 1116 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1117 | vc_conn := f_start_handler(refers(f_tc_establish_and_nothing), 27); |
Harald Welte | 116e433 | 2018-01-26 22:17:48 +0100 | [diff] [blame] | 1118 | vc_conn.done; |
| 1119 | } |
| 1120 | |
Harald Welte | 12510c5 | 2018-01-26 22:26:24 +0100 | [diff] [blame] | 1121 | /* Test MO Call SETUP with no response from MNCC */ |
| 1122 | private function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 1123 | f_init_handler(pars); |
| 1124 | |
Harald Welte | 12510c5 | 2018-01-26 22:26:24 +0100 | [diff] [blame] | 1125 | var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); |
| 1126 | |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1127 | f_perform_lu(); |
Harald Welte | 12510c5 | 2018-01-26 22:26:24 +0100 | [diff] [blame] | 1128 | |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 1129 | f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); |
Harald Welte | 12510c5 | 2018-01-26 22:26:24 +0100 | [diff] [blame] | 1130 | f_create_mncc_expect(hex2str(cpars.called_party)); |
| 1131 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1132 | |
| 1133 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); |
| 1134 | |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 1135 | f_expect_clear(30.0); |
Harald Welte | 12510c5 | 2018-01-26 22:26:24 +0100 | [diff] [blame] | 1136 | } |
| 1137 | testcase TC_mo_setup_and_nothing() runs on MTC_CT { |
| 1138 | var BSC_ConnHdlr vc_conn; |
| 1139 | f_init(); |
| 1140 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1141 | vc_conn := f_start_handler(refers(f_tc_mo_setup_and_nothing), 28); |
Harald Welte | 12510c5 | 2018-01-26 22:26:24 +0100 | [diff] [blame] | 1142 | vc_conn.done; |
| 1143 | } |
| 1144 | |
Harald Welte | 3ab8800 | 2018-01-26 22:37:25 +0100 | [diff] [blame] | 1145 | /* Test MO Call with no response to RAN-side CRCX */ |
| 1146 | private function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 1147 | f_init_handler(pars); |
Harald Welte | 3ab8800 | 2018-01-26 22:37:25 +0100 | [diff] [blame] | 1148 | var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); |
| 1149 | var MNCC_PDU mncc; |
| 1150 | var MgcpCommand mgcp_cmd; |
| 1151 | |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1152 | f_perform_lu(); |
Harald Welte | 3ab8800 | 2018-01-26 22:37:25 +0100 | [diff] [blame] | 1153 | |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 1154 | f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); |
Harald Welte | 3ab8800 | 2018-01-26 22:37:25 +0100 | [diff] [blame] | 1155 | f_create_mncc_expect(hex2str(cpars.called_party)); |
| 1156 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1157 | |
| 1158 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); |
| 1159 | MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc; |
| 1160 | cpars.mncc_callref := mncc.u.signal.callref; |
| 1161 | MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); |
| 1162 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); |
| 1163 | |
| 1164 | MGCP.receive(tr_CRCX) -> value mgcp_cmd; |
Harald Welte | 1852a84 | 2018-01-26 22:53:36 +0100 | [diff] [blame] | 1165 | cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); |
| 1166 | cpars.mgcp_ep := mgcp_cmd.line.ep; |
Harald Welte | 3ab8800 | 2018-01-26 22:37:25 +0100 | [diff] [blame] | 1167 | /* never respond to this */ |
| 1168 | |
Philipp Maier | 8e58f59 | 2018-03-14 11:10:56 +0100 | [diff] [blame] | 1169 | /* When the connection with the MGW fails, the MSC will first request |
| 1170 | * a release via call control. We will answer this request normally. */ |
| 1171 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); |
| 1172 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); |
| 1173 | |
Harald Welte | 1ddc716 | 2018-01-27 14:25:46 +0100 | [diff] [blame] | 1174 | f_expect_clear(30.0); |
Harald Welte | 3ab8800 | 2018-01-26 22:37:25 +0100 | [diff] [blame] | 1175 | } |
| 1176 | testcase TC_mo_crcx_ran_timeout() runs on MTC_CT { |
| 1177 | var BSC_ConnHdlr vc_conn; |
| 1178 | f_init(); |
| 1179 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1180 | vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_timeout), 29); |
Harald Welte | 3ab8800 | 2018-01-26 22:37:25 +0100 | [diff] [blame] | 1181 | vc_conn.done; |
| 1182 | } |
| 1183 | |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1184 | /* Test MO Call with reject to RAN-side CRCX */ |
| 1185 | private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 1186 | f_init_handler(pars); |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1187 | var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); |
| 1188 | var MNCC_PDU mncc; |
| 1189 | var MgcpCommand mgcp_cmd; |
| 1190 | |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1191 | f_perform_lu(); |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1192 | |
Harald Welte | de37149 | 2018-01-27 23:44:41 +0100 | [diff] [blame] | 1193 | f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1194 | f_create_mncc_expect(hex2str(cpars.called_party)); |
| 1195 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1196 | |
| 1197 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); |
| 1198 | MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc; |
| 1199 | cpars.mncc_callref := mncc.u.signal.callref; |
| 1200 | MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); |
| 1201 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); |
| 1202 | |
| 1203 | MGCP.receive(tr_CRCX) -> value mgcp_cmd; |
Philipp Maier | f1e02bb | 2018-03-15 16:30:00 +0100 | [diff] [blame] | 1204 | |
| 1205 | /* Detect if the received CRCX is a wildcarded CRCX request. If yes, |
| 1206 | * set an endpoint name that fits the pattern. If not, just use the |
| 1207 | * endpoint name from the request */ |
| 1208 | if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) { |
| 1209 | cpars.mgcp_ep := "rtpbridge/1@mgw"; |
| 1210 | } else { |
| 1211 | cpars.mgcp_ep := mgcp_cmd.line.ep; |
| 1212 | } |
| 1213 | |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1214 | cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); |
Philipp Maier | f1e02bb | 2018-03-15 16:30:00 +0100 | [diff] [blame] | 1215 | |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1216 | /* Respond to CRCX with error */ |
| 1217 | var MgcpResponse mgcp_rsp := { |
| 1218 | line := { |
| 1219 | code := "542", |
| 1220 | trans_id := mgcp_cmd.line.trans_id, |
| 1221 | string := "FORCED_FAIL" |
| 1222 | }, |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1223 | sdp := omit |
| 1224 | } |
Philipp Maier | f1e02bb | 2018-03-15 16:30:00 +0100 | [diff] [blame] | 1225 | var MgcpParameter mgcp_rsp_param := { |
| 1226 | code := "Z", |
| 1227 | val := cpars.mgcp_ep |
| 1228 | }; |
| 1229 | mgcp_rsp.params[0] := mgcp_rsp_param; |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1230 | MGCP.send(mgcp_rsp); |
| 1231 | |
| 1232 | timer T := 30.0; |
| 1233 | T.start; |
| 1234 | alt { |
| 1235 | [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } |
| 1236 | [] BSSAP.receive(tr_BSSMAP_ClearCommand) { |
| 1237 | BSSAP.send(ts_BSSMAP_ClearComplete); |
| 1238 | BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); |
| 1239 | setverdict(pass); |
| 1240 | } |
Daniel Willmann | 5868e62 | 2018-02-15 17:42:59 +0100 | [diff] [blame] | 1241 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))) { |
| 1242 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); |
| 1243 | repeat; |
| 1244 | } |
| 1245 | [] BSSAP.receive { |
| 1246 | repeat; |
| 1247 | } |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1248 | [] MNCC.receive { repeat; } |
| 1249 | [] GSUP.receive { repeat; } |
| 1250 | [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { |
| 1251 | MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); |
| 1252 | f_create_mgcp_delete_ep(cpars.mgcp_ep); |
Harald Welte | ec6e5b4 | 2018-01-27 12:45:15 +0100 | [diff] [blame] | 1253 | repeat; |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1254 | } |
| 1255 | [] MGCP.receive { repeat; } |
| 1256 | } |
| 1257 | } |
| 1258 | testcase TC_mo_crcx_ran_reject() runs on MTC_CT { |
| 1259 | var BSC_ConnHdlr vc_conn; |
| 1260 | f_init(); |
| 1261 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1262 | vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_reject), 30); |
Harald Welte | 0cc82d9 | 2018-01-26 22:52:34 +0100 | [diff] [blame] | 1263 | vc_conn.done; |
| 1264 | } |
| 1265 | |
Harald Welte | 3ab8800 | 2018-01-26 22:37:25 +0100 | [diff] [blame] | 1266 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1267 | /* helper function to start a MT call: MNCC SETUP; Paging; DChan est.; DTAP SETUP */ |
| 1268 | private function f_mt_call_start(inout CallParameters cpars) runs on BSC_ConnHdlr { |
| 1269 | var MNCC_PDU mncc; |
| 1270 | var MgcpCommand mgcp_cmd; |
| 1271 | var OCT4 tmsi; |
| 1272 | |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1273 | f_perform_lu(); |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1274 | if (isvalue(g_pars.tmsi)) { |
| 1275 | tmsi := g_pars.tmsi; |
| 1276 | } else { |
| 1277 | tmsi := 'FFFFFFFF'O; |
| 1278 | } |
| 1279 | f_bssmap_register_imsi(g_pars.imsi, tmsi); |
| 1280 | |
| 1281 | /* Allocate call reference and send SETUP via MNCC to MSC */ |
| 1282 | cpars.mncc_callref := f_rnd_int(2147483648); |
| 1283 | MNCC.send(ts_MNCC_SETUP_req(cpars.mncc_callref, hex2str(g_pars.msisdn), |
| 1284 | hex2str(cpars.called_party), hex2str(g_pars.imsi))); |
| 1285 | |
| 1286 | /* MSC->BSC: expect PAGING from MSC */ |
| 1287 | BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); |
| 1288 | /* MS -> MSC: PAGING RESPONSE */ |
Harald Welte | 081b19a | 2018-02-10 09:11:13 +0100 | [diff] [blame] | 1289 | f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), EST_TYPE_PAG_RESP); |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1290 | |
| 1291 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1292 | |
| 1293 | /* MSC->MS: SETUP */ |
| 1294 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_SETUP(cpars.transaction_id, *, cpars.called_party))); |
| 1295 | } |
| 1296 | |
| 1297 | /* Test MT Call */ |
| 1298 | private function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | a10db90 | 2018-01-27 12:44:49 +0100 | [diff] [blame] | 1299 | f_init_handler(pars); |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1300 | var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); |
| 1301 | var MNCC_PDU mncc; |
| 1302 | var MgcpCommand mgcp_cmd; |
| 1303 | |
| 1304 | f_mt_call_start(cpars); |
| 1305 | |
| 1306 | /* MS->MSC: CALL CONFIRMED */ |
| 1307 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CALL_CONF(cpars.transaction_id))); |
| 1308 | |
| 1309 | MNCC.receive(tr_MNCC_CALL_CONF_ind(cpars.mncc_callref)); |
| 1310 | |
| 1311 | MGCP.receive(tr_CRCX) -> value mgcp_cmd; |
| 1312 | cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); |
Philipp Maier | f1e02bb | 2018-03-15 16:30:00 +0100 | [diff] [blame] | 1313 | |
| 1314 | /* Detect if the received CRCX is a wildcarded CRCX request. If yes, |
| 1315 | * set an endpoint name that fits the pattern. If not, just use the |
| 1316 | * endpoint name from the request */ |
| 1317 | if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) { |
| 1318 | cpars.mgcp_ep := "rtpbridge/1@mgw"; |
| 1319 | } else { |
| 1320 | cpars.mgcp_ep := mgcp_cmd.line.ep; |
| 1321 | } |
| 1322 | |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1323 | /* Respond to CRCX with error */ |
| 1324 | var MgcpResponse mgcp_rsp := { |
| 1325 | line := { |
| 1326 | code := "542", |
| 1327 | trans_id := mgcp_cmd.line.trans_id, |
| 1328 | string := "FORCED_FAIL" |
| 1329 | }, |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1330 | sdp := omit |
| 1331 | } |
Philipp Maier | f1e02bb | 2018-03-15 16:30:00 +0100 | [diff] [blame] | 1332 | var MgcpParameter mgcp_rsp_param := { |
| 1333 | code := "Z", |
| 1334 | val := cpars.mgcp_ep |
| 1335 | }; |
| 1336 | mgcp_rsp.params[0] := mgcp_rsp_param; |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1337 | MGCP.send(mgcp_rsp); |
| 1338 | |
| 1339 | timer T := 30.0; |
| 1340 | T.start; |
| 1341 | alt { |
| 1342 | [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } |
| 1343 | [] BSSAP.receive(tr_BSSMAP_ClearCommand) { |
| 1344 | BSSAP.send(ts_BSSMAP_ClearComplete); |
| 1345 | BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); |
| 1346 | setverdict(pass); |
| 1347 | } |
| 1348 | [] BSSAP.receive { repeat; } |
| 1349 | [] MNCC.receive { repeat; } |
| 1350 | [] GSUP.receive { repeat; } |
| 1351 | [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { |
| 1352 | MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); |
| 1353 | f_create_mgcp_delete_ep(cpars.mgcp_ep); |
| 1354 | repeat; |
| 1355 | } |
| 1356 | [] MGCP.receive { repeat; } |
| 1357 | } |
| 1358 | } |
| 1359 | testcase TC_mt_crcx_ran_reject() runs on MTC_CT { |
| 1360 | var BSC_ConnHdlr vc_conn; |
| 1361 | f_init(); |
| 1362 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1363 | vc_conn := f_start_handler(refers(f_tc_mt_crcx_ran_reject), 31); |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1364 | vc_conn.done; |
| 1365 | } |
| 1366 | |
| 1367 | |
| 1368 | /* Test MT Call T310 timer */ |
| 1369 | private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
Harald Welte | ad2952e | 2018-01-27 14:12:46 +0100 | [diff] [blame] | 1370 | f_init_handler(pars, 200.0); |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1371 | var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); |
| 1372 | var MNCC_PDU mncc; |
| 1373 | var MgcpCommand mgcp_cmd; |
| 1374 | |
| 1375 | f_mt_call_start(cpars); |
| 1376 | |
| 1377 | /* MS->MSC: CALL CONFIRMED */ |
| 1378 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CALL_CONF(cpars.transaction_id))); |
| 1379 | MNCC.receive(tr_MNCC_CALL_CONF_ind(cpars.mncc_callref)); |
| 1380 | |
| 1381 | MGCP.receive(tr_CRCX) -> value mgcp_cmd; |
| 1382 | cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); |
| 1383 | cpars.mgcp_ep := mgcp_cmd.line.ep; |
| 1384 | /* FIXME: Respond to CRCX */ |
| 1385 | |
| 1386 | /* old libosmocore T310 default timeout is 180s. so let's wait 190 */ |
| 1387 | timer T := 190.0; |
| 1388 | T.start; |
| 1389 | alt { |
| 1390 | [] T.timeout { setverdict(fail, "Timeout waiting for T310"); self.stop; } |
| 1391 | [] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref)) { |
| 1392 | MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); |
| 1393 | } |
| 1394 | } |
| 1395 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); |
| 1396 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); |
| 1397 | /* FIXME: We're sending this with TIflag 0: allocated by sender, which is wrong */ |
| 1398 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); |
| 1399 | |
| 1400 | alt { |
| 1401 | [] BSSAP.receive(tr_BSSMAP_ClearCommand) { |
| 1402 | BSSAP.send(ts_BSSMAP_ClearComplete); |
| 1403 | BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); |
| 1404 | setverdict(pass); |
| 1405 | } |
| 1406 | [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { |
| 1407 | MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); |
| 1408 | f_create_mgcp_delete_ep(cpars.mgcp_ep); |
| 1409 | repeat; |
| 1410 | } |
| 1411 | } |
| 1412 | } |
| 1413 | testcase TC_mt_t310() runs on MTC_CT { |
| 1414 | var BSC_ConnHdlr vc_conn; |
| 1415 | f_init(); |
| 1416 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1417 | vc_conn := f_start_handler(refers(f_tc_mt_t310), 32); |
Harald Welte | 812f7a4 | 2018-01-27 00:49:18 +0100 | [diff] [blame] | 1418 | vc_conn.done; |
| 1419 | } |
| 1420 | |
Harald Welte | 167458a | 2018-01-27 15:58:16 +0100 | [diff] [blame] | 1421 | /* Perform successful LU + MO call, then GSUP LocationCancel. Subscriber must be denied CM SERV */ |
| 1422 | private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1423 | f_init_handler(pars); |
| 1424 | var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); |
| 1425 | cpars.bss_rtp_port := 1110; |
| 1426 | cpars.mgcp_connection_id_bss := '22222'H; |
| 1427 | cpars.mgcp_connection_id_mss := '33333'H; |
| 1428 | |
| 1429 | /* Location Update to make subscriber known */ |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1430 | f_perform_lu(); |
Harald Welte | 167458a | 2018-01-27 15:58:16 +0100 | [diff] [blame] | 1431 | |
| 1432 | /* First MO call should succeed */ |
| 1433 | f_mo_call(cpars); |
| 1434 | |
| 1435 | /* Cancel the subscriber in the VLR */ |
| 1436 | GSUP.send(ts_GSUP_CL_REQ(g_pars.imsi, OSMO_GSUP_CANCEL_TYPE_WITHDRAW)); |
| 1437 | alt { |
| 1438 | [] GSUP.receive(tr_GSUP_CL_RES(g_pars.imsi)) { } |
| 1439 | [] GSUP.receive(tr_GSUP_CL_ERR(g_pars.imsi)) { |
| 1440 | setverdict(fail, "Received GSUP Location Cancel Error"); |
| 1441 | self.stop; |
| 1442 | } |
| 1443 | } |
| 1444 | |
| 1445 | /* Follow-up transactions should fail */ |
| 1446 | var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); |
| 1447 | var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); |
| 1448 | f_bssap_compl_l3(l3_info); |
| 1449 | alt { |
| 1450 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } |
| 1451 | [] BSSAP.receive { |
| 1452 | setverdict(fail, "Received unexpected BSSAP instead of CM SERV REJ"); |
| 1453 | self.stop; |
| 1454 | } |
| 1455 | } |
| 1456 | setverdict(pass); |
| 1457 | } |
| 1458 | testcase TC_gsup_cancel() runs on MTC_CT { |
| 1459 | var BSC_ConnHdlr vc_conn; |
| 1460 | f_init(); |
| 1461 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1462 | vc_conn := f_start_handler(refers(f_tc_gsup_cancel), 33); |
Harald Welte | 167458a | 2018-01-27 15:58:16 +0100 | [diff] [blame] | 1463 | vc_conn.done; |
| 1464 | } |
| 1465 | |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1466 | /* A5/1 only permitted on network side, and MS capable to do it */ |
| 1467 | private function f_tc_lu_imsi_auth_tmsi_encr_1_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1468 | pars.net.expect_auth := true; |
| 1469 | pars.net.expect_ciph := true; |
| 1470 | pars.net.kc_support := '02'O; /* A5/1 only */ |
| 1471 | f_init_handler(pars); |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1472 | f_perform_lu(); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1473 | } |
| 1474 | testcase TC_lu_imsi_auth_tmsi_encr_1_13() runs on MTC_CT { |
| 1475 | var BSC_ConnHdlr vc_conn; |
| 1476 | f_init(); |
| 1477 | f_vty_config(MSCVTY, "network", "authentication required"); |
| 1478 | f_vty_config(MSCVTY, "network", "encryption a5 1"); |
| 1479 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1480 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_1_13), 34); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1481 | vc_conn.done; |
| 1482 | } |
| 1483 | |
| 1484 | /* A5/3 only permitted on network side, and MS capable to do it */ |
| 1485 | private function f_tc_lu_imsi_auth_tmsi_encr_3_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1486 | pars.net.expect_auth := true; |
| 1487 | pars.net.expect_ciph := true; |
| 1488 | pars.net.kc_support := '08'O; /* A5/3 only */ |
| 1489 | f_init_handler(pars); |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1490 | f_perform_lu(); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1491 | } |
| 1492 | testcase TC_lu_imsi_auth_tmsi_encr_3_13() runs on MTC_CT { |
| 1493 | var BSC_ConnHdlr vc_conn; |
| 1494 | f_init(); |
| 1495 | f_vty_config(MSCVTY, "network", "authentication required"); |
| 1496 | f_vty_config(MSCVTY, "network", "encryption a5 3"); |
| 1497 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1498 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_3_13), 35); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1499 | vc_conn.done; |
| 1500 | } |
| 1501 | |
| 1502 | /* A5/3 only permitted on network side, and MS with only A5/1 support */ |
| 1503 | private function f_tc_lu_imsi_auth_tmsi_encr_3_1(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1504 | pars.net.expect_auth := true; |
| 1505 | pars.net.expect_ciph := true; |
| 1506 | pars.net.kc_support := '08'O; /* A5/3 only */ |
| 1507 | pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; |
| 1508 | f_init_handler(pars, 15.0); |
| 1509 | |
| 1510 | /* cannot use f_perform_lu() as we expect a reject */ |
| 1511 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); |
| 1512 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 1513 | f_bssap_compl_l3(l3_lu); |
Neels Hofmeyr | 29b8da0 | 2018-03-01 18:09:45 +0100 | [diff] [blame] | 1514 | if (pars.send_early_cm) { |
| 1515 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 1516 | } else { |
| 1517 | pars.cm1.esind := '0'B; |
| 1518 | } |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1519 | f_mm_auth(); |
| 1520 | alt { |
| 1521 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } |
| 1522 | [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { |
| 1523 | setverdict(fail, "CipherModeCommand despite no A5 intersection"); |
| 1524 | self.stop; |
| 1525 | } |
| 1526 | [] BSSAP.receive { |
| 1527 | setverdict(inconc, "Unknown/unexpected BSSAP received"); |
| 1528 | self.stop; |
| 1529 | } |
| 1530 | } |
| 1531 | setverdict(pass); |
| 1532 | } |
| 1533 | testcase TC_lu_imsi_auth_tmsi_encr_3_1() runs on MTC_CT { |
| 1534 | var BSC_ConnHdlr vc_conn; |
| 1535 | f_init(); |
| 1536 | f_vty_config(MSCVTY, "network", "authentication required"); |
| 1537 | f_vty_config(MSCVTY, "network", "encryption a5 3"); |
| 1538 | |
Neels Hofmeyr | 29b8da0 | 2018-03-01 18:09:45 +0100 | [diff] [blame] | 1539 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_3_1), 360); |
| 1540 | vc_conn.done; |
| 1541 | } |
| 1542 | testcase TC_lu_imsi_auth_tmsi_encr_3_1_no_cm() runs on MTC_CT { |
| 1543 | var BSC_ConnHdlrPars pars; |
| 1544 | var BSC_ConnHdlr vc_conn; |
| 1545 | f_init(); |
| 1546 | f_vty_config(MSCVTY, "network", "authentication required"); |
| 1547 | f_vty_config(MSCVTY, "network", "encryption a5 3"); |
| 1548 | |
| 1549 | pars := f_init_pars(361); |
| 1550 | pars.send_early_cm := false; |
| 1551 | vc_conn := f_start_handler_with_pars(refers(f_tc_lu_imsi_auth_tmsi_encr_3_1), pars); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1552 | vc_conn.done; |
| 1553 | } |
Neels Hofmeyr | 1b3c6e3 | 2018-03-01 17:52:21 +0100 | [diff] [blame] | 1554 | testcase TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() runs on MTC_CT { |
| 1555 | var BSC_ConnHdlr vc_conn; |
| 1556 | f_init(); |
| 1557 | f_vty_config(MSCVTY, "network", "authentication required"); |
| 1558 | f_vty_config(MSCVTY, "network", "encryption a5 3"); |
| 1559 | |
| 1560 | /* Make sure the MSC category is on DEBUG level to trigger the log |
| 1561 | * message that is reported in OS#2947 to trigger the segfault */ |
| 1562 | f_vty_config(MSCVTY, "log stderr", "logging level msc debug"); |
| 1563 | |
| 1564 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_3_1), 362); |
| 1565 | vc_conn.done; |
| 1566 | } |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1567 | |
| 1568 | /* A5/1 + A5/3 only permitted on network side, and MS with only A5/2 support */ |
| 1569 | private function f_tc_lu_imsi_auth_tmsi_encr_13_2(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1570 | pars.net.expect_auth := true; |
| 1571 | pars.net.expect_ciph := true; |
| 1572 | pars.net.kc_support := '0A'O; /* A5/1 + A5/3 */ |
| 1573 | pars.cm1.a5_1 := '1'B; |
| 1574 | pars.cm2.a5_1 := '1'B; |
| 1575 | pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; |
| 1576 | pars.cm2.classmarkInformationType2_oct5.a5_2 := '1'B; |
| 1577 | f_init_handler(pars, 15.0); |
| 1578 | |
| 1579 | /* cannot use f_perform_lu() as we expect a reject */ |
| 1580 | var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); |
| 1581 | f_create_gsup_expect(hex2str(g_pars.imsi)); |
| 1582 | f_bssap_compl_l3(l3_lu); |
| 1583 | BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); |
| 1584 | f_mm_auth(); |
| 1585 | alt { |
| 1586 | [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } |
| 1587 | [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { |
| 1588 | setverdict(fail, "CipherModeCommand despite no A5 intersection"); |
| 1589 | self.stop; |
| 1590 | } |
| 1591 | [] BSSAP.receive { |
| 1592 | setverdict(inconc, "Unknown/unexpected BSSAP received"); |
| 1593 | self.stop; |
| 1594 | } |
| 1595 | } |
| 1596 | setverdict(pass); |
| 1597 | } |
| 1598 | testcase TC_lu_imsi_auth_tmsi_encr_13_2() runs on MTC_CT { |
| 1599 | var BSC_ConnHdlr vc_conn; |
| 1600 | f_init(); |
| 1601 | f_vty_config(MSCVTY, "network", "authentication required"); |
| 1602 | f_vty_config(MSCVTY, "network", "encryption a5 1 3"); |
| 1603 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1604 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_13_2), 37); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1605 | vc_conn.done; |
| 1606 | } |
| 1607 | |
| 1608 | /* A5/0 + A5/1 + A5/3 only permitted on network side, and MS with only A5/2 support */ |
| 1609 | private function f_tc_lu_imsi_auth_tmsi_encr_013_2(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1610 | pars.net.expect_auth := true; |
| 1611 | pars.net.expect_ciph := true; |
| 1612 | pars.net.kc_support := '0B'O; /* A5/1 + A5/3 */ |
| 1613 | pars.cm1.a5_1 := '1'B; |
| 1614 | pars.cm2.a5_1 := '1'B; |
| 1615 | pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; |
| 1616 | pars.cm2.classmarkInformationType2_oct5.a5_2 := '1'B; |
| 1617 | f_init_handler(pars, 15.0); |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1618 | f_perform_lu(); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1619 | } |
| 1620 | testcase TC_lu_imsi_auth_tmsi_encr_013_2() runs on MTC_CT { |
| 1621 | var BSC_ConnHdlr vc_conn; |
| 1622 | f_init(); |
| 1623 | f_vty_config(MSCVTY, "network", "authentication required"); |
| 1624 | f_vty_config(MSCVTY, "network", "encryption a5 0 1 3"); |
| 1625 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1626 | vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_013_2), 38); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1627 | vc_conn.done; |
| 1628 | } |
| 1629 | |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1630 | /* LU followed by MT call (including paging) */ |
| 1631 | private function f_tc_lu_and_mt_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1632 | f_init_handler(pars); |
| 1633 | //FIXME: odd digits var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); |
| 1634 | var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); |
| 1635 | cpars.bss_rtp_port := 1110; |
| 1636 | cpars.mgcp_connection_id_bss := '10004'H; |
| 1637 | cpars.mgcp_connection_id_mss := '10005'H; |
| 1638 | |
Philipp Maier | 4b2692d | 2018-03-14 16:37:48 +0100 | [diff] [blame] | 1639 | /* Note: This is an optional parameter. When the call-agent (MSC) does |
| 1640 | * supply a full endpoint name this setting will be overwritten. */ |
| 1641 | cpars.mgcp_ep := "rtpbridge/1@mgw"; |
| 1642 | |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1643 | f_perform_lu(); |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1644 | f_mt_call(cpars); |
| 1645 | } |
| 1646 | testcase TC_lu_and_mt_call() runs on MTC_CT { |
| 1647 | var BSC_ConnHdlr vc_conn; |
| 1648 | f_init(); |
| 1649 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1650 | vc_conn := f_start_handler(refers(f_tc_lu_and_mt_call), 39); |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1651 | vc_conn.done; |
| 1652 | } |
| 1653 | |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 1654 | /* Test MO Call SETUP with DTMF */ |
| 1655 | private function f_tc_mo_setup_dtmf_dup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1656 | f_init_handler(pars); |
| 1657 | var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); |
| 1658 | cpars.bss_rtp_port := 1110; |
| 1659 | cpars.mgcp_connection_id_bss := '22222'H; |
| 1660 | cpars.mgcp_connection_id_mss := '33333'H; |
| 1661 | |
Neels Hofmeyr | c1f105a | 2018-03-01 20:00:19 +0100 | [diff] [blame] | 1662 | f_perform_lu(); |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 1663 | f_mo_seq_dtmf_dup(cpars); |
| 1664 | } |
| 1665 | testcase TC_mo_setup_and_dtmf_dup() runs on MTC_CT { |
| 1666 | var BSC_ConnHdlr vc_conn; |
| 1667 | f_init(); |
| 1668 | |
Neels Hofmeyr | e9b8eeb | 2018-03-01 20:29:58 +0100 | [diff] [blame] | 1669 | vc_conn := f_start_handler(refers(f_tc_mo_setup_dtmf_dup), 39); |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 1670 | vc_conn.done; |
| 1671 | } |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1672 | |
Philipp Maier | 328d166 | 2018-03-07 10:40:27 +0100 | [diff] [blame] | 1673 | testcase TC_cr_before_reset() runs on MTC_CT { |
| 1674 | timer T := 4.0; |
| 1675 | var boolean reset_ack_seen := false; |
| 1676 | f_init_bssap_direct(); |
| 1677 | |
| 1678 | /* Make a blind connection attemt, to trigger the deadlock condition */ |
| 1679 | BSSAP_DIRECT.send(ts_BSSAP_CONNECT_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, 1, omit)); |
| 1680 | |
| 1681 | /* Send a BSSMAP reset */ |
| 1682 | BSSAP_DIRECT.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, ts_BSSMAP_Reset(0))); |
| 1683 | T.start |
| 1684 | alt { |
| 1685 | [] BSSAP_DIRECT.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_ResetAck)) { |
| 1686 | reset_ack_seen := true; |
| 1687 | repeat; |
| 1688 | } |
| 1689 | |
| 1690 | /* Acknowledge MSC sided reset requests */ |
| 1691 | [] BSSAP_DIRECT.receive(tr_BSSAP_UNITDATA_ind(?, ?, tr_BSSMAP_Reset)) { |
| 1692 | BSSAP_DIRECT.send(ts_BSSAP_UNITDATA_req(g_bssap.sccp_addr_peer, g_bssap.sccp_addr_own, ts_BSSMAP_ResetAck)); |
| 1693 | repeat; |
| 1694 | } |
| 1695 | |
| 1696 | /* Ignore all other messages (e.g CR from the connection request) */ |
| 1697 | [] BSSAP_DIRECT.receive { repeat } |
| 1698 | |
| 1699 | /* If we got no BSSMAP RESET ACK back, then the MSC entered the |
| 1700 | * deadlock situation. The MSC is then unable to respond to any |
| 1701 | * further BSSMAP RESET or any other sort of traffic. */ |
| 1702 | [reset_ack_seen == true] T.timeout { setverdict(pass) } |
| 1703 | [reset_ack_seen == false] T.timeout { |
| 1704 | setverdict(fail, "no BSSMAP RESET ACK seen!"); |
| 1705 | } |
| 1706 | } |
| 1707 | } |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1708 | |
Philipp Maier | 94f3f1b | 2018-03-15 18:54:13 +0100 | [diff] [blame] | 1709 | /* Test MO Call with no response to RAN-side CRCX or DTAP Release */ |
| 1710 | private function f_tc_mo_release_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { |
| 1711 | f_init_handler(pars); |
| 1712 | var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); |
| 1713 | var MNCC_PDU mncc; |
| 1714 | var MgcpCommand mgcp_cmd; |
| 1715 | |
| 1716 | f_perform_lu(); |
| 1717 | |
| 1718 | f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); |
| 1719 | f_create_mncc_expect(hex2str(cpars.called_party)); |
| 1720 | f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); |
| 1721 | |
| 1722 | BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); |
| 1723 | MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc; |
| 1724 | cpars.mncc_callref := mncc.u.signal.callref; |
| 1725 | MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); |
| 1726 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); |
| 1727 | |
| 1728 | /* Drop CRCX */ |
| 1729 | MGCP.receive(tr_CRCX) -> value mgcp_cmd; |
| 1730 | |
| 1731 | /* Drop DTAP Release */ |
| 1732 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); |
| 1733 | |
| 1734 | /* Drop resent DTAP Release */ |
| 1735 | BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); |
| 1736 | |
| 1737 | f_expect_clear(60.0); |
| 1738 | } |
| 1739 | testcase TC_mo_release_timeout() runs on MTC_CT { |
| 1740 | var BSC_ConnHdlr vc_conn; |
| 1741 | f_init(); |
| 1742 | |
| 1743 | vc_conn := f_start_handler(refers(f_tc_mo_release_timeout), 40); |
| 1744 | vc_conn.done; |
| 1745 | } |
| 1746 | |
Harald Welte | 12510c5 | 2018-01-26 22:26:24 +0100 | [diff] [blame] | 1747 | |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 1748 | |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 1749 | /* TODO: |
| 1750 | * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? |
| 1751 | * malformed messages (missing IE, invalid message type): properly rejected? |
| 1752 | * MT call while LU or is ongoing: Do we use existing lchan or page while lchan active? |
| 1753 | * 3G/2G auth permutations |
| 1754 | * encryption algorithms vs. classmark vs. vty config |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 1755 | * send new transaction after/during clear (like SMS, ...) |
Harald Welte | 45164da | 2018-01-24 12:51:27 +0100 | [diff] [blame] | 1756 | * too long L3 INFO in DTAP |
| 1757 | * too long / padded BSSAP |
| 1758 | * too long / short TLV values |
Harald Welte | ba7b6d9 | 2018-01-23 21:32:34 +0100 | [diff] [blame] | 1759 | */ |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 1760 | |
| 1761 | |
| 1762 | control { |
Philipp Maier | 328d166 | 2018-03-07 10:40:27 +0100 | [diff] [blame] | 1763 | execute( TC_cr_before_reset() ); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 1764 | execute( TC_lu_imsi_noauth_tmsi() ); |
Harald Welte | d2328a2 | 2018-01-27 14:27:16 +0100 | [diff] [blame] | 1765 | execute( TC_lu_imsi_noauth_notmsi() ); |
Harald Welte | a49e36e | 2018-01-21 19:29:33 +0100 | [diff] [blame] | 1766 | execute( TC_lu_imsi_reject() ); |
| 1767 | execute( TC_lu_imsi_timeout_gsup() ); |
Harald Welte | d2328a2 | 2018-01-27 14:27:16 +0100 | [diff] [blame] | 1768 | execute( TC_lu_imsi_auth_tmsi() ); |
| 1769 | execute( TC_cmserv_imsi_unknown() ); |
Harald Welte | 2bb825f | 2018-01-22 11:31:18 +0100 | [diff] [blame] | 1770 | execute( TC_lu_and_mo_call() ); |
Harald Welte | 071ed73 | 2018-01-23 19:53:52 +0100 | [diff] [blame] | 1771 | execute( TC_lu_auth_sai_timeout() ); |
| 1772 | execute( TC_lu_auth_sai_err() ); |
Harald Welte | e1a2f3c | 2018-01-24 17:28:48 +0100 | [diff] [blame] | 1773 | execute( TC_lu_clear_request() ); |
| 1774 | execute( TC_lu_disconnect() ); |
| 1775 | execute( TC_lu_by_imei() ); |
| 1776 | execute( TC_lu_by_tmsi_noauth_unknown() ); |
| 1777 | execute( TC_imsi_detach_by_imsi() ); |
| 1778 | execute( TC_imsi_detach_by_tmsi() ); |
| 1779 | execute( TC_imsi_detach_by_imei() ); |
| 1780 | execute( TC_emerg_call_imei_reject() ); |
| 1781 | execute( TC_emerg_call_imsi() ); |
| 1782 | execute( TC_cm_serv_req_vgcs_reject() ); |
| 1783 | execute( TC_cm_serv_req_vbs_reject() ); |
| 1784 | execute( TC_cm_serv_req_lcs_reject() ); |
Harald Welte | 0195ab1 | 2018-01-24 21:50:20 +0100 | [diff] [blame] | 1785 | execute( TC_cm_reest_req_reject() ); |
Harald Welte | 1af6ea8 | 2018-01-25 18:33:15 +0100 | [diff] [blame] | 1786 | execute( TC_lu_auth_2G_fail() ); |
| 1787 | execute( TC_lu_imsi_auth_tmsi_encr_13_13() ); |
| 1788 | execute( TC_cl3_no_payload() ); |
| 1789 | execute( TC_cl3_rnd_payload() ); |
Harald Welte | 1852a84 | 2018-01-26 22:53:36 +0100 | [diff] [blame] | 1790 | execute( TC_establish_and_nothing() ); |
| 1791 | execute( TC_mo_setup_and_nothing() ); |
| 1792 | execute( TC_mo_crcx_ran_timeout() ); |
| 1793 | execute( TC_mo_crcx_ran_reject() ); |
Harald Welte | d2328a2 | 2018-01-27 14:27:16 +0100 | [diff] [blame] | 1794 | execute( TC_mt_crcx_ran_reject() ); |
Daniel Willmann | 8b08437 | 2018-02-04 13:35:26 +0100 | [diff] [blame] | 1795 | execute( TC_mo_setup_and_dtmf_dup() ); |
Harald Welte | aa54cf8 | 2018-01-30 08:15:32 +0100 | [diff] [blame] | 1796 | //execute( TC_mt_t310() ); |
Harald Welte | 167458a | 2018-01-27 15:58:16 +0100 | [diff] [blame] | 1797 | execute( TC_gsup_cancel() ); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1798 | execute( TC_lu_imsi_auth_tmsi_encr_1_13() ); |
| 1799 | execute( TC_lu_imsi_auth_tmsi_encr_3_13() ); |
| 1800 | execute( TC_lu_imsi_auth_tmsi_encr_3_1() ); |
Neels Hofmeyr | 29b8da0 | 2018-03-01 18:09:45 +0100 | [diff] [blame] | 1801 | execute( TC_lu_imsi_auth_tmsi_encr_3_1_no_cm() ); |
Harald Welte | 9de8479 | 2018-01-28 01:06:35 +0100 | [diff] [blame] | 1802 | execute( TC_lu_imsi_auth_tmsi_encr_13_2() ); |
| 1803 | execute( TC_lu_imsi_auth_tmsi_encr_013_2() ); |
Philipp Maier | 94f3f1b | 2018-03-15 18:54:13 +0100 | [diff] [blame] | 1804 | execute( TC_mo_release_timeout() ); |
Harald Welte | 33ec09b | 2018-02-10 15:34:46 +0100 | [diff] [blame] | 1805 | |
| 1806 | execute( TC_lu_and_mt_call() ); |
| 1807 | |
Neels Hofmeyr | 1b3c6e3 | 2018-03-01 17:52:21 +0100 | [diff] [blame] | 1808 | /* Run this last: at the time of writing this test crashes the MSC */ |
| 1809 | execute( TC_lu_imsi_auth_tmsi_encr_3_1_log_msc_debug() ); |
Harald Welte | f6dd64d | 2017-11-19 12:09:51 +0100 | [diff] [blame] | 1810 | } |
| 1811 | |
| 1812 | |
| 1813 | } |