aboutsummaryrefslogtreecommitdiffstats
path: root/tests/tbf
AgeCommit message (Collapse)AuthorFilesLines
2018-03-11implement support for 3-digit MNC with leading zerosNeels Hofmeyr1-5/+6
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-21Simplify TS alloc: move slot assignmentMax1-1/+1
Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282
2018-02-19Simplify TS alloc: split off RX mask computationMax1-3/+3
Move computation of RX mask into separate function and document it. This allows to significantly shrink find_multi_slot() function and overall improve code readability. Since the test output requires cosmetic adjustment anyway due to change in the sequence of log messages, use this opportunity to better group and format log message. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282
2018-02-19Update header includesMax1-0/+1
Many files include unnecessary headers and don't include headers which are actually used. Because of that combined with the fact that OsmoPCU is a mixture of C and C++, it makes it hard to modularize code. Fix this (using iwyu [1] tool): * add missing headers * remove unused headers [1] https://include-what-you-use.org/ Related: OS#1539 Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00
2018-02-08TBF: move common test code into functionsMax1-109/+67
* move common code into functions * print error instead of failing test right away This allows the tests to continue till completion even in case of intermediate error which simplifies troubleshooting by allowing to gather more errors in a single test run. Change-Id: I1c4ad1dc94542835f15bd666f0821e0ccfcc78c1 Related: OS#1759
2018-02-03TBF: add helpers for assignment type handlingMax1-1/+32
* add function to set/unset given assignment type * log assignment type flag changes * update tests output with additional logs This enables us to carefully track the TBF assignment type transitions. Change-Id: I3fe9d52472be8b7f257e8326b2f84e8e7d7bd1f4 Related: OS#1759
2018-01-26Simplify TS alloc: fix allocation callsMax1-6/+7
Using the semantic patch below, adjust allocation-related calls to match updated allocator signatures. // spatch --c++ --dir src -I src --sp-file callfix.spatch --in-place --recursive-includes // spatch --c++ --dir tests -I src --sp-file callfix.spatch --in-place --recursive-includes @@ expression A, B, C, D, E; @@ tbf_alloc_ul_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) @@ expression A, B, C, D, E; @@ tbf_alloc_dl_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Related: OS#2282
2018-01-25TBF: override send function via linker optionMax1-1/+3
Use --wrap linker facility to override pcu_sock_send() similar to other Osmo* projects. Change-Id: Ia3d436bd3d1fb0ce8e98526bd7457f4c57667ceb
2018-01-25TBF: decrease L1 logging verbosity in testMax2-290/+1
Don't clutter output with low-level details. Change-Id: I451f2472070dea2387bfaea45ca5bdd9e3b2276d
2018-01-24TBF: adjust test log levelsMax2-1186/+4796
* enable debugging for DTBF* * disable excessive DRLCMAC* Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab
2018-01-24TBF: make UL ack state internalMax1-3/+3
* add functions/macros for setting TBF's UL ack state * add functions for checking TBF's UL ack state N. B: this should not be confused with TBF-UL state. Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Related: OS#1539
2018-01-24TBF: make UL/DL state internalMax1-5/+5
* add functions/macros for setting TBF's UL/DL state * add functions for checking TBF's UL/DL state * move pre-free check into separate function N. B: this should not be confused with TBF-UL or TBF-DL state. Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Related: OS#1539
2018-01-19TBF: add dedicated log categoriesMax1-4667/+5
Previously all TBF-related events were logged as part of DRLCMAC which is too broad to make it practically useful due to excessive amount of log messages generated. Introduce dedicated log categories for TBF-related events. Adjust test output as necessary. Change-Id: I64d660e5971263d5c63d2ba95d50625c16a594aa
2018-01-17TBF: log source of state transitionsMax1-1/+1
We use the same approach for osmo_fsm: when state transition happens, it's not very useful to always log the transition function itself, it's much more useful to see where the actual transition comes from. Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Related: OS#1759
2018-01-17Use Timing Advance Index in UL assignmentsMax1-16/+16
Write TAI (if available) when generating Rest Octets for UL Assignment. This should not affect actual PCU behavior because TAI is not yet supported by upper layers but we have to adjust corresponding tests anyway. Change-Id: I8b17be78a46c0bc17516b7c90f35aa4768010ae4
2018-01-17Rewrite Packet Uplink AssignmentMax1-16/+16
Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 §10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. The tests are adjusted accordingly. Change-Id: I44db2eeea7448ff67e688ae716487bc6dbfc96a3 Related: OS#1526
2018-01-17Rewrite Packet Downlink AssignmentMax1-35/+35
Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 §10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. The tests are adjusted accordingly. Change-Id: I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 Related: OS#1526
2018-01-12TBF: unify EGPRS window calculationMax1-34/+34
Move actual calculation into shared function and use it to set window size for TBF. TBT test output requires cosmetic adjuestements due to extended debug output. Change-Id: Ib9f4a277082da3c71007f5f3b4f2acac8b994540 Related: OS#1759
2018-01-12TBF: move window parameters to UL/DL levelMax1-10/+10
The UL and DL TBF use different classes implementing window management. Hence it's better to use it explicitly instead of using the common window management superclass inside common TBF superclass. While at it, also remove the direct access to window class - use accessor functions instead. Related: OS#1759 Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6
2018-01-12Avoid code duplication in TBF testMax1-122/+75
Move repetitive checks into corresponding macros to avoid copy-pasted code. This also enables strickter checks some of which were apparently omitted while copy-pasting. This is part of preparation work to move to separate UL/DL windows. Related: OS#1759 Change-Id: If7aa72f5aa66c5e9c255542c066b5494c098aab2
2018-01-12TBF-UL: add simpler test helperMax1-4/+2
Add function to set both V_R and V_Q values to 0 which is useful for TBF test. Related: OS#1759 Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2
2018-01-04window: move encoding into functionsMax1-8/+8
* move window size encoding and writing into separate functions * introduce necessary TBF wrappers to avoid direct m_window access This is part of preparation work to move to separate UL/DL windows. Related: OS#1759 Change-Id: I60184d5049bc7d7b119df5a9eb82d1c4b788c840
2018-01-04TBF-DL: mark rcvd_dl_ack() parameters as booleanMax1-6/+6
The final(_ack) parameter of rcvd_dl_ack() only used as boolean - mark it as such. Change-Id: Icc4d68f049a45d4b42c5594f50594ff0d44c1bac
2017-12-20TBF: implement independent T31xx timersMax1-2/+2
Previously TBF got single timer so the pending timer was automatically cancelled when new one was scheduled. Let's make it more robust by implementing independent T31 xx timers from 3GPP TS 44.060 §13.2 with corresponding start/stop functions and counters. The semantics of the timers is preserved as before: pending timers are restarted unconditionally. It might be neecessary to change this later on after spec review. N. B. T0: used for assign/reject timeouts, have to be properly attributed and documented first. Change-Id: I0305873ca47534f53441247217881da59625e1f7 Related: OS#2407
2017-12-20Introduce LOGTBF* for consistent loggingMax1-875/+875
When troubleshooting complex issues with TBF lifecycle, it's much easier to follow the logs which are consistently formatted. Add LOGTBF*() macro similar to struct-specific log routines we use in other Osmocom project and use it to log TBF-related messages in a unified way. Tweak test output accordingly. Related: OS#2407 Change-Id: I388249afefc32d2f6e5cb5e5abc6daf4dbd284ea
2017-12-05TBF: expand timer loggingMax1-315/+315
* log timer values * log start/stop cause * update test output as necessary This simplifies debugging issues with TBF timers. Related: OS#2407 Change-Id: Ib8e537416af9bec5d447356286f44e9e8bbf1b7a
2017-12-05TBF: fix compiler warning in testMax1-6/+3
tbf/TbfTest.cpp: In function ‘void egprs_spb_to_normal_validation(BTS*, unsigned int, unsigned int)’: tbf/TbfTest.cpp:2788:26: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context] bsn1 = (egprs2->bsn1_hi << 9) || (egprs2->bsn1_mid << 1) ~~~~~~~~~~~~~~~~~^~~~~ tbf/TbfTest.cpp:2788:53: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context] bsn1 = (egprs2->bsn1_hi << 9) || (egprs2->bsn1_mid << 1) ~~~~~~~~~~~~~~~~~~^~~~~ tbf/TbfTest.cpp:2825:26: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context] bsn2 = (egprs3->bsn1_hi << 9) || (egprs3->bsn1_mid << 1) || ~~~~~~~~~~~~~~~~~^~~~~ tbf/TbfTest.cpp:2825:53: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context] bsn2 = (egprs3->bsn1_hi << 9) || (egprs3->bsn1_mid << 1) || ~~~~~~~~~~~~~~~~~~^~~~~ tbf/TbfTest.cpp:2844:26: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context] bsn3 = (egprs2->bsn1_hi << 9) || (egprs2->bsn1_mid << 1) || ~~~~~~~~~~~~~~~~~^~~~~ tbf/TbfTest.cpp:2844:53: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context] bsn3 = (egprs2->bsn1_hi << 9) || (egprs2->bsn1_mid << 1) || ~~~~~~~~~~~~~~~~~~^~~~~ Change-Id: Idf9e5f15faa7810411ed9d68ed43cf907eea2545
2017-12-04TBF: log timer overrideMax1-211/+211
Currently TBF support only single Txxxx timer so scheduling another timer will cancel out the one which is already running. Until the proper fix is in place, let's at least log this situation as error. Note: cosmetic adjustement to test output is required - we do not report restart of the same timer twice because "restarting" assumes it anyway. Change-Id: I462464a1e6df937b72cad65d19cd48e95dc4db45 Related: OS#2407
2017-10-29tests: Don't use private version of log_info but global gprs_log_infoHarald Welte1-28/+4
There's no need for each test case to carry their own log_info and filter function. They can simply use the global gprs_log_info and configure the stderr log verbosity according to their needs. Change-Id: I8706a624e5d06e062d1198711aa197fbd0860769
2017-09-08TBF-DL: extend index check for RLC block copyMax1-0/+215
Log number of RLC blocks to copy and assert if trying to copy too many blocks. Change-Id: I01cbc26ec67400a44e9fff3f9a30d729320380f9 Fixes: CID143069
2017-08-14Simplify polling troubleshootingMax1-82/+47
* introduce enum describing poll kind and use it in set_polling() * move state change into set_polling() * move logging into set_polling() and unify output * move duplicated code into static function * adjust tests to match unified logging output Change-Id: I14074207f8bbc18b3ebd60875bb99a0a3a4b399d Related: OS#1524
2017-05-26Cleanup FN schedulingMax1-15/+1
* replace magic number with defined constant * move copy-pasted code to inline functions * remove unused code Change-Id: I6fee0714453d0c3c3f3f875f88daea2d9c477331 Related: OS#1524
2017-05-15remove pcu own bitvector implementationAlexander Couzens1-2/+2
The osmocore bitvec is exact the same, but use a pointer instead of a reference. Change-Id: Id8f797631d89aa12b6e48efb2dc153a3e2f059f7
2017-05-01tbf.cpp: use new tlli instead of old tlliAlexander Couzens1-1/+1
The old tlli might be 0x00000000. Change-Id: I2fd6fec022506e203d05e91c36ccd9e020ff816c
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
2017-02-08tests: edge, tbf: assert return valuesNeels Hofmeyr1-1/+10
Numerous calls assign a return value without asserting its value. Add assertions and thus also eliminate compiler warnings about unused values. Change-Id: I7f14198cfd747dae68b8aaa3b8d6ff7fc49ab824
2017-02-08Fix dozens of compiler warnings across the boardNeels Hofmeyr1-54/+22
Change-Id: I166109dc05d3323b92cd2a42f0c7e6009950e15d
2017-02-01cosmetic: Fix log outputPhilipp Maier1-60/+30
In BTS::rcv_rach() the log output is messed up because of a stray "\n". This commit removes that. Change-Id: I40d01c71982ad83589f070cf0047a4ae04695411
2017-01-26BTS: accept also relative frame numbers with rach requstPhilipp1-1/+4
The rach request contains a relative frame number (Fn % 42432), while BTS::rcv_rach() accepts the full frame number only. Since the BTS is always aware of the full frame number this is not a problem. But for BSC co-located PCU schemes it is a problem since the rach request only contains the relative frame number as mentioned above. The pcu continusly receives frame number updates with the GSM time indication message. It is simple to re-calculate the full frame number from that information. This patch makes BTS::rcv_rach() compatible with relative frame numbers, while not breaking the compatibility for full frame numbers Change-Id: Iaa182d8d29c6a0f5fa06064c2eb48b21b1ba2775
2017-01-24Handle packet access reject during packet resource requestaravind sirsikar3-0/+341
When Packet resource request is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I05ff25124b58905586caa0c0c37023d69724f121
2017-01-24Add test case for testing PUANsivasankari3-0/+2377
This test case is for testing generation of EGPRS PUAN. Corresponding log files .ok and .err are modified. Change-Id: I18e6d4a9e90fd6453fe14187beab27dfeae8dbe9
2017-01-23Add compression support in EGPRS PUANsivasankari1-0/+37
This adds compression of bitmap in PUAN. The compressed bitmap is used only if the number of bits in the bitmap does not fit in the message and there is a gain after compression. The algorithm is part of libosmocore and so there is dependency on the libosmocore for compilation. The algorithm is tested on integration setup by forcing compression. Change-Id: Id2eec4b5eb6da0ebd24054b541b09b700b9b40ba
2017-01-06Refactoring write_packet_ack_nack_desc_egprs to prepare for CRBB supportPravin Kumarvel1-2/+2
Change-Id: Ie5c25b6ee30f2f1b613e923c234b03a6ffe12ae2
2017-01-05Improve loggingMax1-5/+5
Add value_string describing UL and DL TBF states and use it for logging errors while freeing TBFs. Change-Id: I292ec81ab602c65ef86e6e3e85740182b63474b6
2016-12-09Sanitizer build fix for TbfTestaravind sirsikar1-0/+2
Change-Id: Ia6993fd6f89c9d9ed00ec6cb4b27953e72fa1f52
2016-12-02Add debugging log for RLC data block decodingMrinal Mishra1-0/+1
Added debugging log for RLC UL Data Block decoding for both GPRS/EGPRS cases. Change-Id: I8c197bdc4cd1330cbab0adfd188336d27682cec4
2016-11-11Handle packet access reject during EPDAN/PDAN with channel descriptionaravind sirsikar3-0/+51
When PDAN/EPDAN with channel description is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6
2016-11-09Handle Immediate assignment rejectaravind sirsikar3-26/+332
When RACH is received, PCU will generate the Immediate assignment reject message if no resources are present. The encoding is done based on section 9.1.20 of 44.018 version 11.7.0 Release 11. This patch also includes the test case to validate the generated Immediate assignment reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b
2016-11-02EGPRS: fix for EPDAN out of windowaravind sirsikar2-15/+122
Fix alignment of EPDAN outside the RLC transmit window, according to section 9.1.8.2.4 in 44.060 version 7.27.0 Release 7. The specification explains that a bit within the uncompressed bitmap whose corresponding BSN is not within the transmit window shall be ignored. Without this fix PCU was dropping the EPDAN message and not updating the status of BSNs which are inside the RLC window. This patch updates the status of the BSNs which are inside the window and ignores the remaining bits. Related: OS#1789 Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6
2016-10-30EGPRS: add test case to show EPDAN BSN out of window bugaravind sirsikar3-0/+140
This patch adds a test case test_tbf_epdan_out_of_rx_window, which expects a current bug with EPDAN for interpretation of the bitmap explained in section 9.1.8.2.4 in 44.060 version 7.27.0 Release 7. The specification explains that a bit within the uncompressed bitmap whose corresponding BSN is not within the transmit window shall be ignored. But current PCU implementation drops the EPDAN and does not update status of the BSN which are inside the window. The test's expectation is corrected along with the bug fix in a subsequent commit. Related: OS#1789 Change-Id: If32b67f5c05707155281128b776a90a1e3d587b2