Commit Graph

340 Commits

Author SHA1 Message Date
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
Harald Welte d66c9b8d13 bts: Add Test for receiving PCUIF_TIME_IND on BTS PCU interface
Change-Id: Ib6b99a52790162b0227847d9aec5143cf959e2d0
Related: OS#4023
2019-05-25 09:06:27 +02:00
Harald Welte 3453ab48d6 bts: Add tests for CCCH LOAD IND (RACH)
Add three BTS_Tests.ttcn test cases for verifying the BTS behavior
regarding CCCH LOAD IND (RACH).

Related: OS#3750
Change-Id: I6c9dee1d7d3eaa218fdce7ebb8e334858aedb736
2019-05-24 21:24:36 +02:00
Eric Wild 6833cc9464 bts: Extend BTS_Tests.ttcn with test for RSL channel activation with TA from initial activation onwards
Change-Id: I4b2eec223e961aeedfd8afa77cb671d2842910fb
Related: OS##3750
2019-05-23 19:34:44 +02:00
Harald Welte 4a129f83ce bts: Add tests for CBCH LOAD IND (underflow, overflow)
Change-Id: Ia0a82771ba2912ef06fb0d9ee0816e8150701005
Related: OS#4011
2019-05-21 16:40:57 +02:00
Harald Welte 60bd92bddb bts: Add TC_sms_cb_cmd_sdcch{4,8}_extd_multi
Those tests verify operation of the EXTENDED CBCH.

Change-Id: I06c193d59f21472fb5e4c69a7af1ccb18fba7487
Related: OS#4011
Related: OS#3535
2019-05-21 16:36:51 +02:00
Harald Welte d522ca09dc bts: Test case for mixed NORMAL and DEFAULT SMSCB
This adds TC_sms_cb_cmd_sdcch{4,8]_default_and_normal() which test
the correct behavior in case of a DEFAULT SMSCB and normal one-shot
SMSCBs.

Change-Id: I0782b121cd69158903b09f935b298ddbf5a9ffb5
Related: OS#4011
2019-05-21 16:36:51 +02:00
Harald Welte a3ff670c5f bts: Refactor code to support mixed DEFAULT + NORMAL and EXTENDED CBCH
The existing code structure could only test for normal messages with a
NULL default, but didn't handle situations where normal and/or schedule
messages were superimposed on top of DEFAULT messages.

Also, prepare the infrastructure for testing both CBCH BASIC and CBCH
EXTENDED.

No new tests are introduced, the code should behave identical before
and after this patch.

Change-Id: I144c7d833b79c648b1ac69a6155f3603025ede5c
Related: OS#4011
2019-05-21 16:36:50 +02:00
Harald Welte df4d0f0b8c bts: Test for removal of CBCH DEFAULT message
Add a new testcase TC_sms_cb_cmd_sdcch4_default_then_null() which first
installes a DEFAULT message, verifies that, then removes the default
message and verifies only NULL CBCH blocks are sent anymore.

Change-Id: I9608d42a164a6210f100d10cb3ccfb7735975011
Related: OS#4011
2019-05-21 16:36:50 +02:00
Harald Welte 88e5dffd19 bts: Add TC_sms_cb_cmd_cbch_sdcch{4,8}_default_only
Add a most basic CBCH DEFAULT message test: Ensure *only* the
default message is sent if a default is set.

Related: OS#4011
Change-Id: Iab03fa88b759759a493516d43090c4df63f7b06f
2019-05-21 16:36:50 +02:00
Harald Welte e0026c3fb5 bts: Add TC_sms_cb_cmd_cbch_sdcch{4,8}_multi()
These new tests verify that multiple SMSCB commands are equeued,
and that each related message is sent exactly once.

Change-Id: Ice22fd2689a42c3b1951a02e65664102d4eaccc2
Related: OS#4011
2019-05-21 16:36:50 +02:00
Harald Welte 505cf9b519 bts: CBCH related tests for OsmoBTS
This introduces a set of CBCH related tests for osmo-bts.

Warning: Those tests currently require a patched trxcon to work.

Related: OS#4011
Change-Id: I955b4000c12180a39b0205b69b7b2c8cee8c9da3
2019-05-21 16:36:50 +02:00
Harald Welte 8b01c794f0 bts: Add TC_sacch_chan_act_ho_async + TC_sacch_chan_act_ho_sync
Those two new tests test the subtle rules related to how the presence
of certain IEs in the RSL CHAN ACT influence when exactly DL SACCH
transmission should start during hand-over related channel activation.

Change-Id: Ia88f3ab160891cdbbb8fa6e765f137edd04c6e81
Related: OS#3570
Related: OS#4008
Related: OS#4009
2019-05-20 00:15:09 +02:00
Harald Welte c8d363cd3c bts: Add TC_sacch_chan_act() to test SACCH INFO at RSL CHAN ACT
According to 3GPP Ts 48.058, every logical channel can receive some
specific SACCH filling at the time of RSL channel activation.  This
overrides the global SACCH FILLING.

Related: OS#3750
Change-Id: I8adb371a7e0b80792dd2fa35e5204802068df5ba
2019-05-19 20:43:51 +02:00
Harald Welte ee25aaed96 bts: Extend BTS_Tests.ttcn with test for RSL error handling
Section 7 of the RSL specification (3GPP TS 48.058) describes how the
BTS shall respond in various error situations, including wrong message
type, wrong message discriminator and invalid message sequences.

Let's add three test cases for the above three scenarios.

Change-Id: If507a14bbed9cdcc62cd966468222186590fc965
Related: OS##3750
2019-05-19 14:34:58 +02:00
Philipp Maier e63229e920 BTS_Tests: use 0.0 as default for mp_ipa_up_delay
The module parameter mp_ipa_up_delay ads a delay after the ipa bring up.
This is relevant for the tests with real BTS hardware, but it is not
relavent for the regular TTCN3 tests.

Lets set the default to 0.0, since the delay caused problems with
TC_rsl_ms_pwr_ctrl and TC_si_sched_13_2bis_2ter_2quater.

Change-Id: I7663cad5df1ee5a8bcdbbf522881999f1be9f4fe
Related: OS#3960
2019-04-26 12:37:06 +00:00
Philipp Maier d95f340a01 BTS_Tests: wait until BTS supplies stable signal
When running tests with real hardware it is important to wait for some
time (3 sec. should be enough) before exiting f_init(). This is to
ensure that the BTS supplies a stable carrier before the test proceeds.

Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68
Related: OS#3863
2019-04-24 14:55:19 +02:00
Philipp Maier 12567e45c2 BTS_Tests: default value for mp_ipa_up_timeout too low
The default value for the module parameter mp_ipa_up_timeout is set to
10 sec. Given that the sysmobts needs around 10-11 sec. to perform one
restart cycle this is to low and causes tests to fail occasionally. Lets
increase the default value to 15 sec to get reliable.

Change-Id: I5bb290d00a02a25672305688352a03f3bf484ff3
Related: OS#3863
2019-04-24 12:26:43 +02:00
Vadim Yanitskiy 51cbc104c6 BTS_Tests.ttcn: add TC_pcu_ext_rach_content() for 11-bit RACH
According to 3GPP TS 04.60, section 11.2.5a, the extended (11-bit)
Access Burst on RACH/PRACH is used by the MS to indicate its EGPRS
capability. One of the alternative synch. sequences (see 3GPP TS
05.02, TS1 and TS2) shall be used.

Add a test case to verify extended (11-bit) RACH decoding.

Depends: (OsmocomBB) I36fd20cd5502ce33c52f644ee4c22abb83350df8
Change-Id: I8fe156aeac9de3dc1e71a4950821d4942ba9a253
Related: OS#1854
2019-04-23 14:49:36 +00:00
Max 2c6f563e51 BTS: use PCU-related test cases as version string
When running PCU-related tests against BTS use name of the test as a PCU
version string sent from TTCN-3 code. This makes it easier to separate
OsmoBTS log output related to different test cases.

Change-Id: I9ef9e46061ef116529bdea196050f914804615b3
2019-03-21 16:00:04 +00:00
Max 6e05304843 Log FN and RA in TC_rach_max_ta
Similar to other RA-related tests, log FN and RA values in case of test
failure.

Change-Id: I815b10d0f0e9f29de7d306fa052b72b9e483dd9d
2019-03-14 16:39:29 +01:00
Max ba06feb0ce TC_rach_content(): fail test explicitly
By default Misc_Helpers.f_shutdown() will set test verdict to
'none'. Let's fail test explicitly if we had any timeouts.

Related: OS#1854
Change-Id: Ifff8b3b83eeedea0d308f7ab0bfe347e2dc278c8
2019-03-11 13:37:46 +00:00
Max a199a2e0a2 Log all RA values which cause test failure
Previously the first timeout in TC_rach_content() caused test to
fail. Related TC_rach_count() test shows that there're some (13-16 out
of 1000) RA values which are problematic. Let's log all such values in
TC_rach_content() before failing the test to, hopefully, spot the
pattern which sets such RA values apart.

Change-Id: Ibfeb377101f406608c0193f08729c0e6d084281e
Related: OS#1854
2019-02-25 16:31:11 +01:00
Max 1181f2d105 Log FN and RA on RACH test timeouts
Change-Id: I6caac582649e38e77938602fa675d50bdde57790
2019-02-21 16:46:05 +01:00
Pau Espin 446e07bc77 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.

Change-Id: If11ef05d97aa5f6caaa731f3817c1fecfc3edf7c
2019-02-21 13:31:35 +00:00
Neels Hofmeyr 2caf349752 update expected results
Change-Id: Idacaf8343bed4a37878eacdf338c4d5eb46bf7a7
2019-01-23 12:44:42 +01:00
Vadim Yanitskiy 44ff214356 BTS_Tests.ttcn: fix: use TRXC interface of the BTS side, not BB
It was observed that 'BTS_Tests.TC_rach_max_ta' started to fail
with the following reason: "BTS_Tests.ttcn:1091 : RACH passed
but was expected to be dropped: -2560".

My initial assumption was that the test case basically sends
FAKE_TOA command on a wrong TRXC interface, and it was
confirmed using trx_sniff.py:

  # TRXD of the BB side
  $ ./trx_sniff.py -p 6700
  [DEBUG] trx_sniff.py:110 L1 -> TRX burst: fn=616 tn=0 pwr=0
  [DEBUG] trx_sniff.py:110 TRX -> L1 burst: fn=597 tn=0 rssi=-60 toa256=-2560
  [DEBUG] trx_sniff.py:110 TRX -> L1 burst: fn=598 tn=0 rssi=-60 toa256=-2560
  ...

  # TRXD of the BTS side (Uplink bursts only)
  $ ./trx_sniff.py -p 5700 --direction L1
  [DEBUG] trx_sniff.py:110 TRX -> L1 burst: fn=719 tn=0 rssi=-60 toa256=0

and additionally be enriching logging messages of fake_trx.py:

  [DEBUG] fake_trx.py:186 (trx@0.0.0.0:6700) Recv FAKE_TOA cmd

Sending FAKE_* commands on TRXC interface of the BB side affects
the bursts being forwarded to this side, so we should use the
TRXC interface of the BTS side to simulate Uplink delay.

The reason why the test case has been passing some time ago is
that there was a bug in fake_trx.py, that has been fixed recently.

This patch makes 'BTS_Tests.TC_rach_max_ta' green again ;)

Change-Id: I7736abd85407c186856be9f1a22613a1fa6e0c32
2019-01-12 07:23:05 +07:00
Philipp Maier 4d1e9c9254 BTS_Tests: Verify RSL MS POWER CONTROL and SACCH MS POWER LEVEL
Usually the MS power is controlled by the BTS and there is no continous
supervison by the BSC needed. However, a scheme where the BSC takes care
of the power control loop exists. The power is then set via RSL using an
RSL MS POWER CONTROL message.

This tests establishes a dchan and then sends MS POWER CONTROL messages
with differen power levels and then checks the presence of the power
level set in the MS POWER LEVEL field of the SACCH L1 header.

Change-Id: I82b04a3bf94d355175f7f6ff3fdc43672e8080a2
Related: OS#1622
2018-12-23 10:36:58 +00:00
Pau Espin a14a8af5fd bts: Disable PCU related tests if PCU socket not configured
With some real HW setups, there's no PCU (osmo-pcu) available locally,
for instance when using a sysmobts, or when using a nanoBTS. There's no
need to waste time and generate extra output by running this tests in
this case.

Furthermore, some tests seem to crash sometimes in that setup, probably
due to using invalid fd (-1):
MTC@801a0da9866a: Setting RSL_SYSTEM_INFO_4 (4): '31061C62F224002A4740E50400'O
 /osmo-ttcn3-hacks/bts/BTS_Tests: Segmentation fault occurred
/usr/lib/titan/libttcn3-parallel-dynamic.so(_Z14signal_handleri+0xa3)[0x7f0c33b48073]
/lib/x86_64-linux-gnu/libc.so.6(+0x33060)[0x7f0c321aa060]
/osmo-ttcn3-hacks/bts/UD_PT.so(_ZN12UD__PortType15UD__PT_PROVIDER13outgoing_sendERKN9UD__Types14UD__send__dataE+0xf0)[0x7f0c349e42f8]
/osmo-ttcn3-hacks/bts/PCUIF_CodecPort.so(_ZN16PCUIF__CodecPort16PCUIF__CODEC__PT4sendERKNS_17PCUIF__send__dataERK9COMPONENT+0x19e)[0x7f0c37e1731a]
/osmo-ttcn3-hacks/bts/PCUIF_CodecPort.so(_ZN16PCUIF__CodecPort16PCUIF__CODEC__PT4sendERKNS_26PCUIF__send__data_templateE+0x5f)[0x7f0c37e174f7]
/osmo-ttcn3-hacks/bts/BTS_Tests.so(_ZN10BTS__Tests20f__TC__pcu__act__reqERK7INTEGERS2_S2_RK7BOOLEAN+0x411)[0x7f0c3eec3210]
/osmo-ttcn3-hacks/bts/BTS_Tests.so(_ZN10BTS__Tests28testcase_TC__pcu__deact__reqEbd+0x15d)[0x7f0c3eec4f27]
/osmo-ttcn3-hacks/bts/BTS_Tests.so(+0xfb65d)[0x7f0c3eeef65d]
/usr/lib/titan/libttcn3-parallel-dynamic.so(_ZN11Module_List15execute_controlEPKc+0x1c)[0x7f0c33af3fbc]

Change-Id: I773c7ec52dd8532bf160e92ffefc8d936ca55de2
2018-11-20 13:30:07 +01:00
Pau Espin 315e471bee bts: Introduce mp_ipa_up_timeout parameter
Some test env may take more than 10 seconds to (re-)start a BTS, so
let's make it variable through this parameter.
For instance it was observed that running osmo-bts-sysmo through ssh
inside a sysmobts can sometimes take a good number of seconds (specially
because ssh connection can take a while to be established successfully).

Change-Id: Ieb046358d8266ac94bd7b9e916e85f84de3ad319
2018-11-06 21:47:36 +00:00
Pau Espin 6451b04aed bts: f_est_dchan: verify Chan Rqd originated by RACH arrives on RSL
We cannot notify RSL Emulation layer about expecting a specific FN
(during ts_RSLDC_ChanRqd) because we only know the FN after sending the
RACH request, and since notification to RSL Emulation happens async, it
can happen (verified) that ChanRqd message from BTS arrives and is
handled before we register the RACH req into the ConnectionTable.

Change-Id: I438fd3ee82d88498d928dbcc89ce9bd80d37ab64
2018-11-06 16:22:57 +00:00
Daniel Willmann 0fcc4d357f BTS_Tests: Use Misc_Helpers.f_shutdown consistently
Replace all calls to setverdict(fail) with f_shutdown() since I'd rather
fail and stop early in case we encounter an error.
Only replace setverdict(pass) with f_shutdown() if it is followed by
mtc.stop

Remove internal function f_shutdown and use the one from Misc_Helpers

Change-Id: Ia8b01a1876e969d6f0760ea625e4df83af4f54ca
2018-10-24 15:10:13 +02:00
Pau Espin 3dcf38f7dc bts: Disable testing FACCH/H with real HW
Temporary disable testing on FACCH/H because Calypso PHY is not stable.
Otherwise some tests fail half of the time due to this unstability.

Related: OS#3653
Change-Id: I078cdfbf8d27e543a723eab90f66b2fcda016b5d
2018-10-23 10:35:15 +00:00
Pau Espin e9571aaee5 bts: Introduce mp_ul_rxlev_exp and use mp_rxlev_exp to craft meas rep
Change-Id: I1c8f05bde6f9dc8e8a649e877209192d829dd923
2018-10-23 10:34:43 +00:00
Vadim Yanitskiy 4ebdad65a2 BTS_Tests.ttcn: fix: don't overwrite the expected meas results
Since OS#2988 was fixed, we should not overwrite nor ignore the
measurement results in f_build_meas_res_tmpl().

Change-Id: Ie902bfc7619181b528eafbce367c87e0b062243a
2018-10-21 12:29:50 +00:00
Stefan Sperling aa1e60f584 add an IPA test which sends a chopped payload
Add another IPA test to the BTS and BSC test suites.
This new test sends the header in one burst, followed by the
payload which is transmitted byte-per-byte.

The test uses an ID REQ message. If acting as a server, the test
can expect an ID RESP message. However, if acting as a client, the
server will close the connection when it receives the ID REQ.
The CTRL interface port on the BSC does not close the connection in
this case, so that particular port is skipped by the test for now.

Change-Id: If75cb90841bb25619b414f0cabe008a2428a9fdf
Related: OS#2010
Depends: I4804ccabd342b82d44e69dbc6eaaae220ec7d4e4
2018-10-15 16:41:16 +02:00
Stefan Sperling 0ec1c26808 add chopped IPA ping test to BTS tests
Run the chopped IPA ping test from the IPA_Testing module
as part of the BTS test suite. Contrary to the BSC version
of this test, this test listens for an IPA connection rather
than connecting to an IPA server. Make code in the IPA_Testing
module for accepting connections actually work.

Change-Id: I4804ccabd342b82d44e69dbc6eaaae220ec7d4e4
Related: OS#2010
2018-10-15 15:19:32 +02:00
Pau Espin a0fb42a11c bts: f_tx_lapdm: Build SacchL1Header with proper values
Change-Id: I2c77d9d6262bd4763b3fb53a4a595d2c61f45f4b
2018-10-10 17:47:45 +00:00
Vadim Yanitskiy 35677870c5 BTS_Tests.ttcn: fix: expect RSL_MEAS_RES messages
Since both Calypso PHY and trxcon (since OS#2988 is fixed) are
always sending the Measurement Reports in dedicated mode, the
test cases should expect to 'see' the RSL_MEAS_RES messages,
and ignore them if they are out of the testing scope.

This change makes the following test cases pass:

  - TC_rll_est_ind,
  - TC_rll_rel_ind_DCCH_0,
  - TC_rll_rel_ind_DCCH_3,
  - TC_rll_rel_ind_ACCH_0,
  - TC_rll_rel_ind_ACCH_3,

by adding the 'lazy' version of as_meas_res() alt-step.

Change-Id: I34227b981f76377c338fad4ff9560ba2042abce4
2018-10-05 11:14:58 +00:00
Vadim Yanitskiy e0b91a764a BTS_Tests.ttcn: fix: properly detect Measurement Reports
The altstep for detecting Measurement Results, that was introduced
in I15782ec93d68a0dc54b2ed7a84cb70d780ba0ce1, was implemented in a
wrong way. Basically, the DL Measurement Reports (coming from the
MS) are being combined with the UL measurements, and then being
send as a RSL_MEAS_RES message, not RSL_INITDATA_IND.

Let's use the existing as_meas_res() in 'lazy' mode for that.

Change-Id: Iea5ee868ede8bfe1e2b1cbf5abcbf2844d3fe9a4
2018-10-05 11:14:56 +00:00
Vadim Yanitskiy 41baf00d99 BTS_Tests.ttcn: add 'lazy' mode for as_meas_res()
This mode would be useful for test cases, which expect to receive
the RSL_MEAS_RES messages, but don't care about their correctness.

Change-Id: I39118d6e64c767fad2c9618ec0ef4532dc60e715
2018-10-05 11:14:53 +00:00
Pau Espin 99a7aca62d bts: Use f_L1CTL_PARAM to set expected ms power level for dummy MeasRep
If for whatever reason (eg. CPU scheduling saturation) the L1CTL cli
(TTCN3) doesn't send Measurement Reports on time and no previous one
is cached or has been erased by L1CTL_DM_REL_REQ, lower osmocombb layers
will generate their own dummy Measurement Reports since SACCH must
always be filled.
Those dummy Measurement Reports are filled from
parameters previosuly set using L1CTL_PARAM_REQ (implemented by
f_L1CTL_PARAM() in TTCN3).
Since that function is never called, we need to call it to set the
expected MS power level values in case the cache is empty and we don't send
expected values in case we don't send the Measurement Report through L1CTL
on time.

Change-Id: Ie1fd9cee3472c7aa6580f846d277f485d3401641
2018-10-04 06:38:41 +00:00
Pau Espin ed359cb59f bts: Add parameter to set and expect a specific MS power level
This change uses recently added ts_L1CTL_DATA_REQ_SACCH to be able to
set the L1 Header parameters to match the expected MS power level
announced by the BTS.

Change-Id: Iedab8681a0ba4652a6bb1c001418599a4ff746b6
2018-10-04 06:38:35 +00:00
Vadim Yanitskiy b992050365 BTS_Tests.ttcn: don't tolerate any RSL messages by default
Change-Id: I70dc8af999eed8f7ed6a0d9dad4d3a9406340017
2018-10-04 06:21:00 +07:00
Vadim Yanitskiy 4d78a70802 BTS_Tests.ttcn: fix: properly expect I-frames in f_TC_encr_cmd()
For some reason, in f_TC_encr_cmd() it was expected / assumed that
when a ciphered I-frame is sent from MS on L1CTL, nothing else
than this frame would arrive. But since we have fixed Measurement
Reporting in trxcon (see OS#2988), the MR related messages do
appear on A-bis interface now!

This change introduces a new function f_data_mo(), which should
be used to send I-frames from MS and expect them on A-bis.

So, the following test cases:

  - TC_encr_cmd_a51;
  - TC_encr_cmd_a52;
  - TC_encr_cmd_a53;

should pass with both trxcon and Calypso PHY now :)

Change-Id: I08cb28dd9fa23f3ef8b0c9ede3d4c47f5702a1c1
2018-10-04 06:20:58 +07:00
Vadim Yanitskiy 8d8f91c18b BTS_Tests.ttcn: mark f_unitdata_mo() as private
Change-Id: Idd31608cd91631a92ea9d73e1db508605d7314d4
2018-10-04 06:19:45 +07:00
Vadim Yanitskiy ad131c874a BTS_Tests.ttcn: share as_rsl_sacch_ind() and as_rsl_any_ind()
Change-Id: I7ace54643c10df38a3ea941242f8b65264ef1322
2018-10-04 06:18:59 +07:00
Vadim Yanitskiy 98e0315878 BTS_Tests.ttcn: extend f_unitdata_mo() with tolerance parameters
The ability to control which kinds of RSL messages are permitted
in a given use case (and which are not) makes f_unitdata_mo()
function much more flexible.

Let's introduce two new parameters, one of which would make its
'alt' statement tolerant to SACCH messages (Measurement Reports),
and another to other kinds of RSL messages.

Please note that the original behaviour of f_unitdata_mo()
went untouched, so it's still tolerant to any other messages.

Change-Id: I15782ec93d68a0dc54b2ed7a84cb70d780ba0ce1
2018-10-03 21:37:40 +00:00
Pau Espin 121724cc99 bts: Add timing offset tolerance module parameter to support real HW
When we don't use trxcon (ie we run real HW) we need to relax template
matching when we receive UL measurements in that case.

Change-Id: Icf1d2216d29c1ebf68c672e6ca06c54a7457304b
2018-10-03 21:28:01 +00:00
Pau Espin 9c3ff4e3ec bts: Account for elapsed time in paging timer
Previous implementation always waited for "interval" time until sending
next paging cmd, and didn't finish the test until all expected paging
cmds were sent. As a result, each time it triggered it accumulated some
delay which could go from 2 seconds to 12 seconds depending on machine
load.
As a consequence, the expected number of paging cmd messages to be sent
in 20 seconds was being sent in 22-32 seconds, hence changing the load
on osmo-bts and as a result changing the test results.

Low threshold needs to be adapted since now they are sent in exactly 20
seconds max and the load handled by osmo-bts is bigger.

Fixes: OS#3025
Change-Id: I9651136d6810420e0a4d887bfb11c913a24f0457
2018-09-26 20:42:36 +02:00
Harald Welte f50e3ae532 bts: Add second VTY connection to BSC
Change-Id: If4b5a906a0841c0a8c3d7c4e9e5a3d1208ecf16a
2018-09-16 12:41:11 +02:00
Harald Welte 43c5464370 bts: update TODO comments; remove tests already covered
Change-Id: I35003e20b9b511e5d514549a9ad0acc32b243651
2018-09-16 12:41:11 +02:00
Vadim Yanitskiy 7b8c522741 BTS: enable encryption + RLL tests for Lm (TCH/H) channels
Since OS#3419 is resolved and TCH/H channel is supported by
trxcon, both encryption and RLL tests can be finally enabled
on Lm (TCH/H) channels.

Change-Id: I78f82a5f2a7b21d91692b1c99a9ff125e65cab64
Related: OS#3256
2018-09-16 16:58:57 +07:00
Philipp Maier 82cb0b1e14 BTS_Tests: check paging channel fn (bs_ag_blks_res)
BTS_Tests.ttcn contains numorous tests that issue pagings via RSL and
observe if these pagings are visible on the UM interface as well.
However, it is not checked whether the frame number of the blocks on
which those pagings are sent actually falls into the range that is
specified for PCH. We should check this as well.

(The PCH is part of the CCCH, which also contains the
AGC. How many blocks of the CCCH are to be used by the PCH is set by the
parameter bs_ag_blks_res.)

- Check the FN of each paging message that arrives on L1CTL and make
  sure that those FN are part of the PCH.

Change-Id: I839e75ece05166518bf7132acd3017434b3d3bc2
Related: OS#1575
2018-09-12 15:59:28 +00:00
Neels Hofmeyr 873ae201bd update expected results
Change-Id: I32c29e62ca317937db771f8fb1540bb1fe9da2ab
2018-09-06 14:13:34 +02:00
Stefan Sperling 91d4c9dcf5 update DTX fill frame test expectations
Fix an off-by-one in frame number comparison: Ensure that we
won't stop testing until after fn + 104 has been received.

The DTX test case would never pass since the alt statement
was always repeated even if enough frames had been received.
Fix this by moving code which runs before frame fn + 104 is
received into an 'else' cause.

We receive SACCH frames in DTX mode so we must account for them.
Introduce separate counters for SACCH and non-SACCH fill frames
to make test failure diagnosis easier. Note that we cannot expect
a specific amount of SACCH frames during a particular test run
since their amount depends on what the current frame number window
happens to be. We can however add the counters for SACCH and
non-SACCH fill frames and obtain a meaningful result.

Change-Id: Ie573b54ab5654f027c470aa7a565d2b5b97dc74b
Related: OS#1950
2018-09-04 11:55:50 +02:00
Philipp Maier d65d05634c bts_tests: do not define bs_ag_blks_res in multiple locations
The parameter bs_ag_blks_res is currently defined in ts_SI3_default and
in each PagingTestCfg record. When the parameter is changed in
PagingTestCfg it must be changed in ts_SI3_default as well in order to
have coherent settings in the stestsuit and in the BTS. This can be
quite confusing so lets use the setting from ts_SI3_default when
populating PagingTestCfg to have the value of the constant in one place
only.

Change-Id: I5cbdb31c8398aa241faca34e850388d5e1682167
Related: OS#1575
2018-08-30 18:15:10 +00:00
Stefan Sperling 4880be4385 add DTX fill frame BTS tests
Add tests TC_tch_sign_l2_fill_frame and TC_tch_sign_l2_fill_frame_dtxd.

TC_tch_sign_l2_fill_frame is already passing and verifies that fill
frames are sent if there is nothing else to transmit on a SDCCH4/SDCCH8,
TCH/H, or TCH/F signalling channel where DTX is disabled for downlink.

TC_tch_sign_l2_fill_frame_dtxd is currently failing. It verifies that
only specific fill frames are sent, as required by GSM 05.08 for TCHF
signalling channels with DTX enabled for downlink. At present, our
implementation generates no fill frames in this case, which is one
piece of the problem described in issue OS#1950.

Change-Id: Id4e0de6e78b62cd408f600a57a28617d91da64af
Related: OS#1950
2018-08-09 11:08:44 +00:00
Stefan Sperling 23b45974ce detect VTY TELNET port connection failures (attempt #2)
Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to
the TELNET port by default. This allows tests to make progress
into an error handling path if they are started while the osmo-*
program they want to connect on VTY is not running.

Observed with osmo-ggsn tests, where if the one test runs
into a VTY connection failure the subsequent test would get
stuck forever in a map() call on the VTY TELNET port.

Teach the function f_vty_wait_for_prompt() about connection
reports by the TELNET module. We may now receive an integer which
represents the socket file descriptor for the telnet connection.
This case was not handled by the previous change made in
commit cb111b21ab. As a result,
BSC tests started failing with "VTY Timeout for prompt" because
the alt-statement in f_vty_wait_for_prompt() would not progress
past the integer sitting on the VTY port's receive queue.

Change-Id: I56925f93af6c55e93f3f417099db135744da6a40
Related: OS#3149
2018-07-27 17:20:38 +02:00