Commit Graph

407 Commits

Author SHA1 Message Date
Pau Espin c77743d544 pcu: Update component diagram
The component architecture in PCU_Tests is quite complex to follow.
Update the diagram in order to make it easier for people to gasp the big
picture.

Change-Id: Ie592a9301b7a900334650741ed633cd70535a2b1
2024-04-15 08:55:36 +00:00
Harald Welte 556e4d2dbc various: update expected-results.xml
Change-Id: I21052636bf892e5da86ef736d16035ec324aedbe
2024-03-04 19:09:58 +00:00
Vadim Yanitskiy 8f86bbee5a library/PCUIF_Types: clean up, drop remains of PCUIFv10
Change-Id: Ibfe8558cb9f335d8c29348063b0ff02b138dd4c7
Related: osmo-pcu.git I68a3f59d5c960ae3a4fbd74f9d4a894295cb9ed8
Related: docker-playground.git If0b2209af645f391817f65b4227736b52ca59e2e
Related: docker-playground.git I70f0c30d6c514614095dcbbcac5d025001861fbc
Related: OS#6191
2023-12-15 13:15:30 +00:00
Philipp Maier 7c66d8087f PCU_Tests: tell PCU a more realistic BTS model
In ts_PCUIF_INFO_default we set the bts_model member to
PCU_IF_BTS_MODEL_UNSPEC. This means that the PCU will not know the BTS
model and thus it is not able to comply to the specific pecularities of
the BTS model that is used. In PCU_Tests.ttcn we simulate the behavior
of an OsmoBTS with OsmoTRX, therefore we should set the BTS model to
PCU_IF_BTS_MODEL_TRX.

This will also fix the problems we have with unexpected DUMMY messages
we currently receive since in an OsmoTRX based BTS model those frames
will be generated by OsmoTRX and do not appear on the PCUIF interface.
When the BTS model is left unspecified, then the PCU will generate those
DUMMY messages and irretate the testsuite.

Related: OS#6191
Change-Id: I6b516eece6acc96ebde9759bcb609197a245dd84
2023-11-28 12:45:36 +01:00
Philipp Maier e0666ea5bc PCUIF: upgrade to PCUIF v12
We have added an additional bts_model field to the PCUIF_info_ind. This
also means that we have to increment the PCUIF version number since
adding fields is a major change to the protocol. This patch updates the
related TTCN3 record and also increments the PCUIF version number.

Related: OS#6191
Depends: osmo-pcu.git I48eb75f65ab54fdec41ef913e24c1f18cd4a4047
Change-Id: Ib1516e66c70f021adee49f41bd707803fc06f9cf
2023-11-21 09:17:55 +00:00
Pau Espin aedacf3256 pcu: Fail immediately in TC_n3105_max_t3195
Change-Id: I55b97037c014478451790e1943c617a634fe2457
2023-09-28 15:06:29 +00:00
Philipp Maier 707a3fc8fb PCU_Tests_SNS: fix TC_pcuif_rach
The tesctcase TC_pcuif_rach expects an immediate assignment message on
the AGCH but the template still uses the now deprecated (old v10 PCUIF)
SAPI PCU_IF_SAPI_AGCH. With PCUIF v.11 we must use PCU_IF_SAPI_AGCH_2

Related: OS#5927
Change-Id: Ie8b2e21e184282f70c92d6b9f716cfda1405ef4d
2023-09-27 17:24:52 +02:00
Philipp Maier 7f064e6b02 PCU_Tests: make sure ts_BSSGP_DL_UD includes IMSI
Whenever we send a ts_BSSGP_DL_UD via BSSGP and we expect the downlink
assignment on the paging channel by calling
f_ms_exp_dl_tbf_ass_ccch(ms), then we should make sure that
ts_BSSGP_IMSI actually contains an IMSI (paging group)

Related: OS#5927
Change-Id: I356d93edd03c7e7564bde88d34effcf1b1967621
2023-09-22 16:38:19 +02:00
Philipp Maier c49069b534 PCU_Tests: fix BSSGP in TC_ta_idle_dl_tbf_ass
When we send BSSGP DL UD, we should include an IMSI, since we are
expecting the paging request to appear on the PCH

Related: OS#5927
Change-Id: If62c2c7db9717cd08116374ee6ca939211bdf01e
2023-09-22 16:32:42 +02:00
Philipp Maier 1ec31b3311 PCU_Tests: add an IMSI when sending data via BSSGP
In many of our tests we trigger a paging by the PCU by sending some data
through BSSGP. However, we often do this without putting an IMSI into
the ts_BSSGP_DL_UD template. The PCU then send the paging through the
AGCH because without IMSI no paging group can be calculated. The tests
still expect the paging to appear on the PCH and fail.

Let's fix this by adding an IMSI to the BSSGP request so that the PCU
knows the and the paging is sent through the PCU.

Change-Id: I7a70cc2a8af9d088071841861a8120afb9af86f9
2023-09-22 15:49:15 +02:00
Philipp Maier 8a4d0e09b1 GPRS_Components: confirm only when requested
We currently send a confirmation back when the SAPI was PCH. This is no
longer correct. We now have to check if the receiving end has actually
requested a confirmation.

Related: OS#5927
Change-Id: I339dfd0c057d957d2ace24fd6821e54c25fe8eb2
2023-09-22 11:57:47 +02:00
Philipp Maier e76efaa853 PCUIF_Components: ensure clean IMSI string
When receiving an IMSI from PCUIF (see type record PCUIF_pch), it is
represented as a null terminated string. The field is set to be 17
characters wide with a pdding of zeros at the end (as it ought to be
for a null terminated string). Unfortunately TTCN3 will not chop off
the trailing zeros, and also include them when the string length is
determined using lengthof(). This means we must take care of this
ourselves.

Let's use a regular expression to make sure any non numerical digits
are trimmed off before passing the IMSI string on to higher layers.

Related: OS#5927
Change-Id: I7bfea59a306e75211856e4e80985ebf000c42224
2023-09-22 09:59:47 +02:00
Philipp Maier e0fa9b0786 GPRS_Components: use imsi record member
The function f_pcuif_rx_pch_pag_req1 tries to read the IMSI suffix from
the raw data that was exchanged on the PCUIF interface. This is no
longer the appropriate way in PCUIF v.11. There is now a dedicated imsi
member in type record BTS_CCCH_Block, which is used for that purpose.

Related: OS#5927
Change-Id: I0c7c6a31cbf7ed533e665728c157de0ac9e0fe8d
2023-09-22 07:30:02 +00:00
Philipp Maier 4222f479a2 PCU_Tests: use PCUIF v.11 exclusively
OsmoPCU has support for PCUIF v.11 for quite some time now. Let's
upgrade the testsuite as well.

Related: OS#5927
Change-Id: I6c4042f2224cd48aecc1b1499226f7d23caddd4f
2023-09-19 13:10:25 +02:00
Pau Espin 8d000b7773 PCUIF_Types: Use mp_pcuif_version := 11 everywhere
Since osmo-bts 1.7.0 & osmo-pcu 1.3.0, which were just released
PCUIF v11 is supported, so use it by default.

Change-Id: I8e5f44fc1d613c12eaf984dff860ee6f05c2c171
2023-09-14 17:31:58 +02:00
Philipp Maier 4e76926683 PCUIF_Components: fix confirm member in record BTS_CCCH_Block
The record BTS_CCCH_Block has an optional field "confirm". However, this
field is not marked as optional. Also f_BTS_CT_handler should make sure
that this field is populated with "omit" when it is not present.

Related: OS#5927
Change-Id: Ifcbb72c22b93855bed89f4970cf63bd2d6fcd128
2023-08-30 15:40:15 +02:00
Philipp Maier ca5da3767c PCUIF_Components: add compatibility for PCU_IF_SAPI_AGCH_2
When we receive a PCUIF_DATA_REQ, f_BTS_CT_handler will mangle the
incoming message for us. The resulting BTS_CCCH_Block that is sent up to
the component not only contains the PCUIF message, but will also have
the already parsed MAC block attached. This currently only works for
PCU_IF_SAPI_PCH and PCU_IF_SAPI_PCH_2 but not for PCU_IF_SAPI_AGCH_2.

Let's add compatibility for PCU_IF_SAPI_AGCH_2.

Related: OS#5927
Change-Id: Ife67bde444d957822a953391b80d01d49fff064b
2023-08-29 13:18:03 +02:00
Philipp Maier 0221248078 PCUIF: use confirm flag in struct gsm_pcu_if_pch
In the recent PCUIF change of osmo-pcu (see Depends) a confirm flag
is added to struct gsm_pcu_if_pch. This flag tells the receiving end
(OsmoBSC or OsmoBTS) that the sending of the received MAC block has
to be confirmed towards the PCU. OsmoBTS and OsmoPCU now rely on the
conformation flag.

Let's update the BTS_and PCU testsuites accordingly.

Related: OS#5927
Depends: osmo-pcu.git Ia202862aafc1f0cb6601574ef61eb9155de11f04
Change-Id: I7017ca20ca7e0b77d0f363121e4f17280e39e8ac
2023-08-29 13:18:03 +02:00
Philipp Maier d501ee8c7a GPRS_Components: remove excess new-line
Change-Id: Id039755d0136276ec2fb8f6d370a4415a8d3e17e
2023-08-29 13:18:03 +02:00
Philipp Maier e683828c34 PCUIF_Types: get rid of _DT, _dt (Direct TLLI)
Since we now no longer refer to TLLI when we mean "message ID" (msg_id),
we should also remove the "_DT" / "_dt" suffix from structs and define
constants and replace it with "_2" if required.

Depends: osmo-pcu.git If641b507dcb6b176109c99dce7cff2a7561364b0
Related: OS#5927
Change-Id: I15e754ce3ceed92a517586a073d3e3ed008b5eef
2023-08-22 10:33:56 +00:00
Philipp Maier a6708cf613 PCUIF: rename tlli to msg_id
To confirm downlink IMMEDIATE ASSIGNMENT messages, we use the TLLI as an
identifier and the related record member is also called "tlli".
Unfortunately this is misleading since the message identifier does not
necessarly have to be a TLLI. It is just an implementation detail that
osmo-pcu uses the TLLI as a message identifier.

To make that clear, lets rename the tlli member (and variable and
parameter names where it is passed on) to "msg_id".

(Since this change only renames variables and struct members it will not
break compatibility with other programs that use the PCUIF)

Related: OS#5927
Depends: osmo-pcu.git I4a25039dfe329e68879bc68936e49c4b190625e6
Change-Id: I1db29d5b1920e351c452b798c3260654c2cbe0cb
2023-08-17 14:12:14 +00:00
Pau Espin 85ad3d01c7 pcu: Introduce test TC_dl_multislot_tbf_ms_class_unknown
Related: OS#6118
Change-Id: I9af8792fe4c44b5dd1aab5a2d4b7d3c2a2366d12
2023-07-31 09:14:41 +00:00
Pau Espin 1de8df76d7 pcu: TC_dl_multislot_tbf_ms_class_from_sgsn(): Properly wait for USF
Change-Id: I34b31c292c00b6880311906ce6713a8e3c69a0d2
2023-07-31 09:14:41 +00:00
Pau Espin bd849ccd16 pcu: Split f_ms_tx_ul_data_block() into helper functions
This allows shrinking some tests which wish to send specificaly crafter
LlcBlocks (since the way LlcBlocks are created for f_ms_tx_ul_data_block
only allows sending data related to the same upper LLC PDU)

Change-Id: I81176fa5c7caa2535bcc97eec26833579933ed7a
2023-07-31 09:14:41 +00:00
Pau Espin e8e3b96a75 pcu: Introduce test TC_ul_tbf_bsn_wraparound_gprs
Related: OS#6102
Change-Id: I253e3607b75dd1a850c53f284fadf753dd49c247
2023-07-27 11:17:36 +00:00
Philipp Maier db9d894dda PCUIF_Components: add compatibility for PCU_IF_SAPI_PCH_DT
When we receive a PCUIF_DATA_REQ, f_BTS_CT_handler will mangle the
incoming message for us. The resulting BTS_CCCH_Block that is sent up to
the component not only contains the PCUIF message, but will also have
the already parsed MAC block attached. This currently only works for
PCU_IF_SAPI_PCH, but not for PCU_IF_SAPI_PCH_DT.

Let's add compatibility for PCU_IF_SAPI_PCH_DT.

Related: OS#5927
Change-Id: Ibaa6d170ef0f1f61b708a872a3c2364585063503
2023-07-20 10:42:51 +02:00
Philipp Maier 8e1a5ee4b4 GPRS_Components: use more suitable SAPI for DL TBF assignment
The function that assigns the downlink TBF f_ms_exp_dl_tbf_ass_ccch()
uses SAPI PCU_IF_SAPI_AGCH as default but actually downlink TBFs are
assigned via the PCH. This means we have to put PCU_IF_SAPI_PCH into the
parameter list on every function call, so it makes sense to change the
default to PCU_IF_SAPI_PCH and omit the SAPI when calling the function

Related: OS#5927
Change-Id: I49c59bad0162cb303669f6108201f154918b1db3
2023-07-20 10:42:50 +02:00
Philipp Maier e640d8f80c PCU_Tests: test NACC procedure with UTRAN and E-UTRAN cell
When the PacketCellChangeNotification proposes an UTRAN or E-UTRAN cell,
then the PCU will not provide system information. Instead it will directly
conclude the NACC procedure with a PacketCellChangeContinue message.

Related: OS#6044
Change-Id: Idae86a458fd44ac81bab183ed1865b1c1bdbfd66
2023-07-05 12:23:02 +02:00
Philipp Maier 58c083302e PCU_Tests: verify that PacketCellChangeContine contains an ARFCN and BSIC
The testcase TC_nacc_outbound_success tests the NACC procedure. The cell
that is proposed in the PacketCellChangeNotification is a GERAN cell.
This means that the PCU should conclude the procedure with a
PacketCellChangeNotification that contains the ARFCN and BSIC of the
proposed cell. Let's make sure that this actually is the case.

Related: OS#6044
Change-Id: I4b8f3312088e3d2bc4b90702485e7c6a8d39f954
2023-07-05 10:16:18 +00:00
Pau Espin 7e50fa280c pcu: Wait for USF before start using UL TBF
Change-Id: Ibe8f8c24b239715c0a43d52e59475011e78cb4eb
2023-06-27 15:56:00 +02:00
Philipp Maier 7d187ae98e PCU_Tests: fix typo cell_chf_notif -> cell_chg_notif
Change-Id: I13126b19b65b88f0e73a8413f557f6fe0561ba37
2023-06-21 11:00:44 +00:00
Pau Espin 1c6a9e4e4a pcu: TC_t3193: Fix test to properly trigger tx of last DL data block
Since osmo-pcu.git 95ec50c9e4821ed1bdd15e9e30da1278ec1280c1, OsmoPCU
doesn't allow receiving a FINAL_ACK in FLOW state. This test was not
written properly and was taking advantage of that permissive logic in
osmo-pcu to trigger the target use case. Fix it to have the PCU send the
last DL data block (FBI=1) so that it can send a PKT DL ACK/NACK with
FinalAck=1 to terminate the DL TBF.

Change-Id: Ibd445bdd5cc1d1ffd810eea157829403b4b65f1f
2023-06-20 11:28:47 +00:00
Pau Espin 9584ef23ab pcu: Rework test TC_ul_tbf_reestablish_with_pkt_resource_req_n3105_max to base it on T3168
N3105 is used for DL TBFs only (as tested by TC_n3105_max_t3195). The
test TC_ul_tbf_reestablish_with_pkt_resource_req_n3105_max is hence
wrongly written and should be based on T3168. Since recently, osmo-pcu
also moved to using T3168 in the scenario triggered by this test, hence
move to using it.

Related: osmo-pcu.git Change-Id I87dff68dedd06b60501e7586d20faf02bb1f0c93
Change-Id: Ibdfa9879cc56f5e2090cee0d3d70ee5df7c90454
2023-06-14 09:10:26 +00:00
Pau Espin c8b7327577 pcu: Fix Unbound integer operand of unary increment operator.
Change-Id: I0779feea8e6305b2d8daee68786eee1f8d8f4f29
2023-05-15 16:20:12 +02:00
Pau Espin 002658a071 pcu: Fix some tests missing proper tear down
As a result, they sometimes end up in error during test tear down, and
they show up as failed.

Change-Id: I89047a57a508df5c18e0d7bd2366cf15cda055be
2023-04-13 11:35:22 +02:00
Vadim Yanitskiy 8a15b45ea1 PCU_Tests: fix TC_nacc_outbound_pkt_cell_chg_notif_dup
The TC_nacc_outbound_pkt_cell_chg_notif_dup is currently failing
because in [1] we changed the default hard-coded MCC/MNC values in
ts_BssgpCellIdDstAddr_default, however these it's still using
hardcoded MCC=023/MNC=43.  I overlooked this in [2].

Let's split up the f_handle_nacc_rac_ci_query() into four functions:

* f_ctrl_rx_nacc_rac_ci_req() / f_ctrl_tx_nacc_rac_ci_rsp(),
* f_pcuif_rx_nacc_rac_ci_req() / f_pcuif_tx_nacc_rac_ci_rsp(),

and use them in TC_nacc_outbound_pkt_cell_chg_notif_dup.  Also
employ them in TC_nacc_outbound_pkt_cell_chg_notif_twice.

Change-Id: I3e84f55eedd278fb239600d6a0465bd34fd8cd0b
Related: [1] 03f74d4132
Fixes: [2] 7295661af5
Related: OS#5901
2023-02-13 11:43:02 +00:00
Vadim Yanitskiy d8aa5e8a6e PCU_Tests: fix TC_nacc_outbound_si_resolve_timeout
This patch fixes TC_nacc_outbound_si_resolve_timeout, which is still
using old hard-coded MCC/MNC values.  The altstep does the same, but
relies on the updated values from ts_BssgpCellIdDstAddr_default.

Change-Id: I9f6dbe97e9a494a4e8fdb441a70999d3040f6cfd
Related: OS#5901
2023-02-13 11:43:02 +00:00
Vadim Yanitskiy 76c8b29489 PCU_Tests: remove unnecessary valueof() in NACC TCs
A string literal is already a value, valueof() is for templates.

Change-Id: I86970bb422ad1693829fd20ecf5ee34ef77f30af
2023-02-13 11:43:02 +00:00
Vadim Yanitskiy 03f74d4132 PCU_Tests: use real values for c_BssgpCell{Mcc,Mnc}
There is no such country/operator with MCC=023/MNC=43.  Wireshark
complains about that when looking at the BSSGP messahes:

  Mobile Country Code (MCC): Unknown (23)
  Mobile Network Code (MNC): Unknown (43)

This may look confusing, let's better use some real country/operator:

  Mobile Country Code (MCC): Central African Rep. (623)
  Mobile Network Code (MNC): Celca (Socatel) (03)

Change-Id: Idc22128657d10893aa5c6d8ec80538a764de5c42
Related: OS#5901
2023-02-10 20:53:10 +07:00
Vadim Yanitskiy 7295661af5 PCU_Tests: define ts_BssgpCellIdDstAddr_default
Define hard-coded default Destination Cell ID in one place.

Change-Id: I8f400ba52d4d32447e0b4a640a2f4b73699937c8
Related: OS#5901
2023-02-10 20:53:10 +07:00
Vadim Yanitskiy 88b87a49e0 PCU_Tests: improve coding style, use f_build_BcdMccMnc()
Change-Id: Ia7066c6f36678650ada61c1633977b824777194d
Related: OS#5901
2023-02-10 20:53:09 +07:00
Vadim Yanitskiy 8cc1f72289 library/GSM_Types: rename f_{enc->build}_BcdMccMnc[_int]()
The enc_* functions usually return an octetstring.  However, both
f_enc_BcdMccMnc[_int]() return a sub-type of hexstring (BcdMccMnc),
so let's rename them to avoid confusion.

A follow-up patch adds the actual encoding function for BcdMccMnc.

Change-Id: I0332fe7396310da49910e89571f7181fb1604182
2023-02-10 13:46:04 +00:00
Vadim Yanitskiy 8a7437b09b pcu/osmo-pcu.cfg: use the PCUIF for neighbor resolution
This config is out of sync with the one in docker-playground.git.
The 'neighbor resolution' param makes osmo-pcu use the CTRL interface.

Change-Id: I8d59096644afd5a5278bc7bb1335670edad72576
Related: OS#5901
2023-02-10 13:46:04 +00:00
Vadim Yanitskiy 7a92d5fbc0 library/GSM_Types: rework f_enc_BcdMccMnc: split and rename
* Rename f_enc_BcdMccMnc() -> f_enc_BcdMccMnc_int()
* Add f_enc_BcdMccMnc() accepting a pair of GsmMcc/GsmMnc

Change-Id: I033cce8f975f61ef2216de9f34f2ca418d71dc0b
Related: SYS#5602
2023-02-08 00:31:18 +07:00
Pau Espin 00fec58871 pcu: TC_paging_cs_from_sgsn_*: Fix race condition between BSSGP tx and RLCMAC rx
It can happen that the RLCMAC req arrives at osmo-pcu before the
CS_PAGING we send to it over BSSGP, in which case osmo-pcu will schedule
an RLCMAC DL Dummy Block. Take into account this scenario to avoid
failing id it occurs.

Change-Id: I30da93835c7738aefcd84691d83f39759dd4b599
2022-12-02 14:57:44 +01:00
Pau Espin 3f2b5e41ea pcu: TC_mt_ping_pong*: Fix race condition waiting for first DL data after X2002
Since recently osmo-pcu arms the X2002 in a more fitting place (later,
when paging.cnf is received from osmo-bts over PCUIF).
Since we use same X2002 value in TTCN3 to wait for the timer to trigger,
in the past it was always fine (the X2002 at osmo-pcu always already had
triggered before the one in ttcn3 after receiving the ImmAss).

However, now the timer is roughly set at the same time in both places (ttcn3 and
osmo-pcu) and hence there may be race conditions where we request a
DL data block before the X2002 triggered at osmo-pcu, in which case we
receive a DL dummy block because the TBF is not yet in the FLOW state

Change-Id: Icc94eb0544226facddcd65be65a8a41bcfc662cc
2022-12-02 14:56:03 +01:00
Pau Espin 45b98aa0ee pcu: TC_dl_flow_more_blocks: Fix race condition waiting for first DL data after X2002
Since recently osmo-pcu arms the X2002 in a more fitting place (later,
when paging.cnf is received from osmo-bts over PCUIF).
Since we use same X2002 value in TTCN3 to wait for the timer to trigger,
in the past it was always fine (the X2002 at osmo-pcu always already had
triggered before the one in ttcn3 after receiving the ImmAss).

However, now the timer is roughly set at the same time in both places (ttcn3 and
osmo-pcu) and hence there may be race conditions where we request a
DL data block before the X2002 triggered at osmo-pcu, in which case we
receive a DL dummy block because the TBF is not yet in the FLOW state

Change-Id: I67483bc423567d1fc98eb912ece1cf5cda746119
2022-12-02 14:53:31 +01:00
Pau Espin e3e2bf6e78 pcu: Fix race condition in TC_cs_max_dl waiting for timer first DL data after X2002
Since recently osmo-pcu arms the X2002 in a more fitting place (later,
when paging.cnf is received from osmo-bts over PCUIF).
Since we use same X2002 value in TTCN3 to wait for the timer to trigger,
in the past it was always fine (the X2002 at osmo-pcu always already had
triggered before the one in ttcn3 after receiving the ImmAss).

However, now the timer is roughly set at the same time in both places (ttcn3 and
osmo-pcu) and hence there may be race conditions where we request a
DL data block before the X2002 triggered at osmo-pcu, in which case we
receive a DL dummy block because the TBF is not yet in the FLOW state.

Change-Id: If7121473a3580b40d3a658dc38b9bb1421196127
2022-12-02 14:53:28 +01:00
Pau Espin 99e00b480d pcu: Introduce tests TC_ul_tbf_{1,2}phase_while_dl_ass_pch
Related: OS#5700
Change-Id: I6a72c36265bfdc757180cbb466492ad6bbbf16ad
2022-11-04 09:35:37 +00:00
Pau Espin 15b2b94883 cosmetic: pcu: Fix typo in several comments
Change-Id: I7a2419514582cb9efd8df126bf449711f78586fe
2022-10-28 15:08:44 +02:00