Commit Graph

242 Commits

Author SHA1 Message Date
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
Vadim Yanitskiy fd0b9db301 PCU: refactor f_pcuif_rx_imm_ass(): also handle PCH SAPI
Change-Id: Ia5d162c1d8bbee43a6e9fab784d8675187f15be1
2020-04-28 16:24:41 +00:00
Pau Espin e51e0067de pcu: Allow setting 'egprs only' mode by test
Will be used by next patches testing EGPRS features.

Change-Id: I7b0ff2f4895b7af39314600c10cc2f139bf45a2f
2020-04-28 16:01:18 +00:00
Pau Espin 8f24571e56 pcu: Introduce test TC_mo_ping_pong_with_ul_racap
Test sending MS RA capabilities through Packet Resource Request to
update GPRS multislot class.
EGPRS multislot will come in a later commit.

Change-Id: I5026d8b78a3fb82093956b65989d18fa6f6d5424
2020-04-28 16:01:18 +00:00