aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
AgeCommit message (Collapse)AuthorFilesLines
2017-06-22Enable optional static builds1.0.1Max1-1/+0
* use LT_INIT instead of AC_PROG_RANLIB * remove redundant libbsc entries The default (for both manual and .deb builds) is to use shared build (as before) - the static build is entirely optional. Based on work by Sergey Kostanbaev <sergey.kostanbaev@gmail.com> and Alexander Chemeris <Alexander.Chemeris@gmail.com>. Change-Id: Ibcd1da98302413182c85e25c4cb7d69d9e38c35a
2017-06-15Update SI data structures and generationMax2-28/+150
To support segmented SI2quater as per 3GPP TS 44.018 we'll have to support multiple SI messages (up to 16 for SI2q) for a given type in contrast to existing 1:1 mapping: * expand storage space to hold up to 16 SI messages (spec limit) * add assertions for budget calculations * generate multiple SI2q messages * adjust SI2q-related tests * use precise check for number of SIq messages instead of approximate estimation Change-Id: Ic516ec9f0b821557d9461ae9f1c0afdd786f3b05 Related: OS#1660
2017-06-15Move SI-related definesMax1-1/+1
* move SI2quater related defines to shared header * add define from OsmoBTS which checks for presence of a given SI message in gsm_bts struct. Rename it to avoid conflicts with OsmoBTS code and to match naming conventions of similar macros. Change-Id: I11432c93c772d1ead6d45a7bb0f1d13d492c82f1 Related: OS#1660
2017-06-09don't re-implement osmo_talloc_replace_string()Harald Welte1-1/+1
osmo_talloc_replace_string() was introducd into libosmocore in 2014, see commit f3c7e85d05f7b2b7bf093162b776f71b2bc6420d There's no reason for us to re-implement this as bsc_replace_string here. Change-Id: I6d2fcaabbc74730f6f491a2b2d5c784ccafc6602
2017-05-20Add missing _CFLAGS and _LIBSAlexander Huemer1-1/+2
These missing pieces go unnoticed if dependencies are not installed in distinct directories. Change-Id: If8d57b72f63d79cc0d8efba7466c6ec177207cbb
2017-05-15SI2quater: fix EARFCN inclusion checkMax2-32/+86
Previously only the existance of bts->si_common.si2quater_neigh_list was checked but not the actual number of EARFCNs in it. Fix it by using si2q_earfcn_count() and adjust tests accordingly. While at it - reformat tests to include extra information. The correctness was checked manually by inspecting GSMTAP output. Change-Id: Ic4fb2a9e870db66cac58b1e8d113587b30d64ce2 Related: RT#8792
2017-05-15Restructure SI2quater generationMax2-52/+43
In preparation for extended SI2q messages: * add SI2q-specific accessor macro * add *_offset variables to gsm_bts struct * internalize memory check while generating rest octets - introduce budget concept (number of bits available in a given message) * internalize *arfcn_size() functions as they are not needed outside of si2q_num() anymore * change rest octets generation to work with gsm_bts struct directly * do not generate rest octets if no SI2q is necessary * adjust unit tests accordingly (cosmetic changes only to avoid regressions) Requires: I92e12e91605bdab9916a3f665705287572434f74 in libosmocore Change-Id: Ib554cf7ffc949a321571e1ae2ada1160e1b35fa6 Related: RT#8792
2017-05-12fix subscriber random extension allocation rangeNeels Hofmeyr1-0/+11
The VTY config allows above 32bit range extensions, but db_subscriber_alloc_exten() was unable to generate extensions outside of 32bit. Add VTY regression test and fix the problem by using proper 64bit types. Related: OS#2253 Change-Id: I9afe6a8833004ecd2f3f936b2d5aa4de8e7dbcb0
2017-05-12fix VTY parsing: subscriber-create-on-demand randomNeels Hofmeyr1-0/+11
Fix parsing of the 'subscriber-create-on-demand random' VTY: atoi() is not enough to include the specified range of 1-9999999999. Use atoll() instead to ensure a large enough number space also on 32bit systems. (Note: for me, atoll() truncates at 32 bit when <stdlib.h> is not included.) Add a VTY regression test for this. Related: OS#2253 Change-Id: I353e04481ec567adca383d6b51ba8fb865eed73e
2017-05-08Use libosmocore for SW Description parsingMax2-101/+17
Requires libosmocore with Ib63b6b5e83b8914864fc7edd789f8958cdc993cd. Change-Id: Ib94db414e94a2a1f234ac6f1cb346dca1c7a8be3
2017-05-08Use ipa.py for ctrl testsMax1-16/+8
Remove duplicated code and make sure that python code is actively used as part of test harness Change-Id: I676390abe2f179df6004cdd33d0eaaf60e18df03
2017-04-28Prepare for extended SI2quater supportMax1-3/+2
Supporting SI2quater as per 3GPP TS 44.018 will require chnages to the way System Information is stored because it uses 1:n instead of 1:1 mapping between SI type and generated SI content. This should not affect other SI types though. To facilitate this transition: * convert the code to always use GSM_BTS_SI helper instead of accessing buffer directly * make helper more robust by adding extra parenthesis * add similar helper for gsm_lchan * add function estimating number of SI2quater message to hold configured number of (U|E)ARFCNs * add SI2q index/count fields and pass them to rest_octets generator explicitly * internalize buffer access in generate_si* functions Change-Id: I74e4e3cb86364cec869a1472a41b4a95af0d50dd Related: RT#8792
2017-03-20python tests: allow running from separate build dirNeels Hofmeyr3-4/+9
The VTY tests assume that $top_builddir == $top_srcdir. Use the script's location from sys.path[0] to find the correct locations of example configs even when building in another directory. Change-Id: I2731f361e3b72d0980968e6cf83594ea450db7c2
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
2017-02-07vty tests: more attempts to resolve 'Broken Pipe' errorNeels Hofmeyr1-7/+39
Change-Id: I4251a24eb7a57a354aa76de711547c3e76ebb846
2017-02-03Revert "vty tests: more attempts to resolve sporadic 'Broken Pipe' error"Neels Hofmeyr1-3/+1
'self' will not be accessible in that context, so this patch isn't useful. This reverts commit b39053ad6de50df5a2efcb4ec0c6551020b513e1. Change-Id: Ic1a9ba5fdfd7bdc6c5cf0974e8c637ae23b81ece
2017-02-03vty tests: testBSCreload: ipa_handle_small: ensure rx of 4 bytesNeels Hofmeyr1-0/+2
Change-Id: I995b7aba9d0b51b0861a4281dbbca888f36e9e00
2017-02-03vty tests: more attempts to resolve sporadic 'Broken Pipe' errorNeels Hofmeyr1-1/+3
Change-Id: I3d833ddf8c62845fe68d1e5503332541a4a04a2d
2017-02-02vty tests: attempt to get at sporadic 'Broken Pipe' errorNeels Hofmeyr1-1/+15
Add verbose logging as well as three retries around the place that often fails on our build server with a 'Broken Pipe' error. Change-Id: I8851b76b2d7b87dd500ae40f47e6bea716ef3fc4
2017-01-25CTRL: remove boilerplateMax1-4/+4
Use CTRL_CMD_DEFINE_RO(), CTRL_CMD_DEFINE_WO() and CTRL_CMD_DEFINE_WO_NOVRF() where appropriate to get rid of boilerplate code. Change-Id: I5bcea0b4f4b8f535bef2b423f2013b8b4a218b5b
2017-01-23SI2q: add support for multiple UARFCNsMax2-2/+32
Support multiple UARFCNs with the same Scrambler Code. Fixes: RT#7379 Change-Id: If1c32e8b547a28325180faaaddd21f80c37f7337
2017-01-23Prevent segfault in range encodingMax2-0/+20
* Explicitly check when ARFCN array split is impossible and return gracefully instead of using negative index. * Separate range encoding into generic function and use it for all SI-related things. * Propagate the error into that function and to its callers. * Add separate test-case for the segfault previously triggered by this bug. Change-Id: I3e049ab2d7c1c4d6c791b148f37e10636a8e43e0 Related: RT#7379
2017-01-23cosmetic: use osmo_strlcpy() everywhereNeels Hofmeyr2-18/+12
Shorten some code and make obvious to the reader that the string copy is done in a safe way. Change-Id: I900726cf06d34128db22a3d3d911ee0d1423b1bd
2017-01-23fix strncpy() invocation in vty_interface_layer3.c and 3 testsNeels Hofmeyr2-2/+4
Use osmo_strlcpy() to fix unsafe invocation of strncpy(), which potentially left the result unterminated. Change-Id: I1a119b1760a3e3262538b4b012d476fdce505482
2017-01-23undup: gtphub_test: use libosmocore's llist_count()Neels Hofmeyr1-17/+5
Depends on libosmocore Change-Id Ic49adc7a346f5722bf624d7d3b4a735e4220ae15 Change-Id: I67bc1889c064596a2f3e93cc0354b11c720b0225
2016-12-23sndcp: Allow empty SNDCP-XID indicationsPhilipp1-4/+6
In some rare cases the modem might send a xid indication that does not contain anything except the version number field. The sgsn ignors such SNDCP-XID indications by stripping the entire field from the response. We found a modem in the wild that started to act problematic when the empty SNDCP-XID was missing in the response. This patch changes the XID negotiation behaviour in a way that if a modem should send empty SNDCP-XID indications, the reply will also contain an empty SNDCP-XID indication. Apart from that the SNDCP-XID version number is now parsed and echoed in the response. This ensures that we always reply with the version number that the modem expects. (The version was 0 in all cases we observed so far) Change-Id: I097a770cb4907418f53e620a051ebb8cd110c5f2 Related: OS#1794
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