aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
AgeCommit message (Collapse)AuthorFilesLines
2016-12-13oap_client: make use of OAP optional: disable for NULL configNeels Hofmeyr2-0/+5
When passing a NULL config to osmo_oap_client_init(), set OAP to disabled state. Along with the previous fix that ensures message rejection in the disabled state, this makes use of OAP in the GSUP client optional. oap_client_test: expect null config to set state to disabled. Related: OS#1592 Change-Id: Ie4d622fcfd24cb7d89d19f93e4b2571d8fadd1a3
2016-12-13oap_client: reject all messages in disabled/uninitialized stateNeels Hofmeyr2-20/+14
Fixes the bug indicated in oap_client_test.c: adjust to actually expect the proper behavior. Also adjust for modified return value for message rejection. Instead of -1, just expect < 0. Adjust experr for new error messages. Related: OS#1592 Change-Id: I16165d228653e8a2689f9df94b77b470c06480c6
2016-12-13oap_client_test: show bug: disabled state does not reject messageNeels Hofmeyr2-4/+41
There is a hole in OAP where a disabled OAP still accepts at least a Registration Reject message, after which it will do things it shouldn't. Show this by expecting the bugs, to be adjusted with the upcoming fix. Related: OS#1592 Change-Id: I4a5fde308b876946fea2571ea1a550f0cc7ee136
2016-12-13oap_client: move logging to DLOAP logging categoryNeels Hofmeyr2-22/+18
Use libosmocore's DLOAP logging category for OAP. oap_client_test.c: make sure DLOAP is in DEBUG level to not lose any logging messages from experr. Todo: we're using a "Library" logging category, which is not really what the library category was intended for. Instead, the OAP client should probably be given a logging category like DVLR or DGPRS in its initialization API. Related: OS#1592 Change-Id: Ic765c19381b0d983da90a5d8aee9cd17e31cf34a
2016-12-13oap_client_test: print test descr to stderr, check stderrNeels Hofmeyr5-30/+56
Related: OS#1592 Change-Id: If1696c8e7bfa696b250f7eac24f08f85f8f492a2
2016-12-13oap_test.c: rename to avoid clash with libosmocore oap_test.cNeels Hofmeyr4-7/+7
Rename to oap_client_test.c, which is also a more accurate name. Related: OS#1592 Change-Id: I3ca333141a15940df07a1ae77a30bc54885db41f
2016-12-13move grps_gsup_client.c to libcommon/gsup_client.cNeels Hofmeyr1-1/+0
This is in preparation for libvlr. Related: OS#1592 Change-Id: I9ad7dc7f17f3b033c779de9ae8bc120655502fce
2016-12-13move gprs/oap.c to libcommon/oap_client.cNeels Hofmeyr2-2/+0
This is in preparation for libvlr. Related: OS#1592 Change-Id: Ib526df6d9de55a1e59a379d5e2c8541ed0ef67e3
2016-12-13rename oap.h to oap_client.hNeels Hofmeyr1-1/+1
Related: OS#1592 Change-Id: I05bd65ff81b0f70f68217b2e0a9466e160bdbdec
2016-12-13oap: rename public API from oap_ to oap_client_Neels Hofmeyr1-27/+27
Mainly to differentiate the OAP messaging API (osmo_oap_ in libosmocore) from the OAP client. This is in preparation for moving the oap client to libcommon, which is in turn preparation for libvlr. Add the osmo_ prefix, as all public Osmocom API should have. We also have OAP messages code in libosmocore, so clarify by naming this osmo_oap_client, and by also renaming the oap_test to oap_client_test. This reshuffling will allow an easy move of OAP to libosmocore if we should want to do that. A number of patches will follow up on this. Related: OS#1592 Change-Id: Id447d2bebc026a375567654adafa5f82439ea7e1
2016-12-13move OAP messages implementations to libosmocoreHarald Welte3-4/+1
This corresponds to change-id If5099e60681a215e798b6675f21813f26769c253 in libosmocore, which is now required to build openbsc. Related: OS#1592 Change-Id: I2f06aaa6eb54eafa860cfed8e72e41d82ff1c4cf
2016-12-13rename gprs_gsup_client.h to gsup_client.hNeels Hofmeyr1-1/+1
This is in preparation for moving gsup to libcommon, which is in turn preparation for libvlr. Related: OS#1592 Change-Id: I9c95d00f1a9420887a44c938b1d0ee3e20586f4c
2016-12-13gprs_gsup_client*: remove the gprs_ prefixNeels Hofmeyr2-15/+15
Make sure everything is named gsup_client_ / GSUP_CLIENT_. Rename static gsup_client_send() to client_send() to avoid clash with public gprs_gsup_client_send() being renamed to gsup_client_send(). This is in preparation for moving gsup to libcommon, which is in turn preparation for libvlr. libvlr and osmo-sgsn will use the same GSUP client code. A number of patches will follow up on this, also for the the OAP client. Related: OS#1592 Change-Id: I57433973b1c4f6cc1e12e7b1c96b5f719f418b51
2016-12-13Use IPA module for vty testsMax1-31/+9
Replace hackish ipa_send_* routines with proper implementation from IPA module thus making it part of extended tests. Change-Id: If13ed7fd243ce3aeef505d2e8468e221aa62f79e
2016-12-13Revert "Support Deactivate PDP Context Request from network"Neels Hofmeyr2-140/+0
This reverts commit 1611df5226199da2bf2fba3d22d93cc1a6c6c777. This is due to a segfault introduced to the asan build only. See: http://lists.osmocom.org/pipermail/openbsc/2016-December/009966.html Subject: new sanitizer breakage: SIGSEGV in sgsn_create_pdp_ctx() Date: Tue Dec 13 12:08:32 UTC 2016 Change-Id: Ic926c0e6778947b516994822e3a21d4fde25bb02
2016-12-12Support Deactivate PDP Context Request from networkPravin Kumarvel2-0/+140
Enable Deactivate PDP context based on the IMSI of the subscriber. When there are PDP contexts present for a MM context, PDP context will be deactivated along with GMM Detach(MM context deletion). If there are no PDP present, MM context will be deleted to avoid further PDP context request from the MS. Test cases is added to check this functionality. Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13
2016-12-09gsm0408_test.c: Don't pass negative value to strerror()Harald Welte1-1/+1
Change-Id: I4fcf24ec1bc974a3189486d2372b9713d7fdab70 Fixes: Coverity CID 135192
2016-12-09sgsn_test: Fix missing = in == type checkHarald Welte1-1/+1
Change-Id: I696a7d25d2f4d19922e05a7e83c4aeec5c44fb07 Fixes: Coverity CID 135156
2016-12-02Move timezone settings up to network levelNeels Hofmeyr3-20/+19
Time zone used to be configurable per-BTS. In the upcoming MSC-split, no BTS structures will be available on the MSC level. To simplify, drop the ability to manage several time zones in a core network and place the time zone config on the network VTY level, i.e. in gsm_network. If we are going to re-add fine grained time zone settings, it should probably be tied to the LAC. Adjust time zone VTY config code (to be moved to libcommon-cs in subsequent commit). Adjust time zone Ctrl Interface code. Change-Id: I69848887d92990f3d6f969be80f6ef91f6bdbbe8
2016-12-02reinvent connection_for_subscr() and move to libmscNeels Hofmeyr1-2/+0
Implement connection_for_subscr() from a completely different angle: instead of looking up lchans in bts structs, look up the subscriber in the global list of gsm_subscriber_connection. static lchan_find() is thus obsoleted. All callers of connection_for_subscr() live in libmsc, so move to libmsc. The move and edit are done in a single commit since the old and new implementation have nothing in common. Future: osmo-cscn will use this, without bts being present. Remove implementation of connection_for_subscr() from channel_test.c -- it is possible that the abort() in there was intended for a regression test, but actually it seems the implementation was merely added for linking reasons, and the abort() added to guard against the NULL return value: no comment nor the commit log indicate that the abort() is test critical; the addition was the only change in channel_test.c for that commit; at the same time a connection_for_subscr() call was added in libmsc. Change-Id: I5e0ba0ecf1726ebd540800f4e98fdfc937c904ff
2016-12-02tests: drop unused libmsc, unneeded duplicate libbsc linkingNeels Hofmeyr3-5/+0
Because of libcommon-cs, tests/gsm0408,subscr,trau no longer need libmsc. Change-Id: I9073eba41a1cd3136ed7a9def6fe8aaf282eaa18
2016-12-02sms_next_rp_msg_ref(): use direct pointer to next_rp_ref counterNeels Hofmeyr1-3/+3
libbsc and libmsc will have separate subscriber connection structs. Hence don't rely on gsm_subscriber_connection, but work on a direct pointer to the counter for the next RP reference. The only very thin function in gsm_04_11_helper.c thus becomes obsolete: drop the entire file. Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072
2016-11-24move to libcommon-cs: net init 3: actual moveNeels Hofmeyr7-1/+7
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-11-24move to libcommon-cs: net init 2: move bsc_network_init decl to new .hNeels Hofmeyr2-0/+2
bsc_network_init() is more fit to live in a BSC specific header, move it to new common_bsc.h. It will probably also absorb the BSC-specific part of gsm_network in the future. Adjust header includes across the board. Particularly, fix abis_nm.h by explicitly including gsm_data.h: it so far relied on other headers to do that, which now is no longer always given. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b
2016-11-24move to libcommon-cs: net init 1: rename to bsc_network_initNeels Hofmeyr2-3/+3
The gsm_network_init() function initializes a whole lot of BSC specific stuff. Aiming to move some of it to libcommon-cs, first rename it to bsc_network_init(). This will retain the BSC specific stuff when the move is done. Adjust all callers. Future: osmo-cscn will call the more generic part and not the BSC specific part. Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3
2016-11-15test/gbproxy: Test for possible memory corruption when link_info is freedDaniel Willmann2-0/+276
This test is to trigger the use-after free issue in commit bff7b0d80972. If compiled with address-sanitizer the test will abort without the fix. Change-Id: I5e8c6626ba43342740f08d699383bdded739079f Ticket: OW#3049 Sponsored-by: On-Waves ehf
2016-11-01OML: Improve OML attribute handlingPhilipp5-0/+351
the OML attribute tables are hardcoded. To set variable parameters, the hardcoded data structure (tlv) is patched on byte level during runtime. This patch replaces this mechanism. - Replace hardcoded OML attribute tables with dynamically generated TLV structures. - Add unit tests to check if the OML attribute tables are generated correctly - Put OML attribute table generator code in a separate file: bts_ipaccess_nanobts_omlattr.c Change-Id: Ibeb34a84912d6cf695f553a34c69320fca7d08fa
2016-10-28sndcp: Fixups for sndcp layer based on coverity-scan suggestionsPhilipp2-0/+3
- missing break in gprs_sndcp_pcomp.c, line 143 - string overflow in slhc_test.c, line 211 - sizeof mismatch in gprs_sndcp_xid.c, line 1369 and 1378 - mismatching signedness in gprs_sndcp_xid.c, line 1377 - needless < 0 comparison in gprs_sndcp_xid.c, line 477 - needless < 0 comparison in gprs_sndcp_xid.c, line 209 - missing returncode check in v42bis_test.c, line 320 - wrong pointer dereferentialization in gprs_sndcp_comp.c, line 73 Change-Id: I4f9adf251f5119e67ffe76baad6f1f996ac8dbad
2016-10-13msgb ctx: use new msgb_talloc_ctx_init(), don't access talloc_msgb_ctxNeels Hofmeyr1-4/+3
Drop extern definitions of talloc_msgb_ctx and use msgb_talloc_ctx_init() instead. In sgsn_test.c, use a local variable msgb_ctx to do the talloc report from the return value of msgb_talloc_ctx_init(). Change-Id: I2f9ace855f0ecbdc9adf5d75bcb1a3d666570de4
2016-10-13msgb talloc ctx: initialize in all main() scopesNeels Hofmeyr6-0/+8
Add msgb_talloc_ctx_init() call to many main() functions still lacking a msgb talloc context. Change-Id: Ib0d6751260659cabf18a7ce80680ba2fb4228ea1
2016-10-13gtphub_test.c: remove unused include of msgb.hNeels Hofmeyr1-1/+0
Change-Id: I7a8003a0e0bff803941d7981ffc07cf78c3ae9a9
2016-09-30SGSN: Fixing build configPhilipp2-4/+8
Tests for V.42bis, slhc, llc-xid and sndcp-xid are built and executed on all build configurations, but are only needed when the sgsn (gprs) is built. This patch adds conditions check if the tests mentioned abvove are needed or not. Change-Id: I6921e6198ea7f99fe5276f91cbc522091853bc4e
2016-09-30vty_test_runner.py: fix indents to use spaces, fix vim commentNeels Hofmeyr1-27/+27
Most of this file uses four spaces of indenting. Replace all tabs with spaces. Remove the erratic 'set' from the recently added vim comment at the bottom. Change-Id: I4273b3314defb1e5b31b509c2ac7d7c6cd6834cf
2016-09-30vty_test_runner.py: make unittest print all output by defaultNeels Hofmeyr1-1/+1
Add option to TextTestRunner that shows print output on stdout. It's better to see everything in our jenkins runs and not hide test output. Change-Id: If4be1ad1c81c9ed4ab9b208b4c6d1e4b2cc8fdd5
2016-09-28vty_test_runner.py: fix nat_msc_test(): socket attach: reduce timeout, retryNeels Hofmeyr1-5/+22
In nat_msc_test(), upon socket timeout, retry up to six times. Reduce the timeout between retries. This should get rid of sporadic test failures that we've been seeing a lot on jenkins lately. Raise an exception upon unexpected vty response. Print more detail to stdout. Since we would actually want as much output as we can get in a test suite, remove the 'if (verbose)' and just always print the connection source. unittest is keeping all stdout silent by default anyway. Change-Id: I2f83eef55592778e54164a90e1eabeb80fb918da
2016-09-28dyn TS: fix: ts_subslots() for TCH/F_PDCH in PDCH modeNeels Hofmeyr1-1/+1
In gsm_data_shared.c, add ts_pchan() to determine actual pchan type for dynamic and non-dynamic TS. Use in ts_subslots() to fix the value returned for TCH/F_PDCH in PDCH mode. Adjust the assertion in channel_test.c accordingly. Drop GSM_PCHAN_TCH_F_PDCH, which is now handled in ts_pchan(). Explicitly add GSM_PCHAN_PDCH as zero in subslots_per_pchan[] (cosmetic). Adjust the comment in subslots_per_pchan[]. The fix for the number of subslots affects only one caller: bts_chan_load() in chan_alloc.c. Before this, it would always include a TCH/F_PDCH in the load_counter->total, now it is skipped when in PDCH mode. Whether this is the way bts_chan_load() should handle dynamic TS is a separate discussion, so far I'm only making sure that the two dyn TS kinds act in the same way: TCH/F_TCH/H_PDCH is only counted when in TCH mode, and TCH/F_PDCH should match. Change-Id: Icd6668667ad2be7ad20866ffd185bf3b8711ccd6
2016-09-28channel_test: test nr of subslots for dyn pchan, with errorNeels Hofmeyr2-0/+32
Add test_dyn_ts_subslots() and call from main(). Update channel_test.ok. This includes erratic assert to show a bug for TCH/F_PDCH in PDCH mode: the nr of subslots should be the same as for a normal PDCH, i.e. zero. This will be adjusted along with the fix in an upcoming commit. Change-Id: I09685be3fb3ed1ead4577b772a9fbc31967980d1
2016-09-28channel test: prepare to add another test functionNeels Hofmeyr1-3/+8
Move the main() guts to test_request_chan(), so that I can add another test in an upcoming commit. Change-Id: I1349d0f416806416080d4667ad697f7db1ea252d
2016-09-27SLHC: Improving slhc (RFC1144) testcasePhilipp2-56/+130
- Adding Testcases for UNCOMPRESSED_TCP and TYPE_IP - Minor cosmetic changes Change-Id: I555fa3c9b9f78424102f359ef1c27b290fa9c9e9
2016-09-26vty_test_runner.py: raise exception when MSC socket connection failsNeels Hofmeyr1-0/+4
Instead of below error, raise an exception to describe what's happening. Seen in a jenkins run on https://gerrit.osmocom.org/#/c/945/2: ERROR: testBSCreload (__main__.TestVTYNAT) ---------------------------------------------------------------------- Traceback (most recent call last): File "./vty_test_runner.py", line 787, in testBSCreload msc = nat_msc_test(self, ip, port) File "./vty_test_runner.py", line 1251, in nat_msc_test return conn UnboundLocalError: local variable 'conn' referenced before assignment Change-Id: Iae26e7345267a21aed0b108b089453832889c9fa
2016-09-26cosmetic: vty_test_runner.py: add comment for vim auto settingsNeels Hofmeyr1-0/+2
Change-Id: I61a0476a0317b011432bb4f6f593cfdcaf1c072b
2016-09-26mscsplit: gsm_network_init(): add explicit root talloc ctxNeels Hofmeyr2-3/+3
Decouple the root talloc context from libbsc's global talloc_bsc_ctx. This allows to define the root talloc ctx from a main() scope, which in turn helps decouple libmsc from libbsc. Change-Id: I92f6b47b1eeea2e8f3fba66f25d7e708e5659f8a
2016-09-24SNDCP: add V.42bis data compression functionalityPhilipp1-0/+1
- Add compression control for V.42bis Add code to handle compression (gprs_sndcp_dcomp.c/h) - Add Adjustments in SNDCP - Add VTY commands Change-Id: I6d36cbdf2f5c5f83ca9ba57c70452f02b8582e7e
2016-09-24V.42bis: integration and unit testPhilipp6-0/+1105
- Edit previously committed V.42bis implementation to function outside IAXmodem. - Add unit test to verify the correct function of V.42bis Change-Id: I689413f2541b6def0625ce6bd96f1f488f05f99d
2016-09-24SNDCP: add RFC1144 header compression functionalityPhilipp1-0/+2
- Add module to handle compression entities - Add module to control header compression - Introduce VTY commands for heade compression configuration - Add changes in sndcp and llc to integrate header compression Change-Id: Ia00260dc09978844c2865957b4d43000b78b5e43
2016-09-24RFC1144: integration and unit-testPhilipp6-0/+372
The previously pushed slhc implementation has been modified to compile and function outside of the kernel. Also debug log messages were added and datatypes ware matched. The implementation is now ready to be used Change-Id: I7a638e88a43b3eb9d006751a03ef2570e36613f0
2016-09-24SNDCP: add SNDCP-XID encoder/decoder and unit testPhilipp6-1/+326
The SNDCP-XID (or layer-3 xid) is used to exchange layer-3 parameters such as compression. The encoder encodes a bytestream that is then sent as regular XID field from LLC. We will need the SNDCP-XID to negotiate the parameters for our upcomming GPRS data and header compression features Change-Id: If2d63fe2550864cafef3156b1dc0629037c49c1e
2016-09-18cosmetic: various comment, whitespace tweaksNeels Hofmeyr1-1/+1
Change-Id: I131939cfba4d67d7e2c935341deeb14d09523fee
2016-09-15Build fixesAlexander Huemer4-3/+7
Some fixes for build environments where dependencies are installed in distinct directories. Change-Id: I38808fd2911747b266ee6fde91187a88dd7ae355
2016-09-15Consistenly format variables in */Makefile.am filesAlexander Huemer17-214/+633
Change-Id: Ifa21513c007072314097b7bec188579972dc1694