Commit Graph

2081 Commits

Author SHA1 Message Date
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
Harald Welte f9fb63ec98 DIAMETER_Emulation: Add support for IMSI in Subscription-Id
Ths IMSI on the Gx interface is encoded into a different AVP than
on the S6a/S6d interfaces.  Let's make sure our DIAMETER_Emulation
knows both formats.

Change-Id: I299fcc2e01e908914df32fda4fb93b1114402c77
2020-04-26 22:08:34 +02:00
Harald Welte 24de8caffd DIAMETER_Types: Add IETF RFC4006 CreditControl + related
This adds more DIAMETER types to our TTCN-3 module, specifically those
encountered on Gx between PGW and PCRF.

./AVP.sh Base_IETF_RFC3588.ddf BaseTypes_IETF_RFC3588.ddf AAAInterface_3GPP_TS29272_f10.ddf GxInterface_PCC_3GPP_TS29212_f10.ddf S6Interfaces_3GPP_TS29336_f00.ddf MobileIPv6_HA_IETF_RFC5778.ddf RxInterface_PCC_3GPP_TS29214_f20.ddf NetworkAccessServer_IETF_RFC4005.ddf CreditControl_IETF_RFC4006.ddf CxDxInterface_3GPP_TS29229_c30.ddf GiSGiInterface_3GPP_TS29061_d70.ddf

Change-Id: Ibe7321e695337ff62fdc912270f6e13e6c6d6cf2
2020-04-26 22:08:34 +02:00
Pau Espin 1860bf8391 library/Osmocom_Gb_Types.ttcn: Fix typo presece->presence in function name
Change-Id: I50f1c23e83e9b87de09844226b110d2c48b7cfdb
2020-04-26 14:44:35 +00:00
Harald Welte 71117b689d pgw: Use bash to reliably support += syntax in shell scripts
Change-Id: Id93e83456380ade0617fe9a17eb2b92c685c749e
2020-04-26 15:29:35 +02:00
Pau Espin 55cb2ce675 L3_Templates.ttcn: Fix trailing whitespace
Change-Id: I46ff86b981ef649c89073f155566af35848aef8d
2020-04-22 17:09:25 +02:00
Harald Welte fe595e495c pgw: Add TC_createSession_ping4_256 to test 256 parallel sessions
Change-Id: I38cfaddfb60952f17846fbf87b1a29c32e646438
2020-04-21 22:57:31 +02:00
Harald Welte 8cfdc7cd57 pgw: Don't wait for 10s timeout if starting a ping that takes 10s
rather, dynamically wait 5s longer than the theoretical time it
should take.

Change-Id: Ife2b7b8d03ee6808cfa73bb860cc63c46c451499
2020-04-21 22:57:31 +02:00
Harald Welte 4526da9a22 pgw: Initial testsuite for a PGW (Packet Gateway in the EPC)
Change-Id: I1c0ea207c9191479fd8f581377855f78f36bc635
2020-04-21 22:57:31 +02:00
Harald Welte 88b3ccbf5b Add GTPv2_Emulation component
Change-Id: If73aa453e44ebf28032c60d207feb03e8061dc0c
2020-04-21 22:57:31 +02:00
Harald Welte e53a23db70 HACK: avoid compilation error with TITAN > 6.5.0
it seems TITAN no longer supports 'ifpresent' in certain situations,
see https://www.eclipse.org/forums/index.php/m/1826175/#msg_1826175

Let's make the tests fail if we actually run in those cases, but at
least compile fine and be able to execute all the other tests.

Change-Id: Ia401c2d696979c0062872bca8da62c2ea153427b
2020-04-20 18:02:45 +02:00
Harald Welte 885de1cdb5 CBSP_Templates: fix copy+paste error
Change-Id: Idd07dce8ccdbfa3d65a78ccfcaa9f43eb04979cd
2020-04-20 18:02:45 +02:00
Vadim Yanitskiy 3911d1177e library/RLCMAC_CSN1_Types: add EGPRS Packet Channel Request definition
For more details, see 3GPP TS 44.060, table 11.2.5a.2.

Change-Id: I762b932ed67d9e67a5e13290209cc9017dd650a7
Related: OS#1548
2020-04-20 02:56:41 +00:00
Harald Welte e735a3f6d1 Makefile: Add missing 'ccid' and 'mme' test suites
Only if they're part of the master Makefile, they will be built during
gerrit build verification.

Change-Id: I3c0b89eacadb12efc1e946d8eaff7864a8483c7a
2020-04-19 19:39:37 +02:00
Harald Welte af763aaef5 Fix/complete the partial GTPv2_CodecPort we already had
Change-Id: Idb9f492863d31e9decffeb0d71215fe581fdd4bb
2020-04-19 17:25:02 +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
Philipp Maier 90ec22be5b mgw: use library version of RTP_CodecPort_CtrlFunct
The .cc and the .ttcn file of RTP_CodecPort_CtrlFunct is currently
copied into the mgw directory and then used. However, those files do
exist in the /library folder as well, lets just link them using
gen_links.sh

Change-Id: I14f80051f6a168b7a8155c6e523c085e974b62b5
2020-04-01 10:18:12 +00:00
Harald Welte 0ee2297e97 Initial SIMTRACE testsuite
This doesn't really do much yet in terms of test coverage, but it
adds all related infrastructure

Change-Id: If9fa66b6c5fbddd742ff61fa2c1345736d07accd
2020-04-01 10:16:02 +00:00
Harald Welte 49a61e66cb bsc: Ensure osmo-bsc.fg + BSC_Tests_CBSP.ttcn defaults match
We want to make sure that the tests + config match

Change-Id: I9d6ed0aed34bb983c8db225c7762ceffa642decd
2020-04-01 10:12:27 +00:00
Vadim Yanitskiy 36aa07cb89 BTS: fix as_l1_count_paging(): do not count PCH filling messages
Since build #842, both TC_paging_{i|t}msi_80percent started to fail:

  "BTS_Tests.ttcn:3051 : Expected 271 pagings but have 284"
      BTS_Tests.ttcn:6414 BTS_Tests control part
      BTS_Tests.ttcn:3051 TC_paging_imsi_80percent testcase

  "BTS_Tests.ttcn:3075 : Expected 543 pagings but have 553"
      BTS_Tests.ttcn:6415 BTS_Tests control part
      BTS_Tests.ttcn:3075 TC_paging_tmsi_80percent testcase

As it turns out, since If5339c7a91b4e0188194f1cd935798f153974e01
TITAN can decode PCH filling messages with no Mobile Identity.
We should not count them in as_l1_count_paging(), as they're
sent by osmo-bts itself.

Change-Id: I420f36ed000b1c2488fbe500c33a8161e27d20e3
Fixes: OS#4475
2020-03-31 15:50:33 +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 d665c23237 BTS: fix as_l1_count_paging(): use ispresent() instead of isvalue()
We actually need to check if a MI is present, i.e. not omit.

  ispresent(omit) => false
  isvalue(omit)   => true

Change-Id: I0e24e2aaa1f0da7ffdbc93ea4a19491e5dfb39b4
2020-03-30 14:41:02 +07:00
Vadim Yanitskiy cc4623dff2 library/RSL_Types: use MobileIdentityLV for MS Identity IE
Change-Id: I5436dcbbc961d5b572e10e4f1a3f806d252d7818
2020-03-28 06:21:02 +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 a9a198dbd1 BTS_Tests_SMSCB: use existing tr_PAG_REQ1 and t_MI_NoIdentity
Change-Id: I018e1d875c85fe3958fd184fe0d2b0f56d1e343a
2020-03-28 05:28:59 +07:00