Commit Graph

829 Commits

Author SHA1 Message Date
Neels Hofmeyr 7944004f28 bsc CBSP: add log context for CBSP port errors
Change-Id: Ifd90e84ee65d0cb03eefc7ae1da2605650daf7ac
2020-07-29 20:03:50 +00:00
Vadim Yanitskiy e2a6fdf304 fixup library/GSM_RR_Types: fix BYTEORDER in MobileAllocation
The following bitstring in TITAN:

   0                 N    // N = NF - 1
  -------------------->
   0001 1011 1110 0100    // '0001101111100100'B

needs to be be encoded as follows 'on the wire':

   N                 0    // N = NF - 1
  <--------------------
   0010 0111 1101 1000    // '0010011111011000'B

so it basically gets inversed => we need to use BYTEORDER(first).

Change-Id: Iea2e3a9a7a0557d1ab5d935877d2161ee0988077
Fixes: I70b1baf01859d0cf3b8cec1aed04d73fc097a9b1
Related: SYS#4868, OS#4547
2020-07-23 04:53:16 +07:00
Vadim Yanitskiy 06c416125e library/RLCMAC_CSN1_Types: fix length field in GprsMobileAllication
- Length of field 'MA_BITMAP' is specified in bits, not bytes;
  - The value range of field MA_LENGTH is 0..63, therefore:
    - value  0 means that field 'MA_BITMAP' is  1 bit long,
    - value  1 means that field 'MA_BITMAP' is  2 bits long,
    - value 63 means that field 'MA_BITMAP' is 64 bits long.

Change-Id: Iec19da18637febfa15bc09175bc51504c721c42f
Related: SYS#4868, OS#4547
2020-07-23 04:50:59 +07:00
Vadim Yanitskiy 9fa1db5572 library/RLCMAC_CSN1_Types: fix byte/bit order in GprsMobileAllication
According to 3GPP TS 44.060, table 12.10a.2, given that the number
of bit positions in MA_BITMAP equals NF, the first bit position
in MA_BITMAP corresponds to ARFCN_INDEX = NF-1, the last position
corresponds to ARFCN_INDEX = 0.

To put differently, the following bitstring in TITAN:

   0                 N    // N = NF - 1
  -------------------->
   0001 1011 1110 0100    // '0001101111100100'B

needs to be be encoded as follows 'on the wire':

   N                 0    // N = NF - 1
  <--------------------
   0010 0111 1101 1000    // '0010011111011000'B

so it basically gets inversed.  Let's add both BYTEORDER and
BITORDER attributes to achieve that.

Change-Id: I8f2c8c7b234605523a4fd518210b45ea3c088ff6
Related: SYS#4868, OS#4547
2020-07-23 04:50:59 +07:00
Vadim Yanitskiy 41b4dd8957 library/RLCMAC_CSN1_Types: fix definition of PacketDlAssignment
- s/PacketDlAssignmentRel1999SubStruct/PktDlAssR99EGPRS/g,
  - fix Additions in Release 1999 (missing spare bit),
  - fix RLC_MODE field (it takes 1 bit, not 2),
  - fix PRESENCE(p0) attribute (defined twice).

Change-Id: I98efe66bf43853b580f38bed36487fa10a53298a
2020-07-22 14:49:41 +07:00
Vadim Yanitskiy fdbfd6eff2 library/RLCMAC_CSN1_Types: fix definition of COMPACTreducedMA
Change-Id: If16359edf5f0a270af3223522b9bf5efb14412e3
2020-07-22 14:48:33 +07:00
Vadim Yanitskiy 4728e09ce8 library/RLCMAC_CSN1_Types: fix definition of ZeroOneGamma
Change-Id: I197f300cdfe22bba1be6341381399420e38d81ad
2020-07-22 14:48:28 +07:00
Vadim Yanitskiy a01a05531c library/Osmocom_Types: add f_rnd_bitstring() and f_pad_bit()
Change-Id: I9be55f6979c8ce1cbf5b2ef317c998ae30488e0e
2020-07-21 16:14:20 +00:00
Vadim Yanitskiy c227ea93ae library/RLCMAC_Templates: cosmetic coding style change
Change-Id: I76931373fe9e1cf0de4263c09e36442bad7c3ce1
2020-07-21 16:14:20 +00:00
Vadim Yanitskiy f3cb4ddc86 library/RLCMAC_Templates: make ts_RLC_UL_CTRL_ACK accept a template
Change-Id: Ia71401b5c0d439eeb0dc58739ef0e68b15d4123f
2020-07-21 16:14:20 +00:00
Vadim Yanitskiy cb33c74383 library/RLCMAC_CSN1_Types: make use of 'LENGTHTO(...)+N' syntax
Thanks to LaF0rge, this syntax is now supported by TITAN.

Change-Id: I16ddc3e9f57dffba3e0f2ea80eeb63be3468da06
Related: SYS#4868, OS#4547
2020-07-21 16:14:20 +00:00
Vadim Yanitskiy c155930c22 library/PCUIF_Types: make PCUIF version configurable
When changing the PCUIF, we have to maintain backwards compatibility
with the release versions of both osmo-pcu and osmo-bts, not only
with the recent master.  In order to achieve that, let's introduce
'mp_pcuif_version', so the PCUIF version can be adjusted.

Change-Id: I3cf7f908e606b91dd2cbddc168827dd074aed052
Related: SYS#4868, OS#4547
2020-07-20 04:32:59 +07:00
Vadim Yanitskiy 3ddb3abdc0 library/GSM_RR_Types: fix bit/byte order in MobileAllocation
For more details, see 3GPP TS 44.018, figure 10.5.2.21.1.

Change-Id: I70b1baf01859d0cf3b8cec1aed04d73fc097a9b1
Related: SYS#4868, OS#4547
2020-07-20 04:32:44 +07:00
Vadim Yanitskiy cf1ed3f960 library/GSM_RR_Types: also match MobileAllocation in tr_IMM_TBF_ASS()
Change-Id: Icb13b8414d4a784eccaae2daa85232f066f92f08
2020-07-20 04:06:16 +07:00
Vadim Yanitskiy eec14f0951 BTS_Tests_LAPDm: consider frequency hopping parameters
Change-Id: Idd1ffe0ee97805b40bb5e37645aa53a9b1dc4b0a
Related: SYS#4868, OS#4546
2020-07-14 21:07:50 +07:00
Vadim Yanitskiy f7181ed9c9 library/GSM_RR_Types: share send templates for ChannelDescription
They're going to be used in other modules too, not only in BTS_Tests.
Also, take a chance to rearrange the list of arguments, so the ones
with default values are placed after mandatory ones.

Change-Id: Ia33ebf2e680f16f774a981fc33422dfe5036637f
2020-07-14 20:31:07 +07:00
Vadim Yanitskiy 5bcd91996a library/GSM_RR_Types: add ts/tr templates for MaioHsn
Change-Id: I0c5581c3d95018d808907bd2bc5e8ddd0a730bea
2020-07-14 20:31:07 +07:00
Pau Espin 630c1cf9c6 RLCMAC: Improve support of Pkt Ul AckNack messages
Change-Id: I8586248f435b1a70042ea25f633b75542bbc14aa
2020-07-14 09:49:31 +00:00
Vadim Yanitskiy cb478ec0ab library/GSM_SystemInformation: add dec_SystemInformationSafe()
Some types of System Information (mostly the Rest Octets) are not
fully implemented, so calling the generic dec_SystemInformation()
may result in a DTE.  Let's add dec_SystemInformationSafeBT() with
"prototype(backtrack)", so it would return a non-zero integer if
decoding fails.  Let's add a wrapper dec_SystemInformationSafe()
that would additionally check the RR Protocol Discriminator.

Change-Id: Id4d73e0f3347e1d4c4c77aec75b767311d662292
Related: OS#4662
2020-07-12 12:34:49 +00:00
Neels Hofmeyr ad132f286e bsc: more SI2quater EUTRAN ARFCN tests
Add more EUTRAN ARFCNs, reaching the maximum allowed amount.

Add tests with 12, 23, 42 EARFCNs, just for the sake of testing some arbitrary
numbers.

Add tests with 32 and 33 EARFCNs because before osmo-bsc
Iabeed10053ee5899b4def3509aedd25abb2410a9, only 32 EARFCNs could be stored by
osmo-bsc.

Add a test with 48 EARFCNs to verify the maximum amount of EARFCNs and maximum
amount of SI2quater multiplexes works as expected.

Add a test with 49 EARFCNs to verify the VTY error response when adding too
many EARFCNs, and showing that osmo-bsc still sends 16 SI2quater with 48
EARFCNs.

Depends: Iabeed10053ee5899b4def3509aedd25abb2410a9 (osmo-bsc)
Change-Id: I99bf9b3381812d1db6fd0757f65995bae48da776
2020-07-09 13:27:50 +00:00
Vadim Yanitskiy eacec8abb5 library/GSM_RestOctets: add SI2quater EUTRAN templates
Will be used in upcoming System Information tests.

Change-Id: I4162cc39ad351f5e96f5941116a424adc44efaa2
2020-07-08 23:12:58 +02:00
Neels Hofmeyr bb2777451a GSM_SystemInformation: add SI2quater
Change-Id: I879c37eb51ece55d79346c6bf1a4951c3f11c77e
2020-07-08 15:27:50 +00:00
Neels Hofmeyr c865573668 GSM_RestOctets: SI2quater fixup: rename "Cell List" to "Repeated Cells"
So far the naming is so that the EUTRAN_NeighborCell sounds like it reflects a
single E-ARFCN, while in fact it contains a list of E-ARFCNs. In 3GPP TS 48.018
it is more accurately named "Neighbor Cells", in plural.

There is another "list layer" that allows repeating these lists of E-ARFCNs,
which the spec names Repeated Neighbor Cells, i.e. have a list of (=repeat) the
lists of E-ARFCNs.

  Repeated Neighbor Cells = {
     // first cells list
     Neighbor Cells = {
          cell descriptions = {
                  { e_arfcn = 1, meas_bw = 3 },
                  { e_arfcn = 2, meas_bw = 3 },
                  { e_arfcn = 3, meas_bw = 3 },
          },
          prio, thresh, ...
     },
     // second cells list
     Neighbor Cells = {
          cell descriptions = {
                  { e_arfcn = 4, meas_bw = 3 },
                  { e_arfcn = 5, meas_bw = 3 },
                  { e_arfcn = 6, meas_bw = 3 },
          },
          prio, thresh, ...
     },
     ...
  }

Adjust the naming of the SI2quaterRestOctets members to more closely resemble
this structure, adopting the naming in 3GPP TS 48.018:

  EUTRAN_NeighborCell -> EUTRAN_NeighborCells
    because it is really a collection of multiple E-ARFCNs

  EUTRAN_NeighborCells -> EUTRAN_RepeatedNeighborCells
    because it is a list of E-ARFCN lists, and 3GPP TS 48.018 names it
    "Repeated Neighbor Cells".

Also rename the EUTRAN_NotAllowedCells accordingly.

Change-Id: Ib11d72c04cdb8997ec97321257fb58b2c113e790
2020-07-08 15:27:50 +00:00
Neels Hofmeyr a5f0ed2ba4 GSM_SystemInformation: use GSM_RestOctets for SI3 and SI4 rest_octets
Change-Id: I3f00dd0b4863582fc5edf08149103150b8b5e97b
2020-07-06 16:49:52 +00:00
Pau Espin 245bfcb742 pcu: Support sending with CS other than CS1 in f_ms_tx_ul_block()
Change-Id: Ibafa4246b442e7c26666eb0d37570bfbbf1dbda7
2020-07-06 12:50:01 +00:00
Pau Espin 05b6c178fc pcu: Introduce test TC_ul_flow_multiple_llc_blocks
Related: OS#4559

Change-Id: I62f42981d31bc5c2e4c61e92bea329bd74cb2d19
2020-07-06 12:50:01 +00:00
Vadim Yanitskiy 13c26f9279 BTS_Tests: move ts_RRM_GprsSuspReq to L3_Templates.ttcn
Change-Id: Ib1aa0053cfca8ccd6ff613ab3b1c4f5afbd27534
2020-07-04 21:39:47 +07:00
Vadim Yanitskiy d5f6bfe7bd library/GSM_RestOctets: initial SI2quater Rest Octets definition
This is a very minimalistic (incomplete) implementation of SI2quater
Rest Octets as per 3GPP TS 44.018, table 10.5.2.33b.1.  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] https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488

Change-Id: I6a12c9ee12f8df8b4fc0976dd593152dc1195718
Related: SYS#4870
2020-07-03 03:30:00 +02:00
Neels Hofmeyr 9656e923bf fixup for Osmocom_CTRL_Functions: rate counters in bulk
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
2020-06-30 04:24:59 +02:00
Neels Hofmeyr 7418059a6a Osmocom_CTRL_Functions: add: retrieve and verify rate counters in bulk
First user will be new MSC pooling tests in ttcn3-bsc-test, see
I2006f1def5352b4b73d0159bfcaa2da9c64bfe3f.

Change-Id: Ief0d9b096feeee7d37b5f2429dd3e80de0161806
2020-06-25 20:13:11 +00:00
Pau Espin abcdf78892 library/RSL: pass lost link event to upper layers instead of failing
Some tests may expect that behavior so let the test decide what to do
with it.

Change-Id: Idd4bdfc99514f4c439837f0ce4a20ec5ff45e86c
2020-06-25 09:25:20 +00:00
Harald Welte eddf0e9e10 bsc: Add CommonID Test: Send CommonID from MSC and check it is processed
Related: OS#2969
Change-Id: I501108bc6c19b17d3fc680211c7290a31770a159
2020-06-23 20:08:58 +00:00
Pau Espin 709650980a library/RSL: fix trailing whitespace
Change-Id: I84b23fef3a75dcd6d86855408adcb41142da3407
2020-06-23 14:30:13 +02:00
Vadim Yanitskiy e9c0635dae library/RSL_Emulation: implement waiting queue for DChan messages
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] https://en.wikipedia.org/wiki/Nagle%27s_algorithm

Change-Id: I25e10e28de174337233e6a3bb32cc16f2d7d614e
Related: OS#4619
2020-06-21 20:46:49 +00:00
Vadim Yanitskiy a38c26595f library/RSL_Emulation: fix comment near f_rslem_suspend()
Change-Id: If6487065329a4fc44275999de1972f76ded06562
2020-06-21 20:46:49 +00:00
Neels Hofmeyr 0fbec5678d RAN_Emulation: drop unused function f_bssap_wait_for_reset()
Change-Id: I9ecf4fdeaee8e5437427564ef860c9053ffa4241
2020-06-20 21:43:21 +02:00
Neels Hofmeyr 4f11841173 bsc: add MSC pooling tests
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-18 11:54:47 +00:00
Harald Welte a36b246462 Osmocom_Gb_Types: tr_BSSGP_PS_PAGING should use template arguments
Change-Id: I7d0110e6f26fd407e11b2c60d78f4cd16f0d45af
2020-06-18 11:28:42 +00:00
Neels Hofmeyr a8264612df RAN_Emulation: allow sending UnitData from MSC_ConnHdlr
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-17 01:01:13 +02:00
Neels Hofmeyr d7eabd6ce6 RSL_Emulation: fix rx of tr_RSL_PAGING_CMD()
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-17 01:01:13 +02:00
Vadim Yanitskiy 117c176de7 library/RSL_Types: fix RSL_IE_BS_Power: Power Level is 4 bit long
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-16 01:40:24 +07:00
Neels Hofmeyr 7985aebeb3 move type RAN_Configurations to RAN_Adapter.ttcnpp
So far used only in MSC_Tests.ttcn, but soon to be used also in BSC_Tests.ttcn.

Change-Id: If8f7fd50a88302af645ab337a907d8f0ad79a306
2020-06-14 10:54:11 +00:00
Neels Hofmeyr 1661781611 fix f_enc_IMEI_L3() oddevenIndicator
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-14 10:52:48 +00:00
Vadim Yanitskiy 82af0b53d4 library/RSL_Emulation: optional IPA stream ID patching
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-09 20:28:44 +07:00
Vadim Yanitskiy f79d936b9a library/RSL_Emulation: cosmetic: improve logging messages
Change-Id: Iefb6bc96e57822e216f8d8480337e6b4afc4d892
2020-06-05 21:06:27 +07:00
Vadim Yanitskiy 204d1b832f library/L1CTL_PortType: f_L1CTL_DM_EST_REQ_IA(): handle hopping params
Change-Id: I8c14fee3ec8f7a799469c681b5afe79ab74a5dfc
Related: OS#4546
2020-05-29 22:33:13 +07:00
Vadim Yanitskiy eda908106b library/L1CTL_Types: introduce ts_L1CTL_DM_EST_REQ_H1
Change-Id: Ie236c48a906679a5f46346ac7cbaf5866fd8befc
Related: OS#4546
2020-05-29 15:31:12 +00:00
Vadim Yanitskiy e8ea3ee10e library/L1CTL_Types: fix definition of L1ctlH1 (hopping parameters)
Change-Id: I87555de751e6e4af6ac5fe308c3e77fa15c8bb16
Related: OS#4546
2020-05-29 15:31:12 +00:00
Vadim Yanitskiy 5afe885d26 library/L1CTL_PortType: refactor L1CTL channel establishment
- 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-29 15:31:12 +00:00
Pau Espin 6791eb6b93 pcu: TC_mt_ping_pong: Request UL TBF on last DL ACK
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-28 22:13:10 +07:00