blob: 7eaedb27c7679862ec031e9786382aa24d3349f3 [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"
Harald Welte0df904d2018-12-03 11:00:04 +010025#include "stubs.h"
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010026
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +010027static void test_reject_2nd_conn()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010028{
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010029 struct msub *conn1;
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +010030 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010031
32 btw("Location Update Request on one connection");
33 lu_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010034 gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010035 ms_sends_msg("050802008168000130089910070000006402");
36 OSMO_ASSERT(gsup_tx_confirmed);
37 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
38 EXPECT_CONN_COUNT(1);
39
40 btw("Another Location Update Request from the same subscriber on another connection is rejected");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010041 conn1 = g_msub;
42 g_msub = NULL;
Philipp Maierfbf66102017-04-09 12:32:51 +020043 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010044 ms_sends_msg("050802008168000130089910070000006402");
Philipp Maierfbf66102017-04-09 12:32:51 +020045 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010046 VERBOSE_ASSERT(lu_result_sent, == RES_REJECT, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010047 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010048 EXPECT_CONN_COUNT(1);
49
50
51 BTW("The first connection can still complete its LU");
52 btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010053 g_msub = conn1;
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010054 lu_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010055 gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
56 "12010809710000004026f0" VLR_TO_HLR);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010057 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
58
59 btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
Philipp Maierfbf66102017-04-09 12:32:51 +020060 expect_bssap_clear();
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010061 gsup_rx("06010809710000004026f0"HLR_TO_VLR, NULL);
Philipp Maierfbf66102017-04-09 12:32:51 +020062 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010063
64 btw("LU was successful, and the conn has already been closed");
65 VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010066 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010067 EXPECT_CONN_COUNT(0);
68
69 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +010070 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010071}
72
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +010073static void _normal_lu_part1()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010074{
75 btw("Location Update Request");
76 lu_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010077 gsup_expect_tx("04010809710000004026f0280102" VLR_TO_HLR);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010078 ms_sends_msg("050802008168000130089910070000006402");
79 OSMO_ASSERT(gsup_tx_confirmed);
80 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
81 EXPECT_CONN_COUNT(1);
82}
83
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +010084static void _normal_lu_part2()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010085{
86 btw("HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT");
87 lu_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010088 gsup_rx("10010809710000004026f00804036470f1" HLR_TO_VLR,
89 "12010809710000004026f0" VLR_TO_HLR);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010090 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
91
92 btw("HLR also sends GSUP _UPDATE_LOCATION_RESULT");
Philipp Maierfbf66102017-04-09 12:32:51 +020093 expect_bssap_clear();
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010094 gsup_rx("06010809710000004026f0" HLR_TO_VLR, NULL);
Philipp Maierfbf66102017-04-09 12:32:51 +020095 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +010096
97 btw("LU was successful, and the conn has already been closed");
98 VERBOSE_ASSERT(lu_result_sent, == RES_ACCEPT, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +010099 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100100 EXPECT_CONN_COUNT(0);
101}
102
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100103static void _normal_lu()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100104{
105 BTW("Subscriber does a normal LU");
106 _normal_lu_part1();
107 _normal_lu_part2();
108}
109
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100110static void _normal_cm_service_req()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100111{
112 BTW("Subscriber does a normal CM Service Request");
113 cm_service_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100114 ms_sends_msg("05247403305886089910070000006402");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100115 VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
116 EXPECT_ACCEPTED(true);
117}
118
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100119static void _page()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100120{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100121 const char *imsi = "901700000004620";
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100122 struct vlr_subscr *vsub;
123
124 BTW("an SMS is sent, MS is paged");
125 paging_expect_imsi(imsi);
126 paging_sent = false;
Neels Hofmeyr7c5346c2019-02-19 02:36:35 +0100127 vsub = vlr_subscr_find_by_imsi(net->vlr, imsi, __func__);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100128 OSMO_ASSERT(vsub);
129 VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 0, "%d");
130
131 send_sms(vsub, vsub,
132 "Privacy in residential applications is a desirable"
133 " marketing option.");
134
135 VERBOSE_ASSERT(llist_count(&vsub->cs.requests), == 1, "%d");
Neels Hofmeyr7c5346c2019-02-19 02:36:35 +0100136 vlr_subscr_put(vsub, __func__);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100137 vsub = NULL;
138 VERBOSE_ASSERT(paging_sent, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100139}
140
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100141static void _paging_resp_part1()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100142{
143 btw("MS replies with Paging Response, we deliver the SMS");
144 dtap_expect_tx("09" /* SMS messages */
145 "01" /* CP-DATA */
146 "58" /* length */
147 "01" /* Network to MS */
148 "00" /* reference */
149 /* originator (gsm411_send_sms() hardcodes this weird nr) */
150 "0791" "447758100650" /* 447785016005 */
151 "00" /* dest */
152 /* SMS TPDU */
153 "4c" /* len */
154 "00" /* SMS deliver */
155 "05806470f1" /* originating address 46071 */
156 "00" /* TP-PID */
157 "00" /* GSM default alphabet */
158 "071010" /* Y-M-D (from wrapped gsm340_gen_scts())*/
159 "000000" /* H-M-S */
160 "00" /* GMT+0 */
161 "44" /* data length */
162 "5079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0e"
163 "d3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb"
164 "0c7ac3e9e9b7db05");
165 ms_sends_msg("06270703305882089910070000006402");
166 VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100167
168 btw("conn is still open to wait for SMS ack dance");
169 EXPECT_CONN_COUNT(1);
170}
171
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100172static void _paging_resp_part2(int expect_conn_count, bool expect_clear)
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100173{
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 Maierfbf66102017-04-09 12:32:51 +0200180 if (expect_clear)
181 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100182 ms_sends_msg("890106020041020000");
183 VERBOSE_ASSERT(dtap_tx_confirmed, == true, "%d");
Neels Hofmeyr4068ab22018-04-01 20:55:54 +0200184 if (expect_clear) {
Philipp Maierfbf66102017-04-09 12:32:51 +0200185 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100186 ran_sends_clear_complete();
Neels Hofmeyr4068ab22018-04-01 20:55:54 +0200187 }
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100188
189 btw("SMS is done");
190 EXPECT_CONN_COUNT(expect_conn_count);
191}
192
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100193static void test_reject_lu_during_lu()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100194{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100195 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100196
197 _normal_lu_part1();
198
199 BTW("Another Location Update Request from the same subscriber on the same conn is dropped silently");
200 ms_sends_msg("050802008168000130089910070000006402");
201 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
202 EXPECT_CONN_COUNT(1);
203
204 BTW("The first LU can still complete");
205 _normal_lu_part2();
206
207 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100208 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100209}
210
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100211static void test_reject_cm_during_lu()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100212{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100213 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100214
215 _normal_lu_part1();
216
217 BTW("A CM Service Request in the middle of a LU is rejected");
218 cm_service_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100219 ms_sends_msg("05247403305886089910070000006402");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100220 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100221 VERBOSE_ASSERT(cm_service_result_sent, == RES_REJECT, "%d");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100222 EXPECT_CONN_COUNT(1);
223
224 BTW("The first LU can still complete");
225 _normal_lu_part2();
226
227 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100228 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100229}
230
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100231static void test_reject_paging_resp_during_lu()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100232{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100233 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100234
235 _normal_lu_part1();
236
237 BTW("An erratic Paging Response is dropped silently");
238 ms_sends_msg("06270703305882089910070000006402");
239 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
240 EXPECT_CONN_COUNT(1);
241
242 BTW("The first LU can still complete");
243 _normal_lu_part2();
244
245 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100246 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100247}
248
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100249static void test_reject_lu_during_cm()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100250{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100251 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100252
253 _normal_lu();
254 _normal_cm_service_req();
255
256 btw("A LU request on an open conn is dropped silently");
257 /* TODO: accept periodic LU on an already open conn? */
258 lu_result_sent = RES_NONE;
259 ms_sends_msg("050802008168000130089910070000006402");
260 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
261 EXPECT_CONN_COUNT(1);
262
263 BTW("subscriber detaches");
Philipp Maierfbf66102017-04-09 12:32:51 +0200264 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100265 ms_sends_msg("050130089910070000006402");
Philipp Maierfbf66102017-04-09 12:32:51 +0200266 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100267 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100268 EXPECT_CONN_COUNT(0);
269
270 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100271 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100272}
273
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100274static void test_reject_cm_during_cm()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100275{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100276 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100277
278 _normal_lu();
279 _normal_cm_service_req();
280
281 btw("A second CM Service Request on the same conn is accepted without another auth dance");
282 cm_service_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100283 ms_sends_msg("05247403305886089910070000006402");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100284 VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
285 EXPECT_CONN_COUNT(1);
286
287 BTW("subscriber detaches");
Philipp Maierfbf66102017-04-09 12:32:51 +0200288 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100289 ms_sends_msg("050130089910070000006402");
Philipp Maierfbf66102017-04-09 12:32:51 +0200290 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100291 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100292 EXPECT_CONN_COUNT(0);
293
294 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100295 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100296}
297
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100298static void test_reject_paging_resp_during_cm()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100299{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100300 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100301
302 _normal_lu();
303 _normal_cm_service_req();
304
305 BTW("An erratic Paging Response on the same conn is dropped silently");
306 ms_sends_msg("06270703305882089910070000006402");
307 EXPECT_CONN_COUNT(1);
308
309 BTW("The original CM Service Request can conclude");
Vadim Yanitskiy27605852018-06-15 23:57:30 +0700310
311 /* Release connection */
Neels Hofmeyr7814a832018-12-26 00:40:18 +0100312 expect_bssap_clear(OSMO_RAT_GERAN_A);
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100313 conn_conclude_cm_service_req(g_msub, MSC_A_USE_CM_SERVICE_SMS);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100314
315 btw("all requests serviced, conn has been released");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100316 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100317 EXPECT_CONN_COUNT(0);
318
319 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100320 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100321}
322
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100323static void test_reject_paging_resp_during_paging_resp()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100324{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100325 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100326
327 _normal_lu();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100328 _page();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100329 _paging_resp_part1();
330
331 BTW("MS sends another erratic Paging Response which is dropped silently");
332 ms_sends_msg("06270703305882089910070000006402");
333
Philipp Maierfbf66102017-04-09 12:32:51 +0200334 _paging_resp_part2(0, true);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100335
336 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100337 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100338}
339
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100340static void test_reject_lu_during_paging_resp()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100341{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100342 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100343
344 _normal_lu();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100345 _page();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100346 _paging_resp_part1();
347
348 BTW("MS sends erratic LU Request, which is dropped silently");
349 lu_result_sent = RES_NONE;
350 ms_sends_msg("050802008168000130089910070000006402");
351 VERBOSE_ASSERT(lu_result_sent, == RES_NONE, "%d");
352 EXPECT_CONN_COUNT(1);
353
Philipp Maierfbf66102017-04-09 12:32:51 +0200354 _paging_resp_part2(0, true);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100355
356 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100357 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100358}
359
Neels Hofmeyrf3d81f62018-03-02 01:05:38 +0100360static void test_accept_cm_during_paging_resp()
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100361{
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100362 comment_start();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100363
364 _normal_lu();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100365 _page();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100366 _paging_resp_part1();
367
368 BTW("CM Service Request during open connection is accepted");
369 cm_service_result_sent = RES_NONE;
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100370 ms_sends_msg("05247403305886089910070000006402");
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100371 VERBOSE_ASSERT(cm_service_result_sent, == RES_ACCEPT, "%d");
372 EXPECT_CONN_COUNT(1);
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100373 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 +0100374
Philipp Maierfbf66102017-04-09 12:32:51 +0200375 _paging_resp_part2(1, false);
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100376
377 BTW("subscriber detaches");
Philipp Maierfbf66102017-04-09 12:32:51 +0200378 expect_bssap_clear();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100379 ms_sends_msg("050130089910070000006402");
Philipp Maierfbf66102017-04-09 12:32:51 +0200380 VERBOSE_ASSERT(bssap_clear_sent, == true, "%d");
Neels Hofmeyrc4628a32018-12-07 14:47:34 +0100381 ran_sends_clear_complete();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100382 EXPECT_CONN_COUNT(0);
383
384 clear_vlr();
Neels Hofmeyrdfdc61d2018-03-02 00:40:58 +0100385 comment_end();
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100386}
387
388msc_vlr_test_func_t msc_vlr_tests[] = {
389 test_reject_2nd_conn,
390 test_reject_lu_during_lu,
391 test_reject_cm_during_lu,
392 test_reject_paging_resp_during_lu,
393 test_reject_lu_during_cm,
394 test_reject_cm_during_cm,
395 test_reject_paging_resp_during_cm,
396 test_reject_lu_during_paging_resp,
Philipp Maierfbf66102017-04-09 12:32:51 +0200397 test_accept_cm_during_paging_resp,
Neels Hofmeyr6a29d322017-01-25 15:04:16 +0100398 test_reject_paging_resp_during_paging_resp,
399 NULL
400};