aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
AgeCommit message (Collapse)AuthorFilesLines
2017-03-16log protocol discriminators and message types by namesysmocom/iu_before_collapseNeels Hofmeyr9-820/+834
Depends: libosmocore change-id I0fca8e95ed5c2148b1a7440eff3fc9c7583898df Change-Id: If1c49faf6e1757cb16b383dd2db87b48bc94eee6
2017-03-16adjust msc_vlr_test_reject_concurrencyNeels Hofmeyr2-18/+406
Change-Id: Ic4e6ebd8973e9e7f7c578fb559c741cbe10bef5a
2017-03-16log: ciphering/security are implicit CM Service AcceptNeels Hofmeyr1-0/+4
Log just as prominently to mark CM Service Accept. Change-Id: I7afe9d4f69e5525ede7a7c380a2c48fb2c5054b6
2017-03-16debug log: upon bumping a conn, say why it is keptNeels Hofmeyr8-741/+913
Change-Id: I378af1fa06d8a45c01a80a381be143572e1dc41f
2017-03-16allow CM Service Request on already open connectionNeels Hofmeyr1-9/+19
Change-Id: I3c4687aafe495e60b1568e6505dbf847adab37f1
2017-03-16Reinstate msc subscriber conn ref countingNeels Hofmeyr10-417/+624
Indeed the easiest way of ensuring all code paths can cause conn discarding while still all code paths can check on whether a conn needs to be discarded. Change-Id: I641fe36d9fa2077e3caf63cc583aaa380603bff0
2017-03-16compiler warning mgcp fuNeels Hofmeyr1-1/+1
Change-Id: I79a891dbaff3cd6aec5a0ab08435e4619ade62d2
2017-03-16vlr: fix: don't send CM Service Accept after Ciphering CommandNeels Hofmeyr2-5/+4
Ciphering Mode Command is an implicit CM Service Accept, if we're sending both we're confusing the MS. Change-Id: I3a04debe9b01c086e7f44b6139cb8796fcc71d38
2017-03-16implement utran security mode with vlrNeels Hofmeyr4-75/+218
Change-Id: Ib1e285b54cd7aaa0895e9c51a47720f446a07183
2017-03-16vlr tests: umts auth with tmsiNeels Hofmeyr2-32/+179
Change-Id: I136fa85b234dfeb0e8017d8c3401f7f42114b6ff
2017-03-16vlr: allow setting assign_tmsi per-subscriberNeels Hofmeyr1-1/+2
Change-Id: I7469da0ed19e1e8b292422aadfd3ae2ebc2afd57
2017-03-16vlr on utran: transmit CommonIDNeels Hofmeyr2-0/+9
Change-Id: Ice3c71f048b097f2c2de8bd4f4508a7ca2cb1cf5
2017-03-16msc: decouple from bsc_api and btsNeels Hofmeyr10-50/+48
Change-Id: I3564291a6d20da13a8d75c71b0c425da4948d412
2017-03-16make python tests pass for new OsmoMSCNeels Hofmeyr3-224/+33
Change-Id: I59bf6503a2f822e9b6078c0fd24643df9a2dab3c
2017-03-16Make the code work so that the msc_vlr tests passNeels Hofmeyr16-393/+237
Change-Id: Ie8814d856bbe4c111007a696a4d26576854c134f
2017-03-16mgcp parsing, mgcp testNeels Hofmeyr6-10/+235
Change-Id: Ibe2ab17b3fa3a506a2e841ba979ea4175e3a21e8
2017-03-16mgcp: handle responses from the MGCP GWNeels Hofmeyr1-4/+8
Change-Id: I5c0493feaec775461b5a017c36b93cc2ad63c896
2017-03-16IuCS: rapidly release connectionsNeels Hofmeyr1-0/+3
Do the same as we do in 2G: release the connection as soon as nothing else is pending for a given subscriber. Before, osmo-msc would wait for the UE "to get bored" and send an Iu release. But the CN should stay lean on connections. Also, 25.413[1] in section 7, 6th point states: "While the Iu release is managed from the CN, the RNC has the capability to request the release of all Iu connection resources from the corresponding Iu connection." So far we did not manage Iu release from osmo-msc at all. Use the same mechanism we use in 2G: from msc_release_connection(), just before freeing the gsm_subscriber_conn, invoke a CN initiated Iu Release command to the UE. This works around OS#1816 ("USSD only works when IuCS is released", on nano3G), because the Iu conn is now released right after every signalling, so that typically no two requests will use the same conn. In iu.h/iu.c, add iu_tx_release(), absorbing almost all of the code from ranap_handle_co_iu_rel_req(). Add stub to db_test.c, necessary to build it without linking libiu. [1] 3GPP TS 25.413 v12.4.0 Release 12 / ETSI TS 125 413 V12.4.0 (2015-04) Related: OS#1816 Change-Id: Ic12bd6f3666f6fd42bd6d9fdae1c93abee3b6786
2017-03-16bridge calls via mgcpgwNeels Hofmeyr1-0/+4
Change-Id: Ie259e30bc532fe9817c96562022ac33443d5747a
2017-03-16IuCS: implement msc_call_assignment() for IuCSNeels Hofmeyr2-0/+26
Send IuCS RAB Activation upon MNCC_CALL_PROC_REQ. Implement function msc_call_assignment(): decide between sending A-iface BSSMAP Assignment Request or IuCS RAB Assignment Request. Implement iu_rab_act_cs() to send the IuCS RAB Assignment Request. The IP address and port of the MGCPGW sent in the RAB Assignment are still hardcoded. The A-interface extension is not implemented yet. Declare ranap_new_msg_rab_assign_voice() to avoid including ranap_msg_factory.h, which would require adding ASN1 CFLAGS to Makefile.am. The mgcpgw_client as well as some more osmo-iuh functions are now linked from libmsc, hence add some dummy stubs to libiudummy and db_test.c. Change-Id: Iaae51d1fbbfc28fad1c0b85e161d53d80a420a19
2017-03-16IuCS: send RANAP CommonIDNeels Hofmeyr1-0/+6
Add libiu function to send a CommonID message down a UE connection, iu_tx_common_id(); add also a corresponding stub to libiudummy for linking with tests. Add libmsc function msc_tx_common_id() to call the above. Add this mostly to clearly indicate in msc_ifaces.h that libmsc is calling out of the MSC; also to do conn->via_iface checking. Call msc_tx_common_id() after ciphering is established, in _gsm48_rx_mm_serv_req_sec_cb()'s GSM_SECURITY_SUCCEEDED case. Change-Id: I576ddd5bbabfc989149debd2f8a9743db6d26043
2017-03-16gsm0408_test: use NULL for root ctx -- TODO really?Neels Hofmeyr1-2/+2
2017-03-16remove unneccessary linking from some testsNeels Hofmeyr3-4/+0
The recent shifts and cuts have made some library linking for bsc, channel and db tests unnecessary.
2017-03-16cut off libbsc paging, pending paging in libmscNeels Hofmeyr2-1/+3
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. In osmo-nitb, paging is done on BSC level and MSC level "at the same time". When the new MSC is fully operational, paging will be controlled separately on the MSC level, and the BSC (RNC) level will be instructed over an IuCS or A-interface to negotiate paging with the MS (UE). This MSC level paging does not yet exist and will be added in subsequent commits. Change-Id: I8b6920ddc54fc3f2876a59664e6722666d8a8a4a
2017-03-16add libiudummy, to avoid linking Iu deps in testsNeels Hofmeyr5-0/+55
Change-Id: I4a66c4122011dbc87c6fcb336ab0461b86522c98
2017-03-16vlr: fix: don't send CM Service Accept after Ciphering CommandNeels Hofmeyr2-10/+8
Ciphering Mode Command is an implicit CM Service Accept, if we're sending both we're confusing the MS. Change-Id: I3a04debe9b01c086e7f44b6139cb8796fcc71d38 Conflicts: openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.c openbsc/tests/msc_vlr/msc_vlr_test_umts_authen.err
2017-03-16fix: vlr: clear last_tuple when receiving auth tuplesNeels Hofmeyr2-6/+18
When receiving more than one auth tuple during AUTS resync, the VLR would go on to send the second tuple instead of the first. The unit test didn't catch that because its fake HLR message contained only one tuple. Adjust the test to send two tuples to catch this error. Fix the code to clear vlr_subscr->last_tuple whenever new auth tuples are received. Change-Id: I1f84e7d2619aa8d9a0dcdfb50745feeb040264b9
2017-03-16gsup_client: allow passing a unit id to identify with HLRNeels Hofmeyr1-1/+1
Before, each GSUP client would contact the HLR with an identical unit id, i.e. "SGSN-00-00-00-00-00-00", with the result that some messages were sucked off by the wrong client. Pass explicit unit name from each gsup client user, so that OsmoMSC is "MSC" and OsmoSGSN is "SGSN". Hence the HLR can properly route the messages. Todo: also set some values instead of the zeros. Change-Id: I3f8d6dd47c7013920e2a4bde006ed77afd974e80
2017-03-16vlr: get SMS working, by SMS recipient MSISDN round-robinNeels Hofmeyr6-0/+366
The SQL based lookup of SMS for attached subscribers no longer works since the SQL database no longer has the subscriber data. Replace with a round-robin on the SMS recipient MSISDNs paired with a VLR subscriber RAM lookup whether the subscriber is currently attached. If there are many SMS for not-attached subscribers in the SMS database, this will become inefficient: a DB hit returns a pending SMS, the RAM lookup will reveal that the subscriber is not attached, after which the DB is hit for the next SMS. It would become more efficient e.g. by having an MSISDN based hash list for the VLR subscribers and by marking non-attached SMS recipients in the SMS database so that they can be excluded with the SQL query already. There is a sanity limit to do at most 100 db hits per attempt to find a pending SMS. So if there are more than 100 stored SMS waiting for their recipients to actually attach to the MSC, it may take more than one SMS queue trigger to deliver SMS for subscribers that are actually attached. This is not very beautiful, but is merely intended to carry us over to a time when we have a proper separate SMSC entity. Change-Id: I1acf9debb6ba9164e6edcfd5bc5e48e8c98f2b01
2017-03-16msc_vlr tests: add tests to reject concurrenct connsNeels Hofmeyr7-107/+2002
Change-Id: I5c04b1cf0ad302c35968e0f8dfb122997f3f7bf1
2017-03-16Add msc_vlr test suite for MSC+VLR end-to-end testsNeels Hofmeyr29-1/+12964
Change-Id: Ic073f3a069a7f5e7e421e0e56140f069ee9b10b8
2017-03-16Use libvlr in libmsc (large refactoring)Neels Hofmeyr11-601/+46
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. TODO: This commit may be split in several smaller changes before merging to master. Related: OS#1592 Change-Id: I702ba504ce2de93507312c28eca8d11f09f4ee8b
2017-03-16Add libvlr implementationHarald Welte2-0/+715
Original libvlr code is by Harald Welte <laforge@gnumonks.org>, polished and tweaked by Neels Hofmeyr <nhofmeyr@sysmocom.de>. This is a long series of development collapsed in one patch. The original history may still be available as branch neels/vlr_orig. Related: OS#1592 Change-Id: I3f75de5f0cc2ff77f276fd39832dd3621309c4b9
2017-03-14python tests: vty and smpp: speed up >10 timesNeels Hofmeyr2-2/+0
osmo-python-tests now includes code that retries connecting the VTY socket and needs no external sleep()ing. This flies through most tests without any sleep() at all. See osmo-python-tests.git change-id Icc337f52a93d5fe31fc4ff235ccaf4e0fe75fa39 Change-Id: I42161d9716fe5bb0ef1c56e4bfb770bb99bbca7a
2017-03-08add struct bsc_subscr, separating libbsc from gsm_subscriberNeels Hofmeyr7-2/+187
In a future commit, gsm_subscriber will be replaced by vlr_subscr, and it will not make sense to use vlr_subscr in libbsc. Thus we need a dedicated BSC subscriber: struct bsc_subscr. Add rf_policy arg to bsc_grace_paging_request() because the bsc_subscr will no longer have a backpointer to gsm_network (used to be via subscr->group). Create a separate logging filter for the new BSC subscriber. The implementation of adjusting the filter context is added in libbsc to not introduce bsc_subscr_get/_put() dependencies to libcommon. During Paging Response, fetch a bsc_subscr from the mobile identity, like we do for the gsm_subscriber. It looks like a duplication now, but will make sense for the VLR as well as for future MSC split patches. Naming: it was requested to not name the new struct bsc_sub, because 'sub' is too ambiguous. At the same time it would be fine to have 'bsc_sub_' as function prefix. Instead of struct bsc_subscriber and bsc_sub_ prefix, I decided to match both up as struct bsc_subscr and bsc_subscr_ function prefix. It's fast to type, relatively short, unambiguous, and the naming is consistent. Add bsc_subscr unit test. Related: OS#1592, OS#1594 Change-Id: Ia61cc00e8bb186b976939a4fc8f7cf9ce6aa3d8e
2017-03-05vty tests: close msc socket after nat_msc_testNeels Hofmeyr1-23/+27
Change-Id: Ib64cf8690627803e1b4a8497ea63f1e766960478
2017-03-02vty tests: allow picking specific tests to run by nameNeels Hofmeyr1-0/+5
Depends: osmo-python-tests change-id I92f90c334169f31920c63dd5c5ac8dac215065e6 Change-Id: I849455e0423e1a63d6890aef7f9c6075ad53a920
2017-02-28ctrl_test_runner: speed up more than 10 fold by sleeping lessNeels Hofmeyr1-3/+13
Similar to a recent patch in osmo-python-tests for VTY based tests, but this is for the Ctrl tests. The TestCtrlBase tests gave a constant sleep(2) grace period for the process to startup. This causes tests to take minutes for no reason at all. Add code to TestCtrlBase to try and connect right away, retrying up to three seconds in .1 second intervals. This flies through most tests without any sleep() at all. Change-Id: I06569767153838bd9cd3edac001df5f6c567874c
2017-02-28vty test: nat_msc_test: setsockopt REUSE to avoid TIME_WAIT problemsNeels Hofmeyr1-0/+1
When running the testBSCreload test in close succession, I get a "Connection refused" error because the socket is still in TIME_WAIT state. Passing the SO_REUSEADDR flag allows reusing the addr despite a TIME_WAIT socket. Change-Id: I941851b062999ab4b962430f7b27c19935993e0a
2017-02-27SGSN: Integrate support for UMTS AKANeels Hofmeyr1-0/+1
The general infrastructure for UMTS AKA is already in place: * GSUP with capability to send us auth_vectors that contain either triplets or quintuples * mm_context that holds such auth_vectors Add: * capability to send UMTS AUTN in GMM AUTH REQ * parse extended UMTS RES * on auth response, validate expected AKA with vector and received res/sres * add Auth Failure message to receive resync AUTS token and * send to HLR * clear out-of-sync auth tuple * enter new state for when we're waiting for HLR to resync and send new tuples so that the next Auth Request will be handled Original first half of this patch by: Harald Welte <laforge@gnumonks.org> Full UMTS AKA procedure including AUTS resync tested to work against OsmoHLR with R99 USIM and Milenage algorithm. The sgsn_test.c needs adjustment because we're checking the vector's auth_types now. Depends: libosmocore change-ids I277fb3d407396dffa5c07a9c5454d87a415d393f If943731a78089f0aac3d55245de80596d01314a4 Related: OS#1956 Change-Id: Ie6a0cefba5e4e7f02cc2eaf6ec006ac07d5c1816
2017-02-25smpp_test_runner.py: fix socket leakNeels Hofmeyr1-0/+2
Each running test would open up another socket without ever closing unused ones. Close the sockets after each test is done. Change-Id: I0a42caab3bb8c9c9d04b033e4de9efe0ca8fd2af
2017-02-25python tests: remove process 'Launch' message, now at osmoutilNeels Hofmeyr3-3/+0
Change-Id: Id8eb70ddfdc1d0d9f90aa5343a4ea522042c34ee
2017-02-25vty_rest_runner.py: remove debug monitoring for TCP socketsNeels Hofmeyr1-22/+0
Change-Id: I7361bb0ce5302d00ccb18dc04eeb75ee1f6844a8
2017-02-25add struct gprs_subscr, separating gprs from gsm_subscriberNeels Hofmeyr2-40/+61
Prepare for replacing gsm_subscriber with vlr_subscriber. vlr_subscriber will not make sense to be used in gprs, so have a dedicated GPRS subscriber struct. (Could change if the gprs code were to use libvlr; is currently independent). Related: OS#1592 Change-Id: Ia8b391ee009c8545763cba04505be3947835120e
2017-02-24cosmetic: rename struct osmo_msc_data to bsc_msc_dataNeels Hofmeyr1-2/+2
With the OsmoMSC program coming up, the name osmo_msc_data becomes even more confusing than it already is. Clearly indicate it as libbsc's data of a remote MSC by prefixing with bsc_. Also, the Osmocom community has in the meantime agreed to have the osmo_ prefix only in libosmocore, to avoid naming conflicts in case things are moved there. So while renaming anyway, also drop the osmo_ prefix. Change-Id: I0dfbcb7d1a579211180f71319982820d8700afab
2017-02-24cosmetic: rename osmo_msc_data.h to bsc_msc_data.hNeels Hofmeyr1-1/+1
With the OsmoMSC program coming up, the name osmo_msc_data becomes even more confusing than it already is. Clearly indicate it as libbsc's data of a remote MSC by prefixing with bsc_. Also, the Osmocom community has in the meantime agreed to have the osmo_ prefix only in libosmocore, to avoid naming conflicts in case things are moved there. So while renaming anyway, also drop the osmo_ prefix. Change-Id: I13554563ce9289de126ba0d4cf329bafcda35607
2017-02-24vty_test_runner.py: fix socket leakNeels Hofmeyr1-0/+2
Each running test would open up another socket without ever closing unused ones. Close the sockets after each test is done. Change-Id: Ie433c8560de54f9a9d05fa07c44bae3126d19b30
2017-02-21Handle DSD from HLRMax1-1/+2
Handle Delete Subscriber Data GSUP message from HLR to disable Packet Services for a given IMSI. Change-Id: I6b9b494fa58bcb95bd550c49f8204f00f8fdf628 Related: OS#1645
2017-02-07gprs/sgsn: rename sgsn_mm_ctx_alloc() -> sgsn_mm_ctx_alloc_gb()Alexander Couzens1-1/+1
Postfix the ran type to clarify the purpose. Because of the new support of the Iu ran type, there are 2 functions to allocate a mm ctx. For Iu it's sgsn_mm_ctx_alloc_iu(). For gb it should be named in the same way. Change-Id: Ic49009e8c20c12308855e1409c09004698c79b95
2017-02-07gprs/sgsn: rename gprs->mm_state -> gmm_stateAlexander Couzens1-23/+23
GMM is the right term. MM state is already occupied. Change-Id: I9cfdcf921e4ebd14a5e7ce7489ec4ce5d1f5515f