Commit Graph

134 Commits

Author SHA1 Message Date
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
Vadim Yanitskiy b0970093dd BTS: enable encryption + RLL tests for Bm (TCH/F) channels
Due to OS#3418, both encryption and RLL tests have been failing.
It's time to enable Bm (TCH/F FACCH) channel related tests now!

Please note that Lm (TCH/H) remains disabled because of OS#3419.

Change-Id: I7c0f9f9f695e089e4a30f63ec362d1e6c18abff0
Related: OS#3256
2018-07-27 13:05:53 +00:00
Vadim Yanitskiy 31e7c67772 BTS: fix: pad LAPDm frames before sending via L1CTL
Thanks to Stefan Sperling, a critical bug was discovered in trxcon.
The problem was that length of LAPDm frames was not checked before
passing them to the libosmocoding API. So, if a received LAPDm
frame is shorter than expected (i.e. 23 bytes), then:

  - in case of xCCH, there was a heap overflow (detected by ASAN),
    so a short frame has been encoded together with some garbage
    outside the primitive buffer...

  - in case of FACCH, as the length != 23, a frame was recognised
    as a speech frame, and also encoded together with some garbage.

Since the bug is fixed (OS#3415), some TTCN-3 BTS tests started
to fail, because most likely it was assumed that trxcon would
pad the frames automatically, but it doesn't and shouldn't.

Let's automatically pad LAPDm frames with 0x2b before sending.

Change-Id: I16cba4e4179456bebabf0638760af011a27fd333
Related: OS#3418
2018-07-27 13:05:53 +00:00
Neels Hofmeyr bf3cf5c8bc Revert "detect VTY TELNET port connection failures in TTCN3 tests"
With this patch, I see all ttcn3-bsc-tests failing with
"Verdict: fail reason: VTY Timeout for prompt"

This reverts commit cb111b21ab.

Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140
2018-07-27 13:01:26 +00:00
Stefan Sperling cb111b21ab detect VTY TELNET port connection failures in TTCN3 tests
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.

Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1
Related: OS#3149
2018-07-27 07:40:10 +00:00
Stefan Sperling cd9e86f618 update expected test result for TC_sacch_multi_chg
This test has been passing since osmo-bts commit
eee7247ebe0d0a54a54b53b739bdd434dfceb511, so expect
it to pass instead of fail.

Change-Id: I576f881fcb40c4fcbe6b6f767220111a0e9ffd3c
Related: OS#3173
2018-07-26 20:36:55 +00:00
Daniel Willmann b85a629395 bts: Stop all components before mtc.stop in f_shutdown
This is the bts version of patch 637ef6c8

Again I picked a test that sometimes failed -
BTS_Tests.TC_sacch_info_mod - and ran it 20 times before and after this
commit. Before it failed roughly half the time with a DTE and after I
was not able to make it fail.

Change-Id: I96f02037283b79a93ef4d659b00a90ac519c0a75
2018-07-26 08:08:12 +02:00