Commit Graph

1250 Commits

Author SHA1 Message Date
Pau Espin Pedrol dbc71270df pcu: Fix inadequate restriction on the referenced template parameter
Fixes:
warning: Inadequate restriction on the referenced template parameter
`tfi', this may cause a dynamic test case error at runtime

Same for other parameters.

Change-Id: If2cadbc7087ac0f99537b9916ef0c23363c9242c
2021-02-08 12:32:07 +01:00
Pau Espin Pedrol 40a0295382 CTRL: Avoid using keyword 'now' as var
Fixes warning: Keyword 'now' is treated as an identifier. Activate
compiler option '-I' to use real-time testing features

Change-Id: I2b350bc93b33f36f72d35cb48d01f6c37ac1630f
2021-02-08 12:32:07 +01:00
Pau Espin Pedrol 847a1651cd BSSGP_Emulation: Fix indentation whitespace
Change-Id: Iade336832e7045cd29bae52c7907c6a1c57813cd
2021-02-08 12:32:07 +01:00
Pau Espin Pedrol 011e32f8fc BSSGP_Emulation: Fix warning: control reaches end of non-void function
Change-Id: I9a44afc81b5b6b35a32a12efcf2dd1cb15e73e12
2021-02-08 12:31:14 +01:00
Harald Welte 49f3ea818b NS_Provider_FR: Drop received messages until limk+pvc are up
Related: OS#4974
Change-Id: I69f9cf485b0a9eaf9294236f50ffcf4af20f1d20
2021-02-05 21:05:14 +01:00
Pau Espin cf5c33e0cd PCUIF: Allow receiving decoded RR/RLCMAC blocks in DATA REQ
This way tests can match directly on specific RLCMAC blocks, giving the
opportunity to handle different types using altsteps.
Before this, a user of the port could only receive a pcu_msg DATA_REQ
with a octetstring containing the rlcmac block, then decode it in a
second step when already in the alt step.

Related: OS#4927

Change-Id: Id8628e327d16c3a57e680e5a1ba0a2a8874f3a23
2021-02-05 12:01:14 +01:00
Pau Espin 4f9a48fc23 RLCMAC: Fix unbound spb value in decoded egprs data blocks
That field is only present in Header Type 3 blocks.

Change-Id: Ie05576d7d7c18933dd9abcdc055cbfe1e4e54756
2021-02-05 10:14:48 +00:00
Pau Espin ff7c5baaa2 RLCMAC: Fix decoding of dl data block with no llc block header byte
The value was marked as unbound while it should be marked as omitted:

"""
dl_block := { data := { cs := CS_1 (0), mac_hdr := { mac_hdr := { payload_type := MAC_PT_RLC_DATA (0), rrbp := RRBP_Nplus13_mod_2715648 (0), rrbp_valid := false, usf := 7 }, hdr_ext := { pr := PWR_RED_0_to_3dB (0), spare := '0'B, tfi := 0, fbi := false, bsn := 0, e := true } }, blocks := { { hdr := <unbound>, payload := '0D0C8653110FFEF072972C5A790C0317299753B5'O } } } } }
"""

Change-Id: If00338729ee1b2c8a4e100495e7cfa0599a4cb8b
2021-02-05 10:14:48 +00:00
Vadim Yanitskiy 559f5dc6e1 library/L3_Templates: fix: ensure 'no extension' in {ts,tr}_Called
Our definitions contain the minimum for 'CalledPartyBCD_Number',
optional extensions are not supported.  Thus do not indicate their
presence, use '1'B (inverted logic) in both templates.

Change-Id: I448a1f7b71ed7d63d397da2b7d04942b501deaa5
Related: SYS#5340
2021-02-05 09:44:04 +00:00
Vadim Yanitskiy c833465143 library/MGCP_Emulation: fix a copy-pasted comment
Change-Id: If068b653811c836f8e937a6f77d79d0c150c8e63
2021-02-05 09:44:04 +00:00
Harald Welte daf89681c4 NS_Emulation: Avoid g_unblocked_nsvcs_* overflowing
Sometimes we run into situations where the g_unblocked_nsvcs_* is
exceeding the number of NSVCs we have in g_nsvcs.  This can only happen
as we blindly append integers to the ro_integer fields, rather than
checking if they are already contained.

Let's factor out the add_unique and del functions (in Osmocom_Types)
and use them from NS_Emulation.

Change-Id: Ib3273d6ce9b80f700c964d578fdb0f268eac6a14
2021-02-04 17:11:30 +01:00
Harald Welte aaa0dfdd3f Move "ro_integer" to Osmocom_Types
We don't need several re-definitions of a "record of integer" type,
plus associated helper functions.  Let's move that to the shared
Osmocom_Types.ttcn

Change-Id: I6a68ab8180a40b93c540db9cb80941c39c2fb549
2021-02-04 17:11:30 +01:00
Harald Welte 4998a09917 NS_Emulation: Don't respond to NS-STATUS with NS-STATUS
Change-Id: Id9544ed1a7686fe113c4f6671e482bffc84bd2cc
2021-02-04 14:58:22 +01:00
Harald Welte 633805b1c8 BSSGP_Emulation: Support up to 64 BVCs with 64 users each
Increase this from the previous limit of 16 BVC with 16 users each

Change-Id: I8abca1c020d0ba4b89a6045e99d3a9eb7bcc4648
2021-02-03 19:28:00 +01:00
Harald Welte c0c67ff14f NS_Emulation: Handle NS_PROV_LINK_STATUS_DOWN
This happens e.g. if FrameRelay detects a "service affecting condition",
i.e. the link is considered dead.

Change-Id: I7409079f5e2b77cc08ccc93d1b0baa72720cefb8
2021-02-03 19:28:00 +01:00
Philipp Maier 14d3a8e7c3 GBProxy_Tests: fix TC_rim_* tests
The TC_rim tests do not use the RIM templates from Osmocom_Gb_Types as
intended.

Change-Id: Ie484f288aa0515ef4df4a3cf7f8a347a3f3cf587
Related: SYS#5103
2021-01-30 19:18:36 +00:00
Pau Espin 77783caf84 CTRL_Adapter: Keep server alive after first client disconnects
It can be expected from CTRL clients to connect and disconnect several
times as several commands are sent, so let's by default enable it (only
user of this CTRL servcer in PCU_Tests needs it).

Change-Id: Idddc27671d1b823dfbc62bcf7be673e51b574d63
2021-01-30 19:18:18 +00:00
Pau Espin 2dc137ccd1 IPA_Emulation: Support keeping server alive after first client disconnects
Change-Id: I4c133a889df0a5a060b5c52a1ca40fa9b8695c2e
2021-01-30 19:18:18 +00:00
Pau Espin a948d14d4d CTRL_Adapter: Add function f_ipa_ctrl_wait_link_down
Change-Id: Ia9f08dae76774925de8a08c7e313965280cb51b0
2021-01-30 19:18:18 +00:00
Pau Espin 0637ba0728 pcu: Introduce test TC_nacc_outbound_success
Related: SYS#4909
Change-Id: I951db4af731e5a7c207f0f407dd78d166e2d3d26
2021-01-30 19:17:49 +00:00
Vadim Yanitskiy bc1e66a3f1 library/Osmocom_VTY_Functions: make VTY prompt timeout configurable
Change-Id: Iadec95446b98d9767d08a841fa1c28f8c71c5eea
2021-01-30 14:23:10 +01:00
Vadim Yanitskiy 26e30aa4e0 library/Osmocom_VTY_Functions: cosmetic: coding style changes
Change-Id: Idccdf6fcbda2d020d2263ea1440ea1c5d9ea0e45
2021-01-30 14:23:10 +01:00
Philipp Maier e00776c5db Osmocom_Gb_types: add minimum requred tr_ templates for RAN INF
When testing the serving BSS part of the RIM application in osmo-pcu, we
will need receiving templates that allow us to verify the response (RAN
INFORMATION) rim container.

Change-Id: I964d7504f3c4aeaa4ce537316b3140e8b893003d
Related: SYS#5103
2021-01-29 21:18:18 +00:00
Pau Espin 9df362a94f rlcmac: introduce initial support for NACC related messages
Change-Id: I4d2f123479c34e6afffe0bc8d91409e6b0529a62
2021-01-29 21:16:25 +00:00
Alexander Couzens 20cd41ec89 Introduce NS test cases
Related: SYS#5208
Change-Id: Ic619a374b88879d3116f8f28afb14401c3e3192b
2021-01-25 14:14:47 +01:00
Harald Welte 3f82089977 NS_Emulation: Add CTRL port to administratively disable a NS-VC
This feature is useful in simulating intermittent or permanent transport network
outage by simply halting processing of all rx+tx in the specified NS-VC
until it is administratively re-enabled.

Change-Id: I742ecf01de15e3edbf0719371f0217a5739b7c8e
RelateD: OS#4521
2021-01-25 12:48:38 +00:00
Harald Welte be7afce974 NS_Emulation: Respect data_weight==0 or signalling_weight==0
* allow configuration of signalling + data weight for each NS-VC
* advertise per-NSVC signalling/data weight in SNS-CONFIG
* keep track of unblocked NS-VCS separately for data / signalling
* transmit BVCI=0 traffic only over signalling NS-VC
* transmit BVCI>0 traffic only over data NS-VC
* accept incoming BVCI=0 traffic only if signalling_weight > 0
* accept incoming BVCI>0 traffic only if data_weight > 0

Related: OS#4953
Change-Id: I9798e639b4bc8658482945970775b012b5840779
2021-01-20 15:56:31 +01:00
Harald Welte 1308dbbd8f NS_Emulation: Move SNS handling from NS-VC to NS-VCG
We need to move the IP-SNS handling up one layer, as only the NS-VCG
knows all the other NS-VCs, and after the SNS-CONFIG-ACK, we must
mark all of our NS-VCs as alive and start the alive procedure.

Related: OS#4953
Change-Id: Ie0f4342a0346952d7c50ac36900148e311d4c782
2021-01-18 19:55:03 +01:00
Harald Welte 0b38da55c7 NS_Emulation: Dynamically compute list of v4/v6 endpoints in SNS-CONFIG
Don't hard-code the assumption that we only have a single IP[v4] endpoint.

Related: OS#4953
Change-Id: I43fe5810b95ebbc9f848856803ac2c71f80d74f3
2021-01-18 19:55:03 +01:00
Harald Welte 3f10c62331 Osmocom_Types: fix formatting of log line (missing ", ")
Change-Id: If4555cd2902e056b32e835daa741ee84b346b922
2021-01-18 19:55:03 +01:00
Harald Welte 04358655bf gbproxy: Add test cases for STATUS handling
We expect the uplink BSSGP status to be routed based in the
inner/contained downlink PDU - and vice-versa.

Change-Id: If2ddd158346a3da340f1c673354196f3872c4f67
Related: OS#4951
2021-01-17 18:16:04 +01:00
Harald Welte f536524b07 BSGSP_Emulation: Route STATUS to GLOBAL port for both SIG and PTP
Change-Id: I6573562c0e7638f153798ee178c7c69d07c26756
Related: OS#4951
2021-01-17 18:15:32 +01:00
Harald Welte 112bc1469a Osmocom_Gb_Types: Extend RADIO-STATUS templates
RADIO-STATUS can occur with TLLI, but also with P-TMSI or IMSI.
Update our templates accordingly while keeping backwards compatibility.

Related: OS#4951
Change-Id: I1119e50e457b02d52e7c2c26a8b8039bf2118296
2021-01-17 17:39:29 +01:00
Harald Welte 650bd72849 BSSGP_Emulation: f_bssgp_get_tlli(): TLLI is optional in RADIO-STATUS
We must not dereference the TLLI IE unconditionally

Related: OS#4951
Change-Id: I463b25f5395127d155727d785eb7795ac0165fac
2021-01-17 17:39:29 +01:00
Alexander Couzens c796da8711 remove unused NS_CodecPort.ttcn/NS_CodecPort_CtrlFunct
Change-Id: If885353ec8947309fc7d3ad780448cfc7402e1a4
2021-01-17 15:59:26 +00:00
Alexander Couzens c316572db1 RAW_NS: rework NS connection to use NS_Provider
Previous RAW_NS only supported NS over UDP because
it handled the UDP connection on it's own.
Because of this there was no cleanup function for the tests
because no virtual component were started.
Using the new NS_Provider allows to use the same tests over
UDP and FR with no changes.

Change-Id: I8a3b6c72798a75f434f54229fdbfc802cd13967e
2021-01-17 15:59:26 +00:00
Harald Welte be9bf1e74d Osmocom_Gb_Types: Add templates for various BSSGP PDU types
Related: OS#4951
Change-Id: I89044bf8e736cc1997dff1a550b3e194f8ac1b9d
2021-01-16 22:54:29 +01:00
Harald Welte 14ac346b5d Osmocom_Gb_Types: Add 3GPP spec chapters; unify formatting
Change-Id: I9c3e5458ba7637a1e85f7bb3b32e16a90fad7bc5
2021-01-16 22:54:29 +01:00
Harald Welte dbd5e677ce gbproxy: Move away from random TLLI
We used to generate a random TLLI for each ConnHldr.  Instead, use a
deterministic function to generate the P-TMSI (just like we do for the
IMSI) and derive a local TLLI from that P-TMSI.

Related: OS#4472, SYS#5002
Change-Id: Ic1eaa1d298fe998ca97432769953bfc5a5333ae4
2021-01-16 22:50:21 +01:00
Harald Welte bf3976185a Add f_gen_tmsi() to generate a TMSI similar to f_gen_{imsi,imei}()
... and start to use it from BSC_Tests.ttcn

Related: OS#4472, SYS#5002
Change-Id: Iacba62bb740374c28cbcf50d54ba1814c5b4e1c2
2021-01-16 22:50:21 +01:00
Pau Espin 92c19081c7 rlcmac: Add template to match receival of Dl Ctrl message
Change-Id: Ifd16e8129b4440542b82a47749df1547a061ae88
2021-01-11 13:54:30 +00:00
Pau Espin 8bd54cf77a library: Add templates to initialize CellId, RAI, LAI
Change-Id: Ie9d86e1b651dff279e7d50a4282bf14fbed5bb76
2021-01-11 13:54:30 +00:00
Alexander Couzens 0c96ff6dba NS_Emulation: remove unused variable res
Change-Id: I5cc25ccb8e0d169b6f85e597fda47fdd2130aa70
2021-01-11 13:42:45 +00:00
Alexander Couzens 6da7aaf6f1 NS_Provider_IPL4: fix typo in comment
Change-Id: Ieed010a15675b105807bc8c55bb0977fcb6aa7f3
2021-01-11 13:42:45 +00:00
Pau Espin 9a5b8ffc5b CTRL: Introduce support to run osmocom CTRL server
Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
2021-01-07 15:06:39 +01:00
Pau Espin ec2ee466b7 CTRL: Fix tr_CtrlMsgGet containing invalid value in val field
"val" field is not used in GET commands and is hence set to omit by
TTCN3 decoder.

Change-Id: If1a273a2be71040eaea2189a0aeaf737adf848e5
2021-01-07 13:35:15 +01:00
Philipp Maier b76a279edf Osmocom_Gb_types: add RIM templates
The template set we use for testing the GB (BSSGB) interface on
osmo-sgsn and osmo-pcu lacks templates to generate RIM (ran information
management) messages. The records and unions are already specified in
BSSGP_Types.ttcn, we just need to form templates in order to be able to
use them.

Change-Id: Ic495e0bb6ceb2b65cbc7c3da7ee519a013aede55
Related: SYS#5103
2021-01-05 16:28:20 +01:00
Alexander Couzens d533890fa7 NS_Emulation.ttcnpp: complete SGSN emulation with SNS
The emulation of an SGSN with SNS was incomplete. The SNS
procedure was completed. However the NSVCs didn't moved
into an unblocked state.
Also sending a NS_ALIVE at the beginning is wrong.

Change-Id: I54c2d9d5b34d791be354298171d04180a9b263c3
2020-12-21 18:41:31 +01:00
Alexander Couzens 195c9e70c2 PCU_Tests_SNS: improve SGSN originated BVC-RESETs
The BVC-RESETs are a little bit more complicated. The PCU will send
a BVC-RESET after the NSE become available.
Ensure the RESET is received and ignored so there is no race condition
if both sides send a BVC-RESET at the same time.

The test case TC_sns_1c1u_so_bvc_reset is still failing because the PCU can't
handle BVC-RESETs properly (both PTP and signalling).

Change-Id: Id681749d75073c1d50a4b0a2e86f0a2dd0955b45
2020-12-16 22:27:36 +01:00
Harald Welte 9b461a94a3 sgsn+pcu: Port suspend/resume cases to new BSSGP_CT:GLOBAL port
For 12+ days, suspend/resume related SGSN + PCU TTCN3 tets have been failing.

It was the introduction of the BSSGP_CT:GLOBAL test port in
I40d973d80709f5d56f59247e8647b52754f09bc8 +
I805372f3024a0ec2491a24422e02c0bc6dc669d2 which caused the related PDUs
now to no longer show up where they used to.

Change-Id: I1977302fef4868dc1c330bc6f48f6a6608949393
Closes: OS#4902
2020-12-10 23:42:03 +01:00
Harald Welte cc3894b612 gbproxy: Add test for FLOW-CONTROL-MS procedure (TC_fc_ms)
Change-Id: Ie087ee8e8adfb963d21f35c60628214d4297250d
Closes: SYS#5210
2020-12-10 22:13:25 +01:00
Harald Welte 71449b0a13 bssgp: Introduce "GLOBAL" port for PTP BVC
There are some messages/procedures on a PTP BVC which are not related
to one specific TLLI, but affect the whole PTP BVC.  First and foremost
that is the FLOW-CONTROL-BVC. Let's check if the user is interested in
handling those internally (by connecting to the GLOBAL port).  If not,
fall back to acknowledging all incoing FC-BVC and ignoring all ACKs.

Related: OS#4891
Change-Id: Ib80a6a522dbcb33fd0e7bd31a73ef28fdc636f57
2020-12-09 15:31:30 +01:00
Harald Welte 27a70cc453 bssgp: rename tr_GLOBAL to tr_GLOBAL_SIG
... to indicate this is about the signaling BVC only.

Change-Id: I646db452c89842465902b5167c9c86de51df1241
2020-12-09 15:30:52 +01:00
Harald Welte 86bdcaa79d Osmocom_Gb_Types: Fix t_BVC_FC_BVC_ACK() TAG IE length
Change-Id: Ib9a09fea85110a4f0966c07d911e37234aa06391
2020-12-09 15:30:52 +01:00
Harald Welte 0083ea6b69 BSSGP_Emulation: Add RIM port to BSSGP_CT
This port is used for sending/receiving RIM related BSSGP messages. It
exists once per BSSGP_CT Component (i.e. once per NSE), as RIM is global
for the entire NSE.

Change-Id: I04511df5dffbfe19faabf22014acc72b7673b7d6
2020-12-08 08:30:20 +01:00
Harald Welte da9d9387f6 NS_Emulation: Tolerate late NS-BLOCK-ACK / NS-UNBLOCK-ACK
Particularly in case both sides initiate a BLOCK or UNBLOCK procedure
at almost the same time, it can happen thet we're already in BLOCKED
state and receive a late BLOCK-ACK or in UNBLOCKED state and receive a
late UNBLOCK-ACK.

Let's just silently discard them instaed of generating NS-STATUS which
may confuse the peer.

Change-Id: I2e5b934e1cf6c6cf982d5ab1dbb32e8920b91071
2020-12-07 15:55:20 +01:00
Neels Hofmeyr 2a5670be4f add f_vty_cfg_bts(), f_vty_cfg_msc()
These allow passing N vty configurations on the bts / msc node without
requiring subsequent 'exit'.

As an example, use f_vty_cfg_msc() in BSC_Tests.ttcn AMR config.

Change-Id: I9f3e485f692acb3d2a7620e9b454b372651be78e
2020-11-30 15:59:14 +00:00
Neels Hofmeyr 1a1f854ed2 add f_vty_config3(), to run N commands on a sub-node
f_vty_config2() makes it convenient to enter a specific vty node without
needing to send 'exit'/'end' explicitly. However, to pass multiple
commands on the same node, the VTY would enter and exit the node for
each call of f_vty_config2(). The new f_vty_config3() also allows
multiple commands to be run on that same node without intermediate
exiting.

Change-Id: If969ac645aa82e5a36245d974de2a251633de111
2020-11-30 15:59:14 +00:00
Harald Welte f20af41003 gbproxy: Introduce TC_overload
When the SGSN is sending an OVERLOAD message, we expect that to
propagate down to every BSS on the other side.

Change-Id: Ic61fabd9c633bcb3f256fe7aa5834e66cc66a4fb
2020-11-28 16:14:59 +01:00
Harald Welte c0351d1015 gbproxy: Introduce TC_llc_discarded
This tests the LLC-DISCARDED message, which relates to a BVCI but
is itself sent on BVCI=0.  We expect it transparently passes from BSS
to SGSN.

Change-Id: I98d02d6fa68bddf15b732d06dab00e91e72995d1
2020-11-28 16:12:27 +01:00
Harald Welte f8e5c5dfc7 gbproxy: Test for SGSN-INVOKE-TRACE
Change-Id: I1e46e5c403712eb7972c57e6b6f6eb0850b96ae3
2020-11-28 16:12:27 +01:00
Harald Welte e588792562 BSSGP_Emulation: reo-rder altsteps of per-NSE component
the existing ordering of altsteps unfortunately caused some
receive clauses never to be hit, as they are only in the default
altstep, while more generic receive clauses are already in the
state-specific altsteps.

Let's introduce an as_allstate_pre() and an as_allstate_post() to
solve this ordering problem.

Change-Id: Icc4da95833557931d6685826fb30bdc60bf460c1
2020-11-27 19:18:28 +01:00
Harald Welte bdf96d8412 BSSGP_Emulation: Add MGMT port to per-NSE (BVCI=0) component
We recently introduced a MGMT port in the per-BVC component for the
PTP BVC.  Let's add this also to the signaling BVC.

Change-Id: I24df4cb290c9f9dc1a7398994af101711f12d42e
2020-11-27 19:18:28 +01:00
Harald Welte 3c90515272 BSSGP_Emulation: Send BssgpResetIndication when PTP BVC are being reset
This notifies the user via the MGMT port about the fact that an inbound
BVC-RESET procedure just happened.

Change-Id: I54d0d5e0e06a330a90dfb1da06062d65022efe81
2020-11-27 19:16:58 +01:00
Harald Welte 52cecbb340 BSSGP_Emulation: Fix handling of BsgpResetRequest
We need to change to BLOCKED local state in order to activate
the altstep which handles the inbound BVC-RESET-ACK.

Change-Id: I32ede586f0977b7d96af9fe3ea5fae485184ea98
2020-11-27 19:16:43 +01:00
Harald Welte ab50cc295b BSSGP_Emulation: Fix inbound BVC-RESET
We cannot handle this in as_ptp_allstate(), as the respective clauses
are never hit:  In as_ptp_unblocked() we broadcast all BSSGP messages
without a TLLI, "hiding" the BVC-RESET handling.

Change-Id: Ie3e7a997554e6af42ae7e7294829b6f8d2447d60
2020-11-26 20:57:54 +01:00
Harald Welte ddfc6676d5 BSSGP_Emulation: Implement handling of BVC-UNBLOCK in SGSN role
Change-Id: I7c9cda916f6583613fbf3cdf31f3f08ceadf58d4
2020-11-26 20:57:54 +01:00
Neels Hofmeyr 9ebabc8b0e vty: log failed vty command
Add a log label argument to f_vty_wait_for_prompt(), and feed the sent
command from f_vty_transceive*(), so that the failure verdict already
lists the vty command that caused the failure.

A common error is to issue insufficient 'exit' commands, so that I often
think the newly added VTY command failed, even though it is a subsequent
command causing the failure. I want to shorten the "time-to-aha" there.

Change-Id: Icfd739db150d86e9256a224f12dc979dcd77879f
2020-11-26 01:04:57 +00:00
Harald Welte fba7afdd89 BSSGP_Emulation: Include NSEI in BsgpStatusIndication for PTP BVC
Change-Id: I0d8f18d0e6438a98c75ff24e2a9c8136d8b417d2
2020-11-25 17:14:25 +01:00
Harald Welte 57de220cdb BSSGP_Emulation: Introduce a GLOBAL port in the BSSGP_CT
The per-NSE BSSGP_CT gets a new GLOBAL port which is used for procedures
that are not specific to one BVC, such as the SUSPEND/RESUME related
PDUs, which all are on the signalling BVC without any BVCI in the BSSGP.

Change-Id: I40d973d80709f5d56f59247e8647b52754f09bc8
2020-11-25 17:14:25 +01:00
Daniel Willmann 00c0bbf272 Add templates for LLC_DISCARDED
Change-Id: I587ec89471083e339065f6371ffe6253d49007bf
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Daniel Willmann 7f1d78e164 Add templates for FLUSH_LL_ACK
Change-Id: I57ef98b9a3022ed5915381504aa129979799bee8
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Daniel Willmann 379fc250de Add templates for FLUSH_LL
Change-Id: Id432022fdd7f96bc014f0fd81658fa4aa796a688
Related: SYS#5210
2020-11-25 16:10:23 +00:00
Vadim Yanitskiy 42d8bd5012 BTS_Tests: re-organize configuration of TRX/TS params
Change-Id: I9b225249d135399f63d3c7e4c567121dfea63f75
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy 802508e696 library/RSL_Types: add 'bs_power_params' to 'RSL_IE_Body'
The value part of this IE is defined as vendor-specific.

Change-Id: I48703c45d26cd88c1d9b5fda1a9df42616cb7cc0
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy bc8ebce10e library/GSM_RR_Types: make ts_MEAS_REP more user-friendly
Change-Id: Ica1ea41ebba5c518d515a211e77ca6651c4173d6
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy 05a236a2fc library/GSM_Types: add the Uplink flag to GsmBandArfcn
Change-Id: Ib9bd7268b8a0fd8ed64064871c09fab35e15a761
2020-11-24 11:58:49 +01:00
Vadim Yanitskiy 1acc7bb184 library: move Osmocom_Types.Arfcn to GSM_Types.GsmBandArfcn
In some cases GsmArfcn itself is not enough.  It case of L1CTL
and GSMTAP, it needs to be equipped with a band discriminator:

  - DCS / PCS (as the numbers may overlap),
  - Downlink / Uplink (not yet there).

Let's rename this record and move it to GSM_Types.  Also, add
send / receive tamplates, so we can add new fields later.

Change-Id: I7a63f03bbd15a06caafb786122dc12991d115771
2020-11-24 11:58:49 +01:00
Harald Welte 0e18824f3b gpborxy: Implement variety of paging tests for PS-PAGING and CS-PAGING
Change-Id: Ida44b62dfdb9c4ce2755de63d51a9907d34f247f
2020-11-23 14:51:38 +01:00
Harald Welte 80a249aa07 NS_Emulation: Include NS-VCI in NsUnitdataIndication
The primitive normally only contains NSE + BVCI, but in a tester
we actually want to verify which NS-VC a given message has arrived on,
and hence it makes sense to add the NSVCI, too.

Change-Id: I9402bf0be47e5b93c9cfb081eb8f9fa6734c9227
2020-11-21 22:52:51 +01:00
Daniel Willmann 670bbc0c4e Osmocom_Gb_Types: Fix indentation
Change-Id: I4ca156b53dfe9daa190d52a7de46be56cf74099a
2020-11-20 15:09:00 +00:00
Daniel Willmann 05d4638b9b Add templates for BSSGP Radio Status procedure
Change-Id: I6d49eb4907c4568d88da5d6fd7962e388a3607fb
Related: SYS#5210
2020-11-20 15:53:55 +01:00
Pau Espin e8db673d22 pcu: Implement ACKing EGPRS Dl TBF blocks
Change-Id: I9f1b621a8365e69d2e1a33d59cb8c7a59639ad94
2020-11-18 11:51:14 +00:00
Harald Welte e15299ab20 NS_Emulation: Fail if an unsupported NS provider is chosen
This took me quite some time: Tried to use NS_PROVIDER_FR, but the
code was compiled without support for it.  It just failed silently
without printing any error or ever sending any message on the FR link.

Change-Id: I96475127a2079830b3456a8e288adf4c6c908887
2020-11-17 17:42:23 +01:00
Daniel Willmann ace3ece7be gbproxy: Add test for RA Capability Update procedure
Change-Id: I023b3d24a31d117f05c7327b08e9f8f930720944
Related: SYS#5210
2020-11-16 20:32:20 +01:00
Harald Welte 6dc2ac471b gbproxy: Test for RA Capability procedure
Change-Id: If7e5a5cab1e445e0b4ef0466990e352143c31245
2020-11-16 20:32:20 +01:00
Harald Welte 2436fb5bcc BSSGP: parametrize tr_BSSGP_DL_UD
Change-Id: Ib4a1d64da634813b49474c13ae080d729bbabcf1
2020-11-16 19:13:26 +00:00
Harald Welte 199f386e89 BSSGP_Emulation: Introduce MGMT port to per-BVC component
This port can (optionally) be connected to, and it will receive
state change notifications as well as permit the user to block/unblock
and reset the specific PTP BVC.

Change-Id: I1f0289c8805168e3daace4a7d76764b45cead3d0
2020-11-16 19:13:26 +00:00
Harald Welte 4d112c926c BSSGP_Emulation: Allow a "CreateCb" to handle unknown inbound TLLI
The existing BSSGP Code assumed that the TLLIs were always known "a
priori" by the test case.  With the newly-introduced create_cb,
the user can provide a function to handle any incoming messages for an
unknown TLLL.  The default handler behaves like before: fail +
terminate.

Change-Id: Ice0e145f5a6518ff79547dd851042b7965f38e00
2020-11-16 19:13:26 +00:00
Pau Espin afdd28d73b RLCMAC: Implement type+template for EGPRS Dl Pkt ACK/NACK
Change-Id: I0d6555f8644e39da6124be2e861d57fda3b3d8a1
2020-11-16 10:48:25 +01:00
Pau Espin 68a7a49354 RLCMAC_EncDec: Implement decoding of Egprs Dl Data block HeaderType 2 and 1
Change-Id: I3b8199711e08bc128821e02c626ded1bc6aa30d7
2020-11-16 10:48:25 +01:00
Pau Espin cca530fbf4 RLCMAC_EncDEc: Fix decode of DlEgprsDataBlock without LI
Change-Id: Iec7e1a2d876abfdc911a65113cc6c9e888257c61
2020-11-16 10:48:25 +01:00
Pau Espin cb00c52b07 pcu: Specify (M)CS to use when sending UL rlcmac data blocks
Apply padding and spare bits in the encoder according to CS/MCS format.

Change-Id: I918acac81f550077daeda3374b3de9b426ff3572
2020-11-16 09:14:28 +00:00
Vadim Yanitskiy be33f6b158 library/L1CTL_Types: add missing template restrictions
The template restrictions are quite useful, becaue they give hints
to the TTCN-3 compiler, so it can spot more bugs.  For example,
the lack of thereof would not prevent one from passing 'omit' to
a template, that assigns a value to a non-optional field, so that
might lead to a DTE at run-time in some cases.

Since adding 'template (restriction) ' to each template parameter
obviously makes templates look more cumbersome, let's move the
part with template name and arguments onto a separate line, just
like it's sometimes done for function definitions in C.

Change-Id: I7e6846381e0b3fb611059fcfbafb19bd6c15cfd8
2020-11-14 21:38:15 +00:00
Harald Welte 8f66af1665 move f_gprs_tlli_{type,random} to Osmocom_Gb_Types
Those functions don't depend on any L3 specific data structurs, and
it is not a good idea to burden every user with having to impot all
of a 2G/3G Layer3 just to generate some hexstring identifiers.

Change-Id: I6fc41ed94e97e0ec44dc4ea56d110bdd9ac77a72
2020-11-12 21:51:40 +01:00
Harald Welte 69b3a4839f move f_gen_{imsi,imei,msisdn} from L3_Templates to Osmocom_Types
Those functions don't depend on any L3 specific data structurs, and
it is not a good idea to burden every user with having to impot all
of a 2G/3G Layer3 just to generate some hexstring identifiers.

Change-Id: I7880633a46afc607f16f8aa6ea1a277f7958c95b
2020-11-12 21:51:40 +01:00
Harald Welte c450552c59 NS_Emulation: Introduce Load Sharing Function
The Load Sharing Function distributes traffic among all unblocked NS-VC
within a NS-VCG.  The sharing is done based on a LSP (Link Selector
Parameter) which is passed with the NS-UNITDATA.req primitive from BSSGP
to NS.  Details are implementation specific, but NS must ensure that all
traffic of one LSP is always sent through the same NS-VC, as long as
that NS-VC is alive/unblocked.

We use the LSP as follows:
* Signaling BVC always only uses lsp 0
* PTP BVC messages unrelated to user straffic use a per-BVC static LSP,
  which is the BVCI
* User traffic can set whatever LSP it wants
* NS keeps an array of NSVCs currently unblocked and uses the LSP modulo
  the array size as an index into it

Change-Id: I8b960ec4d729f50cadca353bb52685311cd45eed
Related: SYS#5084
2020-11-12 20:02:07 +00:00
Harald Welte dc0a090ae1 NS+BSSGP: Only send BVC-RESET when _first_ NSVC of NSVCG becomes unblocked
In case of a NS-VCG with multiple NS-VC, we must BVC-RESET only when the
first NS-VC becomes unblocked, i.e. as soon as we have any connection
to the peer at all.  Whether we have further additional links doesn't
matter, at least not in the sense that all state should be reset.

Change-Id: I69b2e9bd919fc981f189b6671b4234c3642e2449
2020-11-12 20:02:07 +00:00
Harald Welte 445fc61dc7 BSSGP_Emulation: Match on proper NSEI from NS layer
Change-Id: I682574bc54b4432357adef2b4662b1f74495578c
2020-11-12 20:02:07 +00:00
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
Harald Welte bd612cd328 NS_Emulation: Introduce status events from provider -> emulation
This allows NS_Emulation to react to changes of the underlying
transport layer (e.g. Frame Relay Link/DLCI up).

Change-Id: If00e9c50dc664ce62b6c0cbde99d741e8173169b
2020-10-03 18:26:59 +02:00
Harald Welte 867243a3ec NS_Emulation: Add [optional] support for FrameRelay transport
This adds a NS_Provider_FR which interfaces between FrameRelay_Emulation
and NS_Emulation.  Include support for it only if enabled at compile
time to avoid pulling in a dependency on the FrameRelay stack for every
user of NS_Emulation.

Change-Id: I42ca811d23e383e362d2527c8ff2c916a62a5b42
2020-10-03 18:24:50 +02:00
Neels Hofmeyr 67de93784e BSSAP_LE: comment/log tweaks
Change-Id: I39ae5abc932c8cb5eb37b8c25a84621bd9ff30ca
2020-10-01 06:48:55 +02:00
Neels Hofmeyr 7b562bfe42 fix typo BSSMAP_LE_LCS_CAUSE_UNSPEIFIED
Change-Id: Iff154cba13febf1a2e623b6de64fb39ffb91b302
2020-10-01 06:48:55 +02:00
Neels Hofmeyr c4c2a9176b fix BSSAP_LE_Types FIELDORDER
Change-Id: I6f3d5b238912923431db36a1ba7b4973ae4e2e91
2020-10-01 06:48:55 +02:00
Harald Welte 5e8573e9b7 NS_Emulation: Prepare NSConfiguration for non-IP providers
NSConfiguration currently contains parameters relevant only for IP
based transport.  Move IP/UDP parameters into a sub-structure in
anticipation of Frame Relay support.

Change-Id: I6904520d8c2f546327029777d68b1907611a8cf5
2020-09-27 09:15:32 +00:00
Harald Welte 9a7c512bbd NS_Emulation: Fix Tns-alive/Tns-test expiration detection
Change-Id: Icb7d076f57c166b498c1b3edd84edcf13ea9739d
2020-09-25 10:01:53 +00:00
Alexander Couzens 904f50115d Move RAW_NS to library to use it in SGSN NS tests
Change-Id: I5a0e62cc9f032c515188530c0ceee29061fe11d2
2020-09-25 01:31:44 +02:00
Pau Espin befd3aaca4 mgw: Introduce test TC_crcx_osmo_ign
Related: SYS#5063
Change-Id: I79415c385e89fe859854430bb20940f078fccea0
2020-09-22 19:32:11 +00:00
Vadim Yanitskiy befa21c5c9 {BTS,PCU}_Tests: bump default PCUIF version: 9 -> 10
Both osmo-bts and osmo-pcu are switching to PCUIFv10 soon, so let's
use the new version by default.  For older (latest) IUT versions
not supporting PCUIFv10, one would need to override this module
parameter in {BTS,PCU}_Tests.cfg.

Change-Id: I9350c4a54434c3d46ce9424f382ca0057e58d053
Related: SYS#4868, SYS#4915
2020-09-22 00:53:26 +07:00
Alexander Couzens 3ee8268e91 NS_Provider_IPL4: map the IPL4 port to the system port before using it
Change-Id: Ia588ff82764e531c14665454eed035cd17b047ad
2020-09-17 23:54:42 +02:00
Alexander Couzens e0f7c543b7 NS_Emulation: remove dependency on PCUIF_Types
The dependency of PCUIF_Types creates also a dependency on

Replace the PCU_AddrType by an unix like address family defined
in the Osmocom_Types to reduce the dependency.

Change-Id: I0b4fda96accef401ffc009010f9f5621583fd6dd
2020-09-17 23:29:16 +02:00
Harald Welte 013d65af1e NS_Emulation: Introduce NS_Provider underneath NS_Emulation
This is a step to prepare the NS_Emulation for operating on top of
Frame Relay, not just UDP/IP.  We replace the NS_CodecPort (mapping to
a IPL4asp) with a newly introduced NS_Provider_CT, specifically a
NS_Provider_IPL4_CT.

This change removes any IP specific bits from NS_Emulation and moves
it into the newly-created NS_ProvideR_IPL4.

Change-Id: I4d0b7ad0ed9447a038dd3eeee2b975146d10fba0
2020-09-17 15:26:52 +00:00
Harald Welte 07cb87a90c BSSGP_Emulation: Fix build without BSSGP_EM_L3
Change-Id: Ic58e2d6bc37cb8fd8f0235b8497f674db7cfdd85
2020-09-17 15:26:52 +00:00
Alexander Couzens efca79da05 PCUIF_Types: fix version 9 remote address
Change-Id: I8a337399632e11d8a376e7a7fa3ff7a2396a80b1
2020-09-16 18:41:27 +00:00
Pau Espin 563b3d013b mncc: Support IPv6 addresses (new version mncc 7)
Apparently commit 06b859ca31 forgot to
bump the MNCC_SOCK_VERSION field from 5 to 6.

Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
2020-09-16 10:36:44 +00:00
Pau Espin 28aa466dd9 library: CBSP_Adapter: Improve robustness of rebind and reconnect
Change-Id: Ibafbc8496eeadd0ea1b97056ef3b8a92bc43e9f1
2020-09-16 10:24:40 +00:00
Vadim Yanitskiy 220fa204da fixup library/PCUIF_Types: version 10: do not add redundant padding
Unlike osmo-pcu, osmo-bts does check length of the messages received
over the PCU interface, so I7a532d7abff8af354e40c5d706bb882efc6f905f
caused all the related test cases in ttcn3-bts-test to fail.

Reverting it is not a solution, because we cannot maintain different
padding attributes for two different protocol versions.  Let's add
a wrapper function that would call enc_PCUIF_Message() and append
padding depending on the configured protocol version.  In addition,
let's add a module parameter that would allow us to (optionally)
disable padding for ttcn3-pcu-test.

This change makes all broken PCUIF specific test cases pass.

Change-Id: Ica9e0c49c8b16e7d585a481670762c6433c61118
2020-09-15 19:15:22 +07:00
Vadim Yanitskiy ca81392360 BTS_Tests: group hopping parameters into a separate record
Change-Id: Iedb5d858a2d4f5d5a45e7465ae6586b3ae4bbb72
Related: SYS#4868, OS#4708
2020-09-14 09:04:39 +00:00
Harald Welte 93331e736b BSSGP_Emulation: Make L3 (SM/GMM) decoding a compile-time option
This allows us to build low-level tests that don't require all of L3.

Change-Id: I7ef7e93e2cd1d37e7e4a62947ca8dfde30d93b95
2020-09-13 10:18:41 +02:00
Harald Welte 6ce47c3ea7 lib: Move ts_RaCapRec from RLCMAC_CSN1_Templates to L3_Templates
There is no reason whatsoevery why a L3_Templates.ttcn file should
ever include types from RLC/MAC.  This creates a dependency nightmare.

The type for which ts_RaCapRec is written (MSRACapabilityValuesRecord)
originates from titan.ProtocolModules.MobileL3 so it's completely
unclear how any of that ever related too RLC/MAC.

Change-Id: Ie1ccef090ad51e26ccae17998e4294c6e27cf9c8
2020-09-13 10:18:41 +02:00
Harald Welte 557c9f8cb8 move some key types from GSM_RR_Types to GSM_Types
This in turn means Osmocom_Gb_Types doesn't need to depend on
GSM_RR_Types anymore, which is particularly ugly as the latter
now depends on RLCMAC_*, creating a long chain of dependencies.

Change-Id: I8c8da7709695ff0023f71b3999291e2515b22e46
2020-09-13 10:18:41 +02:00
Alexander Couzens 4231de67fc library: Osmocom_Types: fix extra indention tab
The top level context doesn't have an indent.

Change-Id: Ib94fa74a7752f21ba8203a5de17ce2b10d800d16
2020-09-11 20:24:19 +02:00
Alexander Couzens 5e6ae79d0c library: GSM_Types: fix extra indention tab
The top level context doesn't have an indent.

Change-Id: Ifece2e9fa782f173665e10fa9174403cccac7eb6
2020-09-11 20:24:19 +02:00
Vadim Yanitskiy a93088ae64 library/PCUIF_Types: version 10: do not add redundant padding
Change-Id: I7a532d7abff8af354e40c5d706bb882efc6f905f
2020-09-11 12:58:00 +00:00
Alexander Couzens 1e5dc48213 library/PCUIF_Types: version 10: support IPv6 NSVC addr
Change-Id: I13b03c380edc2dc609c5e4053462a3cd6f78ce72
Tweaked-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
Related: SYS#4915
2020-09-11 10:35:56 +00:00
Pau Espin 08005d7475 library/RTP_Emulation: Close previous socket after rebind
If test calls RTPEM_bind twice, the previous socket is kept open
(ConnId 1) while the new one is assigned to the the expected ConnId for
RTP/RTCP packets received (ConnId), however, if remote was already
sending packets, it may happen that the port still receives those with
ConnId=1, which may make test fail with message:
"Received unexpected type from RTP"

Change-Id: I73f4af4e590dd3958e3f4d1dba0496c0750d642d
2020-09-09 11:43:51 +00:00
Vadim Yanitskiy 43ccaf51f2 library/PCUIF_Types: version 10: add Mobile Allocation length field
My initial assumption was that we can skip redundant '0'B bits or
even '00'O octets in the Mobile Allocation IE, and thus reduce
the overall size of this element.  Unfortunately, this is wrong.

3GPP TS 44.018, section 10.5.2.21 clearly states that the Mobile
Allocation IE contains a bit-string of size NF, where NF is the
number of frequencies in the cell allocation.  If NF % 8 != 0,
then '0'B padding bits must be appended to make it octet-aligned.

In other words, if the cell allocation contains let's say 13
frequencies, but a hopping timeslot makes use of only a small
fraction of it (e.g. 4 first channels), we would still need to
transmit at least 13 bits (+padding), including all redundant
bits and octets.

In RLC/MAC frames though it's not required to make the bit-string
octet aligned, so we need to send exactly NF bits without padding.

In order to achieve that:

  a) add MA length field to INFO.ind (record PCUIF_InfoTrxTs);
  b) ajust the existing test cases to use this field.

It's safe to merge this change as the related patches have not
been merged to osmo-pcu and osmo-bts yet.

Change-Id: I2709673c90a0cd7d76de9db8b8ad82ac59ca84a0
Related: SYS#4868, OS#4547
2020-09-08 19:04:20 +00:00
Vadim Yanitskiy ac1a4fddc7 library/BSSAP_LE_Types: fix: add missing FIELDLENGTH attributes
Otherwise TITAN would refuse to decode any messages:

  Dynamic test case error: While RAW-decoding type
  '@BSSAP_LE_Types.PDU_BSSAP_LE': Can not decode type
  '@BSSAP_LE_Types.PDU_BSSAP_LE', because invalid message was received

Change-Id: I3db7e8784efd067ccf0bc7dbc234d9b4ff1c033c
Related: OS#4597
2020-09-08 18:26:19 +00:00
Pau Espin 6a846bca2c library: Add template helpers for AoIP Transport Layer Address
This way one can simply pass an IP addr in string format and return the
IE no matter the IP version.

Change-Id: I743dbb7c89e504762498b7f278c12e130352e5f0
2020-09-07 08:05:28 +00:00
Pau Espin 384e949cd2 library/MGCP_Templates: Apply MGCP AddressType based on provided address
Change-Id: I1212abd31f6a4758105675908a1b7cb841caa3dd
2020-09-07 08:05:28 +00:00
Alexander Couzens 9843b66952 Osmocom_Gb_Types: add a simple tr_NS_STATUS()
Change-Id: I0de6c483361a00a924a278a77151253450a0c1a2
2020-09-07 06:12:51 +02:00
Vadim Yanitskiy 5fec37c0d5 library/GSM_RR_Types: add minimalistic HandoverCommand
Similar to [1], the existing implementation [2] is unfriendly
to use, so let's work this around by defining a minimalistic
implementation of (RR) Handover Command.

[1] If1a5244a688abed6e6de2bf3f6e19e0e28129ea5
[2] titan.ProtocolModules.MobileL3_v13.4.0
    MobileL3_RRM_Types.PDU_RRM_HandoverCommand_NW_MS

Change-Id: I08e6d33a725f99e2c92f93153b2369c4c764c012
Related: SYS#4868, OS#4545
2020-09-02 19:02:42 +07:00
Vadim Yanitskiy 480c2ac415 library/GSM_RR_Types: cosmetic: fix formatting in RrL3Union
Change-Id: I00bcc5ebb6e098f8ec4986a3dec7e6d7e31e12f8
2020-09-01 17:15:21 +07:00
Vadim Yanitskiy 27b3801bed library/GSM_RR_Types: add minimalistic AssignmentCommand
Unfortunately, the existing implementation [1] is somewhat
incomplete and unfriendly to build templates on:

  - some fields holding integer numbers defined as BITx,
    so we would have to do bit2int() / int2bit();

  - some bit-map fields defined as octetstrings;

  - some fields are not decoded at all (raw octetstrings).

Let's work this around by defining a minimalistic implementation
of (RR) Assignment Command with all mandatory and some optional
fields.  Reuse some IEs directly from MobileL3_RRM_Types.

[1] titan.ProtocolModules.MobileL3_v13.4.0
    MobileL3_RRM_Types.PDU_RRM_AssignmentCommand_NW_MS

Change-Id: If1a5244a688abed6e6de2bf3f6e19e0e28129ea5
Related: SYS#4868, OS#4545
2020-09-01 14:43:33 +07:00
Neels Hofmeyr 1393d02d0d comment: Osmocom_CTRL: fix example for f_counter_name_vals_list_add()
Change-Id: I2ff77176267058ced3639a42127f0063bed2fd60
2020-08-31 16:40:11 +00:00
Vadim Yanitskiy e02dbcce9f library/RSL_Types: add missing Channel Identification IE
Change-Id: I4698fd15a14ee55aa4004d80e65912531f78cf06
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy c3156ed104 library/GSM_RR_Types: add receive templates tr_ChanDesc{H0,H1}
Change-Id: I1ff98c97f2670e47be5e03f3540a4e2ec8e4c373
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy 7d6eef3a72 library/GSM_RR_Types: restrict Mobile Allocation length
Change-Id: I8333900949c0f39dc1cb777904e207ed1e212440
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy 27057e0e23 library/Osmocom_Types: fix f_rnd_ra_cs(): ensure non-emergency RA
Change-Id: Idbb2a2c7c2024adea5ff5ee639aeca6eab8ebb3b
2020-08-31 15:05:57 +00:00
Vadim Yanitskiy 146efe6391 library/Osmocom_Types: fix: '10111111'B is a valid emergency RA
Most likely, the second part of the condition was copy-pasted
from ra_is_ps(), where the specs. require that at least one
of the three LSB's shall be zero.  This requirement does not
apply to emergency RA values in range '101xxxxx'B.

Change-Id: I4c923682edfeee9c6bf3aeeeb67438809a54109f
2020-08-31 15:05:57 +00:00
Harald Welte a803b72488 library: Add BSSLAP_LE_{CodecPort,Emulation}
Those two modules are analogous to BSSAP/BSSMAP CodecPort and Emulation,
but for the Lb interface (BSC-SMLC) instead of the A interface.

Change-Id: I92fd91056731abb8d3c01560f80c01c6a48a6fc9
2020-08-30 16:07:00 +00:00
Harald Welte f7c2b20741 TTCN-3 definitions for BSSMAP-LE and BSSLAP protocols
Both are part of GSM LCS and are spoken between BSC and SMLC

Change-Id: If31830be2c8e1b624579f6663e74955763db9d0e
2020-08-30 16:07:00 +00:00
Pau Espin c03eb12b58 pcu: Test Downlink UNIT_DATA messages from SGSN containing IMSI IE
osmo-pcu.git 0052051c07af63da98137c9f8e3b3119642eb587 introduced a bug
(fixed in 1d68cdff928f32941aff36c70e4543203c283d15) where no MS could
GMM attach to the network, but no test showed the issue.
This couple test verifies both correct behavior and also ensures wrong
IMSI is detected and reported.

Related: OS#4729
Change-Id: I5072d80b7ed9945a6083cdf3254efb8b8f119c54
2020-08-29 07:56:46 +00:00
Vadim Yanitskiy 4806396589 BSSMAP_Templates: add tr_BSSMAP_IE_Cause and tr_BSSMAP_SAPInReject
Change-Id: Ibf80419df4d198a1aa6f52087bd9356231de65f5
Related: SYS#5047, OS#4728
2020-08-28 18:18:11 +07:00
Vadim Yanitskiy 8352af7502 library/BSSAP_CodecPort: turn conn_id into a template param
Change-Id: I9b9ccee970b3a5bf608f2bdba51b317e35e678c7
2020-08-28 18:17:55 +07:00
Vadim Yanitskiy 6f9f7d2662 library/Osmocom_Types: share RA generation helpers from BTS_Tests
Change-Id: I7c9c3d243b39bbd3d521009d23c1043df729ee10
2020-08-28 05:56:39 +07:00
Vadim Yanitskiy 74e1f6b5d6 library/GSM_SystemInformation: move 'MobileAllocationT' to GSM_RR_Types
Change-Id: I149cf58c4bc1a8e08c69c52eb567706a0de4f9f1
2020-08-28 05:55:58 +07:00
Vadim Yanitskiy 3b464a9812 library/GSM_RR_Types: s/MobileAllocation/MobileAllocationLV/g
Change-Id: Ica803221e885b4746fd42c17cd2828c0ef35a6aa
2020-08-28 05:55:58 +07:00
Vadim Yanitskiy d8051724ff library/PCUIF_Types: fixup: keep PCUIF_InfoV10Trx aligned
Change-Id: I92ba84c5d1f77c86f7871c488965f6345c2dbbe2
Related: SYS#4868, OS#4547
2020-08-22 02:33:26 +07:00
Vadim Yanitskiy 0d59080469 library/PCUIF_Types: fix typo: s/local_pprt/local_port/g
Change-Id: Ic81469107d16c47f02db93a4fe9c35b7825d74b5
2020-08-21 11:59:00 +00:00
Harald Welte bae6be8acc GSM_RR_Types: Fix compiler warning
GSM_RR_Types.ttcn: In TTCN-3 module `GSM_RR_Types':
 GSM_RR_Types.ttcn:957.2-983.2: In template definition `ts_IMM_ASS':
  GSM_RR_Types.ttcn:957.2-983.2: While checking template restriction `value':
   GSM_RR_Types.ttcn:146.14-16: warning: Inadequate restriction on the referenced template parameter `len', this may cause a dynamic test case error at runtime
   GSM_RR_Types.ttcn:145.44-63: note: Referenced template parameter is here

Change-Id: I0d17102294430d23eb683e16d5ac66abe806f2c1
2020-08-21 13:17:59 +02:00
Harald Welte bd98295fcb L3_Templates: Fix compiler warning about missing qualifier
L3_Templates.ttcn: In TTCN-3 module `L3_Templates':
 L3_Templates.ttcn:120.1-125.1: In template definition `tr_MI_IMSI':
  L3_Templates.ttcn:122.25-124.2: In template for record field `oddEvenInd_identity':
   L3_Templates.ttcn:123.11-28: In template for union field `imsi':
    L3_Templates.ttcn:123.23-28: In actual parameter list of function `@L3_Templates.f_tr_MI_IMSI':
     L3_Templates.ttcn:123.24-27: In parameter #1 for `digits':
      L3_Templates.ttcn:123.24-27: warning: Inadequate restriction on the referenced template parameter `imsi', this may cause a dynamic test case error at runtime
      L3_Templates.ttcn:120.37-59: note: Referenced template parameter is here

Change-Id: Ia6979dff7d3c58f8609ebe55de2550446c3f1781
2020-08-21 13:17:58 +02:00
Harald Welte 9bf43cc30d L3_Templates: fix compiler warning
L3_Templates.ttcn:1099.1-1108.1: In template definition `ts_ML3_MO_CC':
  L3_Templates.ttcn:1099.53-1108.1: warning: Field `msgs' is missing from template for record type `@MobileL3_Types.PDU_ML3_MS_NW'

Change-Id: Id131274ae7832846df6c09cbe6763b9e147ef372
2020-08-21 13:17:58 +02:00
Harald Welte 88ee36088c RAN_Emulation: Fix compiler warnings about unreachable code
RAN_Emulation.ttcn: In TTCN-3 module `RAN_Emulation':
 RAN_Emulation.ttcnpp:1294.1-1343.1: In function definition `ExpectedCreateCallback':
  RAN_Emulation.ttcnpp:1309.4-1313.2: In else statement:
   RAN_Emulation.ttcnpp:1312.3-12: warning: Control never reaches this statement
  RAN_Emulation.ttcnpp:1342.2-11: warning: Control never reaches this statement

Change-Id: I4e7cc0a7e6bff5c5e569458548fa70e814bd200c
2020-08-21 13:17:58 +02:00
Harald Welte 09daa2e6cc StatsD_Types: Use 'present' qualifier; use template hierarchy
Change-Id: Ic9207e465bbee77d898d4d710a696656e43eac8d
2020-08-21 11:16:33 +00:00
Harald Welte aecdcec8ca StatsD_Types: Fix compiler warnings about missing record fields
StatsD_Types.ttcn: In TTCN-3 module `StatsD_Types':
 StatsD_Types.ttcn:51.1-55.1: In template definition `tr_StatsDMetric':
  StatsD_Types.ttcn:51.126-55.1: warning: Field `srate' is missing from template for record type `@StatsD_Types.StatsDMetric'
 StatsD_Types.ttcn:57.1-61.1: In template definition `tr_StatsDMetricCounter':
  StatsD_Types.ttcn:57.106-61.1: warning: Field `srate' is missing from template for record type `@StatsD_Types.StatsDMetric'
 StatsD_Types.ttcn:63.1-67.1: In template definition `tr_StatsDMetricGauge':
  StatsD_Types.ttcn:63.104-67.1: warning: Field `srate' is missing from template for record type `@StatsD_Types.StatsDMetric'

Change-Id: I6d3b40dc719b42481dacb5599eb7eeb3be0426b4
2020-08-21 12:39:40 +02:00
Harald Welte b75bbf89c4 RSL_Emulation: Fix compiler warning about dead code
RSL_Emulation.ttcn: In TTCN-3 module `RSL_Emulation':
 RSL_Emulation.ttcn:478.1-713.1: In function definition `main':
  RSL_Emulation.ttcn:500.2-712.2: In while statement:
   RSL_Emulation.ttcn:501.3-711.3: In alt construct:
    RSL_Emulation.ttcn:695.4-28: In function instance:
     RSL_Emulation.ttcn:725.9-744.1: In function definition `f_WaitingQueue_dispatch':
      RSL_Emulation.ttcn:729.2-740.2: In for statement:
       RSL_Emulation.ttcn:732.3-736.3: In if statement:
        RSL_Emulation.ttcn:735.4-8: warning: Control never reaches this statement

Change-Id: I1e080a8543a9f26b45b345e47881b6f6d4c9b362
2020-08-21 12:39:40 +02:00
Harald Welte afd87efcd1 CBSP_Templates: Fix tons of compiler warnings
CBSP_Templates.ttcn:385.1-401.1: In function definition `ts_CBSP_REPLACE_CBS_COMPL':
  CBSP_Templates.ttcn:396.2-398.2: In if statement:
   CBSP_Templates.ttcn:397.3-50: In variable assignment:
    CBSP_Templates.ttcn:397.40-50: In actual parameter list of template `@CBSP_Templates.ts_CbspCellList':
     CBSP_Templates.ttcn:397.41-49: In parameter #1 for `list':
      CBSP_Templates.ttcn:397.41-49: warning: Inadequate restriction on the referenced template parameter `cell_list', this may cause a dynamic test case error at runtime
      CBSP_Templates.ttcn:387.8-68: note: Referenced template parameter is here

Change-Id: I54c21d17ab3235ec37d5f07867d8c6c83d699088
2020-08-21 12:39:40 +02:00
Harald Welte 420c6b0bea BSSMAP_Templates: fix compiler warnings
BSSMAP_Templates.ttcn: In TTCN-3 module `BSSMAP_Templates':
 BSSMAP_Templates.ttcn:181.1-192.1: In template definition `ts_BSSMAP_Reset':
  BSSMAP_Templates.ttcn:181.1-192.1: While checking template restriction `value':
   BSSMAP_Templates.ttcn:188.21-54: warning: Inadequate restriction on the referenced function `f_enc_osmux_support(osmux_enabled)', this may cause a dynamic test case error at runtime
   BSSMAP_Templates.ttcn:174.9-179.1: note: Referenced function is here
 BSSMAP_Templates.ttcn:207.1-217.1: In template definition `ts_BSSMAP_ResetAck':
  BSSMAP_Templates.ttcn:207.1-217.1: While checking template restriction `value':
   BSSMAP_Templates.ttcn:213.21-54: warning: Inadequate restriction on the referenced function `f_enc_osmux_support(osmux_enabled)', this may cause a dynamic test case error at runtime
   BSSMAP_Templates.ttcn:174.9-179.1: note: Referenced function is here

Change-Id: I947e1a6aeb1fe40167eb268906906edd7e857232
2020-08-21 11:55:23 +02:00
Harald Welte cc5e159c61 GSM_Types: Fix compiler warning
GSM_Types.ttcn:45.4-12: warning: Control never reaches this statement

Change-Id: I3572f59f4c2a266e8f549a805c3dffeae0570a8c
2020-08-21 11:55:23 +02:00
Neels Hofmeyr cb11a97aaf bsc CBSP: fix tr_CBSP_KILL_FAIL, no lengthof() on record-of with '*'
Keep a local next_idx so that lengthof() doesn't fail after adding a '*' entry.
Fixes this error in BSC_Tests_CBSP.TC_cbsp_write_then_kill:

 Dynamic test case error: Performing lengthof() operation on a template of type @CBSP_Types.CBSP_IEs with no exact length.

Change-Id: I4d95a8ca311f145fa5ea371b6aed099db771d7b8
2020-08-13 19:31:23 +00:00
Daniel Willmann 742372880b Add parsing and checking of StatsD metrics
Change-Id: Icd1317b5f192d98e6cdc6635788d450501992bf1
Related: SYS#4877
2020-08-13 15:02:15 +00:00
Neels Hofmeyr f793a7e464 comment: Osmocom_Types.ttcn: clarify f_rnd_int() return val
Change-Id: I0841b037d39fcadb75e1c13cf97d22917b68e2aa
2020-08-13 05:36:26 +00:00
Neels Hofmeyr 95a5edc308 bsc: test RR Channel Release cause codes from Clear Command cause codes
Invoke Clear Command with various Cause codes and verify that the RR Channel
Release reflects them.

Depends: I734cc55c501d61bbdadee81a223b26f9df57f959 (osmo-bsc)
Change-Id: Ie6c99f28b610a67f2d59ec00b3541940e882251b
2020-08-12 18:21:24 +00:00
Neels Hofmeyr 0edf4ac242 bsc: test RR Channel Release EARFCNs
Add a DCHAN and release to recently added SI2quater tests (because these tests
already configure various amounts of EARFCNs in osmo-bsc).

Verify that the RR Channel Release for CSFB contains all configured EARFCNs.

In GSM_RR_Types.ttcn, add coding for "Cell selection indicator after release of
all TCH and SDCCH IE".

In f_expect_chan_rel(), add optional arg csfb_expect_cells, and, if present,
decode the RR Channel Release message's L3 part, and in turn the Cell Selection
Indicator Value contained. Match against csfb_expect_cells.

In f_tc_si2quater_n_earfcns(), also compose a list of EARFCNs as found in the
RR Channel Release, and pass to f_expect_chan_rel().

Depends: I59e427e4ebb1c6af99b27a15c40fed82457ac8ab (osmo-bsc)
Change-Id: I882c5e1f70bcc4833fc837a95c900ce291919cc5
2020-08-12 18:21:24 +00:00
Neels Hofmeyr 5c59a8f04a another fixup for "fix mscpool cleanup (fixes LCLS tests)"
During patch grooming of the previous fixup, one patch line went missing, which
breaks the ttcn3-bsc-test-latest completely. Add that change now.

Change-Id: I75295d638072df9f5213a7e74e4a960c009c2865
2020-08-12 11:19:23 +00:00
Neels Hofmeyr 345a15f213 log: for VTY Unknown Command, fix weird log message
In f_vty_wait_for_prompt(), this:

   testcase.stop(fail, "VTY: Unknown Command")

outputs:

   failVTY: Unknown Command

The first stop() argument 'fail' is not actually a test verdict, but gets
rolled into a log output string, becoming "failVTY".

Fix that by simply using the normal pattern of setverdict() followed by
mtc.stop().

Change-Id: Id09986444de02c10b4fba582d454d54568b6e8a2
2020-08-12 01:05:59 +00:00
Neels Hofmeyr e4b0a662ca fixup for "fix mscpool cleanup (fixes LCLS tests)"
For the VTY "Unknown Command" code path, we must actually call 'repeat', to
avoid racey VTY behavior from cruft stuck in the VTY pipe.

The missing 'repeat' caused massive random fallout in the 'latest' builds,
which often hits the 'Unknown Command' code path; fixed by this patch.

Change-Id: Ibd5adb359b3fb302e2c70700d911878aef605ff3
2020-08-12 01:05:48 +00:00
Neels Hofmeyr 2fe5ad171d f_vty_transceive: allow to ignore unknown vty commands
When a new test uses a VTY configuration that may not yet be available in the
'latest' build, it can be useful to ignore the "Unknown VTY Command" error.

To be used by f_init() for multiple MSCs, setting a default 'allow-attach' flag
per MSC implicitly -- such vty config is not yet supported in the latest build.

Change-Id: I284c42e10c0cb282c8410db87959b471867edef6
2020-08-10 20:16:09 +00:00
Vadim Yanitskiy 355604cbcf library/PCUIF_Types: add receive templates for PCUIF_InfoTrxTs
Change-Id: I062079de4440d2c9c0a079cc4cc4328ea0ea37dd
2020-08-09 20:03:38 +07:00
Vadim Yanitskiy 9e1206c791 library/PCUIF_Types: version 10: add frequency hopping parameters
This change introduces new version 10 specific extensions, in
particular: the frequency hopping parameters of each timeslot.
These parameters are used to compose Channel Description IE
in the packet resource assignment messages.

In order to maintain backwards compatibility with version 9 of
the PCUIF, and thus to still be able to run test cases against
the latest release of osmo-pcu, I kept the old parts of the
INFO.ind and gruoped them together with the new records
into union 'PCUIF_InfoTrxs'.

During decoding, the content of this union is resolved by the
TITAN's RAW codec itself, depending on value of the 'version'
field.  During the encoding, it's the responsibility of the
API user to set a proper field of the union.  I implemented
both f_PCUIF_ver_INFO_{Trxs,PDCHMask} helpers for that.

Version 9 is kept as default, so this change can be merged
independently of the actual implementation.  We can bump
it and remove the compatibility glue once the new versions
of both osmo-bts and osmo-pcu are released.

Change-Id: Idf11bc4ba3ff0b00b32f2beab8fd020c67119d05
Related: SYS#4868, OS#4547
2020-08-09 19:58:25 +07:00
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