aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2020-09-22gbproxy_test: fix compilationlynxis/gbproxy-ns2Alexander Couzens1-20/+21
Change-Id: I5455822d4bb30de3da944c2c206fef8b57004c55
2020-09-22works great - push --force got master plsAlexander Couzens1-4366/+4322
Change-Id: Iecfd0408a35a11638d254c1db3c1d477b1a11524
2020-07-18gtphub: rename sgsn's oww osmo_sockaddr into sgsn_sockaddrAlexander Couzens1-23/+23
The osmo_ prefix should be only used for official struct/apis of libosmocore. This commit was done via `sed -i 's/osmo_sockaddr/sgsn_sockaddr/g'`. In prepartion of introducing a different api of osmo_sockaddr to libosmocore. Change-Id: Ibb1ddce9ff1ffe7494de5cdb8ea1843c45fe4566
2020-06-18use new osmo_mobile_identity API everywhereNeels Hofmeyr1-13/+12
Depends: If4f7be606e54cfa1c59084cf169785b1cbda5cf5 (libosmocore) Change-Id: I4cacb10bac419633ca0c14f244f9903f7f517b49
2020-06-18gbproxy_test.c: fix mobile identity test dataNeels Hofmeyr2-271/+271
Fix the final nibble of all IMSI BCD digits to 0xf, since it is a filler digit. The encoded IMSI has an even amount of digits (14) and must contain a 0xf filler nibble at the end. The test data looked correct due to repeated '1' digits. wrong hex: 11 12 13 14 15 16 17 18 correct: 11 12 13 14 15 16 17 f8 order: 1T 32 54 76 98 ba dc Xe T = type, X = filler, 1..e = 14 digits This error was found when applying the new osmo_mobile_identity API. Change-Id: Ia006a3da6779ad1984f642e8ea29790a4daeb8b9
2020-04-20gtphub_test: Fix compilation with gcc-10Harald Welte1-1/+1
/usr/bin/ld: ../../src/gtphub/gtphub.o:/home/laforge/projects/git/osmo-sgsn/src/gtphub/gtphub.c:50: multiple definition of `osmo_gtphub_ctx'; gtphub_test.o:/home/laforge/projects/git/osmo-sgsn/tests/gtphub/gtphub_test.c:57: first defined here collect2: error: ld returned 1 exit status See also https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000653.html Change-Id: I19c1eef6649d2747f0b624f5292d7ae47c4ca839
2020-04-11tests: dlopen does not imply availability of dlsym..Eric1-0/+1
Check for both. Change-Id: If41a20bf499f791432f5f207e40688e97fb6e9f7
2019-12-11osmoappdesc.py, tests: switch to python 3osmith/fix-python3Oliver Smith2-81/+81
Make build and external tests work with python3, so we can drop the python2 dependency. This should be merged shortly after osmo-python-tests was migrated to python3, and the jenkins build slaves were (automatically) updated to have the new osmo-python-tests installed. Related: OS#2819 Depends: osmo-python-tests I3ffc3519bf6c22536a49dad7a966188ddad351a7 Change-Id: I8c07d99c1bc9f0383e4bce17544e0998998cc54d
2019-10-08ranap: add non-spec X1001Alexander Couzens1-0/+1
When the SGSN releases a RANAP connection, it sends a Release Command and waits for a Release Complete. Use X1001 to release the Iu connection when the Release Complete is lost/never received. Change-Id: I39a0169c22a4ac430b3d6f3c281d1f381eaa4756
2019-10-08Iu: implement a user inactivity timerAlexander Couzens1-0/+1
The user inactivity timer is similiar to the Gb READY timer and reduces the resources taken by an idle UE. Change-Id: I66c2ac0350cb074aefd9a22c5121acf723f239d3
2019-10-03Avoid compiling unneeded files when building without IuAlexander Couzens1-2/+2
Remove gprs_ranap.c and gprs_mm_state_iu_fsm.c from the Makefile when building without IU. Change-Id: I2386f8e86bbf0b87eedce9f57eb86b1b64998a69
2019-09-03Split out GPRS SM layer into its own filePau Espin Pedrol1-0/+1
Change-Id: Ie61d22e7868af6de73cdf9c731f07130b282599d
2019-09-03Implement GMM State using osmocom FSMPau Espin Pedrol2-4/+5
State machine inspired in the one from TS 24.008 4.1.3.3.1. Some state transitions are inroduced in the code but are still commented out since we lack some functionalitites or improvements in the code to handle different scenarios. Most of the logic is still outside of the FSM, but at least now the states are handled in a sane way triggered by events. Change-Id: Idecb43c10d66224d4f9ba9320825040ce6cf9a07
2019-09-02Move out sgsn to its own subdirPau Espin Pedrol8-33/+33
Change-Id: I16fccc0eadf588599b9e5578d0f4dbaf9df81737
2019-09-02Move out gtphub to its own subdirPau Espin Pedrol1-1/+1
Change-Id: I707d5e9b775179e732d281ce3d245de83d648eea
2019-09-02Move out gbproxy to its own subdirPau Espin Pedrol2-7/+7
Change-Id: I2cc98d3a276d953609bbbbaa9782a0112687791e
2019-09-02Introduce FSM mm_state_iu_fsmPau Espin Pedrol1-0/+1
Implement TS 23.060 6.1.2 Mobility Management States (Iu mode) using osmocom FSM and drop old implementation. Most of the logic on each state is still kept in gprs_gmm.c, will be inserted into the FSM later. Change-Id: I4c9cf8c27194817c56e8949af0205e1cc14af317
2019-09-02Introduce FSM mm_state_gb_fsmPau Espin Pedrol1-0/+1
Implement TS 23.060 6.1.1 Mobility Management States (A/Gb mode) using osmocom FSM and drop old implementation. Most of the logic on each state is still kept in gprs_gmm.c, will be inserted into the FSM later. Change-Id: I04004423e993107374d5a3549b8a93ac169251dd
2019-09-02Move llc->MM/SM Gb specific glue code to its own filePau Espin Pedrol1-0/+1
Now that we have RANAP/Iu handling specificities in its own file, let's have also Gb specific glue code for messages coming from llc up to MM/SM layer in its own file. This way same entry points in gprs_gmm.c are used by Gb and Iu: gsm0408_rcv_gmm() (for MM) and gsm0408_rcv_gsm() (for SM). Change-Id: Iaf57922a0970c1d03f6f1d6337d27ae3d4aaf32c
2019-09-02Move lots of Iu/ranap specific code into its own filePau Espin Pedrol1-0/+1
RANAP related functionalities were splitted among several files (gprs_gmm.c, gprs_sgsn.c and sgsn_libgtp.c). Let's move it into its own file to shrink complexity/size of existing files. It also allows to keep a lot of conditionally enabled code (BUILD_IU) and its dependencies (osmo-iuh) together. Change-Id: I549042aaff045a378de77d657cc396ee08f22f33
2019-08-20gprs/gprs_gmm: implement T3314. Timeout to reset MM state READY->STANDBYAlexander Couzens1-1/+1
When a MS MM state is READY its exact location is known (PCU). On Gb, T3314 (aka TS 23.060 "READY timer") sets the MM state from READY to STANDBY, where only the RA is known. Introduce a second set of timer variables, because state timer can run while another packet state timer is timing out. Related: OS#1941 Change-Id: I4ce23ebe50d141076c20c9c56990b7103cd25e55
2019-08-20tests: Introduce vty-transcript-test testsPau Espin Pedrol2-4/+88
Add a few commands to make sure it's working fine, and print all available timers with default values. Change-Id: Ifd092b9561d49be1f62769d95ba49f6e4aeb4066
2019-08-20Replace own timer infra with libosmocore osmo_tdefPau Espin Pedrol1-0/+7
VTY command "show timer" is also available now. Change-Id: Ia0cf5f0a49737fbc419e2ccc86312d01c6e0056e
2019-08-20tests: Verify that timers can be set over VTYPau Espin Pedrol1-0/+9
Change-Id: I486fc2a56e235a539836894d2042c1ca6e514ab9
2019-05-11gprs_gmm: send Service Reject when no PDP ctxs are available.efistokl2-0/+18
Look at PDP Context Status IE: if there are any PDP contexts which are ACTIVE on MS side and there are no PDP contexts which are ACTIVE on the network side, then send Service Reject with the cause "NO PDP ACTIVATED". This forces MS to reactivate the PDP contexts. 3GPP TS 24.008 Section 4.7.13.4 Service request procedure not accepted by the network. Cause # 40. Fixes: OS#3937 Change-Id: If610cbef17c25ec44e65d4f1b2340d102c560437
2019-02-26gbproxy_test: Fix test expectations of gprs_ns_rcvmsg()Harald Welte2-334/+340
gprs_ns_rcvmsg() in old libosmocore returns "number of bytes transmitted by any response PDU we sent as a result of the received message", while modern libosmocore simply retunrs '0' for any successfully received message. Let's make sure any non-negative responses lead to a reproducible test output with both old and new libosmocore. Change-Id: I7a48d14aed19825b87a02ccf9ee9cbfe0853342c
2018-12-11Use explicit parameter for sgsn_auth_init()Max1-1/+1
This is necessary to properly test ACLs in follow-up patches. Change-Id: Ibeba371234680f33ad35afbfffce9dca185228c1
2018-11-20update gbproxy test expected outputStefan Sperling1-38/+38
libosmocore commit 797558ea1768e464f9559c5f7a4f3f4285c5de25 changed the order of NS_UNBLOCK_ACK transmission dispatching of the NS_UNBLOCK signal. Update expected output of gbproxy tests accordingly to make these tests pass again. Change-Id: Ia3df811755b1c88cf7a27a466677b24a6c32fd8e Related: OS#2388
2018-11-15use enums consistently instead of falling back to intStefan Sperling1-5/+5
The two existing enums defined in gprs_sndcp_xid.h, for protocol and data compression algorithm numbers respectively, were assigned to 'int' variables when their values were copied to other structures. This prevented the compiler from checking the enum value coverage during switch statements and also tripped up Coverity scans looking for enum value mismatch problems. So instead of copying enums to ints, make use of the enums throughout. Structures which can contain values from both enums now use a union of both, forcing us to be very explicit about which set of values we are dealing with. Change-Id: I3771a5c59f4e6fee24083b3c914965baf192cbd7 Depends: If6f3598cd6da4643ff2214e21c0d21f6eff0eb67 Depends: I8444c1ed052707c76a979fb06cb018ac678defa7 Related: CID#149102
2018-10-30Remove local libgsupclient; Use libosmo-gsup-client from osmo-hlrHarald Welte2-13/+14
osmo-hlr has recently (as of Change-Id Iad227bb477d64da30dd6bfbbe1bd0c0a55be9474) a working shared library implementation of libosmo-gsup-client. We can remove the local implementation in osmo-sgsn and use the system-installed shared library instead. Change-Id: I6f542945403cf2e3ddac419186b09ec0e2d43b69
2018-10-30Update wrong references to bsc in sgsn codePau Espin Pedrol3-28/+28
Change-Id: I93f0dc721c2eff8a87fb9248882f24768f708713
2018-09-13gprs_gmm: introduce a GMM Attach Request FSMAlexander Couzens1-0/+1
The old GMM Attach Request handling used a recursive function which can not handle certain states and is quite complex and hard to extend. The new FSM handles such request in a FSM and can be called multiple times. Change-Id: I58b9c17be9776a03bb2a5b21e99135cfefc8c912
2018-09-13tests: remove gmm unit testsAlexander Couzens2-836/+0
The test cases now implemented by TTCN3 which should not be as fragile as the unit tests. Because the unit tests expect a quite strong internal state to be happen. Change-Id: Iac1c8854b5ea4aa03279990390ebc110c979aac2
2018-08-15Drop gprs_msgb_copy with libosmocore replacementPau Espin Pedrol1-1/+1
gprs_msgb_copy was introduced in libosmocore 0.94 (f78ec5ce0d0f6038147d9b9e14d81094309ba5d5) as bssgp_msgb_copy. Let's use that one to avoid code duplication. Change-Id: I42a65fd8e4045fafadf5694f2d8d0c5e7ab350a0
2018-07-30migrate to oap_client in libosmogsmHarald Welte7-350/+0
libosmogsm in libosmocore.git from Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950 onwards contains oap_client.c, so we don't need our local copy here in this repo anymore. Change-Id: I7b194f98ef3f925b6178d8a8dbd9fcf2f0c6e132 Requires: libosmocore.git Change-Id Ie36729996abd30b84d1c30a09f62ebc6a9794950
2018-06-23finish gbproxy_parse_bssgp_unitdata testStefan Sperling1-5/+55
The message this test is trying to parse is indeed invalid. Add a comment showing the message in decoded form, and assert that the parser rejects it. Also, add a missing call to cleanup_test(). Change-Id: I2a86432d080c38d3c95626372a0129499d7146dd Related: OS#3178
2018-06-07add a test for OS#3178 (invalid unitdata message)Stefan Sperling1-0/+28
Add a test which reproduces the parsing problem. Whether this problem is due to an invalid message or a parser bug is yet to be determined. Until then, this test helps with analyzing the problem further. Change-Id: I39189701a57c785ffdacc3ae26d7aa93bb06cde6 Related: OS#3178
2018-05-01GERAN: allow GSM SRES on UMTS AKA challengeNeels Hofmeyr1-1/+1
Store the established security context type (GSM or UMTS) instead of the boolean flag is_authenticated. Provide the previous boolean query with thin sgsn_mm_ctx_is_authenticated() function. Knowing which security context was established will be necessary for OS#3224, i.e. using the proper ciphering key, which is not yet tested properly, and probably not correct at this stage. This change will make new SGSN_Tests.TC_attach_umts_aka_gsm_sres pass. Related: OS#3193 OS#3224 Change-Id: I36807bad3bc55c0030d4f09cb2c369714f24bec7
2018-04-16use osmo_init_logging2(), fix regression test memleaksNeels Hofmeyr9-35/+90
Particularly gbproxy_test.c had various mem leaks, which (will) show up with gcc (Debian 7.3.0-15) 7.3.0 address sanitizer. Fix those leaks to verify that we don't have memleaks in the production code. Change-Id: Ia4204c8b3d895b42c103edecb61b99d3d22bd36f
2018-03-15implement support for 3-digit MNC with leading zerosNeels Hofmeyr2-25/+16
Add 3-digit flags and use the new RAI and LAI API from libosmocore throughout the code base to be able to handle an MNC < 100 that has three digits (leading zeros). Note that in gbproxy_test.ok, 0-0 changes to 000-000 instead of 000-00, because the parsed ra buffer is 000000 which results in 000-000, while 00f000 would result in 000-00. IOW this is expected. Change-Id: I7437dfaa586689e2bef0d4be6537e5577a8f6c26
2018-02-21sgsn_test: guard against struct gprs_ra_id changingNeels Hofmeyr1-3/+3
sgsn_test initializes various struct gprs_ra_id without naming the actual members, which is vulnerable to struct member re-ordering. Name the members explicitly. An upcoming ABI change in libosmocore would cause test failures here without this patch. Change-Id: I517ed9edf77fac37d9de7a39df24c419a8a65d96
2018-02-08mandatory depend on libc-ares and libgtpAlexander Couzens3-18/+0
Both library are required to build osmo-sgsn. The optional dependency was correct when osmo-sgsn was part of openbsc. Change-Id: Id608165ae490cb6c84aac1fe70412b2cb2b2587b
2018-01-19Use gsm48_encode_ra() for RAI encodingMax1-7/+7
It has stricter type signature which increase the chance of spotting misuse either via compiler warning or with automated scan. This also paves the way for gsm48_construct_ra() deprecation in libosmocore. Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Related: OS#1640
2018-01-16fix build: missing LIBGTP_CFLAGS in sgsn_testNeels Hofmeyr1-0/+1
Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6
2018-01-07cosmetic: tests: sgsn_test: Use proper formatting and remove uneeded semicolonsPau Espin Pedrol1-6/+7
Change-Id: I144175b89f8058f6f8dedfa931c6768d9c43b70e
2018-01-07tests: sgsn_test: Define wrap APIs with correct parametersPau Espin Pedrol1-4/+8
Fixes following compilation warnings: osmo-sgsn/tests/sgsn/sgsn_test.c: In function ‘test_gmm_attach_subscr’: osmo-sgsn/tests/sgsn/sgsn_test.c:1110:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info; ^ osmo-sgsn/tests/sgsn/sgsn_test.c: In function ‘test_gmm_attach_subscr_fake_auth’: osmo-sgsn/tests/sgsn/sgsn_test.c:1144:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info_fake_auth; ^ osmo-sgsn/tests/sgsn/sgsn_test.c: In function ‘test_gmm_attach_subscr_gsup_auth’: osmo-sgsn/tests/sgsn/sgsn_test.c:1275:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info_gsup_auth; ^ Change-Id: I5fcb3d460d8becb4cc917fc8d27bfc7e49d50b90
2017-12-27Migrate from OpenSSL to osmo_get_rand_id()Max6-26/+19
This avoids potential licensing incompatibility and makes integration of Debian packaging patches easier. The libosmocore version requirements are fine already but for jenkins tests to pass we have to have Ic77866ce65acf524b768882c751a4f9c0635740b merged into libosmocore master. Related: OS#1694 Change-Id: I2b687b7f07ef05bbd861b8479cad5a958a3dde92
2017-12-19Remove unneeded .py scriptsMax2-10/+2
The ipa.py has been moved to osmo-python-tests as osmo_ipa - use it for vty and ctrl tests instead of local copy. The soap.py and twisted_ipa.py are not SGSN-specific: leftovers from repository split which are now available in osmo-python-tests as well. Change-Id: I3ef4ca790878921a5846f64942a8de8a6ff9c11c
2017-11-28tests: Fix selection of python versionPau Espin Pedrol3-4/+4
According to documentation (and personal experience), AM_PATH_PYTHON selects the highest version of python, no matter if major version is different, which means if both python2 and 3 are available, 3 will be chosen an PYTHON will point to "/.../python" which is python3. Apparently, the macro cannot be easily used to pick highest python2 version. As {vty,ctrl}_test_runner.py require python2 and are incompatible with python3, let's instead rely on the system having a "python2" binary available, which is the case in most distros. Change-Id: If8e57924ed2c8da7ab7692f58a4bb5c5a970484f
2017-11-15tests/ctrl_test_runner.py: remove BSC/NAT TestRunnerAlexander Couzens1-371/+0
SGSN was splitted out of OpenBSC. Change-Id: Ie4e44e49e5c904929869b47fc4d608aab1aab75e