Commit Graph

2306 Commits

Author SHA1 Message Date
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
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 12941bd6b0 bsc: verify handover rate counters
This will break the 'latest' builds for most handover tests until
Ib0087b6566ae4d82f8c3ef272c1256bcd1d08bf1 is released.

Move the TC_ho_neighbor_config_* closer to the f_tc_ho_neighbor_config_*
functions, so that it is easier to read the added counters, relating to the
expected handovers.

Depends: Ib0087b6566ae4d82f8c3ef272c1256bcd1d08bf1 (osmo-bsc)
Change-Id: I10bc0b67ca8dcf41dbb02332ed18017e819c2b32
2020-08-31 16:40:22 +00: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 8cb5825ffc Revert "bsc: Add Lb interface support"
This reverts commit c47fdb2e52 - as
osmo-bsc currently doesn't yet have a Lb interface, we shouldn't try
to test it yet.

Change-Id: I7898dd336cbef27553d97857ac22f1a539da1380
2020-08-31 16:50:43 +02:00
Harald Welte c47fdb2e52 bsc: Add Lb interface support
This introduces the Lb interface stack, which allows BSC_Tests.ttcn
to emulate a SMLC towards the BSC.

In accordance with https://osmocom.org/projects/cellular-infrastructure/wiki/Point_Codes
we use 0.23.6 as point code for emulating the SMLC.

Change-Id: I854618cc08de1a716784f52542a4df3c7f7ad900
2020-08-30 16:07:00 +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
Neels Hofmeyr cec2d802ad BSC CBSP: apply changes to 'cbc' vty section, switch server<->client modes
With Icaa2775cc20a99227dabe38a775ff808b374cf98, osmo-bsc no longer allows
configuring CBSP as both server and client at the same time, and the 'cbc' VTY
section has a different structure.

Adjust the 'cbc' section in osmo-bsc.cfg.

For each CBSP test init, switch osmo-bsc's CBSP link to server or client mode
by new vty command 'cbc' / 'mode (server|client|disabled)'.

Related: Icaa2775cc20a99227dabe38a775ff808b374cf98 (osmo-bsc)
Related: I9e9760121265b3661f1c179610e975cf7a0873f1 (docker-playground)
Related: OS#4702
Change-Id: I7eea0dd39de50ed80af79e0f10c836b8685d8644
2020-08-29 07:58:41 +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 6ef5dfab86 BSC_Tests: add TC_rll_{rel_ind,err_ind,timeout}_sapi_n_reject
The idea of these new test cases is to verify that the IUT does
send BSSMAP SAPI N Reject in the following cases respectively:

  - on receipt of an unexpected RLL RELease INDication message
    in response to RLL ESTablish REQuest (for SAPI=3 link);

  - on receipt of an unexpected RLL ERROR INDication message
    in response to RLL ESTablish REQuest (for SAPI=3 link);

  - due to SAPI=3 link establishment timeout.

Change-Id: I00489e2af3befe5780380f64b09fb01e726c8df5
Related: SYS#5047, OS#4728
2020-08-29 01:50:10 +07:00