Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 1 | /* Osmocom MSC+VLR end-to-end tests */ |
| 2 | |
| 3 | /* (C) 2017 by sysmocom s.f.m.c. GmbH <info@sysmocom.de> |
| 4 | * |
| 5 | * All Rights Reserved |
| 6 | * |
| 7 | * Author: Neels Hofmeyr <nhofmeyr@sysmocom.de> |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU Affero General Public License as published by |
| 11 | * the Free Software Foundation; either version 3 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU Affero General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU Affero General Public License |
| 20 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 21 | * |
| 22 | */ |
| 23 | |
| 24 | #include "msc_vlr_tests.h" |
| 25 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 26 | void test_reject_2nd_conn(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 27 | { |
| 28 | struct gsm_subscriber_connection *conn1; |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 29 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 30 | |
| 31 | btw("Location Update Request on one connection"); |
| 32 | lu_result_sent = RES_NONE; |
| 33 | gsup_expect_tx("04010809710000004026f0"); |
| 34 | ms_sends_msg("050802008168000130089910070000006402"); |
| 35 | OSMO_ASSERT(gsup_tx_confirmed); |
| 36 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 37 | EXPECT_CONN_COUNT(1); |
| 38 | |
| 39 | btw("Another Location Update Request from the same subscriber on another connection is rejected"); |
| 40 | conn1 = g_conn; |
| 41 | g_conn = NULL; |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 42 | expect_bssap_clear(); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 43 | ms_sends_msg("050802008168000130089910070000006402"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 44 | VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 45 | VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d"); |
| 46 | EXPECT_CONN_COUNT(1); |
| 47 | |
| 48 | |
| 49 | BTW("The first connection can still complete its LU"); |
| 50 | btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); |
| 51 | g_conn = conn1; |
| 52 | lu_result_sent = RES_NONE; |
| 53 | gsup_rx("10010809710000004026f00804036470f1", |
| 54 | "12010809710000004026f0"); |
| 55 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 56 | |
| 57 | btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 58 | expect_bssap_clear(); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 59 | gsup_rx("06010809710000004026f0", NULL); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 60 | VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 61 | |
| 62 | btw("LU was successful, and the conn has already been closed"); |
| 63 | VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); |
| 64 | EXPECT_CONN_COUNT(0); |
| 65 | |
| 66 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 67 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 68 | } |
| 69 | |
| 70 | void _normal_lu_part1() |
| 71 | { |
| 72 | btw("Location Update Request"); |
| 73 | lu_result_sent = RES_NONE; |
| 74 | gsup_expect_tx("04010809710000004026f0"); |
| 75 | ms_sends_msg("050802008168000130089910070000006402"); |
| 76 | OSMO_ASSERT(gsup_tx_confirmed); |
| 77 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 78 | EXPECT_CONN_COUNT(1); |
| 79 | } |
| 80 | |
| 81 | void _normal_lu_part2() |
| 82 | { |
| 83 | btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT"); |
| 84 | lu_result_sent = RES_NONE; |
| 85 | gsup_rx("10010809710000004026f00804036470f1", |
| 86 | "12010809710000004026f0"); |
| 87 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 88 | |
| 89 | btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 90 | expect_bssap_clear(); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 91 | gsup_rx("06010809710000004026f0", NULL); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 92 | VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 93 | |
| 94 | btw("LU was successful, and the conn has already been closed"); |
| 95 | VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d"); |
| 96 | EXPECT_CONN_COUNT(0); |
| 97 | } |
| 98 | |
| 99 | void _normal_lu() |
| 100 | { |
| 101 | BTW("Subscriber does a normal LU"); |
| 102 | _normal_lu_part1(); |
| 103 | _normal_lu_part2(); |
| 104 | } |
| 105 | |
| 106 | void _normal_cm_service_req() |
| 107 | { |
| 108 | BTW("Subscriber does a normal CM Service Request"); |
| 109 | cm_service_result_sent = RES_NONE; |
| 110 | ms_sends_msg("05247803305886089910070000006402"); |
| 111 | OSMO_ASSERT(g_conn); |
| 112 | OSMO_ASSERT(g_conn->conn_fsm); |
| 113 | OSMO_ASSERT(g_conn->vsub); |
| 114 | VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); |
| 115 | EXPECT_ACCEPTED(true); |
| 116 | } |
| 117 | |
Max | 093300d | 2018-02-07 12:06:03 +0100 | [diff] [blame] | 118 | void _page(const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 119 | { |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 120 | struct vlr_subscr *vsub; |
| 121 | |
| 122 | BTW("an SMS is sent, MS is paged"); |
| 123 | paging_expect_imsi(imsi); |
| 124 | paging_sent = false; |
| 125 | vsub = vlr_subscr_find_by_imsi(net->vlr, imsi); |
| 126 | OSMO_ASSERT(vsub); |
| 127 | VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d"); |
| 128 | |
| 129 | send_sms(vsub, vsub, |
| 130 | "Privacy in residential applications is a desirable" |
| 131 | " marketing option."); |
| 132 | |
| 133 | VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d"); |
| 134 | vlr_subscr_put(vsub); |
| 135 | vsub = NULL; |
| 136 | VERBOSE_ASSERT(paging_sent, == true, "%d"); |
| 137 | VERBOSE_ASSERT(paging_stopped, == false, "%d"); |
| 138 | } |
| 139 | |
| 140 | void _paging_resp_part1() |
| 141 | { |
| 142 | btw("MS replies with Paging Response, we deliver the SMS"); |
| 143 | dtap_expect_tx("09" /* SMS messages */ |
| 144 | "01" /* CP-DATA */ |
| 145 | "58" /* length */ |
| 146 | "01" /* Network to MS */ |
| 147 | "00" /* reference */ |
| 148 | /* originator (gsm411_send_sms() hardcodes this weird nr) */ |
| 149 | "0791" "447758100650" /* 447785016005 */ |
| 150 | "00" /* dest */ |
| 151 | /* SMS TPDU */ |
| 152 | "4c" /* len */ |
| 153 | "00" /* SMS deliver */ |
| 154 | "05806470f1" /* originating address 46071 */ |
| 155 | "00" /* TP-PID */ |
| 156 | "00" /* GSM default alphabet */ |
| 157 | "071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/ |
| 158 | "000000" /* H-M-S */ |
| 159 | "00" /* GMT+0 */ |
| 160 | "44" /* data length */ |
| 161 | "5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e" |
| 162 | "d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb" |
| 163 | "0c7ac3e9e9b7db05"); |
| 164 | ms_sends_msg("06270703305882089910070000006402"); |
| 165 | VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); |
| 166 | VERBOSE_ASSERT(paging_stopped, == true, "%d"); |
| 167 | |
| 168 | btw("conn is still open to wait for SMS ack dance"); |
| 169 | EXPECT_CONN_COUNT(1); |
| 170 | } |
| 171 | |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 172 | void _paging_resp_part2(int expect_conn_count, bool expect_clear) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 173 | { |
| 174 | btw("MS replies with CP-ACK for received SMS"); |
| 175 | ms_sends_msg("8904"); |
| 176 | EXPECT_CONN_COUNT(1); |
| 177 | |
| 178 | btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that"); |
| 179 | dtap_expect_tx("0904"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 180 | if (expect_clear) |
| 181 | expect_bssap_clear(); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 182 | ms_sends_msg("890106020041020000"); |
| 183 | VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 184 | if (expect_clear) |
| 185 | VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 186 | |
| 187 | btw("SMS is done"); |
| 188 | EXPECT_CONN_COUNT(expect_conn_count); |
| 189 | } |
| 190 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 191 | void test_reject_lu_during_lu(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 192 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 193 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 194 | |
| 195 | _normal_lu_part1(); |
| 196 | |
| 197 | BTW("Another Location Update Request from the same subscriber on the same conn is dropped silently"); |
| 198 | ms_sends_msg("050802008168000130089910070000006402"); |
| 199 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 200 | EXPECT_CONN_COUNT(1); |
| 201 | |
| 202 | BTW("The first LU can still complete"); |
| 203 | _normal_lu_part2(); |
| 204 | |
| 205 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 206 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 207 | } |
| 208 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 209 | void test_reject_cm_during_lu(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 210 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 211 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 212 | |
| 213 | _normal_lu_part1(); |
| 214 | |
| 215 | BTW("A CM Service Request in the middle of a LU is rejected"); |
| 216 | cm_service_result_sent = RES_NONE; |
| 217 | dtap_expect_tx("052211"); |
| 218 | ms_sends_msg("05247803305886089910070000006402"); |
| 219 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 220 | VERBOSE_ASSERT(cm_service_result_sent, == RES_NONE, "%d"); |
| 221 | EXPECT_CONN_COUNT(1); |
| 222 | |
| 223 | BTW("The first LU can still complete"); |
| 224 | _normal_lu_part2(); |
| 225 | |
| 226 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 227 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 228 | } |
| 229 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 230 | void test_reject_paging_resp_during_lu(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 231 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 232 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 233 | |
| 234 | _normal_lu_part1(); |
| 235 | |
| 236 | BTW("An erratic Paging Response is dropped silently"); |
| 237 | ms_sends_msg("06270703305882089910070000006402"); |
| 238 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 239 | EXPECT_CONN_COUNT(1); |
| 240 | |
| 241 | BTW("The first LU can still complete"); |
| 242 | _normal_lu_part2(); |
| 243 | |
| 244 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 245 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 246 | } |
| 247 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 248 | void test_reject_lu_during_cm(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 249 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 250 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 251 | |
| 252 | _normal_lu(); |
| 253 | _normal_cm_service_req(); |
| 254 | |
| 255 | btw("A LU request on an open conn is dropped silently"); |
| 256 | /* TODO: accept periodic LU on an already open conn? */ |
| 257 | lu_result_sent = RES_NONE; |
| 258 | ms_sends_msg("050802008168000130089910070000006402"); |
| 259 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 260 | EXPECT_CONN_COUNT(1); |
| 261 | |
| 262 | BTW("subscriber detaches"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 263 | expect_bssap_clear(); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 264 | ms_sends_msg("050130089910070000006402"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 265 | VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 266 | EXPECT_CONN_COUNT(0); |
| 267 | |
| 268 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 269 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 270 | } |
| 271 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 272 | void test_reject_cm_during_cm(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 273 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 274 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 275 | |
| 276 | _normal_lu(); |
| 277 | _normal_cm_service_req(); |
| 278 | |
| 279 | btw("A second CM Service Request on the same conn is accepted without another auth dance"); |
| 280 | cm_service_result_sent = RES_NONE; |
| 281 | ms_sends_msg("05247803305886089910070000006402"); |
| 282 | VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); |
| 283 | EXPECT_CONN_COUNT(1); |
| 284 | |
| 285 | BTW("subscriber detaches"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 286 | expect_bssap_clear(); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 287 | ms_sends_msg("050130089910070000006402"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 288 | VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 289 | EXPECT_CONN_COUNT(0); |
| 290 | |
| 291 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 292 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 293 | } |
| 294 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 295 | void test_reject_paging_resp_during_cm(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 296 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 297 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 298 | |
| 299 | _normal_lu(); |
| 300 | _normal_cm_service_req(); |
| 301 | |
| 302 | BTW("An erratic Paging Response on the same conn is dropped silently"); |
| 303 | ms_sends_msg("06270703305882089910070000006402"); |
| 304 | EXPECT_CONN_COUNT(1); |
| 305 | |
| 306 | BTW("The original CM Service Request can conclude"); |
| 307 | btw("a USSD request is serviced"); |
| 308 | dtap_expect_tx_ussd("Your extension is 46071\r"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 309 | expect_bssap_clear(); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 310 | ms_sends_msg("0b3b1c15a11302010002013b300b04010f0406aa510c061b017f0100"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 311 | VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 312 | |
| 313 | btw("all requests serviced, conn has been released"); |
| 314 | EXPECT_CONN_COUNT(0); |
| 315 | |
| 316 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 317 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 318 | } |
| 319 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 320 | void test_reject_paging_resp_during_paging_resp(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 321 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 322 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 323 | |
| 324 | _normal_lu(); |
Max | 093300d | 2018-02-07 12:06:03 +0100 | [diff] [blame] | 325 | _page(imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 326 | _paging_resp_part1(); |
| 327 | |
| 328 | BTW("MS sends another erratic Paging Response which is dropped silently"); |
| 329 | ms_sends_msg("06270703305882089910070000006402"); |
| 330 | |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 331 | _paging_resp_part2(0, true); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 332 | |
| 333 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 334 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 335 | } |
| 336 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 337 | void test_reject_lu_during_paging_resp(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 338 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 339 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 340 | |
| 341 | _normal_lu(); |
Max | 093300d | 2018-02-07 12:06:03 +0100 | [diff] [blame] | 342 | _page(imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 343 | _paging_resp_part1(); |
| 344 | |
| 345 | BTW("MS sends erratic LU Request, which is dropped silently"); |
| 346 | lu_result_sent = RES_NONE; |
| 347 | ms_sends_msg("050802008168000130089910070000006402"); |
| 348 | VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d"); |
| 349 | EXPECT_CONN_COUNT(1); |
| 350 | |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 351 | _paging_resp_part2(0, true); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 352 | |
| 353 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 354 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 355 | } |
| 356 | |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 357 | void test_accept_cm_during_paging_resp(uint8_t nr, const char *imsi) |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 358 | { |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 359 | comment_start(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 360 | |
| 361 | _normal_lu(); |
Max | 093300d | 2018-02-07 12:06:03 +0100 | [diff] [blame] | 362 | _page(imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 363 | _paging_resp_part1(); |
| 364 | |
| 365 | BTW("CM Service Request during open connection is accepted"); |
| 366 | cm_service_result_sent = RES_NONE; |
| 367 | ms_sends_msg("05247803305886089910070000006402"); |
| 368 | VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d"); |
| 369 | EXPECT_CONN_COUNT(1); |
| 370 | VERBOSE_ASSERT(g_conn->received_cm_service_request, == true, "%d"); |
| 371 | |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 372 | _paging_resp_part2(1, false); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 373 | |
| 374 | BTW("subscriber detaches"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 375 | expect_bssap_clear(); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 376 | ms_sends_msg("050130089910070000006402"); |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 377 | VERBOSE_ASSERT(bssap_clear_sent, == true, "%d"); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 378 | EXPECT_CONN_COUNT(0); |
| 379 | |
| 380 | clear_vlr(); |
Max | b0a4314 | 2018-02-06 19:19:52 +0100 | [diff] [blame] | 381 | comment_end(nr, imsi); |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 382 | } |
| 383 | |
| 384 | msc_vlr_test_func_t msc_vlr_tests[] = { |
| 385 | test_reject_2nd_conn, |
| 386 | test_reject_lu_during_lu, |
| 387 | test_reject_cm_during_lu, |
| 388 | test_reject_paging_resp_during_lu, |
| 389 | test_reject_lu_during_cm, |
| 390 | test_reject_cm_during_cm, |
| 391 | test_reject_paging_resp_during_cm, |
| 392 | test_reject_lu_during_paging_resp, |
Philipp Maier | fbf6610 | 2017-04-09 12:32:51 +0200 | [diff] [blame] | 393 | test_accept_cm_during_paging_resp, |
Neels Hofmeyr | 6a29d32 | 2017-01-25 15:04:16 +0100 | [diff] [blame] | 394 | test_reject_paging_resp_during_paging_resp, |
| 395 | NULL |
| 396 | }; |