Commit Graph

951 Commits

Author SHA1 Message Date
Harald Welte 90f1974fb0 NS_Emulation: Support multiple NS-VC within one NSE (NS-VCG)
This is something we need to simulate more complex scenarios,
particularly in the context of frame relay.

Change-Id: If1220852785853f8a5d8de183d5053ddd6ccb958
2020-11-12 20:02:07 +00:00
Pau Espin f8fe2d2ef3 RLCMAC_CSN1: Fix missing padding zero bits in UlAckNackEgprs
Se 3GPP TS 44.060 Table 11.2.28.1

Change-Id: Iee04f39b43dc42efb9c2d96c46ff8e496664594a
2020-11-11 20:09:08 +00:00
Pau Espin 80c1baa71e RLCMAC: Fix stall_ind param not used
Change-Id: Ie1b6c66467028da8f93ccc42e5048daca3b68192
2020-11-11 20:08:47 +00:00
Pau Espin a05b2bc8a3 RLCMAC_EncDec: Fix Encoding of TLLI in UlEgprsDataBlock
Change-Id: If13f36db9c86c10d7c5a6a307c430ee090b7dd06
2020-11-10 12:55:33 +00:00
Pau Espin 081b168060 RLCMAC_EncDec: Implement encoding for RlcmacUlEgprsDataHeader HeaderType 1 and 2
Change-Id: I4e0b0e0960634fd2e5f09073a1ef093200dbe707
2020-11-10 12:55:33 +00:00
Pau Espin 563bcd6cb5 RLCMAC_EncDec: Fix encoding of TI and E bits in UlEgprsDataBlock
Change-Id: I442a12a16fe0d0664c677eec10bb81e2544235aa
2020-11-10 12:55:33 +00:00
Vadim Yanitskiy 6b29571091 library/L3_Common: use f_rnd_octstring() from Osmocom_Types
Change-Id: Iad46c3ab25244389a2a536065653c7ed231d1234
2020-11-10 12:16:21 +00:00
Pau Espin 4fbeefd8cf pcu: Relax some CS/MCS expectancy checks
Previous commit implemented the CS/MCS verification, and hence now some
tests fail because they had too restrictive checks.

In theory the verifications could be done so restrictive by configuring
the PCU accordingly at the start of the test, but we are not
really interested in checking the exact CS/MCS in these tests, only
checking if GPRS/EGPRS is being used.

Change-Id: I79b81d473b7428b57a0ec501c5bd0d88e35c81e3
2020-11-06 14:20:37 +01:00
Pau Espin 5abfded61e RLCMAC_EncDec: Provide decoded (m)cs in (E)GPRS data blocks
Let's provide this information to higher layer since CS is mostly
discovered by original bitstring size which is available during
decoding.

Call the size2mcs converter in each function to avoid having to pass it
as a parameter and have it selfcontained, meaning one can simply call
decode(bitstring) from TTCN3 code and be done with it.

Change-Id: I80ed44e575cc0a11510832e5bbfc07173e7b75b8
2020-11-06 14:20:37 +01:00
Pau Espin 745a48bce3 pcu: prepare tests for new GPRS/EGPRS multiplex support
Once GPRS/EGPRS multiplexed support is ready, it will be controlled
through pcu info_ind.flags by enabling
MCS or not; the "egprs only" VTY comamnd will be dropped.
The usual setup would be to support both GPRS+EGPRS, so make that the default.
Most tests require to be passed the _noMCS variant to work in older
versions of PCU, since those versions use the "egprs only" concept which
will reject egprs_ms_class=0. Same tests enabling MCS in newer osmo-pcu
shouldn't be a problem.

Related: OS#4544
Change-Id: Ib95aae155b0712313a30f0c5404a8cb1f28b98f5
2020-11-06 14:20:37 +01:00
Pau Espin 2aead38cdc pcu: Add infra to handle multitrx and multits envs
ARFCNs are allocated sequentially, so that conversion between
arfcn<->trx_nr is easily done.

Some helper functions are introduced to be able to submit and expect
messages on a given TRX+TS, which is required for setups with several
TRX and PDCH-enabled TS different than the default. These new APIs
will be used in PCU_Tests.ttcn in subsequent patches.

Change-Id: I28430e6d8c77d2b7dc630d186d425a5d82587b82
2020-11-06 13:08:50 +00:00
Vadim Yanitskiy d5321fbdea library/PCUIF_Types: add f_PCUIF_ver_INFO_PDCHMask_set()
Change-Id: I443bc99d35994dda14cdf9c41609d528368c401f
2020-11-01 02:01:59 +07:00
Vadim Yanitskiy 2a9accef09 library/PCUIF_Types: f_PCUIF_ver_INFO_PDCHMask_get() returns BIT8
Change-Id: Ib8e497b596370d0b48e76e6e86c01f0c1d9c5df5
2020-10-31 20:25:15 +07:00
Vadim Yanitskiy 2f8ee5a0c7 library/PCUIF_Types: add '_get' prefix to f_PCUIF_ver_INFO_PDCHMask()
Change-Id: I0ce8f3fe8cfd47c61199fbbdf0d80d19e6f105e9
2020-10-31 20:25:15 +07:00
Vadim Yanitskiy e94164d22e library: fix Repeated Page Info IE in PacketPagingReq
Change-Id: I39e8e3991cc248602460b7f162a0b57c2925315f
Related: OS#4838
2020-10-31 20:24:44 +07:00
Pau Espin bfd69f6133 pcu: Introduce test TC_multitrx_multims_alloc
Related: OS#1775
Change-Id: I6b20fded6b2a1896fb7ec47c7c5dcbdcbe27f771
2020-10-26 17:46:44 +01:00
Pau Espin b88f21cc84 pcu: Assign different ARFCN numbers to each PCU TRX
Change-Id: I78f5c1da9e040cd69071e9ce4c99ce5655f0c477
2020-10-26 11:06:13 +01:00
Alexander Couzens 7b1e44f791 PCU: add IPv6 support for SNS
With PCUIF 10 the remote can be IPv4 or IPv6.
Add all missing parts including SNS IPv6 elements,
the support to omit IPv4 elements and a PCU_Tests_SNSv6.cfg
configuration to run all tests with IPv6

Change-Id: I43d64caca600fff78f3fbbb3e8179f447f235d46
2020-10-21 11:49:54 +00:00
Vadim Yanitskiy 8fc43df69f library/RSL_Types: reorder the arguments of ts_RSL_ChanMode_SIGN
This way it's consistent with ts_RSL_ChanMode, and there is
no need to pass dtx_downlink := false as the first param.

Change-Id: I0b87ef87f8cfff1c96b0beead29d549d5fe0b7c6
2020-10-20 02:24:14 +07:00
Philipp Maier ac693462dd BTS_Tests: fix CHANnel ACTIVation message in TC_meas_res_sign_tchX
The testcase TC_meas_res_sign_tchX activates a traffic channel in
signalling mode and checks the RSL resulting measurement reports.

The CHANnel ACTIVation message sets "SDCCH" as "Channel rate and Type"
value. This is invalid, the "Channel Rate and Type" sould be set to "Half /
Full rate TCH Channel Lm / Bm" (while the speech or data indicator is
still set to "Signalling")

Change-Id: I51887b0d0379fcc1f4483d08dfdd6869e7a9f963
Related: OS#4799
2020-10-19 19:07:44 +00:00
Pau Espin 5fa5b8823c cosmetic: library/LAPDm_Types.ttcn: Fix trailing whitespace
Change-Id: I1fa46a10ca714f63c782004c877f7df96c591fad
2020-10-19 20:19:47 +02:00
Vadim Yanitskiy 161858372a library/L1CTL_Types: use traffic forwarding mode by default
Calypso PHY (unlike trxcon) needs to be explicitly configured to
enable forwarding of the TCH traffic.  Otherwise it's handled
internally by the DSP and routed to/from the built-in speaker/mic.

Change-Id: I5b9ca5683627716868e85dc33f91d8ca4824cd61
Related: OS#4799
2020-10-19 17:36:19 +00:00
Vadim Yanitskiy 52787bf97f BTS_Tests: indicate TCH mode to the L1 in f_est_dchan()
Otherwise the L1 (trxcon or Calypso PHY) would 'think' that we're
in signalling mode, and would not send us Bad Frame Indications.

Change-Id: I0ade3bd63f604c7f0665124b182a023d50030d0b
Depends: I6f403ed0506b4b1872361d9976d3186bfe514b52
Related: OS#4799
2020-10-19 17:36:19 +00:00
Pau Espin d0ec1490c6 bts-oml: Verify BTS obj becomes Enabled durig OPSTART ACK
Change-Id: Iabe2677a458e169e646eb5a105ec9897c48eecc4
2020-10-19 17:33:37 +00:00
Vadim Yanitskiy 3b1fae4529 library/L1CTL_Types: add missing template for L1CTL_TCH_MODE_REQ
Change-Id: I7641c373dca7280d208f4eac85185a9899f0cb71
Related: OS#4799
2020-10-19 17:37:02 +07:00
Vadim Yanitskiy 7ce605fc8b library/L1CTL_Types: add missing 'loop_mode' to 'L1ctlTchModeReq'
Change-Id: Ia62cfc949603780b36f76bd6a9c16815b6152fcd
2020-10-19 17:37:02 +07:00
Vadim Yanitskiy 3240312a16 library/L1CTL_Types: relax some params of tr_L1CTL_TRAFFIC_IND()
A TRAFFIC.ind with 'num_biterr' > 0 or 'fire_crc' != 0 is still
a valid TCH frame - Bad Frame Indication.  Let's relax those
parameters for tr_L1CTL_TRAFFIC_IND().

Change-Id: Ia3357e06f986ae59dd0438f9ace3042cae8d3684
Related: OS#4799
2020-10-19 15:46:53 +07:00
Vadim Yanitskiy 2cdb97f166 library/L1CTL_Types: fix definition of L1ctlDmEstReq
In osmocom-bb 'struct l1ctl_dm_est_req' is defined as follows:

  struct l1ctl_dm_est_req {
    uint8_t tsc;
    uint8_t h;
    union {
      struct l1ctl_h0 h0;
      struct l1ctl_h1 h1;
    },
    uint8_t tch_mode;
    uint8_t audio_mode;
  } __attribute__((packed));

so the overall size of the union is size of the biggest member:

  sizeof(struct l1ctl_h0) is 2
  sizeof(struct l1ctl_h1) is 132

Therefore we need to fix our definitions:

  - introduce 'record L1ctlH0' (with padding),
  - introduce 'union L1ctlH0H1':
    - move hopping indicator to L1ctl{H0,H1},
    - use it as 'TAG' in 'union L1ctlH0H1'.

Change-Id: I53964f794260f0676cc2771a7acbb679befb06d5
Related: OS#4799
2020-10-19 14:33:24 +07:00
Vadim Yanitskiy fe052960b2 library/L1CTL_Types: turn L1ctlTchMode into an enumerated type
Change-Id: Ib547b5984078bc6c6a66addb4622a471487c7342
Related: OS#4799
2020-10-19 14:33:13 +07:00
Vadim Yanitskiy e7c4a99160 library/L1CTL_PortType: fix indention in alt() statements
Change-Id: Ic13c2acbe1379558884fa7d11ba0b52ef31544f3
2020-10-19 13:55:15 +07:00
Vadim Yanitskiy 79da4ce0fb library/GSM_RR_Types: declare {enc,dec}_SacchL1Header()
Change-Id: If2acd617d8bb543851e827ec74bb93d8da5b4966
Related: SYS#4916
2020-10-18 20:11:12 +07:00
Neels Hofmeyr 4f5d7be579 bsc: clarify RESET logging: BSSMAP vs RANAP vs BSSMAP-LE
When a RESET-ACK times out, the logs currently are indistinguishable between
BSSMAP and BSSMAP-LE. Add protocol naming for each RESET / RESET-ACK logging to
make sure the information does not need guesswork.

Example of a test failure shown in jenkins:

  BSC_Tests.TC_unsol_ass_compl
  Stacktrace

  Timeout waiting for RESET-ACK after sending RESET
        BSC_Tests.ttcn:8295 BSC_Tests control part
        BSC_Tests.ttcn:4274 TC_unsol_ass_compl testcase

Nothing conveys that it is (presumably) the background *BSSMAP-LE* timeout
halting the test 5 seconds in, and not an A-interface failure.

Change-Id: I874567e68b8279bf2460b9474241f0a9fe5ff0ff
2020-10-16 16:31:52 +02:00
Daniel Willmann 654f85e2b8 Correctly handle ALIVE/TEST procedure with FR/NS-over-IP without SNS
If IP-SNS is not used we should wait for the RESET procedure to finish
before sending NS-ALIVE.
For IP-SNS start NS-ALIVE in both roles (sgsn and bss) and don't handle
NS-RESET.

Also unified the log messages a bit (received -> Rx).

Related: SYS#5002
Change-Id: Ie01fee70297255b3d9c091bc2cec75b0f915c588
2020-10-15 10:48:34 +02:00
Neels Hofmeyr 79bd2e93d0 Revert "BSSAP_LE_Emulation: configure sending vs receiving RESET"
This should not have been merged. It is an intermediate attempt to make the BSC
send the BSSMAP-LE RESET, which doesn't work because the BSC is not restarted
across test runs. I dropped the patch from my branch, while it remained on
gerrit accidentally; then someone else merged it without noticing that it was
no longer part of my lcs branch.

This reverts commit b2b3704d2a.

Change-Id: If191cf0ee5c239066fa41621e812efbdcca2a2b8
2020-10-15 01:57:55 +00:00
Neels Hofmeyr 6ea71cda5a BSSAP_LE_Emulation: on register_imsi, make sure to wait for RESET ACK
Change-Id: Id0d087a90394369ef60846baa4d02289e9d0be1e
2020-10-13 08:43:10 +00:00
Neels Hofmeyr e52bc2d9df BSSMAP templates for LCS
Both BSSMAP-LE and BSSMAP use the LCS Cause IE with identical definition. In
order to not add further dependencies from BSSMAP_Templates.ttcn to
BSSAP_LE_Types.ttcn to BSSLAP_Types.ttcn, duplicate the LCS Cause enum.

Change-Id: Ifee698c128a5345f6bf0301ad4dac9e083285d56
2020-10-13 08:43:10 +00:00
Neels Hofmeyr fc64f53c49 BSSMAP_LE template tweaks
Change-Id: I9728690e412266001b2a02b0e14d382152d5ab4e
2020-10-13 08:43:10 +00:00
Neels Hofmeyr 0d774653c0 BSSLAP: add some templates
Change-Id: I6774bb6aefed67ebbfd5da8e52bb463cd6279ed4
2020-10-13 08:43:10 +00:00
Neels Hofmeyr 8a6863ccba BSSMAP_LE_IE_LcsCause: fix IEI value and len
Change-Id: I8ea9d91745dc7bcbfdb69779487a1e9fc6cc7fcd
2020-10-13 08:43:10 +00:00
Neels Hofmeyr b2b3704d2a BSSAP_LE_Emulation: configure sending vs receiving RESET
Expecting OsmoBSC to send a RESET to the SMLC implies that the virtual SMLC
stays quiet until a RESET is received. Add flag to configure RESET behavior of
BSSMAP-LE.

Change-Id: I49a749b037b614f922044165a4357fe20b68860b
2020-10-12 18:28:20 +00:00
Neels Hofmeyr a7326888e8 fix ts_BSSMAP_LE_ResetAck
Change-Id: Ia3b3e02f0ea71546e36a7612d77e3e55f2d3810d
2020-10-12 18:28:20 +00:00
Harald Welte cb14e0665c Osmoocm_Gb_Types.ttcn: Add various additional templates
Those can help to match if messages meet certain constraints stipulated
in the BSSGP specification.

Change-Id: I05c768f5a9e4f0b5c1375c2603135a349c38e849
2020-10-11 16:34:39 +00:00
Harald Welte e97e3af203 PCU_Tests_{NS,SNS}: Fix our expectations regarding CellID in BVC-RESET
The BVC-RESET / BVC-RESEt-ACK follow a set of rules:

* Signaling BVCI=0 never has a CellId in BVC-RESET nor BVC-RESET-ACK
* Any BVC-RESET or BVC-RESET ack in BSS->SGSN direction must have CellID
* Any BVC-RESET or BVC-RESET ack in SGSN->BSS direction must NOT have CellID

Let's adjust our test expectations accordingly.

This will break tests against "latest", but the amount of work-arounds
needed in this code outweighs the benefit.

Change-Id: Ic8a83f5214c372faa15178dd9b54364e7d2a60cb
2020-10-09 14:59:56 +02:00
Harald Welte 5339b2e372 BSSGP_Emulation: Support multiple PTP-BVC within one Entity
The existing BSSGP_Emulation is built around the assumption that every
instance of BSSGP_Emulation only servers one signaling-BVC and one
PTP-BVC.  While this is true for osmo-pcu at this point (BTS-colocated
PCU), other BSS/PCU implementations differ.

In general, there can always be any number of PTP BVC (one per cell)
next to the signaling BVC (one per BSS).  Let's represent this in
BSSGP_Emulation so we can create more comprehensive tests.

Change-Id: I7e30b4c4e188518a574e082962fba457b3a97ce3
2020-10-09 12:27:11 +02:00
Harald Welte 23e274919d PCU_Tests_NS: Fix our expectations regarding CellID presence/absence
This is required by the spec, and implemented libosmocore since
Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1

So let's change our test expectations.  Meanwhile, introduce
mp_tolerate_bvc_reset_cellid for working around the bug in 'latest'.

Change-Id: Icebee25b53fef623db6ae91ca0d943e70a3c86b7
2020-10-09 12:27:11 +02:00
Harald Welte 12d19b81a7 BSSGP_Emulation: Ensure BVC-RESET for BVCO=0 has no CellId IE
This is required by the spec, and implemented libosmocore since
Change-Id Ie87820537d6d616da4fd4bbf73eab06e28fda5e1

So let's change our test expectations.  Meanwhile, introduce
mp_tolerate_bvc_reset_cellid for working around the bug in 'latest'.

Change-Id: If6245d73ed701e631b67146ace4ba028bdb4226c
2020-10-09 11:44:20 +02:00
Harald Welte c967d0e6f2 BSSGP_Emulation: Only add CellId to BVC-RESET[-ACK] conditionally
We always used to include the CellID IE, but 3GPP TS 48.018 is
actually quite specific about when it should be present and when not.

Change-Id: Iffd023f0272c9ccb087bdd225fcfb08424a46bdf
2020-10-04 21:09:11 +02:00
Harald Welte 847a77e32f NS_Emulation: pass around string idenifier for components created
We want to see useful identification for components in the log, and
hence must be giving every component a name at create() time.

Change-Id: I0fe650243953e4d85161684865acd0354b2e465f
2020-10-03 18:27:05 +02:00
Harald Welte 3dd8355d7d NS_Emulation: Delay Tx of first NS-RESET until Provider tells us it's up
Change-Id: I300cfeb120540940990a834596b0a83a539df080
2020-10-03 18:27:05 +02:00
Harald Welte 4a6a663654 NS_Emulation: Refactor if/elseif/... clause to altsteps with guard
This makes for much more readable code, and we can even do without
activating any default altsteps.

Change-Id: I4c38dd55b7c27899735f5730851d36c1410d96a8
2020-10-03 18:27:05 +02:00