aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lapd/lapd_test.ok
AgeCommit message (Collapse)AuthorFilesLines
2023-08-23Revert "lapdm: Append RSL_IE_OSMO_ABS_FRAME_NUMBER to RSLms msgs towards ↵Pau Espin Pedrol1-11/+11
upper layers" This reverts commit d981794113efef3cc1195cde82043c5c66937b11. osmo-bts is forwarding the msgbs as they come from lapdm to the RSL on the wire, which means we end up sending the osmocom-specific IEs on the wire, something which was not envisioned when adding this IE. Change-Id: I0ab0d5b545b4862e72eb1842edd07ca2e4955311 Related: OS#6142
2023-08-21lapdm: Append RSL_IE_OSMO_ABS_FRAME_NUMBER to RSLms msgs towards upper layersPau Espin Pedrol1-11/+11
This makes it possible to track GSM time in the upper layers. The existing RSL_IE_FRAME_NUMBER and RSL_IE_STARTNG_TIME cannot be used there, since those are 16bit fields containing Relative FN values. The IE needs to be added before the L3_INFO one, because user code usually assumes the msgb->l3 pointing to L3_INFO value extends until the end of the message, using msgb3_len(msg). Regarding having an extra IE at the middle, it's not a big problem since the libosmocore version submitting this commit to the upper layers is the same which will also be parsing it through rsl_tlv_parse() later on by the app. Related: OS#3626 Change-Id: Id62c18f49f270449067b25b7104eb8b47f1955ec
2020-08-27lapdm: fix SAPI-0/SAPI-3 frame prioritization on DCCHVadim Yanitskiy1-5/+5
According to 3GPP TS 44.005, section 4.2.2 "Priority": a) on DCCH, a SAPI=0 frame always has higher priority than SAPI=3; b) on ACCH, the priority arrangement is more complex: b1) if a SAPI = 3 frame is awaiting transmission, two SAPI=0 frames shall not be sent in consecutive SACCH frames; b2) on the network side (LAPDM_MODE_BTS), it must also be ensured that any SAPI=3 frame is followed by at least one SAPI=0 frame; b3) a SAPI = 0 frame may be repeated in the next SACCH period if the Repeated SACCH is supported (see 3GPP TS 44.006, section 11). We definitely need to extend our testing coverage to ensure that we implement b) correctly, but for now let's focus on DCCH: a) for DCCH, ensure that SAPI=0 frames preceed SAPI=3 ones; b) for ACCH, re-use the existing round-robin implementation. Change-Id: Ia3780bce1222b312ae2fd2d21496a4d6c5ccb6e0 Related: SYS#5047, OS#4731
2020-08-27lapd_test: add a test checking SAPI0/SAPI3 prioritizationVadim Yanitskiy1-0/+18
Recently we've encountered a situation where during MT SMS delivery, the func=SABM for SAPI=3 was sent on Downlink *before* the BTS replied with the func=UA for SAPI=0 (contetion resolution procedure, where we echo the (RR) Paging Response back to the MS). This change adds a unit test reprodicing the problem. Change-Id: Ied0f8bb683de8e37bcfa984c2877aa1cec1c0b4b Related: SYS#5047, OS#4731
2020-08-27lapd_test: fix: print all messages to stdout, not stderrVadim Yanitskiy1-0/+28
We intentionally do not match stderr output because it contains non-deterministic messages (e.g. pointer addresses), so let's make sure that all test specific messages go to stdout. Change-Id: Ia52f8e811cee9d3e1cd5fcda49a9134ccaa31f7f
2017-12-10Fix malformed Abis/RSL messages with extra L3 Information fieldPau Espin Pedrol1-1/+1
Some Abis/RSL messages such as "Release Indication" contained 3 extra bytes from an L3 Information header which should not be there according to specs in GSM 08.58 (section 8.3 "Radio link layer management messages"). Other RSL messages were affected by the same issue, except for "Establish Indication", which had already a workaround in send_rslms_dlsap. This commit fixes the issue in a generic way, removes the "Establish Indication" and fixes the test accounting for the bug, as it otherwise fails after applying the changes. Fixes: OS#1635, OS#2336 Change-Id: Ibb116214e8b1798d65a8b0917150496a3c14f344
2014-03-26gsm/lapdm: Prevent LAPD tx_queue from filling up in polling modeDaniel Willmann1-9/+5
If LAPDm receives an I-Frame while there already is an I-Frame in the tx_queue the code generates an additional RR (to acknowledge the received I-Frame). Instead, N(R) of the I-Frame in the tx_queue should be updated to ACK the data.
2014-03-26tests/lapd: Add a testcase to check for LAPDm sync issuesDaniel Willmann1-0/+62
Regression test for LAPDm recording the current state
2014-03-10ladpm: Fix msgb handling and SAPI=3 establishment delayJacob Erlbeck1-4/+4
Currently it takes 3s to establish a SAPI 3 SACCH connection with osmo-bts. This is due to the fact, that a broken SABME request is sent first and and is ignored by the MS. Then, after a T200 timeout (2s) the SABME command is sent again (this time correctly) and answered by the MS. The first SABME message is broken (it has a length field of 3 and ends with 3 bytes from the tail of the original RSL message), because of it is expected throughout lapdm.c that msg buffers containing RSL have msg->l2h == msg->data. Some abis input drivers fulfill this but IPA doesn't, thus the 3 bytes of the IPA header are still part of the msg and confuse length computation. Since internal fields of the msg are modified directly, this is difficult to see. This patch adds a new function msgb_pull_to_l3() that explicitely skips over all headers prepending L3 and therefore resets l1h and l2h. This function is then used instead of msgb_pull_l2h() which only worked correctly when msg->l2h == msg->data. In addition, code manipulating msg->tail and msg->len directly has been replaced by calls to msgb_trim(). Note that this patch does not fix all issues of this case in the LADP related code. Ticket: SYS#192 Sponsored-by: On-Waves ehf
2014-03-04lapd/test: Extend test case to test msgs having data before l2hJacob Erlbeck1-4/+4
Since e.g. the IPA input driver leaves it's specific header in front of msg->l2h, so that msg->l2h != msg->data. The lapdm code does not expect this at least in rslms_rx_rll_est_req(). This patch modifies the test program to add a dummy L1 header to generated messages (unless the test would abort when doing so). Note that the ok file reflects the current state which is not correct. Sponsored-by: On-Waves ehf
2014-03-04lapd/test: Show dequeued messagesJacob Erlbeck1-4/+14
This adds and uses a wrapper for lapdm_phsap_dequeue_prim() that prints information about the message that has been taken from the queue.
2014-01-26lapd/test: Add test case for RSL EST REQ -> LAPDJacob Erlbeck1-0/+7
This test case processes RSL establish requests for SMS (SAPI 3) on the SDCCH and the SACCH channels. The TX queues are checked after processing each message. Ticket: SYS#192 Sponsored-by: On-Waves ehf
2013-06-19lapd: The two known LAPDm issues have been addressed, update the testHolger Hans Peter Freyther1-2/+2
The issue about the wrong padding has been found when creating the testcase in commit 15f740caa3a1ef681b3a5564daf6dfccb7b1e489 but the patch to fix that was never proposed by inclusion by its author. The issue about about the establish confirm carrying data with a wrong size is still present.
2013-04-06Fix: LAPDm contention resoltion must acknowledge subsequent SABMAndreas Eversberg1-0/+3
After reception of SABM, the network responds with UA and enters the establised multiframe state. If UA is not received by mobile, the SABM is transmitted again, and the network must respond with UA again, unless it is from a different mobile. Add LAPDm collision test (contention resolution on network side).
2012-12-26lapd: Check in rslms_rx_rll() if lapdm context was initialized earlierDaniel Willmann1-0/+1
This was found while implementing handover on a sysmobts. When we receive a channel release request for a channel that was never really activated (set_lapdm_context() was not called) we segfault in lapd_recv_dlsap(). We now return early with -EINVAL in rslms_rx_rll() if we receive a message that assumes set_lapdm_context() was already called. These are: * RSL_MT_UNIT_DATA_REQ * RSL_MT_DATA_REQ * RSL_MT_SUSP_REQ * RSL_MT_REL_REQ A test case was added to trigger the issue.
2012-01-12lapdm: Make sure that the msgb_l3len(msg) == length...Holger Hans Peter Freyther1-2/+2
This code should not play with the internals of the msgb like this, this code got introduced in af48bed55607931307 and is breaking the osmo-bts usecase of forwarding an RSL message. Add a test case that fails without the new code. I would prefer if we could get rid of the manipulating the msgb like this, it is prone to errors like this one.
2011-12-12lapd_test: Look at the content of LAPD messages and compare themHolger Hans Peter Freyther1-0/+4
Verify the output, accept two known errors in the generation of it.
2011-12-11lapdm: Create a simple test case to transmit data between both ends0.4.1Holger Hans Peter Freyther1-0/+16
This is testing the establishment of two ends (BTS, MS) one is in the polling mode as used by osmo-bts. Transfer data between the two ends. The sent data is not verified though. This should be followed up soon.