aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
AgeCommit message (Collapse)AuthorFilesLines
2016-04-20Add Iu pagingNeels Hofmeyr1-0/+12
Add iu_page_cs() and iu_page_ps() API, also add to libiudummy for linking in tests. Implement msc_paging_request() by calling iu_page_cs().
2016-03-31Merge branch 'master' into sysmocom/iuNeels Hofmeyr5-1/+409
Conflicts: openbsc/src/libmsc/auth.c openbsc/src/libmsc/gsm_04_08.c openbsc/src/osmo-bsc/osmo_bsc_vty.c openbsc/tests/Makefile.am
2016-03-31Fix MM Auth: zero-initialize auth tuple before first useNeels Hofmeyr2-1/+27
Make sure a new auth tuple is initialized after db_get_lastauthtuple_for_subscr() returns an error, i.e. if no tuple is present for the subscriber yet. Before this patch, the first key_seq depended on the typically uninitialized value that was present in auth tuple's key_seq upon calling auth_get_tuple_for_subscr(). The very first key_seq used for a new subscriber will now always be 0. Before, it used to be mostly 1 ("(0 + 1) % 7"), but depended on whether the key_seq was indeed initialized with 0, actually by random.
2016-03-31Fix MM Auth: disallow key_seq mismatchNeels Hofmeyr2-0/+38
In auth_get_tuple_for_subscr(), add missing condition to match incoming key_seq with stored key_seq, so that re-authentication is requested for mismatching key_seqs. Add test for this issue.
2016-03-31MM Auth: introduce AUTH_ERROR constant.Neels Hofmeyr2-2/+2
Instead of using hardcoded -1 for errors, include -1 in the enum auth_action type; apply its use. In the mm_auth test, the string output changes from '(internal error)' to 'AUTH_ERROR', since now the proper enum value is used in auth_action_names[].
2016-03-31MM Auth test: add test to re-use existing authNeels Hofmeyr2-0/+37
2016-03-31MM Auth test: add two tests for AUTH_THEN_CIPHNeels Hofmeyr2-0/+152
Test two situations for AUTH_DO_AUTH_THEN_CIPH: - when no auth tuple is available - when the key sequence from LU is marked invalid Add convenience auth tuple comparison function using stringification.
2016-03-31Add MM Auth test; add auth_action_str() functionNeels Hofmeyr5-1/+156
Add basic MM Authentication test setup, with fake DB access and RAND_bytes(). So far implement simple tests for IO error during DB access and missing auth entry. To print the auth action during tests, add struct auth_action_names and auth_action_str() inline function in auth.[hc].
2016-03-22cscn: implement integrity protectionNeels Hofmeyr1-0/+6
Upon authentication response, initiate integrity protection for Iu by sending a Security Mode Command (IK), with hardcoded auth tuple so far. Implement RANAP event handling to receive Security Mode Complete message, adding stubs for the other events; in new files osmo-cscn/iucs_ranap.[hc] to keep RANAP dependencies separate, and particularly out of libmsc. Upon receiving Security Mode Complete, call the security operation callback (conn->sec_operation->cb) to complete the Location Update. Introduce enum integrity_protection_state constants to indicate integrity protection, record in gsm_subscriber_conn.iu.integrity_protection. Make subscr_conn_lookup_iu() non-static and declare in iu_cs.h to be able to call from iucs_ranap.c's Security Mode Complete event. Implement dummy iu_tx_sec_mode_cmd() to allow tests to build without RANAP dependencies. In cscn_main.c, call iucs_rx_ranap_event(), to populate the struct gsm_network struct with cscn_network explicitly (don't share cscn_network across compilation scopes because it's ugly).
2016-03-22fix various compiler warningsNeels Hofmeyr1-0/+4
sgsn_libgtp.c: missing include, for asn1str_to_u32() iu_cs.c: missing include, for subscr_name() osmo_bsc_vty.c: int/pointer conversions (note: this was discussed on the list to be solved by passing a pointer instead. Until then...) iudummy.c: opaque struct declarations
2016-03-17Revert "move to hex TMSI representation"Harald Welte2-3/+3
This reverts commit 044fbe6568f82a12bf4e3addc7e3d6db529b6548.
2016-03-17move to hex TMSI representationVadim Yanitskiy2-3/+3
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>
2016-03-04fix build: add xsc to osmo-bsc and tests/bsc-natNeels Hofmeyr1-0/+1
2016-03-04move sms_next_rp_msg_ref() to libxsc, for gsm0408testNeels Hofmeyr1-3/+3
Also change the signature to avoid using gsm_subscriber_connection, which has different members in libbsc and libmsc.
2016-03-04disable code trying to reach across BSC/MSC bounds, make build passNeels Hofmeyr2-2/+3
Disable ipacc_rtp_direct, Osmo SMPP TLVs, Ctrl interface and channel_test. These need to be reimplemented with proper separation of libs. Add some tall_* pointers the linker requires for osmo-cscn.
2016-03-04create libxsc and move some code, never link libbsc and libmscNeels Hofmeyr7-12/+8
libbsc and libmsc have conflicting definitions of gsm_subscriber_connection and do no longer belong together anyway. Create libxsc, meaning 'lib[bm]sc', to hold all code used by both libmsc and libbsc, and make sure gsm_subscriber_connection isn't used there. In various binaries and tests, do not link libbsc and libmsc. (Note: this commit was reshaped out of a large wip chunk, it may not compile properly without the subsequent commits)
2016-03-03osmo-bsc: half-fix tz override to allow compilationNeels Hofmeyr1-5/+5
As described in a comment, for MSCSPLIT the tz data has been moved to network level. To allow compiling osmo-bsc on the sysmocom-iu branch, move tz up to network level in osmo-bsc as well. This could be done better for osmo-bsc, rather easily too, still allowing per-BTS timezone settings. But I'm trying to focus on IuCS and would like to come back to this later.
2016-03-03sgsn_test: Fix mmctx llme and tlli struct names after mergeDaniel Willmann1-12/+12
2016-03-03add tests/libiudummyNeels Hofmeyr5-1/+24
2016-03-03sgsn_test: Make sgsn_test compile again after libui changeDaniel Willmann1-16/+0
2016-03-03tests/sgsn: Fix compilation of sgsn_testDaniel Willmann1-0/+22
The sgsn test still fails, but at least it is compiling again..
2016-03-03mscplit: try to clarify root talloc ctx and global gsm_network.Neels Hofmeyr1-1/+1
The aim is to allow osmo-cscn to pass its own root talloc context and global gsm_network struct instance cleanly. This may stir up some old and dusty globals, but I hope it's for the better, since not all is a BSC. To ensure that a global gsm_network pointer for the bsc_vty is set, have it as argument to bsc_vty_init(). The vty configuration commands are added only after bsc_vty_init(), which are needed to configure the network struct. So split up the bsc_bootstrap_network() function into bsc_network_init() to allocate a gsm_struct, and bsc_network_configure() to read the config file once the vty commands are in place. In this way, no global bsc_gsmnet pointer is needed for the bsc vty. The atomic super glue is dissolved and osmo-cscn will be allowed to have a different name for it. Admitted, it's still called the bsc_vty, but a split thereof is probably coming soon, because the CSCN doesn't want any of the BSC nor BTS specific vty commands.
2016-03-03put Iu-common and Iu-CS stuff in proper placesNeels Hofmeyr1-1/+1
Add libiu to contain the parts used by both Iu-CS (in osmo-cscn) and Iu-PS (in gprs) into libiu. It's rather thin and may make sense to move to osmo-iuh altogether, eventually. iu.c is half moved to libiu/, and half to osmo-cscn/iu_cs.c.
2016-03-03sgsn_iu -> iuNeels Hofmeyr1-1/+1
2016-03-03disable some sgsn_tests to pass the status quo.Neels Hofmeyr2-19/+6
while working on this, I need to see whether I break any more things. So remove some noise temporarily.
2016-03-03sgsn_test buildNeels Hofmeyr1-0/+4
2016-03-03sgsn_test: apply addition of gb memberNeels Hofmeyr1-18/+18
2016-03-03channel_test: don't segfault if paging failsNeels Hofmeyr1-2/+5
Add due assertions of return value validity, otherwise leading to segfaults.
2016-02-27bsc_test.c: fix tz.override val and note a FIXMENeels Hofmeyr1-2/+6
2016-02-22sgsn: Re-add searching for MM ctx based on TLLI / P-TMSI matchesJacob Erlbeck2-45/+2
If an MM context cannot be found based on BBSGP info and a RA UPDATE REQUEST is received, try to find an MM context with an P-TMSI from which the TLLI could have been derived. This also checks, whether the routing area matches. This is similar to the old behaviour removed by the commits "sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlli" and "sgsn: Remove tlli_foreign2local", except that this will only be done for RA UPDATE REQUESTs now. Sponsored-by: On-Waves ehf
2016-02-22sgsn/test: Add test case test_gmm_routing_areasJacob Erlbeck2-0/+355
This test add different cases of routing area changes. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlliJacob Erlbeck1-1/+1
Currently the code also matches the TLLI against LOCAL and FOREIGN mappings of the P-TMSI, thus eventually finding MM contexts not consistent with the TLLI (both tlli and tlli_new differ). On the other hand, tlli_new is not checked at all. This commit changes the function to only look at mmctx->tlli, mmctx->tlli_new, and the routing area. Sponsored-by: On-Waves ehf
2016-02-22sgsn/test: Add bssgp_raid parameter to send_0408_messageJacob Erlbeck1-25/+30
The BSSGP cell identifier is used to get the RA for the TLLI lookup. The send_0408_message function used in the tests does not set this, so the RA identifier is always 0-0-0-0. This commit adds a parameters to pass the RAID and adds missing dummy RAIDs. Note that the CI can still not be set and thus is always 0. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Remove tlli_foreign2localJacob Erlbeck1-5/+0
Currently foreign TLLI are sometimes mapped to local TLLI in the hope that they will match. This seems to sometimes introduce inconsisties, possibly leading to a failing assertion in _bssgp_tx_dl_ud. This mapping should probably reduce the allocation of additional LLME during routing area changes. This commit removes tlli_foreign2local. Sponsored-by: On-Waves ehf
2016-02-18Patch to make openbsc find libsmpp34Ruben Undheim1-1/+1
This patch lets the build script for openbsc find the libsmpp34 installation with the help of pkg-config instead of assuming the header files are in /usr/include.
2016-01-15tests/abis: fix format specifiersAlexander Huemer1-5/+5
2016-01-15tests/oap: depend on libgtpAlexander Huemer1-0/+4
exclude logic copied from src/gprs/Makefile.am
2015-12-07gtphub: improve handling of restarted peer.Neels Hofmeyr2-9/+48
Handle peer restart earlier, so that all the tunnels are deleted by the restart code path, instead of the first one being deleted due to reused TEI. That caused confusing logging messages. Also, when receiving Delete confirmations from the peer that didn't restart, don't complain about unknown peer, but acknowledge and remove the half invalidated tunnel. This means that the pending delete entry from the restart code path is not needed / not used, so don't bother to add pending delete entries upon peer restart. The test test_peer_restarted_reusing_tei() hits the situation where a tunnel is removed because of a reused TEI rather than the restart counter. Adjust the test to expect the "out-of-band" delete request earlier on, and to still see the half invalidated tunnel around. Enhance the test by adding the delete response from the peer that didn't restart, and add a final tunnels_are() verification. Sponsored-by: On-Waves ehi
2015-12-07gtphub: simplify/fix: one TEI mapping per tunnel.Neels Hofmeyr1-79/+102
Because the sender is known, one unique TEI per tunnel suffices to map the TEIs that the peers are sending to gtphub, instead of previously 4 (SGSN<->GGSN interaction on User and Ctrl plane, where each had an own unique TEI). Also, previously, a tunnel's endpoints should also have been checked against each other for TEI reuse, not only against the endpoints of other tunnels. This simplification fixes that problem for free. Thus simplify TEI reuse detection and improve VTY show readability and debugging. Adjust log and VTY output for tunnels. Adjust tests accordingly. Suggested-by: Holger Hans Peter Freyther <holger@moiji-mobile.com> Sponsored-by: On-Waves ehi
2015-12-07gtphub_test: add test_parallel_context_creation()Neels Hofmeyr2-0/+161
Sponsored-by: On-Waves ehi
2015-12-07gtphub: tweak logging.Neels Hofmeyr1-32/+32
Less spaces in tunnel strings, adjust tests accordingly. Use side_idx to remove code dup in rate counter output. Sponsored-by: On-Waves ehi
2015-12-03gtphub: add test for SGSN behind NATNeels Hofmeyr2-0/+105
2015-12-03gtphub_test: tweak test_user_data(): no seq routing.Neels Hofmeyr1-4/+4
Don't route User message back by sequence number, rather test that a completely unrelated User message is routed back properly. Sponsored-by: On-Waves ehi
2015-12-03tests: fix condition to run sgsn, oap, gtphub testsNeels Hofmeyr1-2/+3
Sponsored-by: On-Waves ehi
2015-12-03gtphub: fix restart cleanup peer matching.Neels Hofmeyr2-3/+6
Adjust test expectations accordingly. Sponsored-by: On-Waves ehi
2015-12-03gtphub: wrap gtphub_write() for test suite.Neels Hofmeyr2-1/+20
Sponsored-by: On-Waves ehi
2015-12-03gtphub: add restart counter testNeels Hofmeyr2-0/+165
Sponsored-by: On-Waves ehi
2015-12-03gtphub: add test for reused TEI.Neels Hofmeyr2-0/+78
Sponsored-by: On-Waves ehi
2015-12-03gtphub_test: add test for Del PDP from GGSN side.Neels Hofmeyr2-6/+58
Sponsored-by: On-Waves ehi
2015-12-03gtphub_test: add some cleanup asserts.Neels Hofmeyr1-0/+5
Sponsored-by: On-Waves ehi