path: root/library
AgeCommit message (Collapse)AuthorFilesLines
48 hourslibrary/GSM_RestOctets: initial SI2quater Rest Octets definitionHEADmasterVadim Yanitskiy1-0/+505
This is a very minimalistic (incomplete) implementation of SI2quater Rest Octets as per 3GPP TS 44.018, table Should be enough to decode some of the E-UTRAN specific parameters though. Some BITn fields might need to be replaced with more specific enumerated or integer types. Beware [1], the bit ordering rules are different for integer and bitstring (sub-)types if a field ends up on boundary of the two octets! [1] Change-Id: I6a12c9ee12f8df8b4fc0976dd593152dc1195718 Related: SYS#4870
5 daysfixup for Osmocom_CTRL_Functions: rate counters in bulkNeels Hofmeyr1-8/+6
At the time of writing Ief0d9b096feeee7d37b5f2429dd3e80de0161806 I wasn't aware of the 'inout' keyword, which allows to pass the counter list by reference. Rather modify the counter lists in-place. Instead of requiring list := f_counter_name_vals_add(list, ...) rather implement by directly modifying list: f_counter_name_vals_add(list, ...) Change-Id: I85ac56b042fe4bb1db392c1f451c8e900582cc2a
9 daysOsmocom_CTRL_Functions: add: retrieve and verify rate counters in bulkNeels Hofmeyr1-0/+123
First user will be new MSC pooling tests in ttcn3-bsc-test, see I2006f1def5352b4b73d0159bfcaa2da9c64bfe3f. Change-Id: Ief0d9b096feeee7d37b5f2429dd3e80de0161806
10 dayslibrary/RSL: pass lost link event to upper layers instead of failingPau Espin Pedrol1-5/+24
Some tests may expect that behavior so let the test decide what to do with it. Change-Id: Idd4bdfc99514f4c439837f0ce4a20ec5ff45e86c
11 daysbsc: Add CommonID Test: Send CommonID from MSC and check it is processedHarald Welte1-0/+25
Related: OS#2969 Change-Id: I501108bc6c19b17d3fc680211c7290a31770a159
12 dayslibrary/RSL: fix trailing whitespacePau Espin Pedrol1-2/+2
Change-Id: I84b23fef3a75dcd6d86855408adcb41142da3407
13 dayslibrary/RSL_Emulation: implement waiting queue for DChan messagesVadim Yanitskiy1-1/+75
Since change [1] has been merged, we see multiple regressions in ttcn3-bsc-test (all LCLS test cases) and ttcn3-bsc-test-sccplite (sporadic failures). In all failed cases, the reason is similar: RSL for unknown Dchan BSC_Tests.ttcn:4501 BSC_Tests control part BSC_Tests.ttcn:2176 TC_assignment_codec_fr testcase The mentioned change enables TCP_NODELAY option for all IPA based connections, including both OML and RSL. This option disables Nagle's algorithm [2], so we get less delays on IPA based links. It took me a lot of time to investigate, and finally, I figured out what is actually causing those regressions. The TCP_NODELAY itself is not a problem, of course. As it turned out, the problem is here, in our TTCN-3 test case framework. Each test case involves several components (actors) running in parallel. One of them is RSL_Emulation_CT, which is responsible for handling and routing of RSL messages between the connected components. A test case may register dedicated channel handlers by calling f_rslem_register(), so DCHAN/RLL/IPACCESS messages will be matched by RslChannelNr/TrxNr and routed to the corresponding one. If no handler is found for a given RSL message, the RSL_Emulation_CT would abort the test case execution. And that's where the problem is. Given that all components are running in parallel, it may happen that a received RSL message would be processed by the RSL emulation component faster than the test case would call f_rslem_register(). The test case would be aborted due to "RSL for unknown Dchan". Speaking in context of the failing BSC test cases, a test case calls f_rslem_register() on receipt of an Assignment Command as it contains all the assignment parameters. After that we expect to receive an RSL ip.access CRCX for that channel. The problem is that both Assignment Command and ip.access CRCX messages are sent by the BSC simultaneously, so the later may be handled faster than the first one. Race condition! Let's work this around by maintaining a waiting queue, where the messages, for which no handler was found, will be kept until the corresponding dedicated channel is registered. This is an optional feature that needs to be enabled explicitly by calling f_rslem_dchan_queue_enable(), and then explicitly disabled by calling f_rslem_dchan_queue_disable(). If at the moment of calling f_rslem_dchan_queue_disable() the waiting queue is not empty, e.g. because the IUT sent us more messages than we expected, test execution will be terminated. The actial fix for the LCLS test cases will be submitted next. [1] Ia3d4c41bf0659e682f0b7ae5f3d58ed0f28edb58 [2] Change-Id: I25e10e28de174337233e6a3bb32cc16f2d7d614e Related: OS#4619
13 dayslibrary/RSL_Emulation: fix comment near f_rslem_suspend()Vadim Yanitskiy1-1/+1
Change-Id: If6487065329a4fc44275999de1972f76ded06562
2020-06-20RAN_Emulation: drop unused function f_bssap_wait_for_reset()Neels Hofmeyr1-22/+0
Change-Id: I9ecf4fdeaee8e5437427564ef860c9053ffa4241
2020-06-18bsc: add MSC pooling testsNeels Hofmeyr1-0/+72
The MSC pooling feature is implemented in osmo-bsc Ifbdea197b26e88751a391c8a80c41f04e7d5e047. A VTY command ('mscpool roundrobin next') that allows deterministic testing is added in I2155d906505a26744966f442ffb1e87a6a9b494c. osmo-bsc.cfg changes needed for these tests to succeed are in docker-playground I1986e4ef43beee161c82193694421b56136c1afe The new tests will fail until the above have been merged. Change-Id: I21cbab193cd0de2e5692665442eae113d5f61904
2020-06-18Osmocom_Gb_Types: tr_BSSGP_PS_PAGING should use template argumentsHarald Welte1-1/+1
Change-Id: I7d0110e6f26fd407e11b2c60d78f4cd16f0d45af
2020-06-17RAN_Emulation: allow sending UnitData from MSC_ConnHdlrNeels Hofmeyr1-0/+6
Add BSSAP_N_UNITDATA_req to RAN_Conn_PT, so that we are able to send a Paging from a test function that runs on MSC_ConnHdlr. This will be needed by upcoming MSC pool tests, see I21cbab193cd0de2e5692665442eae113d5f61904. Change-Id: I36d486db05169b0fc3f19112b5a9008248d62930
2020-06-17RSL_Emulation: fix rx of tr_RSL_PAGING_CMD()Neels Hofmeyr1-1/+1
For tr_RSL_PAGING_CMD, also check comp_ref against null. Upon receiving a tr_RSL_PAGING_CMD, the code tries to dispatch the Paging Command to all valid clients. However, the ConnectionTable[*].comp_ref is *always* present, and actually null for unconnected clients. So, before this patch, a Paging Command from osmo-bsc gets sent to a null client, which disconnects the RSL emulation and aborts the test. There is currently no test using this, but the upcoming MSC pool tests will: see I21cbab193cd0de2e5692665442eae113d5f61904. Change-Id: Iaf7730153a3a19e448a33298c3e12212a55929d5
2020-06-16library/RSL_Types: fix RSL_IE_BS_Power: Power Level is 4 bit longVadim Yanitskiy1-4/+4
Unlike the RSL_IE_MS_Power, where power_level is 5 bit long, in the RSL_IE_BS_Power it's 4 bit long. Fix this. Change-Id: Ic0cb2275ef585754b9ae5e3d8077ca652afd9365
2020-06-14move type RAN_Configurations to RAN_Adapter.ttcnppNeels Hofmeyr1-0/+1
So far used only in MSC_Tests.ttcn, but soon to be used also in BSC_Tests.ttcn. Change-Id: If8f7fd50a88302af645ab337a907d8f0ad79a306
2020-06-14fix f_enc_IMEI_L3() oddevenIndicatorNeels Hofmeyr1-5/+14
f_gen_imei() calls f_enc_IMEI_L3() with a 14 digits argument, but the IMEI_L3 template used is hardcoded to 15 digits. So the oddevenIndicator must always indicate odd, not depend on the digits argument. f_gen_imei() should probably also compose a Luhn checksum, leaving that to another patch. Found by using the new osmo_mobile_identity API in osmo-msc, which is stricter about odd/even and filler digits than our previous implementations. See osmo-msc Idfc8e576e10756aeaacf5569f6178068313eb7ea . Change-Id: Iaa9ba1214c4c15fd9620e68fe2e842fdf52912c0
2020-06-09library/RSL_Emulation: optional IPA stream ID patchingVadim Yanitskiy1-0/+25
Unfortunately, the latest release of osmo-bts still has a bug, that has been fixed [1] in the recent master. Because of that, most of the test cases in ttcn3-bts-test-latest currently fail. The problem is that all transceivers use IPAC_PROTO_RSL_TRX0, regardless of what the BSC tells them to use. Let's work this around by patching IPA stream ID in ASP_RSL_Unitdata messages coming from the IPA emulation. [1] I5927f59a49724170a63e87be604973f7c9d5d8be Change-Id: I66cecc9ea24ba79e1a03492e3fda2874951d37a0
2020-06-05library/RSL_Emulation: cosmetic: improve logging messagesVadim Yanitskiy1-4/+4
Change-Id: Iefb6bc96e57822e216f8d8480337e6b4afc4d892
2020-05-29library/L1CTL_PortType: f_L1CTL_DM_EST_REQ_IA(): handle hopping paramsVadim Yanitskiy1-4/+21
Change-Id: I8c14fee3ec8f7a799469c681b5afe79ab74a5dfc Related: OS#4546
2020-05-29library/L1CTL_Types: introduce ts_L1CTL_DM_EST_REQ_H1Vadim Yanitskiy1-0/+23
Change-Id: Ie236c48a906679a5f46346ac7cbaf5866fd8befc Related: OS#4546
2020-05-29library/L1CTL_Types: fix definition of L1ctlH1 (hopping parameters)Vadim Yanitskiy1-3/+13
Change-Id: I87555de751e6e4af6ac5fe308c3e77fa15c8bb16 Related: OS#4546
2020-05-29library/L1CTL_PortType: refactor L1CTL channel establishmentVadim Yanitskiy3-10/+20
- Get rid of f_L1CTL_DM_EST_REQ, it's not really needed. - Derive ts_L1CTL_DM_EST_REQ_H0 from ts_L1CTL_DM_EST_REQ. - Turn all its params into (value) templates. - Turn it into a (value) template itself. - Pass GsmArfcn directly to ts_L1CTL_DM_EST_REQ_H0. Change-Id: I4f275e22d4309a23b4ed301a0779c4ecb92023a8 Related: OS#4546
2020-05-28pcu: TC_mt_ping_pong: Request UL TBF on last DL ACKPau Espin Pedrol2-2/+19
Let's test the code path where UL TBF is requested through DL ACK/NACK here, since we already test the usual UL TBF through CCCH approach in most tests. rlc_mode is changed to ACKED since that's the mode we are using so far in tests. Change-Id: I5a9a2e8107c87fdbf74cc2f09ae5eeafbb13ad55
2020-05-27library/GSM_RR_Types: fix MaioHsn: add missing MAIO and HSN fieldsVadim Yanitskiy1-0/+2
Change-Id: I76a05e0ee8e46241b1d3bbc71b7ec01f193dd40e Related: OS#4546
2020-05-26library/RSL_Emulation: server mode: handle multiple transceiversVadim Yanitskiy2-5/+124
Since change [1], the IPA emulation component allows us to handle multiple IPA connections, thus multiple RSL connections. The idea is to attach a TCP/IP connection identifier to each message. On top of that, this change implements mapping between TCP/IP connection identifiers and RSL stream identifiers, so we can finally talk to any of connected transceivers (up to 4 for now), not only the last connected one (as it was before). The actual mapping is done during the IPA identification procedure. Instead of forwarding ASP_IPA_EVENT_UP to a test case, the RSL emulation component now sends a new event - RSLEM_EV_TRX_UP, with transceiver number (actually, IPA stream-id) attached. [1] I93c58c08cf296e5cea81d811650caa1a09b8a579 Change-Id: I86afb55ecc6703ce7a229aaa626223f9331a4778 Related: OS#4546
2020-05-26library/IPA_Emulation: server mode: expose IPA IDENTITY RESPONSEVadim Yanitskiy1-6/+33
Change-Id: I685c2697cdbe932572e1839420d0c74c8fa94ee2 Related: OS#4546
2020-05-26library/IPA_Emulation: server mode: also request IPA UnitIDVadim Yanitskiy1-1/+2
Change-Id: I195894d72cf40f081d286a6c0a6d2531e3d0a45c Related: OS#4546
2020-05-26library/IPA_Emulation: handle optional conn_id in ASP_RSL_UnitdataVadim Yanitskiy1-8/+19
This would allow the RSL Emulation component to maintain several transceiver connections in server mode. In order to send an RSL message to a specific transceiver, its TCP/IP connection ID needs to be included in the ASP_RSL_Unitdata message. Change-Id: I5c48d043cd746aad03e4329d9ffd2a627b640f64 Related: OS#4546
2020-05-26library/IPA_Emulation: server mode: handle multiple client connectionsVadim Yanitskiy1-41/+74
This change basically does two simple things: a) adds TCP connection identifier to ASP_IPA_Event, b) splits g_ipa_conn_id into g_self_conn_id and g_last_conn_id. Change a) would let the upper layers of code (based on the IPA emulation component) know which TCP/IP connection a given event belongs/relates to. Change b) solves the problem, happening in server mode when a new client connects, and TCP/IP connection identifier of another previously connected client gets overwritten. With this change applied, g_self_conn_id holds TCP/IP connection identifier of the client or server itself (depending on g_mode), while g_last_conn_id is only used in server mode and holds connection identifier of the last connected client. Change-Id: I93c58c08cf296e5cea81d811650caa1a09b8a579 Related: OS#4546
2020-05-26library/RSL_Emulation: fixup: handle RSL messages from any TRXVadim Yanitskiy1-8/+8
As a side effect of change [1], the RSL emulation component has stopped to handle RSL messages from transceivers other than TRX#0. Let's fix this by using template '?' for stream ID. [1] I4c4a98458cfa33512db661b5435f484a38e2ef4f Change-Id: I5ff05bbd985ddc5e39a390e4b775a16f066a53ea
2020-05-25library/RSL_Emulation: fix comments near f_cid_{create,delete}_cnr()Vadim Yanitskiy1-2/+2
Change-Id: I0fde6ea9c7e549d9cf9f6ce2a8e4e702df313b27
2020-05-25library/RSL_Emulation: use existing tr_ASP_RSL_UD templateVadim Yanitskiy1-14/+8
Change-Id: I4c4a98458cfa33512db661b5435f484a38e2ef4f
2020-05-25library/IPA_Emulation: assume TRX#0 in ASP_RSL_Unitdata templatesVadim Yanitskiy2-8/+9
Change-Id: I93297680a2644516870222c2bb8eee03c6b575a9
2020-05-25library/IPA_Emulation: cosmetic: fix template restrictionsVadim Yanitskiy1-3/+3
Change-Id: I375d1b50491ff0c848088277a86dc061be0a943b
2020-05-25library/IPA_Types: cosmetic: s/IPAC_IDTAG_UNIT/IPAC_IDTAG_UNITID/gVadim Yanitskiy2-2/+2
Change-Id: Iec9cbbea9d38813f0cd3b98fb6b252111d150220
2020-05-22library/GSM_RR_Types: add receive templates for IMM ASS RejectVadim Yanitskiy1-0/+32
Change-Id: Icece9245f4a85dcf59021a76d51d419cf1c13990
2020-05-22library/GSM_RR_Types: add IAR Rest Octets definitionVadim Yanitskiy1-1/+30
See 3GPP TS 44.018, section "IAR Rest Octets". Change-Id: Ib1f16b310d6ca94f19a1700c78cb37e8b35ac570
2020-05-22library/GSM_RR_Types: fix definition of FeatureIndicatorVadim Yanitskiy1-4/+7
Change-Id: I06ad58f25aa97bf13de87127e7e2c6237a90557e
2020-05-20 library/RLCMAC_CSN1_Types: Extend support for PacketDlAssignmentPau Espin Pedrol2-3/+72
Change-Id: I5788d9fffe768bb8ebbb3fc2d93ebf014648e9bf
2020-05-19Add initial support for Packet Uplink Ack/nack EGPRS StructPau Espin Pedrol3-15/+95
Some stuff like EGPRS Ack/Nack description is still not implemented, but it's enouh for now to be able to match against this kind of ACK blocks. Change-Id: I8066fba0e71911f0c6344c1540a501f1853daa7f
2020-05-18library/IPA: use tr_ASP_IPA_EV instead of inline templatesVadim Yanitskiy4-13/+13
This way we can easily add new parameters to ASP_IPA_Event. Change-Id: Icc37286fcb4d43836d56a26424ecb9dcba58d1f1
2020-05-18library/IPA: split t_ASP_IPA_EVT_UD into send / receive templatesVadim Yanitskiy1-9/+13
Change-Id: Ib5494bff3f9aa0ac396b729c326e7b4a64c5a5dd
2020-05-18library/IPA: rename ASP_IPA_EventUpDown to ASP_IPA_EventTypeVadim Yanitskiy1-3/+3
The old name was a bit confusing, because this enumerated type also contains ASP_IPA_EVENT_ID_ACK, among with UP/DOWN events. Change-Id: I8f73a64de40d1c8e9b7f43f538d6b59dcede065f
2020-05-17pcu: Introduce TC_mo_ping_pong_with_ul_racap_egprs_onlyPau Espin Pedrol1-0/+40
Change-Id: I396dbd0ca200fbf9365c534f4d479f903d0417ff
2020-05-15pcu: Support decoding Egprs Pkt Ul Ass on PDCHPau Espin Pedrol3-17/+127
Change-Id: I30fb98aab67303997b803a0359ffc2e0b65ebf01
2020-05-15Move some types from GSM_RR_Types.ttcn to RLCMAC_CSN1_Types.ttcnPau Espin Pedrol2-61/+56
Some types already available in GSM_RR_Types.ttcn will also be required by messages sent over PDCH and which belong to RLCMAC_CSN1_Types. Since GSM_RR_Types.ttcn already requires RLCMAC_CSN1_Types.ttcn, let's move them there so they can be used in both places. Change-Id: Iccaaa2743dc44a36046c19d4d4ff882dc02fb479
2020-05-15pcu: use correct RA type to properly test 2phase accessPau Espin Pedrol2-0/+43
Old code was not setting Single Block Packet Access type, and 2phase access was not properly triggered. Once it's triggered, message flow changes quite a lot from the 1phase access, specially because the 2nd Ul Assignment arrives through PDCH instead of CCCH, which means a different record is received and hence code for 1phase cannot be easily re-used. For similar reasons, f_tx_rlcmac_ul_n_blocks() is modified to receive the only required tfi param instead of a full dl_block. Some functions are also extended to support SingleBlock Allocation instead of usual DynamicAllocation. Change-Id: If636a4898dfa175fdbd6baf04f7f2c955a9c525d
2020-05-11hlr: add tests for GSUP proxy routingNeels Hofmeyr1-31/+121
GSUP proxy routing, as it is implemented in an upcoming osmo-hlr patch, requires that osmo-hlr returns a received Source Name IE back as Destination Name IE. Add tests for these, for various situations. These tests pass since GSUP request handling with request->response association was introduced to osmo-hlr in I179ebb0385b5b355f4740e14d43be97bf93622e3. Implement this by adding a source_name to the g_pars, which should be sent out in ts_GSUP_* to osmo-hlr, and expected back as destination_name in returned messages. Add source_name and destination_name to various templates, with default := omit. Add f_gen_ts_ies() and f_gen_tr_ies() to compose expected IEs more generically. Change-Id: I3728776d862c5e5fa7628ca28d74c1ef247459fa
2020-05-10PCU: refactor and simplify f_rx_rlcmac_dl_block_exp_data()Vadim Yanitskiy1-0/+3
This function was written in a way that it tries to do as many different (but related) things as possible: a) send an RTS.req to the IUT, expect a DATA.ind in return, b) decode RLC/MAC message contained in the received DATA.ind, c) make sure that it's either GPRS or EGPRS data block, d) calculate the last TDMA frame number of RRBP using f_rrbp_ack_fn() regardless of its validity, e) make sure that the block contains a given LLC payload. Everything is ok except point d). The problem is that this is only the case for the first block of RRBP, and not applicable to the rest having 'rrbp_valid' flag unset. Furthermore, this function did not match GPRS DL blocks with 'rrbp_valid' flag unset, for some odd reason. Let's move RRBP calculation into a separate function called f_dl_block_ack_fn() and return TDMA frame number of the received DATA.ind message instead. Among with that, there are more little changes: - simplify matching of (E)GPRS DL data blocks, - use 'in' qualifier in parameter list where possible, - turn parameter 'data' into a template (present). Change-Id: I1528408b4399d0a149a23961805277eaab90d407 Signed-off-by: Vadim Yanitskiy <>
2020-05-10library: enrich tr_RLCMAC_DATA_RRBP, rename to tr_RLCMAC_DATA_GPRSVadim Yanitskiy1-4/+6
Let's make this template more flexible, so it can be used to match any GPRS DL data blocks, not only those with rrbp_valid == true. Note that behavior of f_rx_rlcmac_dl_block_exp_data() is intentionally left unchanged, and will be fixed later. Change-Id: I3940216368cdbb58fe89420675d1d8d5f5e49b05 Signed-off-by: Vadim Yanitskiy <>