aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/db
AgeCommit message (Collapse)AuthorFilesLines
2017-03-16mgcp parsing, mgcp testNeels Hofmeyr1-10/+11
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 Hofmeyr1-0/+11
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-16remove unneccessary linking from some testsNeels Hofmeyr1-2/+0
The recent shifts and cuts have made some library linking for bsc, channel and db tests unnecessary.
2017-03-16add libiudummy, to avoid linking Iu deps in testsNeels Hofmeyr1-0/+1
Change-Id: I4a66c4122011dbc87c6fcb336ab0461b86522c98
2017-03-16Use libvlr in libmsc (large refactoring)Neels Hofmeyr1-0/+7
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
2016-11-24move to libcommon-cs: net init 3: actual moveNeels Hofmeyr1-1/+1
Reincarnate gsm_network_init() as the parts not specific to libbsc. Move from bsc_network_init() those bits that are not BSC specific (and useful for upcoming osmo-cscn). Add libcommon-cs to all linkages that use gsm_network_init(). Note: the only requirement to allow linking gsm_network_init() without libbsc is to keep the call to gsm_net_update_ctype() out of libcommon-cs. The other items are kept out of libcommon-cs because it makes sense semantically. But the separation is not strong in that the BSC specific data members are of course still omnipresent in struct gsm_network. If bsc_network_init() is not called, these are not initialized properly -- for now no users of uninitialized members exist. So this is just a first step towards a sensible split of the BSC and MSC gsm_network structs. The long term aim should be to have entirely separate structs with some common general items. Change-Id: If06316b97002390dc9a434686750cb96193ea63b
2016-09-15Consistenly format variables in */Makefile.am filesAlexander Huemer1-13/+44
Change-Id: Ifa21513c007072314097b7bec188579972dc1694
2016-07-09Make random MSISDN assignment optionalMax1-9/+21
Previously if subscriber was automatically created it got assigned random MSISDN number. Make it optional (defaulting to previous behavior) by adding following: * new optional no-extension argument for subscriber-create-on-demand vty command * db unit tests * vty test Note: using the db made with new code might result in subscribers with empty extension. Such subscribers cannot be deleted using old code. Make sure not to mix db versions or manually fix it by editing sqlite with external program. Fixes: OS#1658 Change-Id: Ibbc2e88e4722b08854ebc631485f19ed56443cbb
2016-06-14Make random extension range configurableMax1-3/+3
Previously if subscriber was automatically created it got assigned random MSISDN number between 20000 and 49999. Make it configurable with new vty command "subscriber-create-on-demand random" and expand vty tests to check it. Change-Id: I040a1d227b0c7a1601dc7c33eccb0007941408a6 Related: OS#1658
2016-05-17Cleanup db testMax1-53/+34
Move copy-pasted code into separate function to make writing more tests easier. Related: OS#1658 Change-Id: I9e39af85718514dd0f081d41c234c9dda77c4b27 Reviewed-on: https://gerrit.osmocom.org/43 Tested-by: Jenkins Builder Reviewed-by: Holger Freyther <holger@freyther.de>
2016-04-06subscr: Make db_create_subscriber fail on duplicatesHolger Hans Peter Freyther1-1/+5
The issue of db_create_subscriber updating an already existing subscr is that the same subscriber will then have two entries in the active subscribers list. In general this will break assumptions that a subscr can be compared by comparing the pointer. In the case of the VTY this was not an issue as the created subscr was immediately destroyed again but it is better to avoid this problem. Change the VTY command to find the subscriber and then call sync to have the updated time set. The side-effect is we will now have two queries for the subscriber. Once through subscr_get_by_imsi and once through db_create_subscriber. Change the db_create_subscriber to fail if a subscriber already exists, and add a testcase for this behavior and do not updated the 'updated' timestamp of an already existing subscriber. Add a testcase for this behavior. Related: OS Issue #1657
2016-03-17Revert "move to hex TMSI representation"Harald Welte1-2/+2
This reverts commit 044fbe6568f82a12bf4e3addc7e3d6db529b6548.
2016-03-17move to hex TMSI representationVadim Yanitskiy1-2/+2
In OpenBSC, we traditionally displayed a TMSI in its integer representation, which is quite unusual in the telecom world. A TMSI is normally printed as a series of 8 hex digits. This patch aligns OpenBSC with the telecom industry standard. Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2015-10-12libmsc: Use RAND_bytes when choosing a tmsiDaniel Willmann1-1/+1
Require openssl version to be >= 0.9.5 because we rely on the RAND_bytes return value. [hfreyther: Add cast to uint8_t*]
2014-12-25db: Extend the test to mark a SMS as delivered and verify itHolger Hans Peter Freyther1-0/+7
Mark the SMS as delivered, then free it and try to get an undelivered SMS to that subscriber again and make sure it is failing.
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck1-3/+7
Currently every subcriber object directly refers to the gsm_network which contains a flag shared by every related subscriber (keep_subscr). This adds a dependency on gsm_network even if only the function defined in gsm_subscriber_base.c are used. This patch adds a new struct gsm_subscriber_group which contains the keep_subscr flag and a back reference to the network object. The latter is not dereferenced in gsm_subscriber_base.c, so it can safely be set to NULL when only that part of the gsm_subscriber API is being used. It also changes that API to use gsm_subscriber_group instead of gsm_network parameters. Since there are some places where a pointer to the gsm_network is needed but where only a gsm_subscriber is available, a 'net' back pointer is added to the group struct, too. Nevertheless subscr group and network could be separated completely, but this is not the topic of this commit. Sponsored-by: On-Waves ehf
2014-05-01db: Fix next fall-out with make distcheckHolger Hans Peter Freyther2-1/+2
2014-04-30db: Add testcase for the db migration.Holger Hans Peter Freyther4-1/+37
2014-04-30db: Add testcase for storing/loading/comparing a smsHolger Hans Peter Freyther1-0/+61
Use the already created subscriber, create a sms and read it back from the subscriber.
2014-03-09db: Add more tests for retrieving subscribers from a DB.Alexander Chemeris1-2/+36
2013-12-13build: db_test does not use dlopen/dlsym.. remove LIBRARY_DL from depsHolger Hans Peter Freyther1-1/+1
2013-12-13freebsd: dlopen/dlsym/dlerror is part of libc, use LIBRARY_DL for linkingNikola1-1/+1
In FreeBSD there is no spearate library for dlopen, dlsym and dlerror. Use LIBRARY_DL to check for this condition.
2013-10-13db: Remove the struct gsm_network from the database layerHolger Hans Peter Freyther1-6/+6
The database code should not know about the network. Move the setting of the network pointer into the subscriber layer.
2013-10-04Fix copy-paste error in console output in db_test.Alexander Chemeris1-1/+1
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2013-03-21db: Link to the VTY library for the vty_config_unlock symbolHolger Hans Peter Freyther1-1/+1
Linking started to fail for me due the symbol coming from the vty library and the db code not linking to it.
2012-11-24tests: Fix build of 'db' test after smpp mergeHarald Welte1-2/+2
2012-01-06tests: Introduce running tests with GNU autotest in OpenBSCHolger Hans Peter Freyther2-0/+6
The quality of the tests is of different value but it is good to get started and improve from here.
2012-01-06db: Fix the test codeHolger Hans Peter Freyther1-14/+27
* Initialize logging * use a dummy net before calling subcr_put as the keep in ram option is going to be set.
2011-08-19src: port openBSC over libosmo-abisopenbsc/0.9.15Pablo Neira Ayuso1-3/+3
This is a big patch that ports openBSC over libosmo-abis. Sorry, the changes that are included here are all dependent of libosmo-abis, splitting them into smaller pieces would leave the repository in some intermediate state, which is not desired. The main changes are: - The directory libabis/ has been removed as it now lives in libosmo-abis. - new configuration file format for nanoBTS and HSL femto, we need to define the virtual e1_line and attach it to the OML link. - all the existing BTS drivers (nanoBTS, hsl femto, Nokia site, BS11 and rbs2000) now use the new libosmo-abis framework. - use r232 input driver available in libosmo-abis for bs11_config. - use ipa_msg_recv instead of old ipaccess_read_msg function. - delete definition of gsm_e1_subslot and input_signal_data. These structures now lives in libosmo-abis. Most of this patch are deletions of libabis/ which has been moved to libosmo-abis. This patch also modifies openBSC to use all the new definitions available in libosmocore and libosmo-abis. In order to do that, we have replaced the following: - DINP, DMI, DMIB and DMUX by their respective DL* correspondences. - SS_GLOBAL by SS_L_GLOBAL - SS_INPUT by SS_L_INPUT - S_GLOBAL_SHUTDOWN by S_L_GLOBAL_SHUTDOWN - SS_INPUT by SS_L_INPUT - S_INP_* by S_L_INP_* sub-signals - E1INP_NODE by L_E1INP_NODE vty node This patch has been tested with: - one nanoBTS - the HSL femto with the examples available under libosmo-abis - BS11 with both dahdi and misdn drivers.
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso1-2/+2
libosmogsm is a new library that is distributed in the libosmocore. Now, openbsc depends on it. This patch gets openbsc with this change. This patch also rewrites all include path to the new osmocom/[gsm|core] Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-04prefix sub-directories containing libraries with 'lib'Harald Welte1-1/+7
... and make sure tests work again after restructuring
2011-02-11[BSC] Move the BTS-type specific code from bcs_init.c to bts_*.cHarald Welte1-2/+0
bsc_init.c was a big mess even only for two supported BTS models, so before adding more BTS types, this needs a cleanup. All the BTS specific code from bsc_init.c has now moved into bts_{siemens_bs11,ipaccess_nanobts}.c This has required that input_event() and nm_state_event() get both converted to proper libosmocore signals instead of referencing external symbols.
2011-01-06subscr: Dump the pending requests to help with debugging state.Holger Hans Peter Freyther1-0/+1
2011-01-01License change: We are now AGPLv3+ instead of GPLv2+Harald Welte1-5/+4
The reason for this is quite simple: We want to make sure anyone running a customized version of OpenBSC to operate a network will have to release all custom modifiations to the source code.
2010-12-22misc: Remove gsm_subscriber.h from the db.h fileHolger Hans Peter Freyther1-0/+1
Reduce the dependencies on the header files.
2010-11-15misc: Introduce a --enable-coverage mode to build with gprof coverageHolger Hans Peter Freyther1-1/+2
This adds a test coverage build. One can use gcov and lcov on the resulting data afterwards to see which code paths were executed and which were not.
2010-02-26[misc] Add LIBOSMOCORE_CFLAGS to the includesHolger Hans Peter Freyther1-1/+1
2010-02-20finish openbsc / libosmocore separationHarald Welte1-1/+1
* use pkg-config from openbsc to find header and library * move sms and timer tests to libosmocore itself * ensure "make distcheck" works on both packages
2010-02-09liblaf0rge: Make the other targets depend on the liblaforge...Holger Hans Peter Freyther1-1/+1
Everything is linking fine here.
2009-09-28[tmsi] Make the tmsi a 4 octet numberHolger Hans Peter Freyther1-2/+2
tmsi is four octets long, there is no need to make it a string and then jump through hoops to convert it to a number. Keep the database using it as a string to benefit from the NULL handling of the db. Introduce the reserved tmsi which has all bits set to 1 according to GSM 03.03 ยง2.4 and start checking for it and make sure the db code will never allocate such a tmsi.
2009-08-17[msc] Move gsm_04_08.c, mncc and various others to libmscHolger Hans Peter Freyther1-1/+1
Currently we have circular dependencies from libbsc to libmsc and this requires to play some linker tricks. The problem will be solved in two ways, first we will get rid of the circular dependencies and second we can start using --start-group and --end-group of the linker to play the tricks for us.
2009-08-17[subscr] Split gsm_subscriber.c in BSC and MSC partHolger Hans Peter Freyther1-1/+1
For the BSC part we still assign a gsm_subscriber to lchan but it might only contain the TMSI of this subscriber. For the MSC part we will need the HLR/VLR feature of the gsm_subscriber, specially the lookup's by number... So if libbsc.a/libmsc.a are compiled in one app and used the subscribers will be shared, and if only libbsc.a gets used we will have more empty gsm_subscriber.c..
2009-08-17[msc] Introduce a libmsc.a libraryHolger Hans Peter Freyther1-1/+1
Attempt to split up bsc/msc functionality according to the specs. The libbsc.a will be responsible for communicating with the BTS, configuring it, paging, channel allocation and passing layer3 messages in both ways. libmsc.a will implement the policy and such.
2009-07-29db_test.c: Make it compile againHolger Hans Peter Freyther1-6/+6
2009-06-10move openbsc into its own subdirectoryHarald Welte2-0/+114