path: root/tests/msc_vlr
AgeCommit message (Collapse)AuthorFilesLines
2017-11-27fix use after free: missing conn_get on CC paging responseNeels Hofmeyr1-15/+15
Adjust test expectations accordingly. The error was: ==16084==ERROR: AddressSanitizer: heap-use-after-free on address 0x61500000f5f4 at pc 0x561be639ac2b bp 0x7ffc0aabbe40 sp 0x7ffc0aabbe38 READ of size 4 at 0x61500000f5f4 thread T0 #0 0x561be639ac2a in _msc_subscr_conn_put ../../../../src/osmo-msc/src/libmsc/osmo_msc.c:384 #1 0x561be636070b in rx_from_ms ../../../../src/osmo-msc/tests/msc_vlr/msc_vlr_tests.c:204 #2 0x561be6360b21 in ms_sends_msg ../../../../src/osmo-msc/tests/msc_vlr/msc_vlr_tests.c:217 #3 0x561be635b40a in test_call_mt ../../../../src/osmo-msc/tests/msc_vlr/msc_vlr_test_call.c:328 #4 0x561be6363bb7 in run_tests ../../../../src/osmo-msc/tests/msc_vlr/msc_vlr_tests.c:802 #5 0x561be63524ea in main ../../../../src/osmo-msc/tests/msc_vlr/msc_vlr_tests.c:849 #6 0x7f6eebb3e2b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0) #7 0x561be6352fb9 in _start (/n/s/osmo/make-3G/osmo-msc/tests/msc_vlr/msc_vlr_test_call+0xdafb9) Related: OS#2672 Change-Id: If0659a878deb383ed0300217e2c41c8c79b2b6a5
2017-11-27add msc_vlr_test_call to reproduce a sanitizer errorNeels Hofmeyr6-4/+1124
On MT call, there is a bug in CC conn use which leads to an early free and use-after-free. Add msc_vlr_test_call to show both MO and MT call legs separately and reproduce the failure. It is visible in a sanitizer build (on debian 9). A subsequent patch will fix the bug: If0659a878deb383ed0300217e2c41c8c79b2b6a5 Related: OS#2672 Change-Id: I6c3ca0c660388b1e2c82df17ec540c846201b0c7
2017-11-27subscr_conn: introduce usage tokens for ref error trackingNeels Hofmeyr10-766/+766
When hunting a conn use count bug, it was very hard to figure out who's (not) using the conn. To ease tracking down this bug and future bugs, explicitly name what a conn is being reserved for, and track in a bit mask. Show in the DREF logs what uses and un-uses a conn. See the test expectation updates, which nicely show how that clarifies the state of the conn in the logs. On errors, log them, but don't fail hard: if one conn use/un-use fails, we don't want to crash the entire MSC before we have to. Change-Id: I259aa0eec41efebb4c8221275219433eafaa549b
2017-11-22msc_vlr_tests: set a valid lac for fake connsNeels Hofmeyr11-72/+73
Change-Id: Ie647d93a54aefad5bde8a9411d983cd60714b83d
2017-11-22msc_vlr_tests: fix test nr arg: clear errno before strtol()Neels Hofmeyr1-0/+1
Change-Id: I8e9376f20a44f6348bcb85f0ff27a429dc90e1b8
2017-11-20cosmetic: msc_vlr_tests: add comment to show expected tallocsNeels Hofmeyr1-0/+13
If something changed the talloc landscape, it is hard to find out what the test actually expected when it was written. Add the expectations in an inline comment. Change-Id: If92a18bb3dc24c2cf6498aa2da29266267488240
2017-11-20vlr_subscr_conn_timeout(): don't fire events to discarded fiNeels Hofmeyr2-7/+15
Terminating one of the FSM instances may effect termination and deallocation of the others, as well as the vlr_subscr itself. So, reserve the vlr_subscr locally, and then dispatch events to exactly those FSM instances that exist. The changes in expected output in the msc_vlr_tests shows that the subscriber was deallocated from the first FSM termination, and now sticks around until we've checked both FSMs are gone. Change-Id: I56551ecc10f5295fe75944bdde4b583b1b621811
2017-11-20subscr_conn: don't close after conn timeoutNeels Hofmeyr2-8/+0
If dispatching a conn timeout, the conn fsm will already have been discarded, and we cannot fire any more events to it. The expected test output changes illustrate that we are now omitting event dispatches that happen *after* the same FSM was already deallocated. Change-Id: I25af3e5a1b04e3a5c9f41956cbcbbdd8439c6457
2017-10-31tests: add msc_vlr_test_authen_reuseNeels Hofmeyr5-0/+2955
Change-Id: I185a2cbff6241a27722f1c37ae609f0fcc59a71e
2017-10-31cosmetic: vlr: rename auth_tuple_max_use_count to _reuse_Neels Hofmeyr1-4/+4
The name auth_tuple_max_use_count suggests that if I want to use each auth tuple exactly once, I need to set it to 1. Curiously, so far you need to set to intended uses - 1. Reflect this in its name by renaming to auth_tuple_max_reuse_count. I first considered to not rename but change the if-conditions so that == 1 means each tuple is used once, and upon struct vlr allocation, set the default to 1. That would also logically entail that setting to 0 means to re-use vectors infinitely often, like now a value < 0 does. That means, when allocating a vlr struct zeroed out, we would by default have the most dangerous/unsafe configuration. It's no problem to set a default to 1 upon allocation, but by renaming the variable instead, we get safer alloc-zero behavior and don't need to change any conditionals in the code (even though the patch ends up considerably larger from all the renaming). Change-Id: I0b036cae1536d5d6fb2304f837ed1a6c3713be55
2017-10-30msc_vlr_tests: fix rebuild: rebuild when src/ libs were rebuiltNeels Hofmeyr1-0/+3
Before this, a code change in libvlr or libmsc would not cause a rebuild of the tests. You'd have thought 'AM_LDADD' were the right name for the variable, but apparently it is just 'LDADD' instead. Tested that it works as intended. Change-Id: Icbdedc1581fa23abe9ed99cef3918592b25f30b3
2017-10-28osmo-msc: Don't link against libasn1cHarald Welte1-1/+0
osmo-msc doesn't use any API/symbols of libasn1c directlry. Rather, we use libosmo-ranap which in turn uses libasn1c. Let the linker work out that dependency. This fixes the following dpkg-shlibdeps warning: Change-Id: I2f840884d8f1cc542de1e26acd3d4215bd2fd899 dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-msc/usr/bin/osmo-msc was not linked against libasn1c.so.0 (it uses none of the library's symbols)
2017-10-03fix memory leak: vlr: vlr_gsupc_read_cb() must msgb_free()Neels Hofmeyr1-1/+1
Add required msgb_free() to vlr_gsupc_read_cb(). Adjust msc_vlr_tests.c gsup_rx() to *not* free the msgb again after vlr_gsupc_read_cb() did. Related: OS#2476 Change-Id: I347c53f57a7fa79921aed3f6e42599841acf27c0
2017-09-15Remove rest_octets.hMax1-0/+1
The MSC should not fiddle with low-level SI details like rest octets anyway. Unfortunately simply removing the header is impossible as it causes massive fallout due to missing includes. Fixed it as well. The only other parameter which required removal is cell_ro_sel_par which is not referenced anywhere in the code anyway. Change-Id: Ibff77330de056fad4288cd4c48d016aad8105354
2017-09-08use separated libosmo-mgcp-client, apply rename to mgcp_client_*Neels Hofmeyr1-2/+2
After osmo-mgw changes I8e0b2d2a399b77086a36606f5e427271c6242df1 and I99f7faab637cfcc22ece64a1dbcbe590f2042187, apply linking of new libosmo-mgcp-client and renames to drop the "gw" from mgcp_client_*. Also rename the gsm_network.mgcpgw to mgw, to indicate that the MGCP client is used to contact the MGW (Media Gateway). Depends: I8e0b2d2a399b77086a36606f5e427271c6242df1 (osmo-mgw) I99f7faab637cfcc22ece64a1dbcbe590f2042187 (osmo-mgw) Change-Id: I093ad02ca0e532f659447c785e09678b3e6f220d
2017-09-06rename include/openbsc to include/osmocom/mscNeels Hofmeyr2-8/+8
Change-Id: I1f96a1285bbd1b4607614856bca935d5c26e2da9
2017-08-30am: msc_vlr_tests: use AM_LDFLAGS instead of COMMON varsNeels Hofmeyr1-53/+32
It was a n00b mistake to define COMMON_LDFLAGS and COMMON_LDADD to pass the same linker options to each test binary. Instead, use AM_LDFLAGS and remove the autoreconf warning. tests/msc_vlr/Makefile.am:66: warning: variable 'COMMON_LDFLAGS' is defined but no program or tests/msc_vlr/Makefile.am:66: library has 'COMMON' as canonical name (possible typo) Related: OS#2448 Change-Id: I6efae6e192b22de2c1d706edd55385135142532b
2017-08-29split off osmo-msc: remove files, apply build, renameNeels Hofmeyr2-3/+0
Change-Id: Icf025e5ea8d180613b3114282951c9afa67af9a7
2017-08-29msc_vlr tests: add IMEISV testsNeels Hofmeyr6-48/+1324
Change-Id: I752afef2ae3ce04e813c7e9fea0e883e607c0e14
2017-08-29move to osmo-mgw.git: osmo-bsc_mgcp and libmgcp as libosmo-legacy-mgcpNeels Hofmeyr1-1/+3
Rewire build and includes to libosmo-legacy-mgcp. Drop osmo-bsc_mgcp and related python tests, now found in osmo-mgw.git. libosmo-legacy-mgcp is installed from osmo-mgw, hence add the dependency to jenkins.sh (so far using the pre_release branch). Change-Id: Ic99d681759edce11564da62500c2aac5cf5fffe2
2017-08-29cosmetic: msc_vlr_tests: drop unused varNeels Hofmeyr1-1/+0
Change-Id: I584c0dfffe005597563dbd72fad8a087c554ba3d
2017-08-29move libiu to osmo-iuh/libosmo-ranapNeels Hofmeyr2-25/+23
Remove libiu here, use the functions from libosmo-ranap instead, by applying the ranap_ / RANAP_ prefix. Corresponding change-id in osmo-iuh.git is I6a3f7ad15be03fb94689b4af6ccfa828c25f45c0 To be able to run the msc_vlr tests for RAN_UTRAN_IU without Iu client headers available, add iu_dummy.h, containing mere function signatures that match iu_dummy.c and a mostly empty struct ranap_ue_conn_ctx. Make sure we can build with and without --enable-iu: include osmo-iuh headers only with --enable-iu. Change-Id: Ib8c4fcdb4766c5e575618b95ce16dce51063206b
2017-08-29Implement AoIP, port to M3UA SIGTRAN (large addition and refactoring)Philipp Maier21-19/+433
This was originally a long series of commits converging to the final result seen in this patch. It does not make much sense to review the smaller steps' trial and error, we need to review this entire change as a whole. Implement AoIP in osmo-msc and osmo-bsc. Change over to the new libosmo-sigtran API with support for proper SCCP/M3UA/SCTP stacking, as mandated by 3GPP specifications for the IuCS and IuPS interfaces. From here on, a separate osmo-stp process is required for SCCP routing between OsmoBSC / OsmoHNBGW <-> OsmoMSC / OsmoSGSN jenkins.sh: build from libosmo-sccp and osmo-iuh master branches now for new M3UA SIGTRAN. Patch-by: pmaier, nhofmeyr, laforge Change-Id: I5ae4e05ee7c57cad341ea5e86af37c1f6b0ffa77
2017-08-2304.08: log protocol discriminators and message types by nameNeels Hofmeyr10-901/+915
On incoming 04.08 messages, we log only the protocol discriminator in decimal. Enhance: log pdisc and message type in hex, and also log the protocol and message type as human readable string. Also adjust the msc_vlr tests' log statements for wrapped rx/tx functions of dtap from/to the MS. Adjust the expected output of msc_vlr_tests. Change-Id: Ida205d217e304337d816b14fd15e2ee435e7397d Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df
2017-08-22fix msc_vlr tests after libosmocore uses localtime for SMSNeels Hofmeyr1-2/+2
libosmocore change-id I4efdb1eaae43aced33961b64d4f14b0040321c10 changes the gsm340_gen_scts() from gmtime to localtime, meaning that by feeding a mere zero as timestamp, we get different results depending on the local machine's timezone setting. Instead of calling gsm340_gen_scts() with zero, simply write a bunch of bytes as time so that the tests get identical SMS bytes every time. Change-Id: I8a50e8963dce80609749571b61fc6ffe1c54660c
2017-08-08Implement IuCS (large refactoring and addition)Neels Hofmeyr14-1315/+1893
osmo-nitb becomes osmo-msc add DIUCS debug log constant add iucs.[hc] add msc vty, remove nitb vty add libiudummy, to avoid linking Iu deps in tests Use new msc_tx_dtap() instead of gsm0808_submit_dtap() libmgcp: add mgcpgw client API bridge calls via mgcpgw Enable MSC specific CTRL commands, bsc_base_ctrl_cmds_install() still needs to be split up. Change-Id: I5b5b6a9678b458affa86800afb1ec726e66eed88
2017-08-08mscsplit: various preparations to separate MSC from BSCNeels Hofmeyr7-66/+34
Disable large parts of the code that depend on BSC presence. The code sections disabled by #if BEFORE_MSCSPLIT shall be modified or dropped in the course of adding the A-interface. Don't set msg->lchan nor msg->dst. Don't use lchan in libmsc. Decouple lac from bts. Prepare entry/exit point for MSC -> BSC and MSC -> RNC communication: Add msc_ifaces.[hc], a_iface.c, with a general msc_tx_dtap() to redirect to different interfaces depending on the actual subscriber connection. While iu_tx() is going to be functional fairly soon, the a_tx() is going to be just a dummy for some time (see comment). Add Iu specific fields in gsm_subscriber_connection: the UE connection pointer and an indicator for the Integrity Protection status on Iu (to be fully implemented in later commits). Add lac member to gsm_subscriber_connection, to allow decoupling from bts->location_area_code. The conn->lac will actually be set in iu.c in an upcoming commit ("add iucs.[hc]"). move to libcommon-cs: gsm48_extract_mi(), gsm48_paging_extract_mi(). libmsc: duplicate gsm0808 / gsm48 functions (towards BSC). In osmo-nitb, libmsc would directly call the functions on the BSC level, not always via the bsc_api. When separating libmsc from libbsc, some functions are missing from the linkage. Hence duplicate these functions to libmsc, add an msc_ prefix for clarity, also add a _tx to gsm0808_cipher_mode(): * add msc_gsm0808_tx_cipher_mode() (dummy/stub) * add msc_gsm48_tx_mm_serv_ack() * add msc_gsm48_tx_mm_serv_rej() Call these from libmsc instead of * gsm0808_cipher_mode() * gsm48_tx_mm_serv_ack() * gsm48_tx_mm_serv_rej() Also add a comment related to msc_gsm0808_tx_cipher_mode() in two places. Remove internal RTP streaming code; OsmoNITB supported that, but for OsmoMSC, this will be done with an external MGCP gateway. Remove LCHAN_MODIFY from internal MNCC state machine. Temporarily disable all paging to be able to link libmsc without libbsc. Skip the paging part of channel_test because the paging is now disabled. Employ fake paging shims in order for msc_vlr_tests to still work. msc_compl_l3(): publish in .h, tweak return value. Use new libmsc enum values for return val, to avoid dependency on libbsc headers. Make callable from other scopes: publish in osmo_msc.h and remove 'static' in osmo_msc.c add gsm_encr to subscr_conn move subscr_request to gsm_subscriber.h subscr_request_channel() -> subscr_request_conn() move to libmsc: osmo_stats_vty_add_cmds() gsm_04_08: remove apply_codec_restrictions() gsm0408_test: use NULL for root ctx move to libbsc: gsm_bts_neighbor() move to libbsc: lchan_next_meas_rep() move vty config for t3212 to network level (periodic lu) remove unneccessary linking from some tests remove handle_abisip_signal() abis_rsl.c: don't use libvlr from libbsc gsm_subscriber_connection: put the LAC here, so that it is available without accessing conn->bts. In bsc_api.c, place this lac in conn for the sake of transition: Iu and A will use this new field to pass the LAC around, but in a completely separate OsmoBSC this is not actually needed. It can be removed again from osmo-bsc.git when the time has come. Siemens MRPCI: completely drop sending the MRPCI messages for now, they shall be added in osmo-bsc once the A-Interface code has settled. See OS#2389. Related: OS#1845 OS#2257 OS#2389 Change-Id: Id3705236350d5f69e447046b0a764bbabc3d493c
2017-08-07vlr: LU FSM: enable Retrieve_IMEISV_If_RequiredNeels Hofmeyr11-50/+51
Change-Id: I121b95ad6d5ecb7603815eece2b43008de487a8a
2017-07-23Add msc_vlr test suite for MSC+VLR end-to-end testsNeels Hofmeyr30-0/+14710
Change-Id: If0e7cf20b9d1eac12126955b2f5f02bd8f1192cd