aboutsummaryrefslogtreecommitdiffstats
path: root/tests/emu
AgeCommit message (Collapse)AuthorFilesLines
2023-05-03pcu_l1_if_phy: fix API function namesPhilipp Maier1-2/+2
The functions l1if_open_pdch and l1if_close_pdch have a misleading naming since what they actually do is opening and closing the TRX since they return and accept a context (obj) that is valid for a whole TRX. This also explains why the other functions accept a timeslot as parameter in addition to the context. Let's rename those functions so that it is clear what they do. Related: OS#6022 Change-Id: I395a60b2fba39bac4facec78989bac20f0cef0d3
2023-04-21alloc_algo: Pass a struct containing all req paramsPau Espin Pedrol1-1/+2
This is a first step towards isolating the allocation algorithm from applying changes on PCU state. In next steps the tbf pointer will be dropped and the allocation algorithm will only result a "result" struct which then the caller can apply to whatever TBF object it requires. Change-Id: Ie4d9ace526ad012d97738bc55bdb5cc1472c632d
2023-02-27pcu_l1_if_phy: add new PHY API function to disconnect PDCHPhilipp Maier1-0/+1
There is a function l1if_connect_pdch, but no complementary function like we have it with l1if_open_pdch and l1if_close_pdch. The reason for this is that the PHY implementations that rely on a femtocell DSP do not need to disconnect the pdch explcitly. However, the planned support for the E1 based Ercisson RBS CCU will require an explicit disconnect. So lets add a function call for this. Change-Id: Ied88f3289bda87c48f5f9255c4591470633cc805 Related: OS#5198
2022-12-16Rename gprs_rlcmac_ts_alloc.cpp -> alloc_algo.cpp & create own .h filePau Espin Pedrol1-0/+1
First commit towards trying to have alloc algorithm as isolated as possible from others parts of the code trying to avoid state changes on data structures. Change name also because the alloc_algo not only allocated TS, but TFIs and USFs. Change-Id: I33a6c178c64a769f05d3880a69c38acb154afa62
2021-02-22Use ALPHA value received in SI13 from PCUIFPau Espin Pedrol1-1/+0
The old VTY command is marked as deprecated and still overrides the use in case it's used. Related: SYS#5358 Depends: libosmocore.git Change-Id I74fb0a3afc1ac4aadbfc609b882d929401f790eb Depends: osmo-bsc.git Change-Id I8b97ea11bad5fe05f2f634945b5703ee9abde81d Change-Id: I46f2a955b157a409055fca7fb917dc4f75482426
2021-02-16gprs_bssgp: rename gprs_ns_config -> gprs_ns_update_configAlexander Couzens1-1/+1
Improve the naming of the function to match it's purpose. Related: SYS#5354 Change-Id: Ib8e4ae734503fd6f6695d9d6767d809e1bf79d22
2021-01-20Allow multiple bts objects in PCUPau Espin Pedrol1-5/+4
This patch doesn't really tests whether osmo-pcu can work on a multi-bts environment, but it prepares the data structures to be able to do so at any later point in time. Change-Id: I6b10913f46c19d438c4e250a436a7446694b725a
2021-01-19Get rid of bts singletonsPau Espin Pedrol1-1/+1
There's no BTS single global object anymore, get rid of those APIs. Move users to use "pcu->bts", which will evolve to a linked list in the future. Change-Id: I9cf762b0d3cb9e2cc3582727e07fa82c8e183ec5
2021-01-19Unify BTS into a C usable structurePau Espin Pedrol1-1/+1
Previous work on BTS class started to get stuff out of the C++ struct into a C struct (BTS -> struct gprs_glcmac_bts) so that some parts of it were accessible from C code. Doing so, however, ended up being messy too, since all code needs to be switching from one object to another, which actually refer to the same logical component. Let's instead rejoin the structures and make sure the struct is accessible and usable from both C and C++ code by rewriting all methods to be C compatible and converting 3 allocated suboject as pointers. This way BTS can internally still use those C++ objects while providing a clean APi to both C and C++ code. Change-Id: I7d12c896c5ded659ca9d3bff4cf3a3fc857db9dd
2021-01-18Move fc_* fields from BTS to PCUPau Espin Pedrol1-1/+1
Change-Id: I816d49e732d0fc7a3c9aa1f0e9a83b83d25e6a32
2021-01-18Move alpha,gamma fields from BTS to PCUPau Espin Pedrol1-1/+1
Change-Id: I2fdd9c8a7393157183fff64084bb10e2a3b1dc63
2021-01-18Split PCU global PCU object from BTS objectPau Espin Pedrol1-7/+13
Currently the BTS object (and gprs_rlcmac_bts struct) are used to hold both PCU global fields and BTS specific fields, all mangled together. The BTS is even accessed in lots of places by means of a singleton. This patch introduces a new struct gprs_pcu object aimed at holding all global state, and several fields are already moved from BTS to it. The new object can be accessed as global variable "the_pcu", reusing and including an already exisitng "the_pcu" global variable only used for bssgp related purposes so far. This is only a first step towards having a complete split global pcu and BTS, some fields are still kept in BTS and will be moved over follow-up smaller patches in the future (since this patch is already quite big). So far, the code still only supports one BTS, which can be accessed using the_pcu->bts. In the future that field will be replaced with a list, and the BTS singletons will be removed. The cur_fn output changes in TbfTest are actually a side effect fix, since the singleton main_bts() now points internally to the_pcu->bts, hence the same we allocate and assign in the test. Beforehand, "the_bts" was allocated in the stack while main_bts() still returned an unrelated singleton BTS object instance. Related: OS#4935 Change-Id: I88e3c6471b80245ce3798223f1a61190f14aa840
2020-11-04pcuif: Improve BTS-supported CS/MCS handlingPau Espin Pedrol1-1/+1
Take into account the MCS values supported by the BTS. In osmo-bts, in general all MCS are enabled if "mode egprs" is selected in BSC, and none otherwise. Change-Id: Ie8f0215ba17da1e545e98bec9325c02f1e8efaea
2020-10-30cosmetic: tests: pcu_emu: fix trailing whitespacePau Espin Pedrol1-1/+1
Change-Id: I889498c75a78fd8aa406cff5600e4773785782de
2020-10-13Rework NS configuration over the info indicationAlexander Couzens1-2/+3
Add support of the second NSVC in the info indication. Add support to update a previous NS configuration. Allow to update of a NS-VC while the NSE is still available over the second. Depends-on: I917f25ebd1239eae5855d973ced15b93731e33a0 (libosmocore) Depends-on: I3a0cd305fd73b3cb9ec70246ec15ac70b83e57f2 (libosmocore) Depends-on: I5a2bb95d05d06d909347e2fb084a446ead888cb3 (libosmocore) Depends-on: I54f110acc3acccb362f6e554324d08cc42b7c328 (libosmocore) Depends-on: Ia00753a64b7622a0864341f51ea49b6963543755 (libosmocore) Depends-on: Ic8f6f8aca10da23a18fab8870be7806065a34b47 (libosmocore) Depends-on: I5f67e6a9bf4cb322bd169061fee0a528012ed54d (libosmocore) Change-Id: I589ebaa2a2b7de55b7e4e975d8fd6412dd5f214b
2020-10-06Use the new NS2 libAlexander Couzens1-5/+19
Depends: Id7edb8feb96436ba170383fc62d43ceb16955d53 (libosmocore) Depends: I2a9dcd14f4ad16211c0f6d98812ad4a13e910c2a (libosmocore) Change-Id: Ib389925cf5c9f18951af6242c31ea70476218e9a
2019-09-12Introduce osmo_tdef infra and timer VTY commandsPau Espin Pedrol1-5/+0
This will allow for configuration of some of the timers by the user, and allow him to inspect current values being used. It will be also useful for TTCN3 tests which may want to test some of the timers without having to wait for lots of time. Timers are splitted into 2 groups: BTS controlled ones and PCU controlled ones. The BTS controlled ones are read-only by the user (hence no "timer" VTY command is provided to change them). TbfTest.err output changes due to timers being set up correctly as a consequence of changes. Other application such as pcu_emu.cpp and pcu_main.cpp had to previosuly set the initial values by hand (and did so), but apparently TbfTest.c was missing that part, which is now fixed for free. Depends: libosmocore.git Id56a1226d724a374f04231df85fe5b49ffd2c43c Change-Id: I5cfb9ef01706124be262d4536617b9edb4601dd5
2019-08-05Remove undefined param passed to {logging,osmo_stats}_vty_add_cmdsPau Espin Pedrol1-1/+1
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However, definition in C file doesn't contain "(void)", which means number of parameters is undefined and thus compiler doesn't complain. Let's remove parameters from all callers before enforcing "(void)" on it. API osmo_stats_vty_add_cmds never had a param list but has seem problem (no "void"), so some users decided to pass a parameter to it. Related: OS#4138 Change-Id: Ic1ac815eafab49577ff883a5d700ecca5936d216
2019-06-07gprs_bssgp_pcu: explicit allocate & initialize bssgp_nsi instanceAlexander Couzens1-0/+7
The instance bssgp_nsi is a global instance to be used by all NS related functions. Previous the PCU allocated and initialized the bssgp_nsi instance when (re-)connecting and freeing on disconnect. The problem of the implicit initialisation is gprs_ns_vty_init(bssgp_nsi). All vty init functions must be called before the configuration is read, otherwise a previous vty written configuration is invalid. Furthermore the vty modifications to the `ns` object were lost when the PCU has to reconnect to the SGSN. Fixes: OS#4024 Change-Id: I2aa53ea54e9352577f6280ad7b9d1d9da9f57eaf
2018-04-01use osmo_init_logging2() with proper talloc ctxNeels Hofmeyr1-1/+1
There is a duality of initialization: early_init() in bts.cpp wants to init logging even before static instances get initialized. Make sure that tall_pcu_ctx is initialized during early_init() as well. There is a build context that does not seem to include bts.cpp (osmo-pcu-remote), so to be sure, init tall_pcu_ctx as NULL and both in early_init() as well as pcu_main.cpp, init both tall_pcu_ctx and logging if it is still NULL. Change-Id: I2199b62d0270bd35dec2283e8f5b364b7c63915b
2018-03-11implement support for 3-digit MNC with leading zerosNeels Hofmeyr1-1/+2
Receive the mnc_3_digits flag from the PCU interface. Bump the PCU interface to 9. This is one part of the three identical pcuif_proto.h patches: - I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts) - I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu) - I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc) 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). Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore), Ib7176b1d65a03b76f41f94bc9d3293a8a07d24c6 (libosmocore) Change-Id: I787fed84a7b613158a5618dd5cffafe4e4927234
2018-02-13emu: use libosmocore definitionsMax1-29/+1
Change-Id: I4eade528faeb3841549ad7a6c78e8c1357909614
2017-06-22tests: remove unused definitionMax1-16/+0
Fix compilation warning. Change-Id: I1c95c6ec8bee68773643f9646b0319a83fbc6cfa
2017-02-08main, tests: use msgb_talloc_ctx_init() (new)Neels Hofmeyr1-1/+1
msgb_set_talloc_ctx() is deprecated since libosmocore commit f45334be29016a36594aacc07c90e262e4994525 / change-id I747fbbf977c4d2c868c8dead64cfc5fd86eb8d4c Change-Id: I8d40abec428b739460ed545c9983d1b63021bd08
2015-05-04pcu_emu/test: Initialise current_testJacob Erlbeck1-1/+3
Currently the global current_test is not initialised, which leads to memory access failures. In addition, the variable is signed but used in comparisons with unsigned values. This commit changes the type to size_t and initialises the variable to 0. Sponsored-by: On-Waves ehf
2015-05-04pcu: Fix non-critical warningsJacob Erlbeck3-6/+2
These fixes do not affect the semantics of the code. They either help gcc by providing default values that won't be used ("may be uninitialised"), remove unused variables, or change signed to unsigned variables to avoid comparison warnings. Addresses: bts.cpp:494:32: warning: 'tbf' may be used uninitialized in this function emu/test_replay_gprs_attach.cpp:81:27: warning: comparison between signed and unsigned integer expressions emu/test_pdp_activation.cpp:95:23: warning: unused variable ‘budh’ emu/test_pdp_activation.cpp:97:6: warning: variable ‘rc’ set but not used emu/pcu_emu.cpp:109:26: warning: unused variable ‘bts’ alloc/AllocTest.cpp:74:27: warning: unused variable ‘tbf’ osmocom/core/utils.h:13:50: warning: comparison between signed and unsigned integer expressions types/TypesTest.cpp:319:7: warning: unused variable ‘count’ types/TypesTest.cpp:320:11: warning: unused variable ‘rbb’ alloc/AllocTest.cpp:74:27: warning: unused variable ‘tbf’ alloc/AllocTest.cpp:132:11: warning: unused variable ‘ts_no’
2013-12-12test: Remove the side-effect from the assertionHolger Hans Peter Freyther1-1/+2
Coverity complains about this code as it doesn't know that the OSMO_ASSERT is always on. But it is good practice to now have the side-effect in here. Fixes: Coverity CID 1080724
2013-10-30bts: Introduce a singleton for the BTS and use it in the codeHolger Hans Peter Freyther1-14/+4
Compared to the previous code there will be a branch to get the global pointer so the code will be slightly slower than the previous version but it allows us to start creating objects but still use the code from C. It is best approach I have found so far. One downside of C++ is that by default talloc will not be used (unless we override the new operator to use talloc. Right now we need to memset the C data structure by hand. The benefit of enforcing a better structure should is more important though.
2013-10-30bts: Move struct gprs_rlcmac_bts and other structs into a bts.hHolger Hans Peter Freyther1-0/+1
Begin to make the BTS a real C++ object with real responsibilities. The biggest issue will be the pcu_vty.c that might not like C++ at all.
2013-09-04emu: Add a crash re-producer for the SGSN (and the concept of tests)Holger Hans Peter Freyther6-13/+330
Introduce the concept of tests that will be ran one after the other. This new test will send static message that will lead to the opening of a PDP context. At this point one should use ping with a large packet size and suspend/stop the emulator. Once the NS connection is considered dead the SGSN will crash with a double free. Reproduce: 0.) Add IMSI 901700000003094 to the ACL 1.) Stop/Suspend the emulation process so the NS Alive times out 2.) Use ping IP -s 2048 This will create a double free... #4 0xb7bb2646 in talloc_abort_double_free () at talloc.c:175 #5 0xb7bbd41a in talloc_chunk_from_ptr (ptr=0x8091208) at talloc.c:190 #6 _talloc_free (ptr=0x8091208) at talloc.c:517 #7 talloc_free (ptr=ptr@entry=0x8091208) at talloc.c:990 #8 0xb7bb319b in msgb_free (m=m@entry=0x8091208) at msgb.c:72 #9 0x0804db54 in sndcp_send_ud_frag (fs=0xbfffcc6c) at gprs_sndcp.c:423 #10 sndcp_unitdata_req (msg=msg@entry=0x808eed8, lle=0x808fbc8, nsapi=5 '\005', mmcontext=mmcontext@entry=0x80903e8) at gprs_sndcp.c:471
2013-09-04emu: Use OpenBSC code to decode the LLC and add assertionsHolger Hans Peter Freyther4-0/+326
Use the OpenBSC SGSN code to parse the LLC data and look into the data we receive. Add assertions to verify the the sequence number is increasing.
2013-09-04emu: Send a static GPRS ATTACH request and wait for the reply.Holger Hans Peter Freyther2-1/+60
This will send a static message. It will trigger the GMM code on the SGSN and might ask us for the IMEI/IMSI or send us an accept. As we are not replying at all the SGSN needs to send new requests and we can observe if the sequence number is increasing like it should.
2013-09-04emu: Create an app that allows to communicate with a SGSNHolger Hans Peter Freyther1-0/+113
This code can open a BSSGP connection toward a SGSN and will inititate the unblocking. It does not send any user data.