Commit Graph

340 Commits

Author SHA1 Message Date
Harald Welte 9b965d5350 bts: Increase SI sampling duration if SI2quater is involved
The existing sampling duration of 8s was insufficient to collect
sufficient samples to confirm the scheduling rules.

Change-Id: I2f631935c86fb840cdd733c28b2df503512341fa
2020-10-12 13:15:53 +00:00
Harald Welte a616ec9260 bts: Log more details in case SI sampling returned insufficient results
Change-Id: I2b853dfff0800cd87e49a3360019ff7198aeafb2
2020-10-12 13:13:04 +00:00
Harald Welte c87d81f916 bts: Avoid race condition in TC_pcu_deact_req
When our emulated PCU sends a DEACT.req to the BTS, there is no way
of knowing when exactly that command will have been completed: There is
no confirmation sent in response.

Let's introduce a f_sleep(1.0) to give the BTS sufficient time for
deactivating the channel.

This will make  TC_pcu_deact_req pass reliably.  It currently fails
in about one third of all test executions on jenkins.

Change-Id: Id9a559b8b208a60f71c3eb9a23830e4d2dbc5df9
2020-10-12 13:13:04 +00:00
Harald Welte c935fad594 bts: Adjust to VTY text change
In osmo-bts Change-Id If53fb07ec38f6bbc368ce84d14e59fa8167691d3
unfortunately the wording / syntax of the VTY was changed.  Let's
adjust to the new wording.

Change-Id: I4a6d37febde104e70ce03992b7e2e8fb793b5a00
2020-10-12 13:12:26 +00:00
Harald Welte 194b691b18 bts: Make f_power_from_band() fail in case of unknown band
Otherwise we get into weird error cases about unbound variables that are hard to debug.

Change-Id: I5716a5dc6ce95daa663be87a1a4fe611b719495e
2020-10-12 13:12:26 +00:00
Harald Welte 52ae168480 bts: Fix TC_rach_load_count
The first RACH LOAD IND may only cover a fractional reporting
interval, and hence must be ignored.

Change-Id: I32a703847fbf2b95993e910e6510613902e2bb1a
2020-10-12 13:12:26 +00:00
Harald Welte e37f9a504f bts: Fix TC_rach_load_idle_thresh0()
The first RACH LOAD IND may only cover a fractional reporting
interval, and hence must be ignored.

Change-Id: I43ee8e846803e2ef6218a3e7ac385ed8af30c217
2020-10-12 13:12:26 +00:00
Harald Welte 762202288b bts: Make TC_pcu_socket_verify_info_ind pass
f_init / f_init_pcu simply save the first PCU_INFO_IND
in g_pcu_last_info.  That first one might still be wrong as
the PCU might connect to the BTS before the BTS is configured
accordingly.

Let's wait for 2 seconds and actually use the last (most recent)
PCU_INFO_IND for the test.

Change-Id: I45717605fde66bf870bcb6e2560f0fc753d05d95
2020-10-12 13:12:26 +00:00
Alexander Couzens 475074bd3b bsc: copy osmo-bsc.cfg from docker-playground
The old file wasn't valid anymore.

Change-Id: Ic72bd755828d0cb6c5858e2fb7800e875f64369a
2020-10-12 02:25:17 +00: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 7e1d0a23fe fixup BTS_Tests: verify hopping parameters in the INFO.ind message
Pass transceiver number to f_resolve_fh_params(), otherwise the
hopping parameters would always be generated for TRX#0, and thus
the expectations for TRX#N > 0 would be wrong.

Change-Id: If1a25f5ff1b1bca900d54cc56e2045df5a81f4e2
Fixes: I9bb164fd2c7c48b91e0d7bd1abaf3cfec155342c
Related: SYS#4868, OS#4547
2020-09-17 15:27:37 +00:00
Vadim Yanitskiy aa553eda65 fixup BTS_Tests: also match MA length in TC_pcu_info_ind_fh_params()
The bit-mask in fhp.ma_map.ma is octet-aligned, so we cannot use
its length.  Use the number of transceivers instead, since they
all belong to the same BTS.

Change-Id: I772d13841babd2856b6b2fcf126ba47fb20b055a
Fixes: Ibebbedecaed0a3f24a1bc7b520013fa563c4bbda
Related: SYS#4868, OS#4547
2020-09-17 15:27:37 +00:00
Vadim Yanitskiy 7fefceea71 BTS_Tests_SMSCB: handle frequency hopping parameters
Change-Id: I1fd0a46b3d23afabae81fd1da5d2466e61e4a806
Related: SYS#4868, OS#4708
2020-09-14 09:04:39 +00:00
Vadim Yanitskiy ca81392360 BTS_Tests: group hopping parameters into a separate record
Change-Id: Iedb5d858a2d4f5d5a45e7465ae6586b3ae4bbb72
Related: SYS#4868, OS#4708
2020-09-14 09:04:39 +00:00
Vadim Yanitskiy cc4e149a2f BTS_Tests: simplify MA length calculation in f_resolve_fh_params()
Change-Id: I13f1d45162b520eff0d2e9823604fda85b71970b
Related: SYS#4868, OS#4708
2020-09-14 09:04:39 +00:00
Vadim Yanitskiy 9308cd665d BTS_Tests: also match MA length in TC_pcu_info_ind_fh_params()
Change-Id: Ibebbedecaed0a3f24a1bc7b520013fa563c4bbda
2020-09-14 09:04:39 +00:00
Alexander Couzens 5283f55777 BTS_Tests: verify NSVC IPv4/IPv6 in the INFO.ind message
Change-Id: Iae854875a45dbc29cd46a267ccaf60f1f2ac2973
Tweaked-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
Related: SYS#4915
2020-09-11 12:58:00 +00:00
Vadim Yanitskiy 6f9f7d2662 library/Osmocom_Types: share RA generation helpers from BTS_Tests
Change-Id: I7c9c3d243b39bbd3d521009d23c1043df729ee10
2020-08-28 05:56:39 +07: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 7faef076ab BTS_Tests: verify hopping parameters in the INFO.ind message
Change-Id: I9bb164fd2c7c48b91e0d7bd1abaf3cfec155342c
Related: I04782222b499d0488269544910fbd4ed9929c05d
Related: SYS#4868, OS#4546, OS#4547
2020-08-09 20:03:38 +07:00
Vadim Yanitskiy 4fa7425b14 BTS_Tests: compose the MA bitmask in f_resolve_fh_params()
Change-Id: Ic0a07d9deb60712347a42d9aa7813c684eaccd01
Related: SYS#4868, OS#4546
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 0d1511d96e BTS_Tests/SMSCB: enable test cases for CBCH on SDCCH/8
Change-Id: I15286bb784ce828bd9fa709945382af9b2b62b44
2020-07-31 06:45:31 +07:00
Vadim Yanitskiy f1c95c8b1c BTS_Tests/SMSCB: establish a dedicated channel in f_smscb_setup()
Change-Id: I3f061a4d48209b1aa5eaea2fd05fc4752de0c70f
2020-07-31 06:44:02 +07:00
Vadim Yanitskiy ffcd128f10 BTS_Tests/SMSCB: improve SDCCH8+CBCH handling and configuration
Change-Id: I130a028df7dc476ab765733261a1f007f19f39a8
2020-07-31 06:41:52 +07:00
Vadim Yanitskiy b1ebcc0163 BTS_Tests: introduce and use as_pcuif_check_pdch_mask()
This altstep would reduce code duplication.

Change-Id: Ic66598e3d2706da7caca7b27b9880562b0fcb9bd
2020-07-19 17:43:11 +07:00
Vadim Yanitskiy 13a29d5f65 BTS_Tests: fixup PDCH tests: consider frequency hopping
Do not resolve frequency hopping parameters unconditionally.

Change-Id: I1735a7f155f737c384e5d1e3e6f4ac97511a1c7c
Related: SYS#4868, OS#4546
2020-07-15 14:42:02 +07:00
Vadim Yanitskiy 1d55dee29b BTS_Tests: fix PDCH tests: consider frequency hopping
Change-Id: I1d805bf5392e59c4b4834757ce6124e63b174a42
Related: SYS#4868, OS#4546
2020-07-14 21:19:34 +07:00
Vadim Yanitskiy eec14f0951 BTS_Tests_LAPDm: consider frequency hopping parameters
Change-Id: Idd1ffe0ee97805b40bb5e37645aa53a9b1dc4b0a
Related: SYS#4868, OS#4546
2020-07-14 21:07:50 +07:00
Vadim Yanitskiy a9894281ef BTS_Tests: implement optional frequency hopping support
Change-Id: If0318fd320d4f112341465844555bf8d65b5f88f
Depends: I7822c3581fccba3277a63577e740e7486307635d
Related: SYS#4868, OS#4546
2020-07-14 21:07:50 +07:00
Vadim Yanitskiy 6c71c17fc5 BTS_Tests: introduce and use helper f_l1ctl_est_dchan()
This is required for the upcoming test cases running on hopping
channels.  Dealing with module / hopping parameters in every
test case is definitely not a good idea, so let's add a function.

Change-Id: Ia4f078ebbb278246ee117f580ff93f301dc60f7c
Related: SYS#4868, OS#4546
2020-07-14 21:07:38 +07:00
Vadim Yanitskiy f7181ed9c9 library/GSM_RR_Types: share send templates for ChannelDescription
They're going to be used in other modules too, not only in BTS_Tests.
Also, take a chance to rearrange the list of arguments, so the ones
with default values are placed after mandatory ones.

Change-Id: Ia33ebf2e680f16f774a981fc33422dfe5036637f
2020-07-14 20:31:07 +07:00
Vadim Yanitskiy cb478ec0ab library/GSM_SystemInformation: add dec_SystemInformationSafe()
Some types of System Information (mostly the Rest Octets) are not
fully implemented, so calling the generic dec_SystemInformation()
may result in a DTE.  Let's add dec_SystemInformationSafeBT() with
"prototype(backtrack)", so it would return a non-zero integer if
decoding fails.  Let's add a wrapper dec_SystemInformationSafe()
that would additionally check the RR Protocol Discriminator.

Change-Id: Id4d73e0f3347e1d4c4c77aec75b767311d662292
Related: OS#4662
2020-07-12 12:34:49 +00:00
Philipp Maier 16ade7860e BTS_Tests: extend rach content tests with emergency call
The testcase tests if a CHANNEL REQUEST on the RACH leads to the correct
CHANNEL REQUIRED message on RSL level. When a MS is sending a CHANNEL
REQUEST to establish an emergency call, it uses a slightly different
layout for the request reference (RA). Lets add another similar testcase
(TC_rach_content_emerg) to cover the emergency call situation as well.

Change-Id: Ie5b7af3e93efaa6d0b412d3b1c77bc9514424f52
Related: OS#4549
2020-07-09 12:40:26 +00:00
Neels Hofmeyr a5f0ed2ba4 GSM_SystemInformation: use GSM_RestOctets for SI3 and SI4 rest_octets
Change-Id: I3f00dd0b4863582fc5edf08149103150b8b5e97b
2020-07-06 16:49:52 +00:00
Vadim Yanitskiy 89be060458 BTS_Tests: mark both TC_rll_data_{req,ind} as TODO
Change-Id: I55d8dbc3a5cb3b0422cb6329b2bd60dd7b7fad6a
2020-07-04 21:39:47 +07:00
Vadim Yanitskiy 13c26f9279 BTS_Tests: move ts_RRM_GprsSuspReq to L3_Templates.ttcn
Change-Id: Ib1aa0053cfca8ccd6ff613ab3b1c4f5afbd27534
2020-07-04 21:39:47 +07:00
Vadim Yanitskiy b2a90db875 BTS_Tests: cosmetic: mark friend types / functions as such
Change-Id: I53296b0d66594c198251526c8433a07348d821b1
2020-07-04 21:39:47 +07:00
Vadim Yanitskiy 8239dd9627 BTS_Tests: cosmetic: mark private types / functions as such
Change-Id: I99ccf398130c7e5c2aac1932ebb83f158fed281d
2020-07-04 21:39:47 +07:00
Vadim Yanitskiy 71c39ea8f2 BTS_Tests: cosmetic: mark private test case functions as such
Change-Id: I173e42dbe1694a10b54f95a730df2e64f2c65d17
2020-07-04 21:39:39 +07:00
Pau Espin 45fe5e0e1f bts: Introduce TC_tx_power_ramp_adm_state_change
Change-Id: I03efdfe19e9cecadb0d03811a7029b54bf6281da
2020-06-25 12:52:48 +02:00
Pau Espin b6985f906f bts: Introduce test TC_tx_power_start_ramp_down_bcch
Change-Id: I895d69394a0123ae32b336c9ffaff615ba657f12
2020-06-25 12:52:42 +02:00
Vadim Yanitskiy 89db3e0f33 BTS: refactor f_init_rsl(): make number of transceivers configurable
Not all osmo-bts backends do support multiple transceivers, while
we still want to run test cases against them. Let's make the
number of transceivers configurable (mp_transceiver_num), so it
can be adjusted depending on osmo-bts backend to be used.

Change-Id: Ic9dd49a2fc856de593b52b3ec0c559e0e15ca173
Related: OS#3155
2020-06-22 18:11:46 +07:00
Harald Welte 7262968a29 osmo-bsc.cfg: Remove access-list directive
This was removed when libfilter was removed from osmo-bsc.

For some strange reason apparently the config files were not used/tested
while testing the removal of libfilter.

Also, irrespective of breaking TTCN3 test execution, we must introduce
a dummy 'access-list' VTY command to osmo-bsc to ensure we don't break
virtually every config file out there.

Change-Id: I5d703b9f2f1066654daa43519999585cf9ec7e78
2020-06-21 20:27:26 +02:00
Vadim Yanitskiy a16749582e bts/expected-results: TC_rsl_bs_pwr_static_{ass,power_control} pass now
Change I16cc50dfca102030380a06e16c234d5f6698f38f fixes them both.

Change-Id: I2e8db76be78fffcc8418096670ad3cf5174856f8
2020-06-16 01:44:21 +07:00
Vadim Yanitskiy 117c176de7 library/RSL_Types: fix RSL_IE_BS_Power: Power Level is 4 bit long
Unlike the RSL_IE_MS_Power, where power_level is 5 bit long, in
the RSL_IE_BS_Power it's 4 bit long. Fix this.

Change-Id: Ic0cb2275ef585754b9ae5e3d8077ca652afd9365
2020-06-16 01:40:24 +07:00
Vadim Yanitskiy 96e8c80b48 BTS: fix latest: ignore mismatching messages in as_rsl_init_guard()
Another surprise from the latest osmo-bts release: it may send us
CCCH LOAD INDication message during the RSL bring up. Ignore it.

Change-Id: Iab22b620a5f7b07fe03c1b13bebef2931d14879d
2020-06-10 14:21:39 +07:00
Pau Espin a2e079cb5d bts: Introduce test TC_tx_power_start_ramp_up_bcch
This test verifies power ramping (up) is working fine during BTS
startup.

config files are updated to make sense:
* "nominal power" in osmo-bsc.cfg reflects correct default nominal tx
  power of fake_trx.
* "osmotrx tx-attenuation" in osmo-bts.cfg is removed to let osmo-bts
  use the value received through OML (max_power_red 20).
* "power-ramp step-size" in osmo-bts.cfg is increased to speed up the
  test. There's no good reason to keep it lower.

Change-Id: Ieb7444c6312bbeab64da2732393b3facf3e1f003
2020-06-09 10:54:05 +00:00
Pau Espin 188bfd2ebd bts: Fix trailing whitespace
Change-Id: I5164212fee7e94bc98f65e60d00ccd77b4d9e01d
2020-06-07 19:41:22 +00:00
Vadim Yanitskiy fc631d1429 BTS_Tests: fix f_init_rsl(): expect all 4 transceivers to connect
Fixes TC_paging_{imsi,tmsi}_{200,80}percent test cases.

Change-Id: I32bb6d37929cde420a547e18eeb2f940e833316b
Related: OS#4546
2020-06-05 21:06:31 +07:00
Vadim Yanitskiy 28cabc4cc1 bts/BTS_Tests: add frequency hopping parameters
Change-Id: I111a14ca5d77c589529b40429d99d9ec6fa55a98
Related: Ib5ad31388ae25399ad09739aac3fdcb0b3a1f78b
Related: OS#4546
2020-05-29 22:33:13 +07:00
Vadim Yanitskiy 5afe885d26 library/L1CTL_PortType: refactor L1CTL channel establishment
- Get rid of f_L1CTL_DM_EST_REQ, it's not really needed.
  - Derive ts_L1CTL_DM_EST_REQ_H0 from ts_L1CTL_DM_EST_REQ.
    - Turn all its params into (value) templates.
    - Turn it into a (value) template itself.
  - Pass GsmArfcn directly to ts_L1CTL_DM_EST_REQ_H0.

Change-Id: I4f275e22d4309a23b4ed301a0779c4ecb92023a8
Related: OS#4546
2020-05-29 15:31:12 +00:00
Vadim Yanitskiy e9f68be1e3 bts/BTS_Tests: cosmetic: use mp_trx0_arfcn in ts_ChanDescH0
Change-Id: I07a91b6517d2f19e127d36d79e6d2136bd2c29bb
2020-05-27 20:14:08 +07:00
Vadim Yanitskiy 9248456057 bts/BTS_Tests: derive ts_ChanDesc{H0,H1} from ts_ChanDesc
Change-Id: Ifea1fe51e6fbfa26601136cfc8af55a5ae4e1512
Related: OS#4546
2020-05-27 20:14:08 +07:00
Vadim Yanitskiy a9eeb7b2f9 bts/BTS_Tests: cosmetic: mark c_MA_null as private
Change-Id: I49d231395a6ae3a582c9719eaa5244daac32e020
2020-05-27 20:14:08 +07:00
Vadim Yanitskiy 6de2fcbfe9 library/RSL_Emulation: server mode: handle multiple transceivers
Since change [1], the IPA emulation component allows us to handle
multiple IPA connections, thus multiple RSL connections. The idea
is to attach a TCP/IP connection identifier to each message.

On top of that, this change implements mapping between TCP/IP
connection identifiers and RSL stream identifiers, so we can
finally talk to any of connected transceivers (up to 4 for now),
not only the last connected one (as it was before). The actual
mapping is done during the IPA identification procedure.

Instead of forwarding ASP_IPA_EVENT_UP to a test case, the RSL
emulation component now sends a new event - RSLEM_EV_TRX_UP,
with transceiver number (actually, IPA stream-id) attached.

[1] I93c58c08cf296e5cea81d811650caa1a09b8a579

Change-Id: I86afb55ecc6703ce7a229aaa626223f9331a4778
Related: OS#4546
2020-05-26 20:57:00 +07:00
Vadim Yanitskiy 493abe7ec6 BTS: use existing templates for ASP_RSL_Unitdata
Change-Id: I8d7b3f8b019964ece9a3187f8232d8d23b2a53a5
2020-05-25 22:14:04 +07:00
Neels Hofmeyr a4d2100431 update expected results
Change-Id: I37014274ee97f09985c31966e7cc9122fe11a856
2020-05-19 19:25:35 +00:00
Vadim Yanitskiy c9c9e2962f BTS: move ASP_IPA_EVENT_UP handling to f_init_rsl()
Change-Id: I2479ce67426810d2789dda885bdbbe82b5d5282a
2020-05-18 23:45:28 +07:00
Vadim Yanitskiy a2afacc905 library/IPA: use tr_ASP_IPA_EV instead of inline templates
This way we can easily add new parameters to ASP_IPA_Event.

Change-Id: Icc37286fcb4d43836d56a26424ecb9dcba58d1f1
2020-05-18 21:16:35 +07:00
Vadim Yanitskiy 61564be045 library/IPA: split t_ASP_IPA_EVT_UD into send / receive templates
Change-Id: Ib5494bff3f9aa0ac396b729c326e7b4a64c5a5dd
2020-05-18 20:47:14 +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 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 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
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
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 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 a9a198dbd1 BTS_Tests_SMSCB: use existing tr_PAG_REQ1 and t_MI_NoIdentity
Change-Id: I018e1d875c85fe3958fd184fe0d2b0f56d1e343a
2020-03-28 05:28:59 +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
Pau Espin 5a012eed43 bts: Introduce new module for performance tests
A new module is created since its tests are aimed at running against
real HW set ups to check performance of the system under high loads.
As a result, tests in here will usually require a specific config file.

One first test is introduced to activate all TCH/H channels and see if
the BTS (+BTS-TRX) can keep on going fine for a while.

Related: OS#4365
Change-Id: I2d5f0043bdee1f8f5edcf46acce79ce547d1333d
2020-02-13 12:39:35 +00:00
Philipp Maier 15cd6870c5 BTS_Tests: skip tests that need PCU socket access
Some tests need direct access to the pcu socket, however, when working
with hardware bts this socket is not always available. The tests that
depend on the pcu socket are then skipped by the testsuite.

The following tests are not automatically excluded, but require direct
PCU access. Lets exclude them as well:

- TC_dyn_osmo_pdch_act_deact
- TC_dyn_osmo_pdch_double_act
- TC_dyn_ipa_pdch_act_deact
- TC_dyn_ipa_pdch_act_tchf_act_nack

Change-Id: I735b85d2ff3f541ebf0a558735d6172d69e7c29f
Related: OS#3863
2020-01-12 13:15:54 +00:00
Philipp Maier dd841d3a05 BTS_Tests: tolerate empty measurement result on chan est.
On channel establishment the first measurement result may lack the
measurement reports from the MS. This is normal behavior, so lets
tolerate that.

Change-Id: Ib2f511991349ab15e02db9c5e45f0df3645835a4
Related: OS#2975
2020-01-06 10:32:15 +00:00
Pau Espin 26b562c1bd bts: Early terminate TC_rec_invalid_frame on error
Extra debugging is added because otherwise it's extremely difficul to
find at which state the test is when debugging sporadic failures.

In f_TC_rec_invalid_frame, timer T is reused because it was actually not
being used before, only defined in there.

Change-Id: If24a81bf20d293b87adf9f37111fc7d344f169f5
2019-12-10 16:47:29 +00:00
Pau Espin a1f7d24efe bts: Update transmitted MS power as requested by BTS
New generic ms power loop algo takes into account the MS Power sent by
MS over L1 SACCH Header. As a result, the test infra must now update its
transmitted value according to what is requested by the BTS as if it was
a real MS in order for algo to output expected results.

Requires osmocom-bb I975cfc5f5d63eb32a7f8932a7f6a544c9a12233c to have
transmitted MS power values for dummy Meas Results updated as requested
over L1CTL.

Change-Id: I287761202093fbc1064f9868efe6f7f6155253ca
2019-12-10 11:23:53 +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
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
Pau Espin 61122c8f35 bts: TC_rsl_ms_pwr_dyn_down: Fix expected MS Power level
Related: OS#4244
Change-Id: I62c468b27d05fbff4a98ea24981188689f5899d3
2019-11-15 18:46:58 +00:00
Vadim Yanitskiy 970b153d4b BTS_Tests.ttcn: fix: move TC_pcu_ptcch to a proper place
We have a module parameter 'mp_l1_supports_gprs' that indicates
whether the L1 back-end (trxcon, virt_phy, or Calypso) does
support PDCH and TBF management.

The TC_pcu_ptcch does not require support of TBF management, only
PDCH (namely PTCCH) needs to be supported. This is already
implemented in trxcon, and can be easily implemented for Calypso.

Change-Id: Id2e751e825a7a5128bc3f2e4677d8ef31174b501
2019-11-06 04:56:35 +00:00
Vadim Yanitskiy 8c242f041a BTS_Tests.ttcn: add a test case for PTCCH/D and PTCCH/U
This test case is aimed to verify handling of both PTCCH/U and
PTCCH/D logical channels, recently implemented in [1]. This is
done by sending 16 Access Bursts on PTCCH/U, and then by
sending a random data block on PTCCH/D.

The existing TC_pcu_data_req_ptcch does not cover PTCCH/U, and
moreover involves TBF handling which has nothing to do with
PTCCH. Let's keep it anyway.

[1] I232e5f514fbad2c51daaa59ff516004aba97c8a3

Change-Id: I011ffdfa63b698ce6085968d15ffb4ff4bd23ee5
Related: OS#4102
2019-10-21 11:25:40 +00:00
Pau Espin 202c2f7486 bts: Fix race condition in f_dyn_ipa_pdch_(de)act
Test BTS_Tests.TC_dyn_osmo_pdch_act_deact was sporadically failing due
to receiving IND_INFO on the PCU port with pdch_mask related TS bit set
to 0 after sending a PDCH ACT. That happened due to a race condition
because PCU send IND_INFO periodically. As a result, it can happen that
BTS sends an IND_INFO after PCU.clear was called and before the PDCH ACT
is handled.

Commit 446e07bc77 already did same fix for
f_dyn_ipa_pdch_(de)act() family, but didn't change this one.

Change-Id: I323852632341c19837bebfcf2f00d404151367a7
2019-10-08 13:11:17 +02:00
Harald Welte 11b734cb10 bts: Test if BTS forwards ETWS Primary Notification to PCU
All MS/UE must be notified of ETWS Primary Notifiations.

Depending on their state, the notification goes different paths:
* CS dedicated mode: BSC sends it as L3 message over LAPDm / DCCH
* CS/PS idle mode: BTS sends paging messages on PCH
* PS TBF active: PCU send Packet Application Info

This tests the last of the three methods by checking that a  ETWS Primary
Notification sent on RSL to the BTS is received by the PCU socket.

Change-Id: I2661df7f7d870a0ac1c89bb8a85df81644b00b0a
Related: OS#4047, OS#4048
Depends: osmo-bts Ic0b3f38b400a0ca7e4089061ceb6548b0695faa6
2019-09-06 09:59:31 +00:00
Oliver Smith e1c00f022d Revert "bts: f_init_pcu: sleep before connect"
This reverts commit c089b415f5. The
additional sleep caused other tests to break, probably because it
triggered race conditions:
* TC_pcu_socket_connect_multi
* TC_pcu_socket_connect_si3gprs
* TC_si_sched_13_2bis_2ter_2quater

Adjust TC_pcu_socket_verify_info_ind test case error message to mention
OS#4179. This test is flapping now, most of the time the BTS sends a
CellID 0 because it did not receive the real CellID from the BSC yet.

Related: OS#4179
Change-Id: I2115c337f4601a4614b140715323c42803b003ee
2019-09-06 07:24:49 +00:00
Harald Welte 908ce54531 bts: Add test for ETWS Primary Notification via P1 Rest Octets
Change-Id: I247ea0f336e4ae9eecb1e8166f2326bdd2c299f4
Related: OS#4047
2019-09-05 12:44:13 +02:00
Oliver Smith 7bdf87bf9f bts: add configs for running without docker
Base on docker-playground.git's ttcn3-bts-test/*.cfg files, change IPs
from 172.18.9.* to 127.0.0.* (last octet unchanged).

Change-Id: I9eb2bb4599a4e874424f73483d9658a4467b8b8c
2019-08-29 19:46:49 +00:00
Oliver Smith f5239c7055 bts: add test TC_pcu_socket_verify_info_ind
Verify that the CellID of SI3 (TS 04.08 9.1.35) and other values are
passed properly to the PCU socket. A bug in OsmoBTS is currently causing
it to send a byte-swapped CellID, related fix is in [1].

[1] I68faf4558f0686fb2a3db24077dceaae05bf0262 (osmo-bts)
Related: OS#3854
Change-Id: I6516808f4b9e9a2301f9ccc1e55ded14e7334c33
2019-08-29 19:46:49 +00:00
Oliver Smith c089b415f5 bts: f_init_pcu: sleep before connect
Give the emulated BSC side some time to send the various SI via RSL.
This workaround makes OsmoBTS send the correct CellID and other
information instead of empty values to the PCU socket. The next commit
tests these values.

Related: OS#4179
Change-Id: I547f2b8e0796b6976506c28b1b493b1f5bce28f8
2019-08-29 19:46:49 +00:00
Vadim Yanitskiy de535e03ca BTS_Tests.ttcn: fix: use reasonable minimum default for C/I
Since [1] we additionally filter Access Bursts by the link quality
(defined by C/I) in L1SAP, and since [2] we do provide the actual
C/I values for osmo-bts-trx, as was received from the transceiver.

[1] https://gerrit.osmocom.org/r/I893ec9c6c2ebad71ea68b2dc5f9f5094dfc43b78
[2] https://gerrit.osmocom.org/r/I8d86dec7ebc039cbfd038c4342ff328b11281865

The default minimum C/I for Access Bursts in OsmoBTS is 50 cB,
while the TTCN-3 test cases configure fake_trx.py to send 0 cB,
so all Access Bursts are getting dropped, as expected.

Let's use 60 cB (or 6 dB) by default. This change makes Access
Bursts pass again, and thus fixes some broken test cases.

Change-Id: Ic345f7995c2553e346590cd851f8857d26e7beb2
2019-07-26 09:50:13 +00:00
Vadim Yanitskiy a2c68e81f9 BTS_Tests.ttcn: introduce TC_pcu_data_ind_lqual_cb
The idea of this test case is to verify that the link quality
measurements, in particular C/I (Carrier-to-Interference ratio),
are delivered to the PCU (as a part of PCUIF_DATA.ind).

The C/I ratio needs to be calculated by the transceiver from the
training sequence of each burst, where we can compare the "ideal"
training sequence with the actual training sequence and then
express that in cB (centiBels).

This test case can only be executed with fake_trx.py and trxcon,
because this pair allows us to simulate C/I values. Also, the
new TRXD header format needs to be supported (see OS#4006).

Change-Id: I67d89b2f0e13a7a6f74f001b19d37add77ec06f5
Depends: (OsmocomBB) I7080effbbc1022d1884c6d6f0cb580eba8e514ff
Related: OS#1855
2019-07-16 04:06:31 +00:00
Eric Wild 5b9ef14b90 unbreak some measurement tests
Trxc port mapping got lost.

Change-Id: I8eb766685dbf16e2eb2a973567016be3976e5840
2019-07-14 00:07:50 +00:00
Eric Wild ae8f262651 BTS: BS power tests
osmo-bts does currently not use the signaled lchan BS power level, nor
does it update the BS power IE returned in the measurement results.

Change-Id: If91fb57b4070c60bb277d0b55d69ee3dde47ee48
2019-06-18 17:08:09 +02:00
Eric Wild 095024b599 BTS: test that RSL MS POWER does not activate MS power control without PP IE
Change-Id: I8776ed4af83dc9f9f32ac14f5d4c9e35f4a286d6
2019-06-17 15:08:57 +02:00
Eric Wild 280ccb83a0 BTS: add another failing power control test
Change-Id: I8b3bdf374c96fa3368f90ae524859f30ceefa5f5
2019-06-17 11:12:21 +02:00
Eric Wild 74f25ae2c3 bts: clean up old tests and make them work again
Change-Id: Ie9d73cd9777b6fdda5115ed5dc103979d79c8cd9
2019-06-14 16:37:02 +00:00
Eric Wild 211acc3d45 bts: more lapdm tests
Change-Id: I0db71de5f600022935f47573aa919990de4bfec0
2019-06-14 16:36:25 +00:00
Pau Espin acc5119bac lib/IPA_Emulation: Build IPA_CTRL conditionally based on define
Change-Id: I4d1eca6b0008a395b7f7449e6ea3f9b6d41133c7
2019-06-13 16:33:49 +02:00