Commit Graph

345 Commits

Author SHA1 Message Date
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
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
Vadim Yanitskiy fd6cbdf3ed PCU: Timing Advance: introduce TC_ta_idle_dl_tbf_ass
This test case initiates the packet Downlink assignment procedure
by sending a DL-UNITDATA PDU containing a random TLLI and checks
Timing Advance value indicated in the Immediate Assignment.

Currently fails due to a bug in the IUT (TA=220).

Change-Id: I410abedcc549495f30b5355d399a85648408a946
2020-04-28 18:37:25 +07:00
Vadim Yanitskiy a0b47cf825 PCU: add test cases for EGPRS Packet Channel Request
This change introduces three similar test cases:

  - TC_egprs_pkt_chan_req_signalling,
  - TC_egprs_pkt_chan_req_one_phase,
  - TC_egprs_pkt_chan_req_two_phase,

which basically send several 11 bit RACH.ind messages to the IUT
containing different variations of EGPRS Packet Channel Request.

Depending on the establisment cause, for each RACH.ind we expect
to receive an Immediate Assignment containing an EGPRS Packet
Uplink Assignment in its Rest Octets.

All test cases make sure that Request Reference in the received
Immediate Assignment messages is set to 127 as required by 3GPP
TS 44.018 (see table 9.1.8.1, note 2b), and the Extended RA IE in
the Rest Octets matches 5 LSBs of the RA value that was sent.

Change-Id: Ib5732956ea160f93d82f06bf82bea45501f439d2
Related: OS#1548
2020-04-28 11:18:50 +00:00
Vadim Yanitskiy 8ae978cecb PCU: derive f_pcuif_rx_imm_ass() from f_establish_tbf()
Change-Id: I3b49927d0db49555e0bf2bb453449f614c7b9323
2020-04-14 23:19:27 +07:00
Vadim Yanitskiy fb3edf951d library/L3_Templates: remove tr_PAGING_REQ1_MI1_TMSI, use existing MI templates
Change-Id: Id35477ffc4a914e71100f129bbc4833b48ed5da4
2020-03-30 14:47:08 +07:00
Vadim Yanitskiy 9c51313c71 PCU: fix f_tc_paging_ps_from_sgsn(): also match received MI
Change-Id: Ia8c25ee74c711d8abc84b7d164b3d41abafc1da4
2020-03-28 05:36:09 +07:00
Vadim Yanitskiy 98bb2d5eea library/GSM_RR_Types: do not duplicate Mobile Identity records
All the records related to Mobile Identity IE (see 3GPP TS 24.008,
section 10.5.1.4) are defined in [1], so there is no real need to
dumplicate them. Moreover, most of the related templates in
library/L3_Templates.ttcn are based on these records.

[1] titan.ProtocolModules.MobileL3_v13.4.0/src/MobileL3_CommonIE_Types.ttcn

Change-Id: I27c2743c59db770d6f7e9447dc8c1f539b228ced
2020-03-28 03:29:22 +07:00
Vadim Yanitskiy 7b2242157b PCU: also test GSGN originated PS/CS Paging containing TMSI
This additional couple of test cases reveals several bugs:

  1) the IUT encodes a erroneous RR Paging Request message
     containing P-TMSI, so TITAN fails to decode it;

  2) the IUT prints an invalid P-TMSI in its log output
     due to load of misaligned address (found by UBSan).

[1] I97fd5ffc15a4a58112d7c37c69b7ac42b0741a0e
[2] Icf8836f216793e342b239c8e6645aac1e82bf324

Change-Id: I7fbec5b2c5c3943a7413417b623f55c135c152d7
2020-03-26 16:27:50 +07:00
Vadim Yanitskiy cca15a388f pcu: cosmetic: fix formatting of 'execute' statements
Change-Id: Ia5a0eca1be13cc6580329b272ed9f663938f1e60
2020-03-24 21:27:00 +07:00
Pau Espin dc9666ff9c pcu: Verify CodingScheme of received data blocks
Change-Id: I0a5247650548f8a03f7b025aae65652fb424c156
2020-03-20 20:03:59 +01:00
Pau Espin 2422d1fa82 pcu: Introduce TC_mt_ping_pong_with_dl_racap
Allows checking how pcu parses MS RA Capabilities coming from SGSN.

Change-Id: Iedd8ab278547471b72252743d93a0f9e11d7e787
2020-03-18 15:53:17 +01:00
Pau Espin e7cabe6f54 pcu: Introduce TC_mt_ping_pong
Change-Id: I0cbf4ac78e4c89f21b8c2b92eba1783667501e64
2020-03-18 13:27:45 +01:00
Pau Espin 925818ac36 pcu: Check received IMSI suffix from PCUIF paging request
Change-Id: Ia11447fb71ea0b6a8fcce1a28e93cc166d22ef7a
2020-01-11 00:24:03 +00:00
Vadim Yanitskiy 322c79367b PCU: fix: actually match IMSI in Packet Paging Request
Change-Id: I0afdd53fd5d2a89e139f65a7aec412a2e12511cc
2020-01-03 22:20:50 +00:00
Vadim Yanitskiy 5e51873d9c library/RLCMAC_CSN1_Types.ttcn: fix ps / cs selection in PageInfo union
Change-Id: I40c2a3c38799a625836e4c28f476524c92077b83
2020-01-03 22:20:50 +00:00
Pau Espin 4536c82b99 pcu: Move NS tests to PCU_Tests_RAW_NS.ttcn
Tests from PCU_Tests_RAW_SNS inherit most infrastructure from NS tests
defined in PCU_Tests_RAW, which in turn don't share that much with other
tests present in that file. This way we simplify file PCU_Tests_RAW.ttcn,
which will potentially grow once more tests are added.

Change-Id: If680d1bd7dbfe98829f330c33705e0f13bedf3c7
2019-12-30 14:06:06 +01:00
Pau Espin f04ba541c1 pcu: Pass correct fn to ts_PCUIF_DATA_CNF
Change-Id: I68fc0e3dba2cdadbe479017f31868f6dd0dabe9f
2019-12-23 14:47:44 +01:00
Pau Espin 88bf537b35 pcu: Introduce tests for CS and PS paging from SGSN/Gb
CS Gb paging and PTP CS/PS paging implemented in osmo-pcu:
I9501e02e1d7f6944497e724dbccb9a19c3f5221f
I5c52b5af740460c48bb3ba858243b1d20e624268

Related: OS#3927, OS#2406
Change-Id: I90b5a792c1d91e38ea7b8c060ff0b459673df951
2019-12-23 14:46:07 +01:00
Oliver Smith 8f9daab414 pcu: add TC_paging_cs_from_bts
1. BTS send a CS paging Request over pcu socket
2. Expect a CS paging frame

Related: OS#3927
Change-Id: Ia3ad503c243c9b3b162e204683fa4fa5447bbab3
2019-12-17 13:53:44 +00:00
Pau Espin ff8da1901b pcu: Introduce test TC_t3193
Change-Id: Ib11cd1793d985ff609b10b0e60bddadd5fcfa6d2
2019-12-17 13:53:44 +00:00
Pau Espin a7b7566e0b pcu: Introduce test TC_imm_ass_dl_block_retrans
Change-Id: Icc60cebb8583c9dc97b658def69f17e6efced384
2019-12-17 13:53:44 +00:00
Pau Espin 8948633e8c pcu: Introduce helpers to update AckNackDescription
Change-Id: Ic62ab9e4a854239b95c434068543d95c5352f1c6
2019-12-17 13:53:44 +00:00
Pau Espin 7503c872db pcu: send UL CONTROL ACK triggered by DL ACK/NACK
Change-Id: Ib409394257427cfc62da08fe06ce6c001dcf608a
2019-12-17 13:53:44 +00:00
Pau Espin 65bab9e3bc pcu: Support sending message to PCU at specific FN
Change-Id: I81a29b4885f3fc6b753a1612d5fd369cd18f5dc6
2019-12-06 09:51:31 +00:00
Pau Espin 6072725622 pcu: Fix incorrect FN being send over PCUIF to PCU
The event FN contains the current FN, but the message should contain the
FN of the first burst of the block.

Change-Id: Iba0b1d1a3d7d875c5443a7bcaff399f9681624ad
2019-12-06 09:51:31 +00:00
Pau Espin 6e3b68988a pcu: Verify contents of data dl blocks originated from emulated SGSN
Change-Id: I4fe79572094038cbb26d5195c0544846ca2550b5
2019-12-06 09:51:31 +00:00
Pau Espin a3f0a85eb2 pcu: TC_mo_ping_pong: Check DL block is sent and ACK it
Function f_rx_rlcmac_dl_block_exp_data() still misses proper
verification of data. Apparently the received message has 2 blocks,
first with expected 10 bytes, but next one contains 18 bytes with 4
actual bytes and other bits are padding.

Last DL ACK/NACK sent is not yet working correctly. osmo-pcu seems to be
unable to match it against sent DL block (I think due to non-matching
FN), and instead drops it and schedules after timeout an IMM ASS to try
to send DL block again.

Change-Id: Icf66dd5c07690368722c586632c38fb7e770053c
2019-12-04 16:33:31 +00:00
Pau Espin 216596340a pcu: Fix RLCMAC template naming
There's also DL_ACK_NACK message for which a template will be introduced
soon, so let's rename and fix typos/wrong descriptions to avoid
confusion later.

Change-Id: I4a2025ad282006953fcfadf429c980b77cb94371
2019-12-02 19:12:10 +01:00
Pau Espin d16bb27306 pcu: Handle PCUIF (DE)ACT.req messages
Change-Id: I4440a6b24fb76b4f8096706769250b91bd2444bb
2019-12-02 13:07:15 +01:00
Pau Espin 3eef95c031 pcu: Introduce tests to check UL CS initial and max
Related: OS#4286
Change-Id: I3aa654e6f678698e5b8cb4914f1ca5b39fc08568
2019-12-02 11:14:49 +00:00
Pau Espin 2a45a5037d pcu: Add VTY support and use it to set (M)CS lqual thresholds
Requires osmo-pcu.git I3430abb5fc622dec293457466e760de95fa3a05c, before
that commit OsmoPCU cmd prompt contained a dash which resulted in TTCN3
being unable to match it.

Change-Id: I221675721b65b3ab44179e9657da70ba4004d7de
2019-12-02 11:14:49 +00:00
Pau Espin 1755fab662 pcu: Introduce test TC_mo_ping_pong
Ideally some more checks should be done on this test at the end, but
it's fine keeping it as it is for now and can be extended later.

Change-Id: I3be5123ff5294e5851652ec14d54589442082b28
2019-11-23 08:10:19 +00:00
Vadim Yanitskiy 36558d9526 library/PCUIF_Types.ttcn: extend RACH.ind with TRX / TS number fields
Since there can be multiple PDCH channels configured on different
timeslots, different TRXes, and BTSes, the PTCCH/U handling code
in OsmoPCU needs to know the exact origin of a given RACH.ind.

Otherwise, it is not known which subscriber originated a given
PTCCH/U indication, and hence it is impossible to send PTCCH/D
Timing Advance notification properly.

Fortunately, we can extend the RACH.ind message without even
bumping the protocol version, because every single PDU has a
fixed size defined by the largest message - INFO.ind. In case
if the actual message payload is smaller, the rest is filled
with a constant padding byte (0x00).

Older versions of OsmoPCU will consider the new fields as padding,
while the messages from older OsmoBTS versions will always have
both fields set to 0x00. Since C0/TS0 cannot be configured to
PDCH, this can be easily detected on the other end.

Change-Id: Ia5c4e504a21dc5508920553d3856027455dba1b1
Related: OS#4102, OS#1545
2019-11-23 07:57:45 +00:00
Vadim Yanitskiy 26cd244a9f PCU_Tests_RAW.ttcn: fix the expectations of TC_cs_lqual_ul_tbf
As it turned out, OsmoPCU is not supposed to change the Coding
Scheme immediately when the recent link quality value leaves the
current window. Instead, in order to avoid rapid changes of the
Coding Scheme, it also takes the previous value into account.
Thus the current Coding Scheme is only changed if both current
and old values fit into a new window.

This change makes the test case pass.

Change-Id: I5d503d5a9c46cb9de84fbabd2d591afbe4216fdb
2019-11-17 02:06:19 +07:00
Pau Espin 0361193a55 Update README.md of several TTCN3 test suites
Some stuff was wrong and some was missing after new features being
implemented in tests over time.

Change-Id: I7a279592a68ffc76408a8e728e76151534265cc0
2019-11-15 18:49:09 +00:00
Vadim Yanitskiy 20f8700767 PCU_Tests_RAW.ttcn: fix ToA handling in as_ta_ptcch()
As it turns out, it was a bad idea to use a counter in altstep
as_ta_ptcch(), because its value is getting lost. Let's instead
introduce a new type PTCCH_TAI_ToA_MAP, which is basically a
list of ToA values for each PTCCH/U sub-slot (TA Index), and
pass it to the altstep.

Change-Id: I74252dfb929fcb32d07e8728d692674931fae727
2019-10-09 15:24:22 +00:00
Vadim Yanitskiy b58b7308e5 PCUIF_RAW_Components.ttcn: ClckGen_CT: fix PTCCH event handling
Both TDMA_EV_PTCCH_DL_BLOCK and TDMA_EV_PTCCH_UL_BURST events may
happen together during the same TDMA frame (fn % 104 == 90). We
shall not skip TDMA_EV_PTCCH_UL_BURST. Let's fix this.

Change-Id: Ifc66d5d1c5f9eaa7bed6882105298c45257ebef0
2019-10-09 15:24:22 +00:00
Pau Espin cf47a920e5 pcu: TC_t3169: Check ul block reaches SGSN before timer expiration
Change-Id: Ic6fd82dc5037d08278d36aed9b6e72e80da5c42f
2019-10-07 15:28:22 +02:00
Pau Espin 596faa40dc pcu: Introduce test TC_t3169
Related: OS#3928
Change-Id: I587413a7de7956daee3423057530e4052a55ba88
2019-10-07 13:27:25 +02:00
Pau Espin 6c1b4be6c3 pcu: Introduce func helper f_imm_ass_verify_ul_tbf_ass()
Change-Id: I5b8a7ca5a4d0f905bf68949978811b139568c237
2019-10-07 13:23:54 +02:00
Pau Espin f787b0953c pcu: Allow tests to overwrite pcuif INFO_IND params
Change-Id: I75c746b822184fdcc966d77a7c6a0a6918c236e6
2019-10-07 13:23:51 +02:00
Pau Espin c3a7732311 pcu: Introduce some function helpers
Change-Id: I8608fac4375153d5020df5d05026513a7fe931d6
2019-10-07 11:21:25 +02:00
Vadim Yanitskiy 02f77d8807 PCU_Tests_RAW.ttcn: add a test case for continuous Timing Advance control
Unlike the circuit-switched domain, Uplink transmissions on PDCH time-slots
are not continuous and there can be long time gaps between them. This happens
due to a bursty nature of packet data. The actual Timing Advance of a MS may
significantly change between such rare Uplink transmissions, so GPRS introduces
additional mechanisms to control Timing Advance, and thus reduce interference
between neighboring TDMA time-slots.

At the moment of Uplink TBF establishment, initial Timing Advance is measured
from ToA (Timing of Arrival) of an Access Burst. This is covered by another
test case - TC_ta_rach_imm_ass. In response to that Access Burst the network
sends Immediate Assignment on AGCH, which _may_ contain Timing Advance Index
among with the initial Timing Advance value. And here PTCCH comes to play.

PTCCH is a unidirectional channel on which the network can instruct a sub-set
of 16 MS (whether TBFs are active or not) to adjust their Timing Advance
continuously. To ensure continuous measurements of the signal propagation
delay, the MSs shall transmit Access Bursts on Uplink (PTCCH/U) on sub-slots
defined by an assigned Timing Advance Index (see 3GPP TS 45.002).

The purpose of this test case is to verify the assignment of Timing Advance
Index, and the process of Timing Advance notification on PTCCH/D. The MTC
first establishes several Uplink TBFs, but does not transmit any Uplink
blocks on them. During 4 TDMA multi-frame periods the MTC is sending RACH
indications to the PCU, checking the correctness of two received PTCCH/D
messages (period of PTCCH/D is two multi-frames).

At the moment of writing, PTCCH handling is not implemented in OsmoPCU
(neither PTCCH/D messages are correct, nor PTCCH/U bursts are handled).

Additionally, this change introduces a new message type, which is used
for sending commands to the RAW components - RAW_PCU_Command. Commands
can be used to (re)configure components at run-time.

Change-Id: I868f78e3e95a95f8f2e55e237eea700d7d4726a3
Related: SYS#4606
2019-10-04 20:24:08 +07:00
Vadim Yanitskiy 1f72b0ad84 PCU_Tests_RAW.ttcn: introduce a test case for PTCCH/D coding
Change-Id: I887c8922446d0c1a959e6f2678f50e5754f55e83
Related: SYS#4606
2019-10-01 05:59:00 +07:00
Vadim Yanitskiy 6276b6cf52 PCU_Tests_RAW.ttcn: TC_cs_lqual_ul_tbf: properly check for Dynamic Assignment
According to 3GPP TS 44.018, section 10.5.2.16 "IA Rest Octets",
Packet Uplink Assignment can be either of the following types:

  - single block allocation,
  - dynamic allocation.

The current version of TC_cs_lqual_ul_tbf does not handle single
block allocation, so we need to make sure we got a TBF with
dynamic allocation.

Change-Id: I05cf0c62d21094fb53a9e5e54b404f3cf972a182
2019-09-29 20:11:22 +07:00
Vadim Yanitskiy 740ae7614c PCU_Tests_RAW.ttcn: refactor TC_pcuif_suspend: use the RAW PCU components
This change is a step towards getting rid of the old test case
infrastructure. Note that a call to f_bssgp_establish() is moved
out of f_init_bssgp() to the test case's body.

Change-Id: If15339f02c5188e60fcb47ae6dc0ac289efa2896
2019-09-29 16:19:36 +07:00
Vadim Yanitskiy 0eb26621d8 PCU_Tests_RAW.ttcn: add test case for UL link quality adaptation
This change introduces a new test case TC_cs_lqual_ul_tbf, which
is aimed to test the feedback of OsmoPCU on changing link quality
measurements in Uplink Data blocks during an active TBF.

Change-Id: Ia78d93e43a3c41b0b30e70df20a2da31077fd05f
Related: SYS#4607
2019-09-27 03:17:50 +00:00
Vadim Yanitskiy 3e1d31808e PCU_Tests_RAW.ttcn: introduce TC_ta_rach_imm_ass to test initial TA
The aim of this test case is to test the correctness of Timing Advance
at the time of TBF establishment. In particular, the test case sends
several Access Bursts (RACH.ind) with increasing 'qta' value, what
causes OsmoPCU to allocate a TBF (Temporary Block Flow) for each
RACH.ind and send DATA.req with Immediate Assignment on AGCH,
containing the expected Timing Advance value.

Change-Id: I21f76ae723519c0eb54515922a05ca8045b00ade
Related: SYS#4606
2019-09-27 03:17:50 +00:00
Vadim Yanitskiy f7d9c0f22b Introduce PCUIF, BTS and ClckGen components for RAW PCU test cases
The problem of existing test cases is that they mix IUT (i.e. OsmoPCU)
with OsmoBTS (osmo-bts-virtual) and OsmocomBB (virt_phy). This approach
allows to avoid dealing with TDMA clock indications and RTS requests on
the PCU interface - this is done by OsmoBTS. On the other hand, our test
scenarios may be potentially affected by undiscovered bugs in OsmoBTS
and the virt_phy.

In order to solve that problem, this change introduces a set of new
components and the corresponding handler functions:

  - RAW_PCUIF_CT / f_PCUIF_CT_handler() - PCU interface (UNIX domain socket)
    handler. Creates a server listening for incoming connections on a given
    'pcu_sock_path', handles connection establishment and message forwarding
    between connected BTS components (see below) and OsmoPCU.

  - RAW_PCU_BTS_CT / f_BTS_CT_handler() - represents a single BTS entity,
    connected to OsmoPCU through the RAW_PCUIF_CT. Takes care about sending
    System Information 13 to OsmoPCU, forwarding TDMA clock indications from
    a dedicated ClckGen component (see below), and filtering the received
    messages by the BTS number. Implements minimalistic scheduler for both
    DATA.ind and RTS.req messages, so they are send in accordance with the
    current TDMA frame number.

  - RAW_PCU_ClckGen_CT / f_ClckGen_CT_handler() - TDMA frame clock counter
    built on top of a timer. Sends clock indications to the BTS component.

All components communicate using TTCN-3 ports and explicitly defined sets
of messages (see RAW_PCU_MSG_PT). One noticeable kind of such messages is
events (see RAW_PCU_Event and RAW_PCU_EventType). That's how e.g. the PCUIF
component can notify the BTS component that OsmoPCU has just connected, or
the BTS component can notify the MTC that SI13 negotiation is completed.
Events may optionally have parameters (e.g. frame-number for TDMA_EV_*).

Furthermore, the proposed set of components allows to have more than one
BTS entity, so we can also test multi-BTS operation in the future.

  +-----+               +----------+      +---------+
  | MTC +---------------+ PCUIF_CT +------+ OsmoPCU |
  +--+--+               +----+-----+      +---------+
     |                       |
     |                       |
     |                       |
     |    +-----------+      |      +---------------+
     +----+ BTS_CT #1 +------+      | ClckGen_CT #1 |
     |    +-----+-----+      |      +-------+-------+
     |          |            |              |
     |          +---------------------------+
     |                       |
     |    +-----------+      |      +---------------+
     +----+ BTS_CT #2 +------+      | ClckGen_CT #2 |
     |    +-----+-----+      |      +-------+-------+
     |          |            |              |
     |          +---------------------------+
     |                       |
     |    +-----------+      |      +---------------+
     +----+ BTS_CT #N +------+      | ClckGen_CT #N |
          +-----+-----+             +-------+-------+
                |                           |
                +---------------------------+

Change-Id: I63a23abebab88fd5318eb4d907d6028e7c38e9a3
2019-09-27 03:17:50 +00:00
Vadim Yanitskiy 6edd4f5a06 library/GSM_RR_Types.ttcn: introduce generic tr_IMM_TBF_ASS
Both 't_IMM_ASS_TBF_DL' and 't_RR_IMM_ASS_TBF_DL' templates were
introduced for a specific task - matching Packet Immediate
Assignment (Downlink TBF) by TLLI.

In the upcoming changes we will also need to match Uplink TBF
assignment, and more generic fields such as Timing Advance.
Let's add a generic template for Packet Immediate Assignment
and allow passing IaRestOctets as a parameter.

Change-Id: I492cf990820ba153ea71469b8b623e56e031e549
2019-09-09 16:30:47 +02:00
Vadim Yanitskiy 7091e8de88 library/GSM_RR_Types.ttcn: refactor IaRestOctHH coding
According to 3GPP TS 44.018, section 10.5.2.16, IA Rest Octets IE
starting with 'HH' bits may contain one of the following CSN.1
encoded components:

  7 6 5 4 3 2 1 0  Bit Numbers
  H H 0 0 . . . .  Packet Uplink Assignment
  H H 0 1 . . . .  Packet Downlink Assignment
  H H 1 . . . . .  Second Part Packet Assignment

We already have (partial) support for the first two, while the
last type has not been supported so far. Let's add it.

Also, this change introduces several templates for IA Rest Octets
IE and some of its components mentioned above. This would allow
us to abstract the API users from dealing with further changes,
e.g. adding a coding attribute 'CSN.1 L/H' and missing fields.

Change-Id: Ib3a21e7c5fa1cad4466e3a09fa70540de7f6ecc5
2019-09-09 16:30:47 +02:00
Oliver Smith aac9b9ceca BSSGP_Emulation: add BssgpDecodeDepth
Make the decoding level (BSSGP, LLC, SNDCP, L3) configurable, so the
existing PCU tests, that expect messages only decoded to the BSSGP
level, can pass again. Move the SNDCP decoding in f_dec_bssgp above the
L3 decoding, so f_dec_bssgp goes through the layers in the reverse order
of f_send_bssgp_dec.

I have verified, that all testsuites using the BSSGP Emulation (SGSN,
PCU, PCU-SNS) are still working with this patch.

Related: OS#4180
Fixes: 955aa94504 ("BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure")
Change-Id: I8f76385528c1de98c557cee451c0e0dfd182b605
2019-09-02 09:15:33 +02:00
Oliver Smith aa6278dd8f pcu: add configs for running without docker
Base on docker-playground.git's ttcn3-pcu-test/*.cfg files, change IPs
to 127.0.0.1, log to stderr, adjust pcu-socket path.

Change-Id: Iff3e5e6cf0c608680c8c5f9f83e8bc1032274ea9
2019-08-30 13:21:54 +02:00
Oliver Smith 00d7bc4a93 pcu/GPRS_TBF.ttcn: less verbose logging
Reduce the formatted log size of TC_ul_tbf from ~140 MB to ~8 MB.

Related: OS#3925
Change-Id: Ibccfc399a6e8b50e4f01b5f167c47fbbde4533ed
2019-08-30 12:05:39 +02:00
Harald Welte 955aa94504 BSSGP_Emulation: Abandon "BssgpDecoded" intermediate structure
It originally seemed like a great idea to define a custom record
which aggregates the decoded BSSGP, LLC, L3 and/or SNDCP and passes
it to the individual ConnHdlr.  However, particularly with testcase
interoperability for IuPS in mind, this seems bogus.  Also, we
never really took advantage of this.

Let's now decode as far as we can decode any PDU, and then send the
decoded version of that PDU via the ports between the BSSGP_Emulation
and the ConnHdlr component.

Change-Id: I8c1082880902dd9a04935945f0293895f4d0c53a
2019-08-18 17:12:46 +00:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Harald Welte 7fd25cfbfd pcu: Add TC_pcuif_suspend() to test PCU->BSSGP SUSPEND processing
The PCU is supposed to forward any RR SUSPEND received by the BTS
on dedicated channels and pass it to the SGSN via BSSGP.  This provides
knowledge to the SGSN that the MS is not reachable via PS/TBF anymore
until it completes its CC dedicated mode transaction and RESUMEs.

Change-Id: Iaf35e0c1087413db1dc7d169fa716df14c78f5db
2019-03-27 11:17:49 +00:00
Harald Welte 3d1fd5feef PCU: make f_bssgp_establish() run on BSSGP_Client_CT
This means it can be used in different/other scenarios, e.g.
with tests that use PCUIF directly.

Change-Id: I1aa5dc090aac78a85a85ac190343befb0199a093
2019-03-27 11:17:49 +00:00
Harald Welte 797ab3a91c pcu: Fix MCC/MNC handling: use 'F' between MCC and MNC in 2-digit case
Change-Id: Ifdb64c501095839e86894716769adb53e3c17382
2019-03-27 11:17:49 +00:00
Harald Welte 0466d16d42 pcu: move f_pcuif_tx() to PCU_Tests_RAW as it runs on RAW_PCU_CT
Change-Id: Ic60a7fc657df17ff2d3a889501f0576b98f1f4ad
2019-03-27 11:17:49 +00:00
Harald Welte f12b5a412d pcu: Ensure we're always using the same defaults for the CGI
Not all parts of the code explicitly specify each and every parameter
of the Cell Gobal Identifier (particularly we don't do that for the PCU
INFO IND), and hence multiple parts only interoperate if the same
defaults are used in all locations.

Change-Id: Iac9be9a8d4ccb4d01cc343d763d2e35873e3844f
2019-03-27 11:17:49 +00:00
Harald Welte a419df22a6 PCU_Tests.ttcn: Use "normal" Osmocom TTCN-3 coding style
Change-Id: I6eaca0ec7fb9c2dc5d59e385bc3a3a8bb85fe23a
2019-03-27 11:17:49 +00:00
Harald Welte 5e514fa3db NS_Emulation: Add minimal support for SGSN-side SNS handling
Change-Id: I1edf739d6fd39478f662a28a7d9334ca51c270a3
2019-03-27 11:17:49 +00:00
Harald Welte 64d0731c5b pcu: Add SNS tests for SGSN-originated BVC-RESET handling
Change-Id: Ib6b80acf98711f4749da4faf549b02ff2b82425f
2019-03-20 10:57:38 +00:00
Harald Welte 7e6a35cc65 pcu: Verify IPv4 address communicated in PCU-originated SNS-CONFIG PDU
Prior to this patch, the test accepted anything as list of IPv4
endpoints in the PCU-originated SNS-CONFIG PDU.  Using this patch,
the corect IPv4 address and UDP port number is verified.

Change-Id: Ia57100c7833bebc8d77118968c19ab12a3834036
Related: OS#3845
2019-03-16 18:37:54 +01:00
Harald Welte ecd159ecc7 pcu: Test SNS where initial IP/port is not part of configured NS-VCs
As per section 6.2.1 of 3GPP TS 48.016, the initial IP/port where the
SNS SIZE/CONFIG procedures are being performed is not automatically part
of the later NS-VCs.  This means we shall not perform the NS-ALIVE
procedure or any other procedure beyond SNS with that specific endpoint.

This adds a new TC_sns_1c1u_separate() to test for this behavior.

Change-Id: Ie2a017250ca1d5386e2cf42d1945e61d170ac92d
Related: OS#3844
2019-03-16 14:46:12 +01:00
Harald Welte 3b3358323c pcu: Fix PCU_Tests_RAW_SNS.TC_pcuif_rach
Change-Id: Ifb19e68a4b2b3250cdc6079dcd7f42656c57cee0
2019-03-15 22:41:33 +01:00
Harald Welte 33ad57b6fe pcu: Fix TC_sns_so_config_success expectations
If there's only one IP/PORT/NSVC, we cannot expect something happening
on another NSVC.  In this test case, only index 0  / NSVC0 is used.

Change-Id: Ia83d726c4223d61544f80d266ea832fcaa235518
2019-03-15 17:03:14 +00:00
Harald Welte 16e92f4169 PCU: Add simple test for PCUIF RACH Indication
Change-Id: I8fa6de711391837ed16888c48b22cd29892f222f
2019-03-02 00:04:52 +01:00
Harald Welte ea3c7e945e PCU: Split RAW_PCU_CT from RAW_NS_CT
Let's split the PCUIF-side component from the NS-side component
and create a new RAW_Test_CT which derives from both.

Change-Id: I15021c5dea16e39a530d8d9080e37a7f2a6c4fa7
2019-03-02 00:04:52 +01:00
Harald Welte 72099557a5 PCU: Add test for SNS Change Weight procedure
Change-Id: Ia63865139f63969ccde010b01ddb8fb073209f3a
2019-02-26 11:28:28 +01:00
Harald Welte 630d0e6523 PCU: Add tests for SNS with separate signalling/data NS-VC, ADD, DEL
Change-Id: Ie1d14a901b354daa4e3796fe66e7390d87c7e778
Related: OS#3617
2019-02-26 11:28:28 +01:00
Harald Welte b63c3a1e4f PCU: Add a bit more logging/tracing to ease debugging of SNS tests
Change-Id: Ic558f02f3c3ddbde0f16a7656b84486a8462b0a4
Related: OS#3372
2019-02-26 10:20:29 +00:00
Harald Welte bf76824482 PCU: Prepare for having multiple Gb connections on tester side
Change-Id: I6de4832bda18b36873f57986a34ba8082af2c853
Related: OS#3372
2019-02-26 10:20:29 +00:00
Harald Welte c4d7beb3ff PCU: Move SNS specific functions to PCU_Tests_RAW_SNS.ttcn
Change-Id: Ie41a21b6f2b95f4aaea84d8b717e96efefb704e3
RelateD: OS#3372
2019-02-26 10:20:29 +00:00
Harald Welte f7b74076c2 PCU: Add tests for our new IP Sub-Network-Service (SNS) Gb interface
The SNS-enabled Gb interface has no RESET/BLOCK/UNBLOCK procedures,
but introduces a bunch of new SNS procedures.  Most importantly the
SNS-SIZE and SNS-CONFIG procedures.

Change-Id: I0fe3d4579960bab0494c294ec7ab8032feed4fb2
Related: OS#3372
2019-02-26 10:20:29 +00:00
Harald Welte 88963dc365 PCU: Change PCU-side port to 22000
This way the tester and PCU can run on the same ip address without
conflicts.

Change-Id: I0e98877db8f0300a98f7694744a063c1143b89f3
2019-02-26 10:20:29 +00:00
Harald Welte b1b853a8ec PCU_Tests.default: Remove content of [EXECUTE] section
If we have tests stated in the .default file and we have them stated
again in the .cfg file, they will be executed twice.  Let's align
the PCU tests suite with those of other network elements.

Change-Id: Ieeaf70153f4dc61978569d06e20947fa939cabdd
2019-02-21 15:54:46 +00:00
Harald Welte 9fbcf4b01e PCU: Tests for the BSS/PCU side NS/BSSGP implementations
The existing (unused) PCU_Tests are operating on top of a NS + BSSGP
emulation, i.e. they're aimed at testing higher protocol layers.  Also,
they required BTS+BSC to run next to the PCU.

The new PCU_Tests_RAW introduced in this patch are the exact opposite:
* they test the PCU alone (attach to PCUIF and Gb interface)
* they don't require BTS or BSC to run
* they don't use NS + BSSGP emulation but raw NS/BSSGP frames to
  test the very NS/BSSGP implementation inside of OsmoPCU.

Change-Id: I7ad76b96974cf0a686ad0f00ccd09d1a9df8b4d5
Related: OS#2890
2019-02-21 11:53:42 +01:00
Harald Welte f4bf131eca Osocom_Gb_Types: Add send/receive templates for SNS-SIZE and SNS-CONFIG procedure
Change-Id: Iaa12c468a9e665d2050945cfc0a60dab4024071c
2019-02-18 20:25:00 +01:00
Stefan Sperling 4c32b952dd start implementing the TC_paging() PCU test
Implement a basic paging test for the PCU, which is passing for paging
via TMSI (but only if osmo-pcu is started after the test is started).

Previously, this test code amounted to a debugging loop which
never terminated.

Change-Id: Id0384e0742ab91983615e4f1c883bb044c1c8b18
Related: OS#2404
2018-11-19 11:10:22 +00:00
Max cdce375449 PCU: cleanup test config
* remove unused parameters
* add expected results
* use control for default test execution
* only tests which could (in theory) pass are left in control

Previously generic control had some tests which never called
"setverdict(pass)" which means they would always fail. Such tests might
be useful during development but should not be part of test set executed
by default.

Change-Id: I91910e18f108f8ee9a3b76ced16c420fdbdb665a
Related: OS#2890
2018-11-06 22:13:30 +00:00
Daniel Willmann d93047434b Add Misc_Helpers.ttcn to centralize TTCN3 shutdown handling
This function can now be called from anywhere to try and safely shutdown
a testcase. It is not optimal as we can't call "all component.stop" from
outside the mtc, but without any proper and orderly shutdown handling of
all our emulation components I believe this is the best we can do.

To use it:

import from Misc_Helpers all;

in your module and then call

Misc_Helpers.f_shutdown(__BFILE__, __LINE__);

You can also pass the function a verdict and a message and it will take care
of calling setverdict, but beware of the following:

While setverdict would accept any number of arguments as log message
and convert them to a log string f_shutdown expects one charstring.
It's possible to use the log2str function to use the log arguments in
setverdict for f_shutdown, for example

setverdict(fail, "Template didn't match: ", tmpl_foo);
would become
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Template didn't match: ", tmpl_foo));

Change-Id: I84d1aa6732f6b748d2bfdeac8f6309023717f267
2018-10-24 15:10:13 +02:00
Alexander Couzens 0e510e693d BSSGP_Emulation.ttcn: extend BSSGP_Client_CT to hold 3 instances of BSSGP
Change-Id: Ibd7abba826a08b582361e9c255e9c44185e14067
2018-08-14 13:26:47 +00:00
Alexander Couzens 2c12b24a47 NS_Emulation: support multiple instances at the same time
The NS_Emulation has configuration values hardcoded or bound
to module parameters which prevents multiple instances.
Replace the module parameter based configuration with configuration
given when starting the NS_Emaulation.

Change-Id: I9128f9ad5c372779c38799269393137ba52576cd
2018-08-13 16:23:50 +00:00
Daniel Willmann afce86630c Stop tests after failures
Call mtc.stop after setverdict(fail), add reasons to most failures and
fail with verdict error for internal errors.

Change-Id: I9b618235939fa41160b9be6677b121963d3ec857
2018-07-24 14:19:42 +02:00
Stefan Sperling f82bbb6829 make PCU tests send PS paging requests on BVCI zero
osmo-pcu discards PAGING-PS messages unless received on the
signalling BVCI 0. The BVCI value must be set to zero both
in the NS header and the BSSGP header. Create new ports between
the PCU_Test components which the TC_paging test case can use
to ensure that both layers send frames with BVCI value of zero.

This does not make PCU_Tests.tc_paging work yet, however the PS
paging request is now processed by osmo-pcu rather than discarded.

Change-Id: I0437123b04b7320a4f690f0646578c57abf6bc87
Related: OS#2404
2018-05-25 14:26:19 +02:00
Neels Hofmeyr cd11223c0f ignore results of .ttcnpp files
Add another macro ignore_pp_results to gen_links.sh.inc and call from all
gen_links.sh files, to add results of *.ttcnpp files, i.e. generated *.ttcn
files, to .gitignore.

Change-Id: Ic7fb176226771212d7700dafaf27ac71f12a4a61
2018-03-16 18:25:58 +01:00
Neels Hofmeyr 1a4c4601d7 fix gen_links.sh: don't include source dir as link target
First of all, use one common place to define the gen_links() macro, in
gen_links.sh.inc.

In this new file, add a 'shift' to exclude the $DIR arg from also appearing in
$FILES.

This prevents the following wrong symlinks in the source dirs:

  M3UA_CNL113537/src/src
  MTP3asp_CNL113337/src/src
  SCCP_CNL113341/src/src

Change-Id: Ia8493e77df1ba8723f2c5d2a49816247b0fb55f7
2018-03-16 00:08:02 +01:00
Harald Welte cc5c1152cc WIP: Work towards a more real DL TBF receiver implementation
Change-Id: I300312734d99f2b8a406f39e04b4f738940f7579
2018-03-12 16:04:15 +01:00
Harald Welte b669ee029e pcu: First DL TBF hack
Change-Id: Ib3f09e125a7a4492d9072f8e9f5896eaac7ed03b
2018-03-12 15:50:03 +01:00
Harald Welte a35a9ca4d4 pcu: Adapt TC_paging to new code structure
OsmoPCU still doesn't support PAGING-PS, so this test is moot.

Change-Id: I94258c386073b1c11792949df56d643b92eeaefd
2018-03-12 14:23:57 +00:00
Harald Welte a0895f96a9 pcu: Rename 'gprs_gb/Test' tp 'pcu/PCU_Tests' to align with other suites
Change-Id: Ia3350e7e1a9d6715ab81f4a5f413b7e4d728ff60
2018-03-12 14:23:57 +00:00