Commit Graph

1955 Commits

Author SHA1 Message Date
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
Vadim Yanitskiy c06688efe2 library: cosmetic: fix misleading comment in RSL_Types.ttcn
Change-Id: Id7974dc666d61025453b79b7e054306c8122ca65
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-06 15:22:53 +07:00
Vadim Yanitskiy a8e83a8ea0 BTS: verify presence of GPRS Indicator in SI4 Rest Octets
So far we only checked presence of GPRS Indicator in the Rest
Octets of System Information Type 3, but this indicator is
also included in the Rest Octets of System Information Type 4.

Let's add additional test cases to check this indicator in the
Rest Octets of both message types. In order to achieve this:

  a) refactor f_si3_has_gprs_indicator(), so it can handle
     System Information Type 4 and its Rest Octets too;

  b) separate common part from the existing test cases into
     functions and (re)use them from the new ones;

  c) in f_TC_pcu_socket_noconnect(), make sure to send
     BCCH INFO with System Information Type 4.

Change-Id: Ifc589c35a52a62331b0ad4fbe2eec3fba55b5ff9
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
Related: OS#3075
2020-05-06 02:26:03 +07:00
Vadim Yanitskiy 3c18538651 BTS: refactor f_get_si3(), so it can be used to get SI4
This is needed for the follow up change(s) verifying the GPRS
indicator in the Rest Octets of RR System Information Type 4.

Change-Id: I540b43bbe886f8ca3e9a7eb49a4d30d391d45f49
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
Related: OS#3075
2020-05-06 02:26:03 +07:00
Vadim Yanitskiy ab5363f33a BTS: fix missing GPRS Indicator in SI4 Rest Octets
We do have GPRS Indicator in SI3 Rest Octets, but for some reason
it was absent in SI4 Rest Octets. Let's finally enable it, so we
can extend the existing test cases to check GPRS Indicator in the
Rest Octets of both System Information Type 3 and 4.

Change-Id: Ib55c2673b53b5981e57372f4f8cfb0af32e04132
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
Related: OS#3075
2020-05-06 02:26:03 +07:00
Vadim Yanitskiy 12cf3d908a BTS: manually compose Rest Octets for SI Type 3 and 4
Finally, we can get rid of hard-coded octetstrings and control
every field of the Rest Octets we're sending to the IUT.

Note that template 'ts_SI4_default' did not contain any Rest
Octets at all, thus the GPRS indicator was (and still is)
absent. This will be fixed in a follow up change.

Change-Id: I0a95b34b495267edf1f48692e24fcd5ede8ccdd1
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-06 02:26:03 +07:00
Vadim Yanitskiy 0217b05050 library: fix enc_SystemInformation(): properly pad messages
Due to a buggy nature of TITAN's padding attributes [1], we cannot
apply them to individual fields of the records that are embedded
into other structured types, like records and unions.

Ensure that encoded System Information messages are padded to
either 23 or 19 octets, depending on their type. In order to
achieve this, rename and wrap the external encoding function.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=562849

Change-Id: I3368df52985e576ad180c9a74d4925dd9c952b55
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-06 02:25:10 +07:00
Vadim Yanitskiy b7bc2e6746 library: relax length constraints applied to SI Rest Octets
As it turned out, the length constraints introduced in [1] were
too strict. In particular, the use of FIELDLENGTH attribute made
it impossible to assign an octetstring of a smaller size and then
pad the remaining octets with '2B'O. TITAN would just use '00'O
instead, ignoring all my attempts to talk some sense into it.

[1] I183d3ba9000e3ced8ecce74a4390b80075ddf25d

Change-Id: Ie1b6d4100c064b6ae08ed55cd797b9416c6faf14
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-05 00:16:38 +07:00
Vadim Yanitskiy 135b45eed9 library: add PADDING attributes to SI3/SI4 Rest Octets
Change-Id: Icce6d1e565edc6dce51310364079fc3840a18d45
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-05 00:16:38 +07:00
Vadim Yanitskiy 4a07c129e8 BTS: fix f_get_si3(): do not return uninitialized SI value
Change-Id: Ie60ef237443043578a218dcf19fe1b474b1d4e10
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-03 23:07:56 +07:00
Vadim Yanitskiy 5d2cf443ca BTS: refactor f_si3_has_gprs_indicator(): use SI3RestOctets
Change-Id: I2dc970d3d34a7d70c6845558544259e387f1d6fc
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-03 22:57:08 +07:00
Vadim Yanitskiy 2b98bda8dc library: clarify length restrictions for SI4 Rest Octets
Change-Id: I54bfe5710f744cdd61752f3e46b1b00e9f2f3e43
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-03 22:54:08 +07:00
Vadim Yanitskiy edae16aaa3 library: System Information: use RestOctets where possible
The 'RestOctets' is a sub-type of the 'octetstring' with additional
padding attributes. Let's use it for SI2bis, SI2ter, and SI6 too.

Change-Id: I183d3ba9000e3ced8ecce74a4390b80075ddf25d
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-03 22:48:23 +07:00
Vadim Yanitskiy 3c74a1113a library: get rid of Si1RestOctets and Si3RestOctets
Both are basically sub-types of GSM_RR_Types.RestOctets with length
constraints. We don't really need to have them as separate symbols,
especially since we have SI3RestOctets and SI4RestOctets now, so
let's apply these constraints within the corresponding records.

Change-Id: I2b126348ae5c5425fea4267ab2b77ea0192795ac
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-03 22:20:13 +07:00
Vadim Yanitskiy 72add6d7ed library: implement mandatory part of SI4 Rest Octets
Optional "Rest Octets S" part is left for later.

Change-Id: Ib0814e79f8627f3e2b4746b7e521e06ff82bf2d7
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-03 21:50:34 +07:00
Vadim Yanitskiy 0df8c94d69 library: implement SI3 Rest Octets as per 3GPP TS 44.018
Change-Id: Iaf86f1451a956bf1deef0a9d98fa0513aeb8164b
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-02 17:06:33 +07:00
Vadim Yanitskiy e05d7162a2 library/GSM_RR_Types.ttcn: fix: work around TITAN bug 562488
Commit [1] introduced multiple regressions, because it basically
changed the byte order in all fields of the whole module from
'first' (implicit default) to 'last'. This is not what we need.

Instead, let's apply BYTEORDER(last) to 5 bit 'ext_ra' fields
unless the bug [2] in TITAN's RAW codec is fixed.

[1] I481a40daef3eed4a3daa687ad87c4128a13181b4
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488

Change-Id: If998ef72c13787f04fee79e1e646cd9a6787028a
Signed-off-by: Vadim Yanitskiy <axilirator@gmail.com>
2020-05-02 17:06:33 +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 27d6af5edb RLCMAC_Templates: Add functions to convert HeaderType<->MCS<->CPS
They will be used by tests, templates and RLCMAC_EncDec.cc itself.

MCS HEader Type 1 and 2 to CPS conversion lefts as a TODO with
placeholder functions to easily implement when needed.

Change-Id: I18ff55a8067165bf081bf21473b4f88af955bf5b
2020-04-30 20:22:25 +02:00
Pau Espin 0b8e22be46 RLCMAC_EncDEc.cc: Support decoding Egprs Ul Data HeaderType2
Change-Id: I4dfc994beb7d0ee5522770651150c77701c573fe
2020-04-30 20:10:17 +02:00
Pau Espin 82d22bc326 RLCMAC_EncDEc.cc: Use copied structure as other parts of the function
Change-Id: Iffe45b3d220c0f95f1fdb54e1b90f0a0cef88ee3
2020-04-30 20:09:12 +02:00
Pau Espin d3da797249 RLCMAC_EncDEc.cc: Fix encoding of tfi and rsb fields in Egprs Ul HdeaderType3
Change-Id: Id0f7cb29cf3a30aafdaaed2aca7d34277e3c975d
2020-04-30 20:07:01 +02:00
Pau Espin 331f52507b RLCMAC_EncDEc.cc: Fix wrong descriptors passed to RAW encoder
Change-Id: Ieb061d2914be086791e264a78ae14d3d55e10815
2020-04-30 20:05:29 +02:00
Pau Espin a2c5b6e9d9 RLCMAC_EncDEc.cc: dec_RlcmacUl(Egprs)DataBlock: fix tlli and pfi uninitialized instead of omit
Change-Id: Id63ae66cd715512f12eb87fd9ff0a9f5af93d5d2
2020-04-30 20:00:02 +02:00
Pau Espin ecaeb89648 cosmetic: RLCMAC_EncDEc.cc: fix typos in comments
Change-Id: Id91ed01759c3e1e2b52f1e35b1f4198fbc052408
2020-04-30 19:58:15 +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
Pau Espin 372af7a116 library/RLCMAC: Add partial support for EGPRS data block encoding/decoding
* RlcmacUlBlock and RlcmacDlBlock gain a new union field "egprs_data",
  which is chosen when msg contains an egprs data block. Hence one can
  use same structure for both gprs/egprs data and simply check
  "ischosen(block.data_egprs)" to know whether it contains egprs or gprs
  data block.
* C++ code in RLCMAC_EncDec.cc takes care of encoding and decoding of
  each data header type and exposes a generic ttcn3 struct
  "UlMacDataHeader" and "DlMacDataHeader". Decoded header type can be
  found in mac_hdr.header_type. This can be used t5ogether with CPS to
  get the MCS of the message received. Similarly, the encoder will use the
  same field to know how to encode the ttcn3 structure.
* In RLCMAC_EncDec.cc order of functions has been ordered to split
  between encoding and decoding, and inside these split between Ul and
  Dl messages.
* Only encoding of UL HeaderType3 and decoding of Dl HeaderType3 is
  implemented so far in RLCMAC_EncDec.cc. However, all code is already
  arranged and functions prepared (with FIXME fprintf) to easily add the
  missing header types once needed.
* Actually only the decoding of DL HeaderType3 has been tested to work so far.
  Encoding may still be missing to octet-align the data block after the header.
  All these wil lbe fixed once a test using them exists.

Change-Id: I2bc4f877a5e17c57ffa8cf05565dc8593b45aae8
2020-04-29 09:06:34 +00:00
Pau Espin fe3ae511e2 cosmetic: RLCMAC_Types.ttcn: Make different PTCCH types section more visible
On top there's a lot of types related to data blocks. Having more
stylish section header helps orientating one self while looking through
the data blocks.

Change-Id: I87d4694031ea6874b233626818824cdc4f3505c6
2020-04-29 09:06:34 +00:00
Vadim Yanitskiy b021ed49b7 library/GSM_RR_Types.ttcn: use 'CSN.1 L/H' attribute where needed
Thanks to Harald, TITAN's RAW codec now supports the L/H syntax.

Change-Id: I279901aeffd09de071d274944cd0f1a93d711f85
2020-04-29 09:04:38 +00:00
Vadim Yanitskiy 0a71fcadbd library/GSM_RR_Types.ttcn: fix BYTEORDER of MCC/MNC in RAI
Change [1] introduced a regression: PCU_Tests_RAW.TC_pcuif_suspend
fails since build #443. I have no idea why the BYTEORDER should be
set to 'first' (and not 'last'), but this is the only way I could
make TITAN's RAW encoder generate a valid MCC/MNC pair again.

[1] I481a40daef3eed4a3daa687ad87c4128a13181b4

Change-Id: I70a5b2eed3788be10d62fa421e3ba7444d66c655
2020-04-29 15:32:17 +07: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 1175b5e509 library/GSM_RR_Types.ttcn: fix: apply BYTEORDER(last) globally
By default, the BYTEORDER for BIT1..N sub-types is set to 'first'.
This may result in incorrect decoding of bit-fields located on the
boundary of two octets. For example:

  IA Rest Octets
    L... .... = First Discriminator Bit: Low
    .H.. .... = Second Discriminator Bit: High
    ..0. .... = Discriminator bit: EGPRS Packet Uplink Assignment
    ...0 .... = Downlink/Uplink: EGPRS Packet Uplink Assignment
    EGPRS Packet Uplink Assignment
      .... 0001  1... .... = Extended_RA: 3  // <------------ (!)
      .0.. .... = Access Technologies Request: Not Present
      ..1. .... = TFI/Multiblock: TFI Assignment Present
      ...0 0000 = TFI_Assignment: 0

As can be seen, the field 'Extended_RA' in this particular case
occupies 4 LSBs of the first octet and 1 MSB of the second. So
instead of '00011'B, TITAN's RAW codec decodes '10001'B.

For more details, see:

https://www.eclipse.org/forums/index.php/m/1826511/
https://bugs.eclipse.org/bugs/show_bug.cgi?id=562488

Change-Id: I481a40daef3eed4a3daa687ad87c4128a13181b4
2020-04-28 11:18:50 +00:00
Harald Welte f400151003 pgw: Add support for PCRF emulation (CCR/CCA)
If mp_pcrf_local_ip is set to a non-empty string, the PGW testsuite
now emulates a PCRF and expects the PGW to perform the related
transactions - so far Credit-Control-Request INITIAL_REQUEST
at session creation, and TERMINATION_REQUST at session deletion.

Change-Id: I5f0c7a66d38e5c8b5f36b45717d49648a14ed7b2
2020-04-26 22:08:34 +02:00
Harald Welte d01b5d0af0 DIAMETER_Emulation: Notify user of CapabilityExchange
During start of the test case, we must wait until the IUT has
established a DIAMETER/SCTP connection to the testsuite.  Implement
this by means of a message on the DIAMETER_UNIT port and an associated
helper function.

Change-Id: I95434307efc67025ee6d373561f6d22398f959c5
2020-04-26 22:08:34 +02:00
Harald Welte 61f73d553b DIAMETER: parametrize CEA template
So far, we hard-coded the Capabilities-Exchange-Answer for
HSS emulation.  As we want to emulate other DIAMETER network
elements, let's parametrize the template as well as the respective
parameters for the emulation component.

Change-Id: Ie30ff1bac40ab3dc6058587f0586b643ff2b0cb6
2020-04-26 22:08:34 +02:00