aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)AuthorFilesLines
2017-10-29tests: Don't use private version of log_info but global gprs_log_infoHarald Welte6-119/+15
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-12TS alloc: properly count UL slotsMax1-0/+4
Add cycle to mark multiple allocated UL slots similar to the way we count DL slots in AllocTest. Until multislot UL allocation is implemented it does not affect test output. Change-Id: I2705405119421da3066c6c6bdd5830df4c133a36 Related: OS#2282
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-06-22tests: remove unused definitionMax1-16/+0
Fix compilation warning. Change-Id: I1c95c6ec8bee68773643f9646b0319a83fbc6cfa
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 Couzens3-14/+16
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-03-27bitcomp test: use expected rc instead of 'verify' flagNeels Hofmeyr2-41/+51
The 'verify' flag is useless, we always want to verify everything. Replace 'verify' with 'expect_rc', expecting a specific decoding result per test set. When an error code was returned, cut short the loop and skip printing expected vs. decoded bits. This uncovers the fact that the first test marked as "invalid inputs" does not seem to be invalid after all, or at least does not produce an error to be returned. For now, only uncover this fact, the fix shall be submitted later. Change-Id: Icf815a8f1acb0e275463408450171df046879847
2017-03-27bitcomp test: fix: also verify bits after decoded dataNeels Hofmeyr2-16/+5
Before this, the expected data had seemingly random bits set after the end of the expected decoding result. Make the test expect these extra bits as zero, matching with the buffer initialization to zero. In result_matches(), compare the full length of bytes instead of masking the bits after the end of the decoded data (which caused us to not catch the wrong expectation until now). This fixes the underlying issues found in http://lists.osmocom.org/pipermail/osmocom-net-gprs/2017-March/000876.html [osmo-pcu 0.2.896-0a8f] testsuite: 4 failed from: Arnaud ZANETTI on: Fri Mar 24 09:53:53 UTC 2017 Change-Id: I2501208e2f8b4f709efbcadbd1057c086472c9e6
2017-03-27bitcomp test: fix: only one hexdump per log; use printfNeels Hofmeyr2-19/+17
The test wants to write multiline results, so it should use printf instead of the logging system. Split logs to only one hexdump per printf(). One cannot use osmo_hexdump twice in one printf(); before this, one of the two hexdumps won, both dumps would show as the same. Very bad for a regression test! This uncovers a discrepancy between expected and produced results, proving that the expected stderr output was not capable of uncovering test failures. The test's check_result() function *has* always verified the decoded data, but only up to the last decoded bit. Our expected data contains seemingly random bits after the end of the decoded bits, but check_result() never compares those, hence we don't catch that error. The extra bits should definitely be zero, because the destination buffer is pre-initialized to zero -- fixed in a subsequent patch. This should cosmetically fix the build failure found in: http://lists.osmocom.org/pipermail/osmocom-net-gprs/2017-March/000876.html [osmo-pcu 0.2.896-0a8f] testsuite: 4 failed from: Arnaud ZANETTI on: Fri Mar 24 09:53:53 UTC 2017 The real fix will follow. Change-Id: I24fc32eb55baaf22f9c6fdda917bfb8395d02b1c
2017-03-27cosmetic: BitcompTest: make readableNeels Hofmeyr1-37/+45
In order to understand what the bitcomp test is logging, cosmetically rearrange the code: - memset bits_data before assigning to destination bitvec. - use macro CEIL_DIV_8 to clarify what (x+7)/8 does. - rename check_result() to result_matches() and return a bool, also constify result_matches() args and pass a bitvec reference instead of copying the bitvec struct. - rearrange logging lines to make readable what is going on there. - drop unused 'init_flag' There are obviously errors like double hexdumps per log line, multiple newlines in a LOGP statement and so forth: these shall be fixed by subsequent patches. Change-Id: Id0da9d9b67f4713d3a67e3532ed44b8cb1bd1d08
2017-03-13tests: include headers from include/Max1-1/+1
In addition to .h files from src/ add include/ as well: some headers are now public and reside in separate directory. Change-Id: I09c02a171fb3b2f2791ce938725db7d4ff397e95
2017-03-05BTS: Convert relative frame numbers to absolute frame numbersPhilipp Maier4-2/+242
The implementation of the method rcv_rach() in class BTS, restores the absolute frame number of the incoming RACH-Request by using the relative frame number (RFn = Fn mod 42432) from the rach request and the already known internal absolute frame number m_cur_fn, which is continusly updated by the CCU interface. In some rare cases, a RACH request might be received by the BTS, a very short time before the frame number wraps in its 42432. Depending on the PCU location, RACH request might be received by the BSC, which forwards it to the PCU. It is then likely that, while the RACH request is being forwarded to the PCU, the PCU internal absolute frame number wraps before the RACH can be processed. The relative frame number from the rach request would then be interpreted as if it were received after the wrapping of the internal frame number modulos. This commit adds logic to detect and resolve this race condition. Also a unit test is added to check some cornercases. Change-Id: I74f00c11e5739d49f370ce6c357149e81d9aa759
2017-02-08main, tests: use msgb_talloc_ctx_init() (new)Neels Hofmeyr5-5/+5
msgb_set_talloc_ctx() is deprecated since libosmocore commit f45334be29016a36594aacc07c90e262e4994525 / change-id I747fbbf977c4d2c868c8dead64cfc5fd86eb8d4c Change-Id: I8d40abec428b739460ed545c9983d1b63021bd08
2017-02-08tests: edge, tbf: assert return valuesNeels Hofmeyr2-1/+16
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 Hofmeyr5-77/+34
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 sirsikar5-26/+371
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
2016-10-18Revert "tbf: Add state WAIT_ASSIGN"Neels Hofmeyr2-168/+125
This reverts commit f1a7b8fc6651f92a8b7f3f27b7ca05d07f4e44e0. Conflicts: tests/tbf/TbfTest.err The commit broke GPRS service at least for osmo-bts-sysmo on a SysmoBTS 1002 with current master of osmo-bts (ef30f50d5d6d5f863fc147d05ccdceb89284934e). The error observed is the following log output (was viewing both osmo-bts-sysmo and osmo-pcu logs interleaved): <0002> tbf.cpp:874 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN) T3169 timeout during transsmission <0002> tbf.cpp:893 - Assignment was on CCCH <0002> tbf.cpp:899 - No uplink data received yet <0007> l1sap.c:904 RACH for packet access <0001> pcu_l1_if.cpp:311 RACH request received: sapi=1 qta=0, ra=121, fn=13653 [repeat] When removing this single commit from current osmo-pcu master, GPRS service works well on SysmoBTS, with current osmo-bts master. The TbfTest.err expected output needed adjustment after the revert. Disclaimer: I am not aware of adverse effects this commit may have. I have no idea what the WAIT_ASSIGN state is used for -- further review is required. Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd
2016-10-17EGPRS: Add EPDAN CRBB Tree based decodingPravin Kumarvel5-1/+384
Implemented tree based algorithm to decode compressed bitmap in EPDAN as described in section 9.1.10 of 3GPP 44.060. This algorithm intends to improve the performance over existing method. New Regression test is added under bitcomp directory. Test case is added to validate decompressed result of the bitmap Present in EPDAN. Test is done for multiple bitmaps of varying length. Invalid inputs are also part of the test vector. Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce
2016-09-15Fix EGPRS DL window calculation during tbf updateAravind Sirsikar2-6/+4
Earlier there was no handling for recalculation of DL window size during tbf update. Which has been fixed in this patch. Related: OS#1808 Change-Id: I41aa807068520460fd665a55e3529e60f6bbb630
2016-09-15EGPRS: Fix issue with row 4 of Table 10.4.14a.1 of 44.060 version 7.27.0 ↵Aravind Sirsikar3-20/+12
Release 7 row 4 of Table 10.4.14a.1 of Spec 44.060 version 7.27.0 Release 7. Says "The previous RLC data block contains a Upper Layer PDU, or a part of it, that fills precisely the previous data block and for which there is no length indicator in that RLC data block. The current RLC data block contains a Upper Layer PDU that either fills the current RLC data block precisely or continues in the next RLC data block." So when we receive block with 1st LI: value=0 and Value of E bit in the same octet as 1, we expect 2 chunks with 1st chunk as length as 0 and complete and 2nd chunk as length non zero. But with this bug we see only 1 chunk causing incorrect assembling This issue has been fixed in this patch. Related: OS#1811 Change-Id: I2cd0fca3ed28a553ede3f4b8a7d3267284dd2c9b
2016-09-15EGPRS: add test case to show LI decoding bugAravind Sirsikar4-0/+289
This patch adds a test case test_tbf_li_decoding which expects a current bug with LI decoding for row 4 of Table 10.4.14a.1 in 44.060 version 7.27.0 Release 7. The test's expectation is corrected along with the bug fix in a subsequent commit Related: OS#1811 Change-Id: Ida410dab1aa4b0cf3e15b2090586377eb19b2469
2016-09-14DL TS allocation: add test case to show TS allocation bug for 2nd DL TBFAravind Sirsikar2-0/+54
This patch adds a test case test_2_consecutive_dl_tbfs which expects a current bug with TS allocation for 2nd DL TBF. The test's expectation is corrected along with the bug fix in a subsequent commit Related: OS#1792 Change-Id: I890e4fbb2b64037e051433e70082a197e2a929a6
2016-09-14Fix CSN1 decoding: CSN_LEFT_ALIGNED_VAR_BMP boundsNeels Hofmeyr1-6/+1
Fix attempted read past vector boundaries in case of a starting bit offset != 0, so that the last amount of bits read should be < 8. In the case of CSN_LEFT_ALIGNED_VAR_BMP, the mod-8 calculation was flawed, and in the final step, 8 bits were read instead of the remainder < 8. This lead to -EINVAL being returned by bitvec_get_bit_pos() and bogus resulting data. Instead, read 8 bits only as long as at least 8 bits remain, and read any remaining bits < 8 in a final step. Drop unneeded nB1 variable and an obvious comment. Adjust the unit test assertion in testCsnLeftAlignedVarBmpBounds() in RLCMACTest.cpp. Based on a fix by Aravind Sirsikar <Arvind.Sirsikar@radisys.com>, but implemented differently. Related: OS#1805 Change-Id: I490498c8da6b531f54acb673379379f7b10907c0
2016-09-14CSN1 decoding: add test to show bug in CSN_LEFT_ALIGNED_VAR_BMPAravind Sirsikar1-1/+22
CSN1 decoding currently contains an attempted read past vector boundaries in case of a starting bit offset != 0, so that the last amount of bits read should be < 8. In the case of CSN_LEFT_ALIGNED_VAR_BMP, the mod-8 calculation is flawed, and in what should be the final step of reading n < 8 bits, 8 bits are read instead of n (with an extraneous read of n bits following after that). This leads to -EINVAL being returned by bitvec_get_bit_pos() and bogus resulting data. Add testCsnLeftAlignedVarBmpBounds() in RLCMACTest.cpp to show and expect this bug. The test's expectation shall be corrected along with the bug fix in a subsequent commit. Related: OS#1805 Tweaked-by: Neels Hofmeyr <nhofmeyr@sysmocom.de> Change-Id: I4641f5d1d49f66cb1a5cd813befb3a2a266001b0
2016-09-12TBF flow: unit test compilation error fixAravind Sirsikar1-35/+39
The test failure was introduced by 9bbe1600cc02e1b538380393edb1dcdabe9247a2 "Fix Timing Advance handling": between patch build checking and patch submission, a new section was added to TbfTest.cpp which also needs adjustment. Tweaked-by: Neels Hofmeyr <nhofmeyr@sysmocom.de> Change-Id: If077da5f21fd5cba54556f1dead05a1bc4ea5540
2016-09-09Fix Timing Advance handlingMax2-76/+100
* initialize with invalid TA instead of making assumption that phone is located within 550 meters (TA=0) * only set valid TA Change-Id: Idfc40ff0c11bdac13d9e28fbfa4e95dfc6b735b0 Related: OS#1526
2016-09-02Fix GPRS PUAN encoding: wrong BSN statusAravind Sirsikar1-3/+2
Earlier there was an incorrect encoding of BSN status in GPRS PUAN message. This was a bottle neck for GPRS performance testing for UL. Which has been fixed in this patch. Related: OS#1806 Change-Id: I98e586aa5cb9200cf03e092556304211d4d459aa
2016-09-02GPRS: PUAN encoding: add test case to show wrong BSNs statusAravind Sirsikar1-0/+18
This patch adds a test case which expects a current bug with GPRS PUAN encoding. The test's expectation is corrected along with the bug fix in a subsequent commit Related: OS#1806 Change-Id: Ied0f1dd3037d8fac6a772f4e097defb72634f955
2016-08-30DL: add test case to show wrong window sizeAravind Sirsikar3-0/+111
This patch adds a test case test_tbf_update_ws. Which expects a current bug with DL window size calculation. The test's expectation is corrected along with the bug fix in a subsequent commit Related: OS#1808 Change-Id: I4659494c6f93ae89e4cc4ac79fff5fcaf2d23699
2016-08-28TBF flow: unit test compilation error fixAravind Sirsikar1-1/+1
Change-Id: I89638ba908e7d9964a5525061ce0cf26049be438
2016-08-27Change interface in osmo-pcu for 11 bit RACHbhargava1-4/+5
Interface structure between osmo-bts and osmo-pcu is updated with the parameters to differentiate the type of RACH and further support 11 bit RACH. The function prototype and definitions are changed accordingly. Interface version number is increased. Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4
2016-08-25Fix EGPRS PUAN encoding: use correct urbb_lenAravind Sirsikar2-4/+3
Earlier there was an incorrect encoding of PUAN when VQ is not equal VR case for EGPRS UL RLC window. The PCU was encoding the same PUAN message always irrespective of radio condition. This was a bottle neck for performance testing. Which has been fixed in this patch. Related: OS#1793 unit test assertion in the previous commit is fixed in this patch. Change-Id: Iba7b1995028bd81749ffb080616b2ad5f2540d57
2016-08-25EGPRS: PUAN encoding: add test case to show wrong urbb_len issueAravind Sirsikar3-0/+304
This patch adds a test case which expects a current bug with EGPRS PUAN encoding when VQ != VR. The test's expectation is corrected along with the bugfix in a subsequent commit Adds test_tbf_puan_urbb_len to describe the following bug: EGPRS PUAN encoding disregards the urbb_len, leading to identical PUAN messages regardless of the urbb_len. Related: OS#1793 Change-Id: I00662a564f64c0c83627401ae8f7bfef0f0a5de8
2016-08-25Modify EGPRS DL TBF flow to support SPBAravind Sirsikar4-32/+707
Modify the EGPRS DL TBF flow to support Split block during Retx. This patch will also Upgrade the test suite with test cases to validate the EGPRS Downlink SPB for Retransmission Scenarios like MCS6->MCS3, MCS4->MCS1, MCS5->MCS2, MCS9->MCS3 MCS7->MCS2, MCS8->MCS3 have been simulated and Integration tested in NuRAN 1.0 hardware thoroughly. Change-Id: I242afdd8ae7622dec8593b26382ad66bad5b9516
2016-08-02Add support for SPB handling for EGPRS UL TBFAravind Sirsikar3-1/+747
This patch will modify the EGPRS UL TBF flow to support Split block handling. This patch also contains test suite modification for SPB UL. Scenarios like MCS6->MCS3, MCS4->MCS1, MCS5->MCS2, MCS9->MCS3 MCS7->MCS2, MCS8->MCS3 have been simulated and Integration tested in NuRAN 1.0 hardware thoroughly. The scope of Unit testing is limited. Change-Id: I39ca53218b6e0982abc2ab9c703c24c8bf0a09c0
2016-07-26Remove useless ARFCN parameterMax1-5/+5
ARFCN is already part of TRX struct so there's no need to supply it explicitly in a separate parameter. I've tested and those are the same anyway. Change-Id: I8e975c52cbc819427880093b1e5371fe1f8ce460