blob: dea0c291b68ef544a279f6083619c913e6af5219 [file] [log] [blame]
Neels Hofmeyr6a29d322017-01-25 15:04:16 +01001/* 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
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +010026static void test_reject_2nd_conn()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010027{
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010028 struct msub *conn1;
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +010029 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010030
31 btw("Location Update Request on one connection");
32 lu_result_sent = RES_NONE;
Neels Hofmeyr63b24642019-12-12 01:31:04 +010033 gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010034 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");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010040 conn1 = g_msub;
41 g_msub = NULL;
Philipp Maierfbf66102017-04-09 12:32:51 +020042 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010043 ms_sends_msg("050802008168000130089910070000006402");
Philipp Maierfbf66102017-04-09 12:32:51 +020044 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010045 VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010046 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010047 EXPECT_CONN_COUNT(1);
48
49
50 BTW("The first connection can still complete its LU");
51 btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010052 g_msub = conn1;
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010053 lu_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010054 gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
55 "12010809710000004026f0" VLR_TO_HLR);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010056 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
57
58 btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
Philipp Maierfbf66102017-04-09 12:32:51 +020059 expect_bssap_clear();
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010060 gsup_rx("06010809710000004026f0"HLR_TO_VLR, NULL);
Philipp Maierfbf66102017-04-09 12:32:51 +020061 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010062
63 btw("LU was successful, and the conn has already been closed");
64 VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010065 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010066 EXPECT_CONN_COUNT(0);
67
68 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +010069 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010070}
71
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +010072static void _normal_lu_part1()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010073{
74 btw("Location Update Request");
75 lu_result_sent = RES_NONE;
Neels Hofmeyr63b24642019-12-12 01:31:04 +010076 gsup_expect_tx("04010809710000004026f0" CN_DOMAIN VLR_TO_HLR);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010077 ms_sends_msg("050802008168000130089910070000006402");
78 OSMO_ASSERT(gsup_tx_confirmed);
79 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
80 EXPECT_CONN_COUNT(1);
81}
82
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +010083static void _normal_lu_part2()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010084{
85 btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
86 lu_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010087 gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
88 "12010809710000004026f0" VLR_TO_HLR);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010089 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
90
91 btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
Philipp Maierfbf66102017-04-09 12:32:51 +020092 expect_bssap_clear();
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010093 gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
Philipp Maierfbf66102017-04-09 12:32:51 +020094 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010095
96 btw("LU was successful, and the conn has already been closed");
97 VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010098 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010099 EXPECT_CONN_COUNT(0);
100}
101
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100102static void _normal_lu()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100103{
104 BTW("Subscriber does a normal LU");
105 _normal_lu_part1();
106 _normal_lu_part2();
107}
108
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100109static void _normal_cm_service_req()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100110{
111 BTW("Subscriber does a normal CM Service Request");
112 cm_service_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100113 ms_sends_msg("05247403305886089910070000006402");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100114 VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
115 EXPECT_ACCEPTED(true);
116}
117
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100118static void _page()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100119{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100120 const char *imsi = "901700000004620";
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100121 struct vlr_subscr *vsub;
122
123 BTW("an SMS is sent, MS is paged");
124 paging_expect_imsi(imsi);
125 paging_sent = false;
Neels Hofmeyr7c5346c2019-02-19 02:36:35 +0100126 vsub = vlr_subscr_find_by_imsi(net->vlr, imsi, __func__);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100127 OSMO_ASSERT(vsub);
128 VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
129
130 send_sms(vsub, vsub,
131 "Privacy in residential applications is a desirable"
132 " marketing option.");
133
134 VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
Neels Hofmeyr7c5346c2019-02-19 02:36:35 +0100135 vlr_subscr_put(vsub, __func__);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100136 vsub = NULL;
137 VERBOSE_ASSERT(paging_sent, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100138}
139
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100140static void _paging_resp_part1()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100141{
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");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100166
167 btw("conn is still open to wait for SMS ack dance");
168 EXPECT_CONN_COUNT(1);
169}
170
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100171static void _paging_resp_part2(int expect_conn_count, bool expect_clear)
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100172{
173 btw("MS replies with CP-ACK for received SMS");
174 ms_sends_msg("8904");
175 EXPECT_CONN_COUNT(1);
176
177 btw("MS also sends RP-ACK, MSC in turn sends CP-ACK for that");
178 dtap_expect_tx("0904");
Philipp Maierfbf66102017-04-09 12:32:51 +0200179 if (expect_clear)
180 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100181 ms_sends_msg("890106020041020000");
182 VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
Neels Hofmeyr4068ab22018-04-01 20:55:54 +0200183 if (expect_clear) {
Philipp Maierfbf66102017-04-09 12:32:51 +0200184 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100185 ran_sends_clear_complete();
Neels Hofmeyr4068ab22018-04-01 20:55:54 +0200186 }
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100187
188 btw("SMS is done");
189 EXPECT_CONN_COUNT(expect_conn_count);
190}
191
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100192static void test_reject_lu_during_lu()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100193{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100194 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100195
196 _normal_lu_part1();
197
198 BTW("Another Location Update Request from the same subscriber on the same conn is dropped silently");
199 ms_sends_msg("050802008168000130089910070000006402");
200 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
201 EXPECT_CONN_COUNT(1);
202
203 BTW("The first LU can still complete");
204 _normal_lu_part2();
205
206 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100207 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100208}
209
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100210static void test_reject_cm_during_lu()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100211{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100212 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100213
214 _normal_lu_part1();
215
216 BTW("A CM Service Request in the middle of a LU is rejected");
217 cm_service_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100218 ms_sends_msg("05247403305886089910070000006402");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100219 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100220 VERBOSE_ASSERT(cm_service_result_sent, == RES_REJECT, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100221 EXPECT_CONN_COUNT(1);
222
223 BTW("The first LU can still complete");
224 _normal_lu_part2();
225
226 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100227 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100228}
229
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100230static void test_reject_paging_resp_during_lu()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100231{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100232 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100233
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();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100245 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100246}
247
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100248static void test_reject_lu_during_cm()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100249{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100250 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100251
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 Maierfbf66102017-04-09 12:32:51 +0200263 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100264 ms_sends_msg("050130089910070000006402");
Philipp Maierfbf66102017-04-09 12:32:51 +0200265 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100266 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100267 EXPECT_CONN_COUNT(0);
268
269 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100270 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100271}
272
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100273static void test_reject_cm_during_cm()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100274{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100275 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100276
277 _normal_lu();
278 _normal_cm_service_req();
279
280 btw("A second CM Service Request on the same conn is accepted without another auth dance");
281 cm_service_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100282 ms_sends_msg("05247403305886089910070000006402");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100283 VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
284 EXPECT_CONN_COUNT(1);
285
286 BTW("subscriber detaches");
Philipp Maierfbf66102017-04-09 12:32:51 +0200287 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100288 ms_sends_msg("050130089910070000006402");
Philipp Maierfbf66102017-04-09 12:32:51 +0200289 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100290 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100291 EXPECT_CONN_COUNT(0);
292
293 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100294 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100295}
296
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100297static void test_reject_paging_resp_during_cm()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100298{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100299 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100300
301 _normal_lu();
302 _normal_cm_service_req();
303
304 BTW("An erratic Paging Response on the same conn is dropped silently");
305 ms_sends_msg("06270703305882089910070000006402");
306 EXPECT_CONN_COUNT(1);
307
308 BTW("The original CM Service Request can conclude");
Vadim Yanitskiy27605852018-06-15 23:57:30 +0700309
310 /* Release connection */
Vadim Yanitskiy188dd5f2019-06-19 02:05:08 +0700311 expect_bssap_clear();
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100312 conn_conclude_cm_service_req(g_msub, MSC_A_USE_CM_SERVICE_SMS);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100313
314 btw("all requests serviced, conn has been released");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100315 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100316 EXPECT_CONN_COUNT(0);
317
318 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100319 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100320}
321
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100322static void test_reject_paging_resp_during_paging_resp()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100323{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100324 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100325
326 _normal_lu();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100327 _page();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100328 _paging_resp_part1();
329
330 BTW("MS sends another erratic Paging Response which is dropped silently");
331 ms_sends_msg("06270703305882089910070000006402");
332
Philipp Maierfbf66102017-04-09 12:32:51 +0200333 _paging_resp_part2(0, true);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100334
335 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100336 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100337}
338
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100339static void test_reject_lu_during_paging_resp()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100340{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100341 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100342
343 _normal_lu();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100344 _page();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100345 _paging_resp_part1();
346
347 BTW("MS sends erratic LU Request, which is dropped silently");
348 lu_result_sent = RES_NONE;
349 ms_sends_msg("050802008168000130089910070000006402");
350 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
351 EXPECT_CONN_COUNT(1);
352
Philipp Maierfbf66102017-04-09 12:32:51 +0200353 _paging_resp_part2(0, true);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100354
355 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100356 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100357}
358
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100359static void test_accept_cm_during_paging_resp()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100360{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100361 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100362
363 _normal_lu();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100364 _page();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100365 _paging_resp_part1();
366
367 BTW("CM Service Request during open connection is accepted");
368 cm_service_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100369 ms_sends_msg("05247403305886089910070000006402");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100370 VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
371 EXPECT_CONN_COUNT(1);
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100372 VERBOSE_ASSERT(osmo_use_count_by(&msub_msc_a(g_msub)->use_count, MSC_A_USE_CM_SERVICE_SMS), == 1, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100373
Philipp Maierfbf66102017-04-09 12:32:51 +0200374 _paging_resp_part2(1, false);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100375
376 BTW("subscriber detaches");
Philipp Maierfbf66102017-04-09 12:32:51 +0200377 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100378 ms_sends_msg("050130089910070000006402");
Philipp Maierfbf66102017-04-09 12:32:51 +0200379 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100380 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100381 EXPECT_CONN_COUNT(0);
382
383 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100384 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100385}
386
387msc_vlr_test_func_t msc_vlr_tests[] = {
388 test_reject_2nd_conn,
389 test_reject_lu_during_lu,
390 test_reject_cm_during_lu,
391 test_reject_paging_resp_during_lu,
392 test_reject_lu_during_cm,
393 test_reject_cm_during_cm,
394 test_reject_paging_resp_during_cm,
395 test_reject_lu_during_paging_resp,
Philipp Maierfbf66102017-04-09 12:32:51 +0200396 test_accept_cm_during_paging_resp,
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100397 test_reject_paging_resp_during_paging_resp,
398 NULL
399};