Commit Graph

2321 Commits

Author SHA1 Message Date
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
Vadim Yanitskiy cc4e149a2f BTS_Tests: simplify MA length calculation in f_resolve_fh_params()
Change-Id: I13f1d45162b520eff0d2e9823604fda85b71970b
Related: SYS#4868, OS#4708
2020-09-14 09:04:39 +00:00
Vadim Yanitskiy 9308cd665d BTS_Tests: also match MA length in TC_pcu_info_ind_fh_params()
Change-Id: Ibebbedecaed0a3f24a1bc7b520013fa563c4bbda
2020-09-14 09:04:39 +00:00
Philipp Maier 104f4c0399 BSC_Tests: set verdict to pass when TC_emerg_premption is done
The testcase TC_emerg_premption does not set a verdict when done. Make
sure that the verdict is set to pass when the test is done.

Change-Id: Ie612b32cfa9cedd1e0f1d51e48911da94ec325cf
Related: OS#4549
2020-09-13 16:14:08 +00:00
Harald Welte 501e070d6e deps: switch TELNETasp and M3UA back to upstream
the respective changes we had have long been merged upstream, so
let's switch back from our own forks to upstream

Change-Id: I52bdac20745bc3f5ce618ea804686781483a6f4c
2020-09-13 11:34:28 +02: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
Alexander Couzens 5283f55777 BTS_Tests: verify NSVC IPv4/IPv6 in the INFO.ind message
Change-Id: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973
Tweaked-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
Related: SYS#4915
2020-09-11 12:58:00 +00: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 f57ff03acb PCU_Tests_NS: add missing bound of nrf
Otherwise it will try to use setverdict() with an unbound PDU

Change-Id: Ieafe9017126dd293aad09dad3c8a4180c9c29fa0
2020-09-11 12:56:39 +00:00
Alexander Couzens f74b5cba34 BSC_Tests: check for the same measurement bandwidth as in SI2quater on Channel Release
osmo-bsc is using the same LTE neighbors of the SI2quater in the Channel Release -
Cell selection indicator after release of all TCH and SDCCH IE. Ensure the same measurement bandwidth
is present to not overwrite the measurements bandwidth from the SI2quater.

Change-Id: I9aa30dfd1e2c1b80e037bd71ebc4cdd3752638b4
2020-09-11 14:40:47 +02:00
Alexander Couzens 4ad3a356f3 BSC_Tests: fix whitespace typo
Change-Id: I68d7b6ef1d35b798f66a04bce4de29fdd75ff7f1
2020-09-11 11:23:01 +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 9e0141aa84 mgw: Test IPv6 RTP streams in osmo-mgw
Change-Id: I2a47926757af84ffa190a954aac0dcc5369528b3
2020-09-09 18:13:37 +00:00
Pau Espin 24c0599541 bsc: Fix race condition waiting for RESET-ACK
This scenario appeared in jenkins runs of BSC_Tests making
TC_ctrl_msc_connection_status fail (the first test in the suite). I
could however not reproduce it on my local docker setup because it
really seems like a timing race condition.

The scenario is:
TTCN3 -> BSC: RESET
TTCN3 <- BSC: RESET
TTCN3 -> BSC: RESET-ACK

In there, TTCN3's f_legacy_bssap_reset() expected a RESET-ACK to be
received, but it may well be that the other end never saw the RESET and
hence it will never sent the RESET-ACK, since it indicated it became
available afterwards. In that case (RESET received), let's not fail if a
RESET-ACK is never received, since the connection is actually in the
desired state and this scenario can happen and it's all fine.

Change-Id: Ic92e0fb7033e5134b66e485a11371394adaba78a
2020-09-09 16:50:53 +00:00
Pau Espin db2dc0494e mgw: Test IPv6 addresses in MGCP messages
These tests verify that osmo-mgw handles requests no matter of IP
version used in the remote address.

Change-Id: Ib134dda5a8f7c8f50968b6ce330f9986ae72575d
2020-09-09 13:54:42 +00:00
Pau Espin b604af09ea mgw: Rename IP address module parameter specifying IP version
Change-Id: Ia393d7175de277ec8fa524ba74bf3b150b74c766
2020-09-09 13:54:42 +00:00
Pau Espin 25f47a72dc mgw: Fix using incorrect IP version in TC_one_crcx_receive_only_rtp
Send the remote address to MGW so it knows which IP version to return
during CRCX ACK. This actually better suits the test, since there's less
point in checking whether we receive something if we never pass the
IP/port to MGW. In any case, the "recvonly" should still tell MGW to
refrain from sending stuff to us, so we are really testing that here.

Change-Id: Id3452cecf7fb281e5e46471f7f53983c08c6bfdf
2020-09-09 12:22:42 +00:00
Pau Espin e67b1c64ce mgw: Fix logic in test TC_two_crcx_mdcx_and_rtp_osmux
rtpem should be set to BIDIR at the same time where MDCX "sendrecv" is
sent, otherwise if MGW sends us RTP packets (because we set the conn to
sendrecv) they will be counted incorrectly in
stats[0].num_pkts_rx_err_disabled.

This issue doesn't trigger in current code because the MGW doesn't know
anyway the remote IP address of the other connection until an MDCX is
sent to it. However, if for whatever reason the IP address is known (for
instance because it is set during CRCX, which will be done in next
commits), then RTP messages would be sent and the error counter would
be > 0.

Change-Id: I8f2c4e497e522fc17e5cfe76987f802265c486ab
2020-09-09 12:22:42 +00:00
Pau Espin 89c76d2102 mgw: Fix logic in test TC_two_crcx_mdcx_and_rtp
rtpem should be set to BIDIR at the same time where MDCX "sendrecv" is
sent, otherwise if MGW sends us RTP packets (because we set the conn to
sendrecv) they will be counted incorrectly in
stats[0].num_pkts_rx_err_disabled.

This issue doesn't trigger in current code because the MGW doesn't know
anyway the remote IP address of the other connection until an MDCX is
sent to it. However, if for whatever reason the IP address is known (for
instance because it is set during CRCX, which will be done in next
commits), then RTP messages would be sent and the error counter would
be > 0.

Change-Id: I653eb75439321f9a488dc56dca5d3fc5a8811547
2020-09-09 12:22:42 +00:00
Pau Espin 71387aac71 mgw: Allow setting udp ip/port with wildcard osmux in f_flow_create_osmux()
This will be needed once IPv4+IPv6 support is used, since we want to set
the remote IP addr in CRCX for convinience to get an IP adr from ther
same family during CRCX, while still allowing for testing Osmux CID
wildcard value.

Change-Id: I3abd80b1c0053004aab3d03e09fada1129a59765
2020-09-09 12:22:42 +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
Pau Espin 833174e7fb msc: Introduce tests to verify BSSAP and MGCP handling with IPv6
It tests IPv6 Transport Address are passed correctly through BSSAP, and
forwards handles them correctly as an MGCP client too.

Change-Id: Id616926dd4a9febc4268eea2ee1e377b2d22753a
2020-09-09 12:48:32 +02:00
Pau Espin 078666329d bsc: Introduce test TC_assignment_aoip_tla_v6 and TC_ho_into_this_bsc_tla_v6
Change-Id: Iba24fae66c80b64bf81bbfd616294af757e5dca3
2020-09-09 12:48:28 +02:00
Vadim Yanitskiy 7a04cdd9aa PCU_Tests: randomize MA length in f_TC_pcuif_fh_params_gen()
This way we also test different variations of MA length.

Change-Id: Id886ed72c8a03fe2b27bc7add74eb0f58a2fe6ff
Related: SYS#4868, OS#4547
2020-09-08 19:04:20 +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 ef0c1b5943 PCU_Tests: introduce and use f_TC_pcuif_fh_params_gen()
Change-Id: I297b52410afafedad51d5b51734e946c4d62e8d2
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
Pau Espin cb4c59d131 msc: Fix wrong mgcp conn expected in several places
Change-Id: I0bb15881e640fe49552108679894d5df15339fc8
2020-09-07 08:05:28 +00:00
Vadim Yanitskiy 8f5430d8cc BSC_Tests/hopping: add TC_fh_params_handover_cmd
Similar to TC_fh_params_assignment_cmd, this test case verifies
presence and correctness of the hopping parameters in the following
messages and their IEs:

  1. (RR) Handover Command
  1.1. Description of the First Channel, after time IE
  1.2. Cell Channel Description IE (presence)
  1.3. Mobile Allocation, after time IE

The hopping parameters are randomly generated and configured
via the VTY interface in the beginning, and unset in the end.

Since the C0/TS0 (BCCH+SDCCH4+CBCH) shall not be hopping, let's
temporarily re-configure TS0 as BCCH, and TS1 as SDCCH8 on TRX0
of BTS1 (handover tagret).

Change-Id: I0ddea535dce7e5558793be5cddaad0ab46e978ec
Related: SYS#4868, OS#4545
2020-09-07 07:53:59 +00:00
Vadim Yanitskiy 2172631ba4 BSC_Tests/hopping: call f_shutdown_helper() in all TC_fh_params_*
Change-Id: I84d35bc6c50fb7404918b43022819713f3e86d37
2020-09-07 07:53:59 +00:00
Vadim Yanitskiy 2aa02529de BSC_Tests/hopping: fix: do not reduce Mobile Allocation bit-mask
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.

Change-Id: Ia79efc9aa07b5088913d6679715f351d30f48d13
Related: SYS#4868, OS#4545
2020-09-07 07:53:59 +00:00
Vadim Yanitskiy 8bc46011e3 BSC_Tests/hopping: fixup TC_fh_params_si4_cbch: bring CBCH back
Change [1] introduced a regression that caused some TC_cbsp_*
test cases to fail.  The problem is that TC_fh_params_si4_cbch
re-configures TS0 as CCCH+SDCCH4 instead of CCCH+SDCCH4+CBCH,
so the CBCH channel vanishes after this test case is executed.

[1] Ibc3b73697a1d2c8dbb27274e48f5e5ba21fdd540

Change-Id: Ia249f10c1b768a5af2b6c92ecba5d2941528f876
Related: SYS#4868, OS#4545
2020-09-07 07:53:59 +00:00
Alexander Couzens 355ab56a24 PCU_Tests_NS: allow an UNBLOCK message to arrive before ALIVE
The ALIVE PDU does not have to be sent before an UNBLOCK message.
Ignore UNBLOCK messages in cases a single ALIVE is expected.

According to TS 48.016 v5.2.0, 7.4:
"Upon successful completion of an NS-VC reset procedure,
a BSS (or SGSN) shall start timer Tns-test, then [..]"
The ALIVE should arive Tns-test after the reset procedure (typ. 1s-60s).

Change-Id: I11d77b7477981998082967e5123b61636af2b980
2020-09-07 07:10:01 +00:00
Alexander Couzens 1220a24ebd RAW_NS: implement f_outgoing_ns_reset
-> RESET
<- RESET ACK

Change-Id: I1a50615de4650266ca99216f8e4a18202678d669
2020-09-07 06:12:51 +02:00
Alexander Couzens 9843b66952 Osmocom_Gb_Types: add a simple tr_NS_STATUS()
Change-Id: I0de6c483361a00a924a278a77151253450a0c1a2
2020-09-07 06:12:51 +02:00
Alexander Couzens 3c268daa0e PCU: move RAW_NS into own file to use it in the SGSN tests
In preparation to test the SGSN role of NS

Change-Id: Id91aa81c4fb6689cd1353d88b4806d26868769e8
2020-09-07 06:12:25 +02:00
Vadim Yanitskiy 0007072fda BSC_Tests/hopping: make f_vty_{handover,ss_action}() more flexible
Make it possible to call them from a testcase / function
running on any kind of component, not only on MSC_ConnHdlr.

Change-Id: Ifbcc24c5a0299ba43a998ccbdd0f77bc109c6935
2020-09-02 19:02:49 +07:00
Vadim Yanitskiy 93a2fda742 BSC_Tests/hopping: fix bit-mask reduction in f_TC_fh_params_gen_tr_ma()
Change-Id: Id8b1e9fb62f9deaa5517d7366271437af0fc6eef
Related: SYS#4868, OS#4545
2020-09-02 19:02:42 +07:00
Vadim Yanitskiy 38d069d09b BSC_Tests/hopping: fix error message in TC_fh_params_assignment_cmd
Change-Id: I6ccee0296e3f5ae13086b8e68c1709e386f59e97
2020-09-02 19:02:42 +07: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 ca97403ec3 BSC_Tests/hopping: add TC_fh_params_si4_cbch
This test case verifies presence and correctness of the hopping
parameters in (RR) System Information Type 4 (CBCH description).
Since the C0/TS0 (BCCH+SDCCH4+CBCH) shall not be hopping, let's
temporarily re-configure TS0 as BCCH, and TS1 as SDCCH8+CBCH.

According to 3GPP TS 44.018, section 9.1.36.1, if CBCH is active
in the cell, the CBCH Channel Description IE indicates where to
find it (physical channel description).

According to section 9.1.36.2, the CBCH Mobile Allocation IE shall
be included if CBCH Channel Description IE indicates that frequency
hopping is in use.

Change-Id: Ibc3b73697a1d2c8dbb27274e48f5e5ba21fdd540
Related: SYS#4868, OS#4545
2020-09-01 21:45:05 +07:00
Vadim Yanitskiy aeb54a2f29 BSC_Tests/hopping: add TC_fh_params_assignment_cmd
This test case verifies presence and correctness of the hopping
parameters in the following messages and their IEs:

  1. (RR) Assignment Command
  1.1. Description of the First Channel, after time IE
  1.2. Mobile Allocation, after time IE

Change-Id: Id12509385b444c426f4af7a0cf0d46efe2cb0eda
Related: SYS#4868, OS#4545
2020-09-01 21:45:05 +07:00
Vadim Yanitskiy 16bbde9d31 BSC_Tests/hopping: add TC_fh_params_{chan_activ,imm_ass}
This test case verifies presence and correctness of the hopping
parameters in the following messages and their IEs:

  1. RSL CHANnel ACTIVation
  1.1. Channel Identification IE

  2. RSL IMMEDIATE ASSIGN COMMAND
  2.1. Channel Description IE
  2.2. Mobile Allocation IE

The hopping parameters are randomly generated and configured
via the VTY interface in the beginning, and unset in the end.

Change-Id: Ib9218b61a2b0c0467340656e4b65a36b7b0ba302
Related: SYS#4868, OS#4545
2020-09-01 21:45:05 +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