Commit Graph

345 Commits

Author SHA1 Message Date
Pau Espin 2889f87d20 pcu: Assign TLLI_UNUSED instead of string literal
Change-Id: I7a505527458ed716b7b0912e88c6fcf58e0ff044
2021-01-11 13:54:48 +00:00
Pau Espin 7b761e2850 pcu: Use TLLI_UNUSED constant everywhere
Change-Id: I0399e98dc726061ac272465288e2a4ba0a61be81
2021-01-11 13:45:40 +00: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
Pau Espin Pedrol 0bf74e560a pcu: Fix counter expectancies after LLC UI dummy frame fixes in PCU
Recent commit 7d0f9a0ec383fcfca934731bd6979b6be6629c90 in osmo-pcu.git
fixed situation where lots of unneeded LLC UI dummy frames where being
sent. As a result, osmo-pcu correctly counts less dl rlcmac payload
bytes being sent, so we must adjust our test expectancies.

Related: OS#4849
Change-Id: I01c34a0948094b17cc0d67e613cd9b756f78c372
2020-12-11 19:57:38 +00: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
Alexander Couzens 2373afc482 pcu: SNS: fix typo
Change-Id: Iedb6b3f38d87ea3ac29c4bcaaf50e771b0b8a750
2020-12-10 15:21:30 +00:00
Alexander Couzens 2a0ac80fd1 pcu: SNS: add TC_sns_add_existent
Try to add via SNS an already existent NSVC which should
fail.

Change-Id: I096bcbe38d82d08a150a2f8e56f6bc02353273a1
2020-12-10 15:21:30 +00:00
Alexander Couzens 1e21fd40a1 pcu: SNS: remove TODO expect FLOW-CONTROL BVC
It should not be expected in a new NSVC.

Change-Id: I142c87d496f08d603ab8e1e13c5a29ebe6596bb0
2020-12-10 15:21:30 +00:00
Alexander Couzens a8fb621aba pcu: TC_sns_add: fix wrong udp port in SNS ADD message
When sending the SNS ADD in the test case the ip/port to add must be different
from the current NSVCs.

Fixes: 90f1974fb0 ("NS_Emulation: Support multiple NS-VC within one NSE (NS-VCG)")

Change-Id: I9bbbf1431468a452df324a7559518496e3eb48e3
2020-12-10 15:21:30 +00:00
Pau Espin 2e459d602e pcu: Verify LLC UI dummy frames are not appended at end of rlcmac DL block
LLC UI dummy frames are only to be sent alone in order to delay TBF
termination. Until recently (osmo-pcu.git
Ifae1a7b2b3dfad8df19585063088ba0df2749c8f), osmo-pcu was sending LLC UI
dummy frames instead of padding at RLCMAC layer, which made no sense.

Related: OS#4849
Change-Id: I7e0d9ed2475dbf989fbf932c8b83117ff5fb28fc
2020-12-07 13:29:13 +00:00
Pau Espin 1b9aa78ee0 pcu: Introduce test TC_mcs_max_dl
Change-Id: If6c58cc18b537c4a1354f1b8263db8321347fbd7
2020-11-30 18:56:16 +01:00
Pau Espin e130305aa5 pcu: Introduce test TC_multiplex_dl_gprs_egprs
Change-Id: I1b6b1042f25888407f48865de220c8af7451a7f0
2020-11-26 09:20:19 +00:00
Pau Espin 599d56bbc4 pcu: Fix counter expectancies in TC_bssgp_dl_unitdata_with_valid_imsi
Since sending with the network-requested UL CS/MCS was implemented, CS-2
is being used in the test (since it's requested by the network during UL
Imm Ass). We used to send UL blocks with CS-1 prior to that, which means
we are sending a different amount of data, and hence the test
expectancies need to be updated.

Change-Id: Ie7112a96f5f2ca9c5bbd224b6270f55a338d101a
2020-11-20 15:06:35 +00:00
Pau Espin e8db673d22 pcu: Implement ACKing EGPRS Dl TBF blocks
Change-Id: I9f1b621a8365e69d2e1a33d59cb8c7a59639ad94
2020-11-18 11:51:14 +00:00
Pau Espin 6d3a8fc4f7 pcu: Set acceptable logging verbosity for ConsoleMask
With prior situation it's impossible to follow stdout due to the huge
amount of noise.

Change-Id: I1f49eb26af0d6144f7632320097f2c78d47f3a22
2020-11-17 21:48:55 +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 e582f20aa3 pcu: Call f_shutdown if BSN doesn't match
Change-Id: I208f5100f9891874a8a61510edc8c5d215570b14
2020-11-16 10:48:25 +01:00
Pau Espin aa0d7ccf6a pcu: Fix f_dl_block_ack_fn for Dl EGPRS data block
Change-Id: I012b18ef084df0faa4cce79c4778e793af39b199
2020-11-16 10:48:25 +01:00
Pau Espin e4fa45b603 pcu: Introduce test TC_mcs_initial_dl
Change-Id: Ida01fb066f202033507f0c6a99212a1ff9d95423
2020-11-16 10:48:25 +01:00
Pau Espin db15fa7c06 pcu: Introduce test TC_mcs_max_ul
Change-Id: I4cc77988832a2ae431ac3c5b85de940c2419bf09
2020-11-16 10:48:25 +01:00
Pau Espin 2354d6a97d pcu: Introduce test TC_mcs_initial_ul
Change-Id: I0ee2fce7045628caf8145468b29688a9f230e7cd
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
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 5d07ae6d3c pcu: Introduce test TC_cs_max_dl and TC_dl_cs1_to_cs4
Change-Id: If847d091f3f4e6a7c77fbadc7280423637c50b35
2020-11-10 12:55:33 +00:00
Pau Espin 9a2d61bb3c pcu: f_acknackdesc_ack_block: Fix BSN wrap-around
Change-Id: Ibe90e58e04ae5e24c36a0b3dda6742080107bd51
2020-11-06 14:20:37 +01:00
Pau Espin 7512259cce pcu: Introduce test TC_cs_initial_dl
Change-Id: I00bae15a007935cc4e027e63de4367d83e994bd7
2020-11-06 14:20:37 +01: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 e5e64c1246 pcu: Implement check for expected (M)CS in received data block
Change-Id: Ibdc63f6b695c08e4ddf5894c22767d07acf21311
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 a9f27fa4f6 pcu: Introduce test TC_ul_multislot_tbf_ms_class_from_2phase
Similar to the DL TBF counterpart from last commit, this time verifying
UL multislot TBF is allocated.

Change-Id: I26a3cc0f2bd7bab176aa52df3e40aca7300de216
2020-11-06 14:20:10 +01:00
Pau Espin 8155bf4e7b pcu: Introduce test TC_dl_multislot_tbf_ms_class_from_2phase
Change-Id: Ie0035bab79c286a968394d7b724d975f43d187ce
2020-11-06 14:19:19 +01:00
Pau Espin 0ea8b6f355 pcu: Introduce test TC_dl_multislot_tbf_ms_class_from_sgsn
Related: SYS#5131
Change-Id: I417953a4c89dec82500b3b66f08ed648d266d813
2020-11-06 14:17:21 +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 dbd4b245c0 PCU_Tests: verify CS paging of multiple subscribers
The change introduces three new test cases:

  - TC_paging_cs_multi_ms_imsi,
  - TC_paging_cs_multi_ms_tmsi,
  - TC_paging_cs_multi_ms_imsi_tmsi.

Each of these establishes 56 Uplink TBFs, and then enqueues 56 CS
PAGING requests from the SGSN side.  The main idea is to verify
encoding and compositing of the paging MIs in PACCH massages.

Change-Id: Ie8b4006f969598c9b0c452002d559f985d108a66
Related: OS#4838
2020-11-02 19:24:45 +07:00
Vadim Yanitskiy 8a02b92ce0 PCU_Tests: add 'f_multi_ms_' API for multi-MS test cases
Change-Id: Ie2cc717f9f50db16748fe4e4a0ad80d549981e61
Related: OS#4838
2020-11-02 19:24:45 +07:00
Vadim Yanitskiy b6aae9980d GPRS_Components: remove even more unused module imports
Change-Id: I25b1f1e02c95db0f0aed3867f814f9476d3c0d0d
2020-11-02 19:24:45 +07:00
Vadim Yanitskiy 316b0c6d78 GPRS_Components: remove unused import of MobileL3_GMM_SM_Types
Change-Id: I502c2b9905e18915da179c1bdf57402f56bdf7bf
2020-11-02 19:24:45 +07:00
Vadim Yanitskiy 7d72a7627b GPRS_Components: remove unused NS / BSSGP module imports
Change-Id: Idf8a92b03015e6a44512e820d8a8bdba7ce556e9
2020-11-02 19:24:45 +07:00
Vadim Yanitskiy 0544e5d625 GPRS_Components: neither TELNET nor VTY API is used in this module
Change-Id: I41813e1e2a8d7c54dffbabee9de4e0706293743e
2020-11-02 19:24:45 +07:00
Vadim Yanitskiy 3e5f07436a GPRS_Components: generalize both f_pkt_paging_match_{imsi,tmsi}()
Change-Id: Ie0578fa299cdac18e942350b2e879839c9bd9dba
2020-11-01 04:05:33 +07:00
Vadim Yanitskiy 7942580e23 GPRS_Components: ensure cyclic RA in f_init_gprs_ms()
Change-Id: I9896bb6bf1ceb592bae22139bf48c6aa7c0265bd
2020-11-01 02:01:59 +07:00
Vadim Yanitskiy 1cea9fdcb7 GPRS_Components: add RA definition for single block packet access
Change-Id: I8997121f1b1207d4236f5911befc3c29278f37d8
2020-11-01 02:01:59 +07:00
Vadim Yanitskiy e12b2acd95 GPRS_Components: ensure unique IMSI/TLLI in f_init_gprs_ms()
Change-Id: I4beeeac600515458c2aeaf9e0be1cf2546ff0584
2020-11-01 02:01:59 +07:00
Vadim Yanitskiy cff3e1b46c GPRS_Components: rename 'GprsMSArray' to 'GprsMSList'
In TTCN-3, array assumes a fixed number of elements.  A 'record of'
type is more like a 'list' in Python, so let's call it this way.

Change-Id: Ib7df7efaa28a53a45d981d1c99f9eb1ac26fd91c
2020-11-01 02:01:59 +07:00
Vadim Yanitskiy fa6b882657 GPRS_Components: allow arbitrary number of GprsMS instances
Change-Id: Ia118d58fafa50547f109c68829aa869785e0dc9c
2020-11-01 02:01:59 +07: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 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 b20b7e59f9 pcu: Parse TS and TRX allocation from Assignment in Ul/DlTbf objects
This will allow tests to use multitrx and multislot scenarios.

Change-Id: Ia2b9dd73f61c7068a729b427c118ae2ef027c30b
2020-10-30 13:23:52 +01:00
Pau Espin 7ebc1124ef pcu: Fix TC_egprs_pkt_chan_req_reject_exhaustion
older versions of osmo-pcu were broken and were only allocating TBFs in
the first TRX available. This is now fixed and hence osmo-pcu tries
better to allocate TBFs across different TRX. That's why the test needs
to be fixed to set up only 1 TRX in order to run into the same scenario.

Change-Id: I3f6633950bb89dde3f87a237359497f5b23e0fee
2020-10-30 08:59:34 +00:00
Pau Espin 25e0f29c46 pcu: Verify TLLI for Dl Assignemnt in f_ms_rx_pkt_ass_pacch()
The same is already done for Ul Assignment. Dl assigment check was a
TODO until now.

Change-Id: Ib44a315d9ce80da05aeee642d033198f4addf6c3
2020-10-29 12:36:43 +01:00
Pau Espin b9b1baae57 pcu: Remove empty lines at end of file
Change-Id: I69e8c2b49c4726078a343fd628b6ddbc9ad0efdc
2020-10-26 17:47:23 +01: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
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 ceb1f9888f PCU_Tests: fix readability of code using t_RLCMAC_UL_DATA_TLLI
Change-Id: I175f8ce2606050c6b4ea54eae4e00846291d462f
2020-10-19 18:02:15 +00:00
Vadim Yanitskiy 8e6df0c811 PCU_Tests: add missing f_shutdown(final := true) statements
Otherwise those test cases may sporadically fail due to DTE:

  Sending data on the connection of port CLCK to 8:CLCK failed. (Broken pipe)

Change-Id: Ia8c934697a4e7bc39e762bf81587fea3bbe11b17
2020-10-19 18:02:01 +00:00
Vadim Yanitskiy c776ded961 PCU_Tests.cfg: synchronize with docker-playground
Otherwise neither of the test cases would even start.

Change-Id: Ibbef1875b266e3512e5ada731bac5f2246a1446d
2020-10-17 11:27:45 +00:00
Vadim Yanitskiy c67240a021 PCU_Tests: fix f_TC_mt_ping_pong() header readability
Change-Id: I2d2e80fe411c0677b8f8d7833ec2b9ea62888221
2020-10-17 16:03:15 +07:00
Alexander Couzens 50493b3503 pcu/PCU_Tests_SNS.cfg: fix configuration to match new NS provider
The NS uses now a provider to support FR and IP at the same time.

Change-Id: I6b0fa97a1098070a4f63228568092084503d6164
2020-10-13 19:49:14 +00:00
Vadim Yanitskiy d53fb672c9 PCU_Tests: introduce TC_pcuif_info_ind_subsequent()
This change reproduces a segfault caused by the recent regression [1].
The IUT tries to bind on BSSGP host:port that it's already bound to.

[1] Ib389925cf5c9f18951af6242c31ea70476218e9a

Change-Id: I4c3bc883d795e5d1ee5ab175ac03684924692a7c
Related: SYS#5108
2020-10-10 10:30:06 +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 04ce4c6047 pcu: Don't log timer operations of ClkGen-0 (every 4.16ms)
We don't need to spam the console with that kind of information.

Change-Id: I029193f6e21415f53424ebf4417e3fcd9a53c86c
2020-10-04 23:41:45 +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 929b406940 update expected results
Change-Id: Icb534a2b00fc48c3ead009a620e6061e595cb581
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
Daniel Willmann 535aea686e pcu: Check stats for pcu channel allocation, bytes transferred
Change-Id: I90964b32fa11ed2582afc5fb56bd302b06606f86
Related: SYS#4877
2020-09-25 12:31:36 +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
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
Vadim Yanitskiy 4b7473d99c pcu/GPRS_Components: allow passing/matching of TS/TRX/BTS/BLK numbers
This change will facilitate adding test cases for multi-slot TBF
allocation across several TS and/or TRX instances of a BTS.

Change-Id: I9bff9e912bf73ad6259946a6ea5b08f3e2f728c8
Related: OS#4756
2020-09-21 17:06:08 +07:00
Harald Welte e18fccd5ab {PCU,SGSN}: Add missing address_family field in NSConfiguration
Change-Id: If63a96ec7ad28e87ff8bd18bf189d9395dda9c0d
2020-09-18 01:03:46 +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 60408e3f57 Don't map NS_Emulation_CT:NSCP anymore
NS_Emulation_CT:NSCP used to be a NS_CODEC_PT, which is a translation
port on top of the IPL4asp.  Such ports need to be mapped to a system
port at start-up.

However, in I4d0b7ad0ed9447a038dd3eeee2b975146d10fba0 we introduced
a new underlying component called NS_Provider.  Hence, NSCP is actually
connected to that underlying component, and no longer mapped.

The corresponding change in pcu/SGSN_Components.ttcn and sgsn/SGSN_Tests.ttcn
has unfortunately been missed in the above-mentioned change.  Fix that.

Change-Id: I4c085210e6021e38a38ebc052ec3d9b345638cd2
2020-09-17 20:32:37 +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
Alexander Couzens ad70991d51 RAW_NS: remove usage of mp_gb_cfg
RAW_NS uses module parameter from SGSN_Components. To decouple
RAW_NS from SGSN_Component pass the cell_id via a function argument.

Change-Id: I91d9db85519675054aaab83c85fac43e67391f33
2020-09-14 12:01:42 +00:00
Alexander Couzens 2beaa20295 RAW_NS: remove usage of mp_nsconfig
RAW_NS uses module parameter from SGSN_Components. To decouple
RAW_NS from SGSN_Component pass the NSConfiguration via f_init_ns_codec()

Change-Id: Ida8b8a6af815dc11b2ff4c65e19cc5ec25f18ae2
2020-09-14 12:01:42 +00:00
Alexander Couzens b3d4c670ad RAW_NS: f_init_ns_codec: add argument tc_idx to modify the port
In preparation for the SGSN tests allow to change the source udp port
for every test case.

Change-Id: I465ad2c8580e74cce4dab46f4ec29a9043df9938
2020-09-14 12:01:42 +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
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 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
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
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 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
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 3b464a9812 library/GSM_RR_Types: s/MobileAllocation/MobileAllocationLV/g
Change-Id: Ica803221e885b4746fd42c17cd2828c0ef35a6aa
2020-08-28 05:55:58 +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
Vadim Yanitskiy 94fe83e8ab PCU_Tests: verify handling of frequency hopping parameters
Change-Id: I1beda9224998848f9243237413e5ae3e0ddab8a5
Related: SYS#4868, OS#4547
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
Vadim Yanitskiy 7431e9e8db GPRS_Components: s/f_ms_rx_imm_ass_pacch/f_ms_rx_pkt_ass_pacch/g
Immediate Assignment is sent on AGCH/PCH, while on PACCH we have
Packet Uplink/Downlink Assignment instead (see 11.2.29, 11.2.7).

Change-Id: I56473ae5dfa565d2c9d26984b14685a4163bf69a
2020-07-23 04:57:05 +07: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 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 f77421f4cf PCU_Tests_NS: use ts_PCUIF_INFO_default from PCU_Tests
Change-Id: I80b33b10603e8e8c1beee17acce65f5d3873a9b2
2020-07-19 17:43:56 +07:00
Pau Espin cdbe90306b pcu: Introduce test TC_ul_tbf_reestablish_with_pkt_resource_req
Related: OS#4657
Change-Id: Ic251339afb9caa23d9a4e7bdb135d42a36a203d5
2020-07-14 09:49:31 +00:00
Pau Espin e1195bbc42 cosmetic: pcu: Fix whitespacing typos
Change-Id: I38f752f709e593d1cfd3489a6ac590360f22a10f
2020-07-08 11:36:33 +00:00
Pau Espin 5e6844d170 pcu: Introduce TC_ul_data_toolong_fills_padding
Change-Id: Ic37294efac005ed6c0ce48dea566fd20284b5868
2020-07-06 12:50:01 +00:00
Pau Espin fb2301eba3 pcu: Introduce test TC_ull_all_sizes
Change-Id: I293c8dea2d44c5232a96c44b605e0d8c6dc1fa0e
2020-07-06 12:50:01 +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 28d18e1e3e PCU: s/f_establish_tbf/f_pcuif_tx_rach_rx_imm_ass/g
Fix confusion: f_ms_establish_ul_tbf() vs f_establish_tbf(). The
new name precisely describes what the function does. Sending a
RACH.ind and receiving a DATA.req with RR Immediate Assignment
is just a part of the TBF establishment process.

Change-Id: I1e22b9936bf68ebcaf70cefbc57345995ebbbaed
2020-05-29 20:02:49 +00:00
Vadim Yanitskiy 438939029d PCU: revert changes to f_TC_egprs_pkt_chan_req(), fix tests
I noticed that TC_egprs_pkt_chan_req_reject_exhaustion has started
to fail since the refactoring change [1]. As it turned out, this
test case does not init a GprsMs instance, which is needed by a
function it depends on - f_TC_egprs_pkt_chan_req().

I don't really see the point of using the GprsMs abstraction for
such small test cases sending just a few messages, which do not
require us to keep any state. Let's just revert those changes,
and keep using the low level API.

[1] Ib3fee37580f0ea0530a659dec83656799bf57288

Change-Id: I4f32c138e7587e68d2d35d13d13c044893fec4b2
2020-05-29 20:02:49 +00:00
Pau Espin 1617e31001 pcu: Add missing f_shutdown() to exit as soon as possible without final=true
Change-Id: I9703f7c81a98b6ef826db48c107ee833c125e5cc
2020-05-28 22:13:10 +07:00
Pau Espin 6791eb6b93 pcu: TC_mt_ping_pong: Request UL TBF on last DL ACK
Let's test the code path where UL TBF is requested through DL ACK/NACK
here, since we already test the usual UL TBF through CCCH approach in
most tests.

rlc_mode is changed to ACKED since that's the mode we are using so far
in tests.

Change-Id: I5a9a2e8107c87fdbf74cc2f09ae5eeafbb13ad55
2020-05-28 22:13:10 +07:00
Pau Espin 9040111df2 pcu: Parse ChCodingCommand on CCHAN Ul Ass
Change-Id: I8bf13f763bd8aa8d8a39f6b2757d5da01437cc05
2020-05-28 22:13:10 +07:00
Pau Espin eb98025e69 pcu: Parse USF from Pkt Ul Ass
Change-Id: If786d838f24755f3207d57c849ac28e58a7ee1c6
2020-05-28 22:13:10 +07:00
Vadim Yanitskiy 84d1dd557f fixup pcu/GPRS_Components: do not duplicate existing functions
Both f_ms_rx_imm_ass_ccch() and f_ms_establish_ul_tbf() functions
are actually twin brothers of good old f_pcuif_rx_imm_ass() and
f_establish_tbf() with some minor changes.

The former accepts a GprsMS parameter, that is never used. The
latter simply calls f_ultbf_new_from_rr_imm_ass() in the end.

Let's avoid code duplication:

  - call f_establish_tbf() from f_ms_establish_ul_tbf(),
  - remove f_ms_rx_imm_ass_ccch(), use f_pcuif_rx_imm_ass().

After the removal of f_ms_rx_imm_ass_ccch(), the implementation
of TC_ta_idle_dl_tbf_ass() does not need the GprsMS state, so
let's make it look like it was before.

Change-Id: If6c0b8796500e96525b7b1cadb61ab2fc84b4744
2020-05-28 22:13:10 +07:00
Vadim Yanitskiy 7466c338d8 pcu/GPRS_Components: return GsmRrMessage from f_pcuif_rx_imm_ass()
Change-Id: Ide6a00348b81a637309644be82a523c99f9fd30a
2020-05-28 22:13:10 +07:00
Pau Espin 4f7b8fd617 pcu: Refactor GPRS infrastructure to keep state and simplify tests
Before this patch, each test had to somehow keep state for all the
transactions needed. Now, most of the state is moved to generic GprsMS,
UlTbf and DlTbf structures, and APIs to maintain its state, as well as
function helpers to submit or receive messages from it. For now
specially the Tx side was improved, some of the Rx parts are left for
later and are still using the old APIs.

This will allow for more complex scenarios and more complex tests
running several MS.

All the tests were updated to use the new APIs, reworked when needed and
even totally rewritten in some cases since they were doing
inconsistent/wrong stuff from the point of view of what the scenarios
or code paths they were expected to test. There's no test regressions.

Change-Id: Ib3fee37580f0ea0530a659dec83656799bf57288
2020-05-28 22:12:46 +07:00
Pau Espin 34c940b721 pcu/GPRS_Components: send DATA.cnf in f_pcuif_rx_imm_ass()
The IUT expects a confirmation when Immediate Assignment is sent on PCH.

Change-Id: I585a1933dfb2119f1d3223b24db191282fd698b7
2020-05-28 20:19:49 +07:00
Pau Espin fddc20b63e pcu/GPRS_Components: call f_shutdown() immediately on timeout
Change-Id: I1fa31d95ea393aaf80d8f6c03c3fcf3484daa565
2020-05-28 20:19:49 +07:00
Pau Espin 71c08f662d pcu/GPRS_Components: get rid of meaningless bts_nr argument
We don't (yet) support multi-BTS test cases anyway. Ideally, each
virtual BTS would be a separate component with an individual port.

Change-Id: I8b639d179db259bf0e43cf1929447a44d5736f62
2020-05-28 20:19:49 +07:00
Vadim Yanitskiy c4324ffb64 PCU: introduce TC_egprs_pkt_chan_req_reject_exhaustion
Send 7 RACH indications to the IUT with EGPRS Packet Channel Request.
Since we have only one timeslot (and USF value '111'B is reserved),
the 8-th indication should be properly rejected by the IUT.

Change-Id: Ie6e5fc68e1591c57e21541ba16fbdcd3fe477ac7
Related: OS#1548
2020-05-22 22:00:34 +07:00
Vadim Yanitskiy 7e06c25ed3 PCU: introduce TC_egprs_pkt_chan_req_reject_emergency
At the moment, the IUT does not support any emergency services.
Make sure that EGPRS Packet Channel Request for an emergency call
is properly rejected (RR Immediate Assignment Reject).

Note that at the time of writing this test, the IUT does not
handle EGPRS Packet Channel Request properly, so it fails.

Change-Id: I63d989e89e6235a631e024c2810a3a4b0de56ccf
Related: OS#1548
2020-05-22 20:51:29 +07:00
Vadim Yanitskiy 4f56d329b0 PCU: introduce TC_egprs_pkt_chan_req_reject_content
The purpose of this test case is to verify the contents of RR
Immediate Assignment Reject message (and its IAR Rest Octets)
sent in response to EGPRS Packet Channel Request (11 bit RA).

To provoke the reject message, test case crafts an incorrect
EGPRS Packet Channel Request message ('111111xxxxx'B).

Note that at the time of writing this test, the IUT does not
handle EGPRS Packet Channel Request properly, so it fails.

Change-Id: I4bfd5621085d63896e2e9b70355524cf4285036a
Related: OS#1548
2020-05-22 20:34:42 +07:00
Neels Hofmeyr a4d2100431 update expected results
Change-Id: I37014274ee97f09985c31966e7cc9122fe11a856
2020-05-19 19:25:35 +00:00
Pau Espin adbbe1e28e pcu: Expect UL ACK/NACK after all UL data is transmitted
This is needed since osmo-pcu.git
I9b4ef7b7277efa645bdb5becf2e9f6b32c99a9b1, where a bug was fixed in
which osmo-pcu was not sending UL ACK/NACK under some conditions.

Change-Id: I1a58b3984a96b432b2cb5300fc8a4261133a4f69
2020-05-19 19:21:29 +00:00
Pau Espin 692222cb99 Add initial support for Packet Uplink Ack/nack EGPRS Struct
Some stuff like EGPRS Ack/Nack description is still not implemented, but
it's enouh for now to be able to match against this kind of ACK blocks.

Change-Id: I8066fba0e71911f0c6344c1540a501f1853daa7f
2020-05-19 19:21:29 +00:00
Pau Espin aedc51186b Move all GPRS helper function to its own file and component
This is a first step towards refactoring of all functions to use MS and
Ul/DlTBF objects containing state.

Change-Id: Ieae27d6e707f79ec2145864ef5cd67ddbbec9314
2020-05-19 19:21:29 +00:00
Pau Espin a416cb8afe Introduce test TC_ul_intermediate_retrans
Test Verifies that if PCU doesn't get one of the intermediate UL data blocks in a UL
TBF, it will request retransmission through UL ACK/NACK (with missing block
in its bitmap) when CV=0 is received (and hence it knows no more data is to be
transferred).

This test fails as of current osmo-pcu master, and it's fixed there by
osmo-pcu.git Change-Id I9b4ef7b7277efa645bdb5becf2e9f6b32c99a9b1.

Change-Id: I204a470e47fcc5965de758ad9a275837e0c8034d
2020-05-17 18:34:51 +02:00
Pau Espin 487d634726 pcu: Introduce test TC_countdown_procedure
Change-Id: I2b92bf4a17e89b1d68869aac4243c0e106ce3be5
2020-05-17 18:34:51 +02:00
Pau Espin 4cbb96079b pcu: f_tx_rlcmac_ul_n_blocks(): Keep BSN state and return all payload sent
These features will be used in test added in next commit.

Change-Id: I7dde6a2e71a9e64cf6c704eda37b47838460102b
2020-05-17 18:34:51 +02:00
Pau Espin 5feace6584 pcu: Use BS_CV_MAX in f_tx_rlcmac_ul_n_blocks
Also increment BSN with each new submitted packet.

Change-Id: I685d1535154197bb85e18875e0a4d41122a24fa0
2020-05-17 07:26:34 +00:00
Pau Espin 0c0bf8731b Introduce test TC_force_two_phase_access
Change-Id: Icce25b5d113eb5b37ec1e5b6c6c14aacdb01cd8d
2020-05-17 07:26:34 +00:00
Pau Espin 42acafc9b8 pcu: Introduce TC_mo_ping_pong_with_ul_racap_egprs_only
Change-Id: I396dbd0ca200fbf9365c534f4d479f903d0417ff
2020-05-17 07:26:34 +00:00
Pau Espin 45b664b8af pcu: Support decoding Egprs Pkt Ul Ass on PDCH
Change-Id: I30fb98aab67303997b803a0359ffc2e0b65ebf01
2020-05-15 13:29:10 +02:00
Pau Espin 02c972d8aa pcu: use correct RA type to properly test 2phase access
Old code was not setting Single Block Packet Access type, and 2phase
access was not properly triggered.

Once it's triggered, message flow changes quite a lot from the 1phase
access, specially because the 2nd Ul Assignment arrives through PDCH
instead of CCCH, which means a different record is received and hence
code for 1phase cannot be easily re-used.

For similar reasons, f_tx_rlcmac_ul_n_blocks() is modified to receive
the only required tfi param instead of a full dl_block.

Some functions are also extended to support SingleBlock Allocation
instead of usual DynamicAllocation.

Change-Id: If636a4898dfa175fdbd6baf04f7f2c955a9c525d
2020-05-15 11:27:08 +00:00
Pau Espin 1832cd8fb0 pcu: f_dl_block_ack_fn(): Allow passing ctrl dl_block
Downlink Control blocks like Packet Uplink Assignment (PACCH)
contain rrbp + rrbp_valid in mac headers

Change-Id: I0401b0b378c7770d06a15d14dac6436303b4ccab
2020-05-13 16:44:16 +02:00
Pau Espin 4aac3d0c8f pcu: Properly pass tlli in f_tx_rlcmac_ul_n_blocks()
Change-Id: Idb8febbbff732f02d05b0043c75e2a0729e01d4f
2020-05-13 15:13:49 +02:00
Vadim Yanitskiy 71238c135d PCU: introduce a new test case TC_dl_flow_more_blocks
Change-Id: I45edbc943194c15b084eb04dda390db75b4bfa0f
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
Related: OS#4506
2020-05-11 13:48:11 +07:00
Vadim Yanitskiy b6733a67ec PCU: refactor and simplify f_rx_rlcmac_dl_block_exp_data()
This function was written in a way that it tries to do as
many different (but related) things as possible:

  a) send an RTS.req to the IUT, expect a DATA.ind in return,
  b) decode RLC/MAC message contained in the received DATA.ind,
  c) make sure that it's either GPRS or EGPRS data block,
  d) calculate the last TDMA frame number of RRBP using
     f_rrbp_ack_fn() regardless of its validity,
  e) make sure that the block contains a given LLC payload.

Everything is ok except point d). The problem is that this is
only the case for the first block of RRBP, and not applicable
to the rest having 'rrbp_valid' flag unset. Furthermore, this
function did not match GPRS DL blocks with 'rrbp_valid' flag
unset, for some odd reason.

Let's move RRBP calculation into a separate function called
f_dl_block_ack_fn() and return TDMA frame number of the
received DATA.ind message instead.

Among with that, there are more little changes:

  - simplify matching of (E)GPRS DL data blocks,
  - use 'in' qualifier in parameter list where possible,
  - turn parameter 'data' into a template (present).

Change-Id: I1528408b4399d0a149a23961805277eaab90d407
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-10 21:34:38 +07:00
Vadim Yanitskiy d4f22aaf31 library: enrich tr_RLCMAC_DATA_RRBP, rename to tr_RLCMAC_DATA_GPRS
Let's make this template more flexible, so it can be used to match
any GPRS DL data blocks, not only those with rrbp_valid == true.

Note that behavior of f_rx_rlcmac_dl_block_exp_data() is
intentionally left unchanged, and will be fixed later.

Change-Id: I3940216368cdbb58fe89420675d1d8d5f5e49b05
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-10 21:14:12 +07:00
Vadim Yanitskiy 2742bcd6fd PCU: introduce f_rrbp_ack_fn(), fix poll frame number calculation
The resulting frame number shall be within the period of TDMA hyperframe.

Change-Id: I794a14f69293cbbc937d62d09dd5794956b882db
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-10 12:46:03 +07:00
Vadim Yanitskiy b043b78419 PCU: fix f_pkt_paging_match_tmsi(): drop copy-pasted line
Change [1] broke the following test cases:

  - TC_paging_cs_from_sgsn_sign_ptmsi,
  - TC_paging_cs_from_sgsn_ptp.

Let's fix this!

Change-Id: I9ec798e44138570bed726ffcd842448e199c1b54
Fixes: [1] I6a859687d9605cc08c51ff44d946c279b79bedfa
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-07 17:02:59 +07:00
Vadim Yanitskiy 5cbebf8758 PCU: PCU_Tests.default: add 'USER' category to ConsoleMask
Change-Id: I12bffab01e52d92d313edddc000b5f3ec62c5139
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-07 02:43:56 +07:00
Vadim Yanitskiy 2e213ae056 PCU: refactor f_imm_ass_verify_{ul,dl}_tbf_ass(): call f_shutdown()
This allows us to reduce code duplication.

Change-Id: Ib74285177a5d8e3c4a27df1321e7eab3462318bc
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-07 02:43:56 +07:00
Vadim Yanitskiy 91f8a09220 PCU: introduce f_shutdown() to ensure proper tear down
Most of existing test cases are built on top of the PCU interface
abstraction components (see PCUIF_Components.ttcn). This means
that during the test case execution, additional components are
running in parallel, among with the MTC (Main Test Component).

When a test case terminates, either normally or due to an error,
it may happen that the virtual BTS component is stopped before
the associated TDMA clock generator. In this situation, sending
a clock indication towards the stopped BTS component would
lead to a dynamic test case error.

Let's take the process of tear down under control, and ensure that
the clock generator is stopped first. To achieve that, every test
case needs to call f_shutdown() in case of an error, as well as
in case of the normal termination.

Note we cannot use the existing f_shutdown() from Misc_Helpers,
because doing 'all component.stop' does not gurantee that the
clock generator is stopped first, and I experienced at least
one DTE while trying to integrate it.

Change-Id: I6a859687d9605cc08c51ff44d946c279b79bedfa
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-07 02:43:55 +07:00
Vadim Yanitskiy 8685b380b8 PCU: fix TC_ta_rach_imm_ass(): properly match Timing Advance
This test case would not fail even in case of Timing Advance mismatch.

Change-Id: Ife86e5e0e39f0112b854ed9a13e9c6f3c49531c9
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-07 02:42:56 +07:00
Vadim Yanitskiy 5b649ccbc6 PCU: f_imm_ass_verify_{ul,dl}_tbf_ass(): use 'in' qualifier
We don't need a copy of the whole RR Immediate Assignment message.

Change-Id: I44417460126e507a0a47a5aee8c4a995085023fa
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-06 16:36:17 +07:00
Vadim Yanitskiy 85cb9911b9 PCU: fix f_establish_tbf(): always expect Uplink TBF
In response to a CHANNEL REQUEST received on BCCH, the network
would never allocate a Downlink TBF, so we should always expect
an Uplink TBF assignment.

Change-Id: I6b4c108bed39ba9ac9b6144827bc1e20b04333b4
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-06 16:29:45 +07:00
Vadim Yanitskiy f74ae99369 PCU: fix f_establish_tbf(): use proper CHANNEL REQUEST by default
Back in September 2019, while writing the first lines of the new
test infrastructure for OsmoPCU, I picked a random value as the
default RA (CHANNEL REQUEST message) for Uplink TBF establishment.

It has been accepted by the IUT so far, and still works, but
according to 3GPP TS 44.018, table 9.1.8.1, value '3A'O has
nothing to do with GPRS - it actually means 'Answer to paging'.

The new value belongs to range '011110xx' - one phase packet
access with request for single timeslot uplink transmission.

Change-Id: Ic036d380af3667d54a3a0a011a9d56a87e0f949b
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-06 16:21:21 +07:00
Vadim Yanitskiy f561ae0a8f PCU: drop meaningless 'udpReuseAddress' option
The PCU interface has nothing to do with UDP...

Change-Id: I8d919e686c6ef311517eb53496d008987f984794
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-06 15:35:00 +07:00
Pau Espin 2456dad91e RLCMAC_EncDec.cc: Fix egprs data block encode alignment
Selftests I'm using in the pcu testsuite to verify encoding are attached
too.

Change-Id: Id0e21248853eb5fac89e863822804cfbecf3c865
2020-05-01 15:54:17 +02:00
Pau Espin e8d7d16f13 Split templates in RLCMAC_{CSN1_}Types into their own _Templates file
RLCMAC blocks have a lot of fields and we will potentially require lots
of different templates, as well as functions to handle related structs.

Change-Id: I9c6597178168aa3848b21930f33be698dd2ce545
2020-04-29 19:07:38 +02:00
Pau Espin 8dd59fba5e pcu: Rename PCU*RAW* content to PCU
Basically what's done here:
* mv PCU_Tests_RAW${suffix}.ttcn -> PCU_Tests${suffix}.ttcn
* mv PCUIF_RAW_Components.ttcn -> PCUIF_Components.ttcn
* Change module names according to file names and fix all references in
  code and configuration.

Change-Id: Iacaddb56e41012ba58ef6d1b9e79d2c012259bed
2020-04-29 18:33:48 +02:00
Pau Espin 0e6ed2e477 pcu: Get rid of PCU_Tests.ttcn tests
Delete PCU_Tests.ttcn along with the configs, since they are broken and
we are only adding new tests to PCU_Tests_RAW.ttcn. They are broken
because it's not possible to run multiple tests after another.

Some components which used to be in PCU_Tests.ttcn and which were used
by other PCU_Tests*.ttcn files have been moved to SGSN_Components.ttcn

Selftests have been moved to PCU_selftest.ttcn.

Small placeholder for module PCU_Tests is left in PCU_Tests.ttcn to
still be able to compile the binary as "PCU_Tests" and avoid changing
that part of docker setup. We'll eventually rename RAW tests soon
anyway.

Change-Id: Ie862a1525e9f4f9a3f2427ac3898810e3d044d2f
2020-04-29 18:33:14 +02:00
Pau Espin bc93633b95 pcu: Support retrieving BSN and TFI in tests from data_egprs blocks
function helpers are slightly modified or added to accomodate for fields
in egprs data blocks being in different places.

Change-Id: I570fb7346519b2a161515e0ec40bd1870a89d673
2020-04-29 09:06:34 +00:00
Vadim Yanitskiy f24a6d382d PCU: fix f_pcuif_tx_data_cnf(): do not include paging group
As it turns out, DATA.cnf shall not contain paging group.

Change-Id: I7e0d1bb03fd42fc742f1f3d13a48e9781975dc17
2020-04-29 12:23:11 +07:00
Vadim Yanitskiy c90c0497c8 PCU: introduce and use helper f_pcuif_tx_data_cnf()
Change-Id: Icc23f4d0cd56f553aad81679d9d62243554402aa
2020-04-28 16:24:41 +00:00