Commit Graph

398 Commits

Author SHA1 Message Date
Vadim Yanitskiy 52787bf97f BTS_Tests: indicate TCH mode to the L1 in f_est_dchan()
Otherwise the L1 (trxcon or Calypso PHY) would 'think' that we're
in signalling mode, and would not send us Bad Frame Indications.

Change-Id: I0ade3bd63f604c7f0665124b182a023d50030d0b
Depends: I6f403ed0506b4b1872361d9976d3186bfe514b52
Related: OS#4799
2020-10-19 17:36:19 +00:00
Pau Espin d0ec1490c6 bts-oml: Verify BTS obj becomes Enabled durig OPSTART ACK
Change-Id: Iabe2677a458e169e646eb5a105ec9897c48eecc4
2020-10-19 17:33:37 +00:00
Pau Espin d431248f67 bts: Drop duplicated f_establish_dcch
A private copy of the function already exists in LAPDm_RAW_PT.ttcn where
it is used.

Change-Id: I141269b432d85b18b273992419b5ae3470569cde
2020-10-19 18:42:00 +02:00
Vadim Yanitskiy c7ef03057f BTS_Tests: introduce TC_ms_pwr_ctrl_constant()
This test case is aimed to verify that the MS power level remains
constant when 'rx-current' does not change and equals 'rx-target'.

Change-Id: Ifdafa03506102ff15f4d6dc304fff7d7e8f48170
Related: SYS#4916
2020-10-18 20:12:44 +07:00
Vadim Yanitskiy dd82be3c53 BTS_Tests: fix f_TC_imm_ass(): use send template, not receive one
BTS_Tests.ttcn:3647.9-3703.1: In function definition `f_TC_imm_ass':
    BTS_Tests.ttcn:3661.37-99: In the operand of operation `valueof()':
      BTS_Tests.ttcn:3661.58-98: In actual parameter list of template
                                 `@GSM_RR_Types.ts_ChanDescH0':
        GSM_Types.ttcn:125.48-55: warning: Inadequate restriction on
                                  the referenced template parameter
                                  `sub_slot', this may cause a dynamic
                                  test case error at runtime
        GSM_Types.ttcn:126.8-9: warning: Inadequate restriction on
                                the referenced template parameter
                                `tn', this may cause a dynamic test
                                case error at runtime

Change-Id: I7d36d25e5f8d3bb1040c737eeaeddd15f98ec4c2
2020-10-18 10:38:48 +00:00
Pau Espin 006d195794 bts-oml: Wait for SwActivatedRep before opstarting BTS nm obj
According to TS 12.21 attribute setting is done after the object becomes
sw installed.

Change-Id: I942c55df8ac8af22593e31ac4c501f644e9bee35
2020-10-16 17:11:16 +00:00
Pau Espin 9a053c07c9 bts: Fix race condition during init_rsl receiving from multiple TRX
When several TRX are set up, it can be that in between a RSLEM_EV_TRX_UP
event and the related tr_RSL_RF_RES_IND for that TRX, we receive a
RSLEM_EV_TRX_UP from another TRX which got just connected in parallel.

Change-Id: I1296c76c1d97e6704340484994ff3921975146b9
2020-10-16 14:06:03 +02:00
Harald Welte d0aed4f1b6 bts: Update osmo-bsc.cfg and osmo-bts.cfg
Somebody seems to have forgotten to update the osmo-bsc.cfg file here,
as osmo-bsc wouldn't even start using the file here.

Change-Id: I8453da3bda36912ee42fb0c8d862f75b2065965f
2020-10-12 17:19:20 +02:00
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
Eric Wild 61edb7e974 BTS: add some dynamic power control tests
Change-Id: I57489ba22542d859ced767e856634f9060c060f0
2019-06-12 20:16:44 +00:00
Alexander Couzens a063483b8b BTS: pcu_rr_suspend clean up and release the channel
The testcase failed becaues of an unexpected RSL Error Indication from
the LAPDm system which was in the RSL emulation queue when tearing down
the test environment.
By calling f_rsl_chan_deact() the queue gets flushed until the RSL
deactivate channel is received. It's also more clean to release the
channel.

Fixes: OS#4051
Change-Id: I55827626803ca81b68f905fd0df3126367951f39
2019-06-08 10:09:26 +00:00
Harald Welte d48c0c7f87 bts: Check if BTS_TRXC port is mapped before attempting UDP socket connect
A large number of our tests is currently failing with
	BTS_Tests.ttcn:341 Dynamic test case error: IPL4 Test Port not mapped
which was introduced by Change-Id Ie7d311bf8f03bf9b1d29b5bb28ffad793f215fd1

Change-Id: Ia1ef4ac7dcfec137a8613bc49a7f312d81a86153
2019-06-05 10:09:33 +02:00
Harald Welte a39ac756d3 bts: Add LAPDm test for SABM with wrong C/R bit
Test that the BTS will take no action when it receives an SABM frame
with the C bit set wrong (R); Inspired by TS 51.010-1 25.2.5.2

Implemented as TC_sabm_incorrect_c().

Related: OS#4032
Change-Id: I4fbe7e708c9b1a2c04e5d24a205b5b5af20ff8c7
2019-06-04 23:13:47 +02:00
Harald Welte 44479781b0 bts: Add test csse for I frame with wrong C/R value
Implemented as BTS_Tests_LAPDm.TC_incorrect_cr()

Related: OS#4032
Change-Id: I19e50049625bd31662a1e22b1394b69b2d249104
2019-06-04 23:13:41 +02:00
Vadim Yanitskiy dc8db92c86 BTS_Tests.ttcn: fix name of f_trx_fake_toffs256()
Change-Id: I83a1d68ffbfc4d588e143fecc62517baac9b31af
2019-06-04 22:27:55 +07:00
Vadim Yanitskiy 10d72468f4 BTS_Tests.ttcn: indicate default RSSI=-60 to FakeTRX
Change-Id: Ib13e3f8d9fbcd2722c6522a1bb5c513e34adfb18
2019-06-04 22:27:52 +07:00
Vadim Yanitskiy f4e997c5d4 BTS_Tests.ttcn: fix TRXC port mapping between test_CT and ConnHdlr
Before this patch, sending special TRXC commands to FakeTRX, such as
FAKE_TOA and FAKE_RSSI, from ConnHdlr resulted in a receive timeout
waiting for the response.

As it turned out, both the test_CT and the ConnHdlr have a TRXC port,
as depending on the test one would want to globally control it
from test_CT or from within a ConnHdlr.

However, only one of the two should be active (connected) at any given
point in time. Otherwise we'll have two UDP sockets on the same bind
port, and it's more or less random on which of them it ends up.

Let's add an optional parameter 'trxc_comp', which would indicate
whether we need to control TRXC from ConnHdlr or not.

Let's get rid of both f_trxc_connect() and f_main_trxc_connect(),
which basically do the same, but run on different components.

Change-Id: Ie7d311bf8f03bf9b1d29b5bb28ffad793f215fd1
Closes: OS#4039
2019-06-04 22:24:40 +07:00
Vadim Yanitskiy fc1a3ca32b BTS_Tests.ttcn: correct error messages about TRXC connection
Change-Id: Ie3dbe925b8840c0c8d8047ee5878fcdaa1395ab3
2019-06-04 19:35:13 +07:00
Harald Welte 7d9f6db401 bts: Implement testcase for RR response frame loss
Test is implemented as BTS_Tests_LAPDm.TC_rr_response_frame_loss()

Change-Id: I32340fff6666fee0ebfb9b31b55e0982d0d917a1
2019-06-04 09:12:03 +00:00
Harald Welte 76771f1cc2 bts: Factor out mobile-originated LAPDm establishment
which avoids us to have to copy+pate this between several test cases.

Change-Id: I8da753bb3d809ec09f9380bb4bac666ceaf61f00
2019-06-04 09:12:03 +00:00
Harald Welte b2a3034826 bts: Add test for expiring T200 N200+1 times
Change-Id: I9e1dbc889575f8952a4581551076829825b3b1cd
2019-06-04 09:12:03 +00:00
Harald Welte ef6fd44965 bts: Also test SACCH in TC_segm_concat
Change-Id: If9b51b4d6c357aa015f31e1e6851d4d1bb71a58f
2019-06-04 09:12:03 +00:00
Harald Welte 9ea918c2a8 bts: Add TC_segm_concat to test segmentation+concatenation
Change-Id: I6a9ce3e27f4a01412186b3b5d8d2b86573b6f8ac
2019-06-04 09:12:03 +00:00
Harald Welte 2f2b2b7f95 bts: Extend LAPDm test suite with a number of new tests
This adds the following test cases to BTS_Tests_LAPDm.ttcn:
* TC_sabm_retransmit_bts()
* TC_sabm_invalid_resp()
* TC_sabm_dm()
* TC_establish_ign_first_sabm()
* TC_iframe_seq_and_ack()
* TC_iframe_timer_recovery()

Change-Id: I4e1136c0c0f10d5bc8d01e826ae5d92f17a0b2aa
2019-06-04 09:12:03 +00:00
Harald Welte 104740610e bts: don't require users to pass test case name to f_init()
The f_init() function itself can very well derive the identity using
the built-in testcasename() function.  There's no need asking users
to do that - many of them don't do it in the first place :/

Change-Id: I17a61a84fba4df31b8baab1f631c8aa55d894dbd
2019-06-02 22:36:15 +02:00
Harald Welte 61332c0367 bts: BTS_Tests_LAPDm.ttcn: rename f_init() to f_lapdm_init()
This is to avoid name clashes with f_init() from BTS_Tests.ttcn

Change-Id: Ie6272165b1dbda53d2d02af43c8e969da7a54d2e
2019-06-02 22:36:15 +02:00
Harald Welte 72c81e7cbc bts: Remove one indent lvel from BTS_Tests_LAPDm.ttcn
Change-Id: I4637393df9989a97a4d70f08bd334d0f8cfd2284
2019-06-02 22:36:15 +02:00
Harald Welte c38611bab5 bts: Derive test component that talks RSL and LAPDm
Change-Id: I6e24c6f6a904c4c051780c35af82c3bd53c970ce
2019-06-02 22:36:15 +02:00
Harald Welte 97cca2f5cb move lapdm/L1CTL_Test.ttcn to bts/BTS_Tests_LAPDm.ttcn
Change-Id: Ibbc967f0bd9a19ab4bbd17f612654d72cb32d571
2019-06-02 22:36:15 +02:00
Vadim Yanitskiy 7c2c10cbf0 BTS_Tests.ttcn: introduce TC_ho_rach() for handover RACH
The idea of this test case (as can bee seen from its name) is to
verify handover RACH detection. What we basically do is:

1. Activate a logical channel on the BTS side (HO_SYNC for now);
2. Switch the MS (e.g. trxcon) to that channel without waiting
   for Immediate Assignment and sending Access Burst;
3. Send an Access Burst on that channel using RA = HO_REF;
4. Wait for RSL HANDOver DETected from the BTS;
5. Release a dedicated connection.

There is no way to verify if the Handover Reference received
from the MS matches the one that was sent to the BTS. We can
introduce a separate test case that would just send an Access
Burst with RA != HO_REF.

Change-Id: If2e8d9c9947823df62f4bcc9a7fcd20734ff7858
Depends on: (trxcon) Ia967820a536c99966ba2c60b63d2ea9edb093f46
2019-06-02 02:03:16 +07:00
Vadim Yanitskiy ab448a516a library/RSL_Types.ttcn: t(r|)s_RSL_CHAN_RQD: make chan_nr configurable
Change-Id: I89e9286e86b09ed54eb7749d107f5d8d57b93644
2019-06-01 14:03:42 +07:00
Vadim Yanitskiy 0a8d6daa65 L1CTL_Types.ttcn: accept SacchL1Header in ts_L1CTL_DATA_REQ_SACCH
In BTS_Tests.ttcn we used to compose L1ctlDataReq manually. This
can be done by ts_L1CTL_DATA_REQ_SACCH() template itself, so
let's abstract BTS_Tests.ttcn from doing that.

Change-Id: I1ae948bd0314cdf15c21ce4b6346d5e32f1fcf95
2019-06-01 14:03:42 +07:00
Vadim Yanitskiy 2f01fbd040 ts_TRXC_FAKE_RSSI(): define RSSI range, allow signed values
Change-Id: I8944e690c0da648eae3005777f2487c77b66a17b
2019-05-31 20:41:57 +00:00
Harald Welte bb9512e640 bts: move f_pad_oct() to Osmocom_Types as it's generally useful
Change-Id: I4df99e5612c67006eb2998529425956fb4a664af
2019-05-30 15:06:12 +02:00
Harald Welte ed0c1560d0 bts: Initial set of OML tests
The test coverage is far incomplete, but it at least is a starting
point.

Related: OS#4031
Change-Id: I82bb85b684d2db3a6b1e96a68ffde03e22affa6b
2019-05-29 18:39:22 +02:00
Harald Welte be03048ae8 bts: Verify SI3 GPRS indication reflects PCU interface status
When no PCU is connected to the BTS, the BTS should mask the GPRS
indicator from the SI3 rest octets to indicate "no GPRS support"
in the cell.  This will cause phones not even trying to send us
RACH requests for GPRS ATTACH, RAU, etc.

Change-Id: I37efb712ee0c513aea230beeb35e7dabce698a34
Related: OS#4023
Related: OS#3075
2019-05-29 06:07:07 +00:00
Eric Wild f1827a7baa Extend BTS_Tests.ttcn with test for RSL MODE MODIFY with encryption IE
This test will currently fail due to a MODE MODIFY NACK, even though the
channel mode is not modified.
Related: OS##3750

Change-Id: I4cbea499bb6a331d314e6573548a4540945208b5
2019-05-28 21:02:20 +00:00
Eric Wild e57e1a6942 Extend BTS_Tests.ttcn with test for RSL channel activation with static MS Power
Change-Id: Icecf18c77bfe8b049cc0896c4c5b441187be1c0e
Related: OS##3750
2019-05-28 18:09:48 +00:00
Harald Welte c761c547cd bts: TC_pcu_{time,rts}_ind: Higher tolerances
When executing the test on our build slaves, we ran into the following:

> Number of TDMA Frames (1100) not matching (1073 .. 1093)
> Number of TDMA Frames (1096) not matching (1073 .. 1093)

So it seems the tolerance was a bit too tight.  If the timer runs
for a bit more than the requested amount of seconds (e.g. due to
high system load), the number of TDMA frames is likely a bit higher
and hence we need to permit a larger tolerance.

Change-Id: Ib00bb7e7f223fb0329d00e3835127b8c31299e27
2019-05-28 12:18:40 +02:00
Harald Welte c8effb7e0f bts: Verify PCU socket can disconnect + re-connect
Change-Id: Ic69c3f34405012d42319bd9752f875071aae2243
Related: OS#4023
2019-05-27 21:31:56 +00:00
Harald Welte a2e0e94457 bts: Add test ensuring only one connection to PCU interface accepted
This adds TC_pcu_socket_connect_multi, which verifies that a second
connection to the PCU Intrerface socket is denied while the first
connection is still established.

Change-Id: Ib484a0a39e719cb2ce00a9464fc1207357ec9e93
Related: OS#4023
2019-05-27 21:31:56 +00:00
Harald Welte 6b86b3471f Fix use of osmocom-extended RSL Channel Numbers
Bring our TTCN-3 view of how RSL channel numbers are defined in sync
with that of our other implementations (BTS, libosmocore, trxcon, ...)

Change-Id: I48908058ac2501a3b5ae7c74e4e8527cbaee1b01
Related: OS#4027
2019-05-27 21:31:56 +00:00
Harald Welte 990a36138b L1CTL: Add support for CCCH_MODE_COMBINED_CBCH
In OsmocomBB/trxcon Change-Id Ia94ebf22a2ec439dfe1f31d703b832ae57b48ef2
we introduced a new mode CCCH_MODE_COMBINED_CBCH to indicate that the
channel combination is a CCCH+SDCCH/4 with one SDCCH stolen for CBCH.

Let's make sure we actually use that mode in our CBCH related tests

Change-Id: I27ee2c81bec7175c1ea09d4f3f6037f2866fe242
2019-05-27 21:31:56 +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 1490695778 bts: Add copyright + license header + short summary/explanation
Change-Id: Ia31427595b6d9fde883cfcd49f92767b69ead114
2019-05-27 10:00:06 +00:00
Harald Welte eaa9a86e0a bts: Add TC_pcu_rr_suspend() to test forwarding of RR SUSPEND via PCU socket
This test opens a SDCCH and sends a RR SUSPEND message from the
simulated MS.  It then expects the BTS to pick that up and forward
it to the PCU socket rather than via RSL to the BSC.

Change-Id: I4da6e9d7c5dfbd0e017d2a63c6474da700c38e52
Related: OS#2249
Related: OS#4023
2019-05-27 10:00:06 +00:00
Harald Welte 928622b092 bts: Add TC_pcu_data_req_pch() for testing PCU-originated PCH
Change-Id: I0f2c4f053ef1b8d61d565f94a548c47fe3666f16
Related: OS#4023
2019-05-27 10:00:06 +00:00
Harald Welte 7162a61f16 bts: Fully implement TC_pcu_data_req_{wrong_{bts,trx,ts},ts_inactive}()
The four existing test in BTS_Tests.ttcn so far didn't have any chance
to verify if the invalid messages actually ended up on the air interface
or not.  By using virtphy instead of trxcon, we can finally add that missing part.

Change-Id: Ie05d6b1530bd4d4cf4eaa574b068870682439ee4
Related: OS#4023
2019-05-27 10:00:06 +00:00
Harald Welte ad033dc6f1 bts: Fully implement TC_pcu_data_req_{pdtch,ptcch}
As trxcon+fake_trx don't have GPRS (TBF) support yet, we cannot do
any PCU related tests involving the Um interface yet.  Instead, let's
use virtphy to fill that gap.  Using virtphy, we can actually
receive/transmit GPRS blocks on the simulated Um interface.

TC_pcu_data_req_{pdtch,ptcch} are moved to a new test suite
"BTS_Tests_virtphy.ttcn" which should symbolize that the related tests
are to be executed with osmo-bts-virtual + virtphy instead of
osmo-bts-trx + fake_trx + trxcon.

You also have to set the following module parameter to make this work:
	BTS_Tests.mp_bts_trxc_port := -1

Related: OS#4023
Change-Id: I677f660b1076148b3317b08b06eb3d6551d9b577
2019-05-27 10:00:06 +00:00
Harald Welte 4832c86acd bts: Add TC_pcu_rts_req() to verify PCUIF_RTS_REQ
This new test verifies that the expected amount of PCUIF_RTS_REQ are
observed on the PCU Interface for both PTCCH and PDTCH.

Change-Id: Ic27cdd4f4adf11f871b84bd72692a03280274fe2
Related: OS#4023
2019-05-25 14:57:18 +02:00
Harald Welte 07bd2d265b Add TC_pcu_oml_alert() for testing PCU-originated OML alerts
As we don't yet speak OML directly from the TTCN3 test suite,
this requires a currently "RFC/WIP" state patch turning OML
Failure Event Reports into CTRL TRAP on the BSC, see
https://gerrit.osmocom.org/#/c/osmo-bsc/+/14177

Change-Id: I6c7641b37b6ee2177d43127140cc0b625409379c
Depends: osmo-bsc I4f8a9737c6ef1b951ea8e742cdbd3689371a99d5
Related: OS#4023
2019-05-25 11:03:30 +02:00