Commit Graph

472 Commits

Author SHA1 Message Date
Oliver Smith 15890b4346 bsc: TC_stats_conn_fail: fix for sccplite
Change the test so OsmoBSC always sends an BSSAP Assignment Failure by
setting the Data Indicator to an invalid value. Previously the test had
assumed that OsmoBSC would always send an Assignment Failure when
requesting CSD as it was not yet implemented.

The test only passed by chance on AoIP: OsmoBSC rejects the CSD
Assignment Request unless it has the Speech Codec List IE for AoIP.

Related: OS#4393
Change-Id: Ia4e8ab01dbadae5c9d7a964c0760dd3b016ab606
2023-03-08 14:27:25 +01:00
Oliver Smith d49f46d80c bsc: TC_ho_in_fail_no_detect: fix sporadic fails
Don't fail the test if the BSSAP Handover Failure arrives after both
MGCP DLCX. In that case, the DLCX arrive at as_Media_mgw() in
MSC_ConnectionHandler. Set pars.fail_on_dlcx := false so it gets ignored
there and stays in the queue, until f_expect_dlcx_conns() in
f_tc_ho_in_fail_no_detect() takes care of them.

Fix for:
TC_ho_in_fail_no_detect(1979)@ba5f1f91fb11: setverdict(fail): none -> fail reason: "Unexpected DLCX received", new component reason: "Unexpected DLCX received"

Timeout of T_guard
      BSC_Tests.ttcn:12410 BSC_Tests control part
      BSC_Tests.ttcn:6990 TC_ho_in_fail_no_detect testcase

Change-Id: Ie0216504b6bdac38c2f7dcc23fc8e9a7e5acff57
2023-03-08 12:23:13 +01:00
Oliver Smith 30eb882b84 bsc-sccplite: fix TC_ho_in_fail_mgw_mdcx_timeout
Make the test pass with sccplite too.

Related: OS#5787
Fixes: 7a8594a8 ("bsc: TC_ho_in_fail_mgw_mdcx_timeout: new test")
Change-Id: If09c0ab5f668aefe262905bbd4f8c676f3b05fd3
2023-03-06 12:33:51 +01:00
Oliver Smith dd0027540c bsc: TC_assignment_csd: expect BSC to handle CSD
Related: OS#4393
Change-Id: Iff19dc704af09d09d2265d8da38fc745a3936ce4
2023-03-05 17:51:18 +00:00
Oliver Smith 0033b12262 library/RSL_Types: RSL_SpeechAlgo: support CSD
Prepare to test CSD in BSC_Tests.ttcn. After sending a BSSAP assignment
request to the BSC with channel type data, the BSC will send a channel
activation via RSL to the BTS (which is emulated by the testsuite).

Without CSD support in the RSL template, the testsuite is unable to
decode the message, prints "Data remained at the end of the stream
after successful decoding" and the test fails.

Related: OS#4393
Change-Id: Ief2d95c7e9d71afb26fa74da755294226c8e158d
2023-03-05 17:51:18 +00:00
Oliver Smith a1cbec52f0 bsc: TC_ho_in_fail_mgw_mdcx_timeout: fixup
Fix that the test was torn down too early, before DLCX messages were
received from OsmoBSC. This caused a race condition that sometimes
failed the test with:

VirtMGW-MGCP-0(1996)@e5a096d6b4ff: Dynamic test case error: Sending data on the connection of port MGCP_CLIENT to 1999:MGCP failed. (Broken pipe)

Related: OS#5787
Fixes: 7a8594a8 ("bsc: TC_ho_in_fail_mgw_mdcx_timeout: new test")
Change-Id: If47fa3e0204ce841c79a67dd78a1c53d04e4a586
2023-02-22 11:14:03 +01:00
Oliver Smith 4eed06f3f2 bsc: TC_ho_in_fail_ipa_crcx_timeout: new test
Verify that OsmoBSC runs into a timeout and aborts the handover if the
IPA CRCX is not answered by the BTS. This test ensures it still works
after removing a redundant timer, as discussed here:
https://gerrit.osmocom.org/c/osmo-bsc/+/30307/1#message-9e02be4de78c03ed25b8422d6eee4ba9c6dda9ff

Related: OS#5787
Change-Id: I2f79e3ff988a4315fbef3538f02403b818fa7839
2023-02-16 11:16:02 +01:00
Oliver Smith 735b47cc4f bsc: move as_Media arg fail_on_dlcx to pars
Prepare to use fail_on_dlcx in a new test case. Instead of dragging the
parameter through lots of function calls, just add it to pars.

Related: OS#5787
Change-Id: I6f0c4ce543724cc6f18bae9fc2b480f5818db8b7
2023-02-16 11:16:02 +01:00
Oliver Smith 7a8594a85a bsc: TC_ho_in_fail_mgw_mdcx_timeout: new test
Verify that OsmoBSC runs into a timeout and aborts the handover if the
MDCX is not answered by the MGW. This test ensures it still works after
removing a redundant timer, as discussed here:
https://gerrit.osmocom.org/c/osmo-bsc/+/30307/1#message-9e02be4de78c03ed25b8422d6eee4ba9c6dda9ff

Related: OS#5787
Change-Id: I30e1811f97406cff6ba794fcd6882e2bb0205087
2023-02-15 20:00:23 +00:00
Pau Espin 4e43183151 Update UIT version expectancies after Osmocom CNI release 202302
Change-Id: Iec06390a1de9391ab573e66f9bd3421f4a627c6d
2023-02-08 12:49:37 +01:00
Pau Espin 6b869f49d1 bsc: Fix regression in TC_assignment_emerg_setup_deny_bts
A recent commit introduced a regression which made
TC_assignment_emerg_setup_deny_bts fail.

The problematic commit (see hash below) set "pars.ra :=
f_rnd_ra_emerg()" in the helper function, which made the BSC early
reject the CHAN RQD with ImmAssRej in the case the BTS policy forbids
emergency calls.
In that scenario, rejection can be done early because there's no need to
wait to find out which MSC it is aimed at.
This scenario, however, is already being validated by test TC_chan_rqd_emerg_deny.

The scenario TC_assignment_emerg_setup_deny_bts was testing is actually
one where CHAN RQD doesn't contain reason="emergency call", which means
BTS doesn't early reject it, but only knows about it being an emergency
call when a CC Emergency Setup is sent to it, time at which it releases
the call.

Hence, this commit sets back pars.ra = f_rnd_ra_emerg() only on the ..._deny_msc
testcase, since it's the only test really needing it.

Fixes: 14076d3b72
Related: OS#5849
Change-Id: I8d342e5938f6293ae45ee399796417651768af5d
2023-01-17 13:22:23 +01:00
Vadim Yanitskiy 3cc065b252 fix BSC_Tests_LCLS: do not use t_def_TestHdlrPars directly
As stated in the comment near the t_def_TestHdlrPars definition,
valueof() shall not be used for getting a value of this template.
The f_gen_test_hdlr_pars() function should be used instead.

All LCLS testcases violated this, and started to fail since
recently after patch [1] has been merged:

  "MSC_ConnectionHandler.ttcn:820 : Either imsi or imei must be set!"
      BSC_Tests_LCLS.ttcn:743 BSC_Tests_LCLS control part
      BSC_Tests_LCLS.ttcn:262 TC_lcls_gcr_only testcase

Use f_gen_test_hdlr_pars() as suggested.

Change-Id: I69ab8699b0be80b12e2df590d9170a743a00d035
Fixes: [1] b27653c6b6
2023-01-06 21:42:38 +07:00
Pau Espin 14076d3b72 bsc: TC_assignment_emerg_setup_allow(_imei): Test full voice establishment
Extend tests to also test the data plane setup.

Related: OS#5849
Change-Id: I9f39f861398669a8eb1da242595de584725e5b83
2023-01-03 17:55:43 +01:00
Pau Espin 39bd33c72c bsc: Move BSSAP handling of emergency call to helper function
Change-Id: I3a88efeae6710ba005496067ecb0c8f4035404ab
2023-01-03 17:05:27 +01:00
Pau Espin 3560979cf8 cosmetic: bsc: Fix typos in comments
Change-Id: I87f351fe2ab69120a3af8d6674f2738ef2d57a3a
2023-01-03 16:56:59 +01:00
Pau Espin 1809bcee83 bsc: Use f_rnd_ra_emerg() instead of hardcoded value
Change-Id: Id10d71868dc8ef427e0353ee4b7e51d5bebc6255
2023-01-03 16:54:41 +01:00
Pau Espin b27653c6b6 bsc: Introduce test TC_assignment_emerg_setup_allow_imei
Related: OS#5849
Change-Id: I5a95cb0cd6903801db8cfcc1542bd6147461eebe
2023-01-03 14:33:17 +01:00
Pau Espin 07657aedc1 bsc: Introduce test TC_paging_imsi_nochan_ci_resp_invalid_mi
Related: SYS#6280
Change-Id: Id0d069f00bc77be33ca61ce469bea8079ae9bd16
2023-01-03 13:13:02 +01:00
Pau Espin e8a51010d7 bsc: TC_paging_resp_unsol: Avoid encoding l3 twice
Change-Id: I4c5ea6272325671e47a91124a7efe0321c9f3a02
2023-01-03 13:13:02 +01:00
Pau Espin cc77b49fe7 bsc: Submit valid l3 payload
OsmoBSC does some minimal parsing of l3 content to select MSC target,
match paging response to paging request, etc.
Since tests right now use potentially invalid data, osmo-bsc is not
rejecting conns providing invalid l3 content.

This commit makes sure TTCN3 tests pass valid l3 payloads to osmo-bsc,
so that they keep working once osmo-bsc starts rejecting invalid IEs it
parses.

Related: SYS#6280
Change-Id: I6e99ac39f32c9a981420b73f8d7d1568d2fa1c54
2023-01-03 13:13:02 +01:00
Pau Espin 57aa1c71c1 bsc: Use c_l3_payload instead of random octetstring as l3 payload
OsmoBSC does some minimal parsing of l3 content to select MSC target,
match paging response to paging request, etc.
Since tests right now use potentially invalid data, osmo-bsc is not
rejecting conns providing invalid l3 content.

This commit is another step towards passing proper l3 data to osmo-bsc
in TTCN3 tests.

Related: SYS#6280
Change-Id: I012dbdc673ff98a6647280ce3d0245abff86cfa4
2023-01-02 18:42:02 +01:00
Pau Espin 695ada5f72 bsc: Move hardcoded octetstring to single constant field
This makes it easier changing it to be a valid l3 payload in the future.

Related: SYS#6280
Change-Id: I888bcc42d4b68bac4c12dfbbf3c74e1734318699
2023-01-02 18:41:59 +01:00
Vadim Yanitskiy 01d0a90b68 BSC_Tests: fix a race condition in TC_chan_rel_conn_fail
Change-Id: Ic8ee641c19f47442538eaba2b120736bec793c70
Fixes: OS#5823
2022-12-20 13:03:58 +00:00
Oliver Smith a67730465e BSC: extend TC_ho_meas_rep_multi_band for ARFCN=0
Adjust the test to also check the special case ARFCN=0, which is at the
end of each sub list.

Related: OS#5717
Related: osmo-bsc Ic5e4f0531e08685460948b102367825588d839ba
Change-Id: Ia8f94d72651061427afc9e34f678544f89d0149b
2022-11-04 14:17:59 +00:00
Oliver Smith c9a5f53ede BSC: add TC_ho_meas_rep_multi_band
Related: OS#5717
Related: osmo-bsc Ic5e4f0531e08685460948b102367825588d839ba
Change-Id: I4fe6bb9e4b5a69ea6204585ebdf1f157a68a8286
2022-11-04 14:17:59 +00:00
Oliver Smith 39f530751f BSC: reset handover related vty cfg after ho tests
Reset the handover related configuration to what is in osmo-bsc.cfg
after running handover tests.

Change-Id: I8ca6909dec633f0c1f26b5e72a7cfc1931c0ec54
2022-11-04 14:17:59 +00:00
Vadim Yanitskiy 389d7e061f BSC_Tests: fix TC_mgwpool_pin_bts: do not leave MGW1 configured
For the purpose of testing MGW pooling, test cases TC_mgwpool_*
configure an additional MGW instance by calling f_vty_mgw_enable()
and then remove it by calling f_vty_mgw_disable().

Unlike the other two TC_mgwpool_* test cases, TC_mgwpool_pin_bts
does not call f_vty_mgw_disable() - this breaks LCLS testcases
executed after it.  Add the missing call.

Change-Id: I3157203888d704b25aabd2569035cd95d48c48b2
Fixes: 3f41e321c7
Fixes: OS#5727
2022-10-25 18:17:51 +07:00
Pau Espin 3f41e321c7 bsc: Introduce test TC_mgwpool_pin_bts
Change-Id: If6e5ab5e5d3478621306e716836a5c7ddd129c0d
Related: SYS#5987
2022-10-21 10:59:59 +02:00
Pau Espin d2355e8f2b bsc: Add tests for MGW pool features
Add a couple tests to validate some MGW pool features, like load
balancing and skip selection blocked MGWs from the pool.

Related: SYS#5987
Change-Id: I6a8c30309be406e37190dc67b6ee5af13e1b9e68
2022-10-21 10:59:56 +02:00
Pau Espin 3c63053fe8 bsc: Support running several MGW node emulations
Change-Id: Ic84726c09ad3c6bea3ce6f0198db862d7dbb6dd3
2022-10-20 19:00:11 +02:00
Pau Espin 41b0f915c0 bsc: rename MGW component s/VirtMSC/VirtMGW/
Change-Id: Iad5609d691a746104933dacca62c5375063d49de
2022-10-20 16:51:16 +02:00
Pau Espin 36eeaf7478 cosmetic: bsc: Fix typo
Change-Id: Idd572b262561b03732ba825abee412e2fad17714
2022-10-20 16:50:31 +02:00
Pau Espin cd6077f538 bsc: Test assignment of non-AMR codec with Osmux enabled
Change-Id: I31ea10963bdf61b2e070ed6ac3257b872245f724
2022-09-19 20:53:43 +02:00
Vadim Yanitskiy 3998c03df3 BSC_Tests: fix AMR tests matching RSL MultiRate configuration IE
The RSL_IE_MultirateCfg was implemented and added to union RSL_IE_Body
in [1].  Before this change, this IE was decoded as RSL_LV (basically
an octetstring).  Now this IE is decoded as RSL_IE_MultirateCfg, while
some AMR tests still expect RSL_LV.  Let them use RSL_IE_MultirateCfg.

Change-Id: I40dab41d5dc5d14e358ba5a070ce174e7d8d4a4b
Fixes: [1] I0a5ddce570c0fd70f096d897b0b609d20b552ff7
2022-09-14 18:19:28 +07:00
Vadim Yanitskiy 8b18937eef BSC_Tests: f_assignment_codec(): log the actual value on mismatch
Change-Id: I437c1e796b00bfae41620f05ef8f15c8db8ca3d9
2022-09-14 17:48:38 +07:00
Vadim Yanitskiy b9bf00f96a BSC_Tests: fix TC_assignment_osmux_cn: use c_mr_conf_5_90
Currently this testcase fails:

  RSL MR CONFIG IE does not match expectation.
  Expected: { other := { len := 2, payload := '2804'O } }

Change-Id: Icc5381eccb924803b1117b46d2b4c47cee6dabd7
2022-09-14 16:47:18 +07:00
Vadim Yanitskiy 36fe958279 BSC_Tests: use c_mr_conf_5_90 in TC_assignment_codec_amr_startmode_cruft
This way it's easier to see that the only difference from other
tests using c_mr_conf_5_90 is the ICMI field set to false.

Change-Id: If7b491fa55a9366520c2d665a700c5badb187fae
2022-09-14 16:47:18 +07:00
Vadim Yanitskiy 5949470f1a BSC_Tests: cosmetic: s/mr_conf_amr_5_90/c_mr_conf_5_90/
* This is a global constant, so prefix with 'c_' for consistency.
* The RSL_IE_MultirateCfg is all about AMR, remove redundant 'amr'.

Change-Id: I72405b7139fcfd0dbe90afc469ed4db71b43a87c
2022-09-14 16:47:18 +07:00
Vadim Yanitskiy 4d85208f01 fixup: bsc: Add testscase & infra to validate Osmux support BTS<->BSC
The per-BTS VTY command 'osmux (on|off|only)' was added to osmo-bsc.git
recently, and is not available in -latest yet.  Use it conditionally.

Change-Id: Id501d3f4b5eb18b096d8baffcb5f38e583f7a3d8
Fixes: I6e82eb9d995de988b812001e1c4cf6923509de66
2022-09-14 16:44:15 +07:00
Pau Espin 29c6dfb46d bsc: Add testscase & infra to validate Osmux support BTS<->BSC
New TC_assignment_osmux_bts is added which tests Osmux used only
BTS<->BSC.
Existing TC_assignment_osmux is renamed to TC_assignment_osmux_cn,
and a new TC_assignment_osmux is added which tests using Osmux on both
sides (towards BTS and CN).

Related: SYS#5987
Change-Id: I6e82eb9d995de988b812001e1c4cf6923509de66
2022-09-13 11:20:11 +00:00
Pau Espin f7634dc706 BSC: Implement RSL_IE_MultirateCfg and use it in BSC_Tests
Change-Id: I0a5ddce570c0fd70f096d897b0b609d20b552ff7
2022-09-07 10:46:13 +02:00
Vadim Yanitskiy 5f6dd352ea BSC_Tests: fix race conditions in TC_chan_alloc_algo_ass_dynamic
In cases a), b), c), d), and e) we're sending one or more Measurement
Reports via the A-bis/RSL, and then immediately triggering a traffic
channel assignment by calling f_TC_chan_alloc_algo(), which sends an
Assignment Request via the A interface.

The above-mentioned messages are sent immediately all together, so it
may happen that the BSC handles the Assignment Request earlier than
the Measurement Report(s).  In this case there will be no RxLev
samples, so the BSC would fall-back to ascending allocation order.

Recently we saw this race condition actually happening on Jenkins:

https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-bsc-test-sccplite/1583/

Let's introduce an artificial delay before sending the Assignment
Request, so that the BSC has enough time to process received MRs.

Change-Id: I2fd6508488e935d208a7aba8e2f215b1cc14ad32
2022-08-29 15:39:06 +00:00
Pau Espin 9b94149ef9 bsc: Set g_osmux_enabled_cn directly in the test
We want to add more options later on, and we don't want to be passing
all of them as params. Let's simply set the global fields directly in
the test and let f_init() use the confgured values.

Change-Id: I27b685c2c22cf876b5eba79cf8ad151a2643ecb1
2022-08-10 18:47:33 +00:00
Pau Espin f967afc2ec bsc: Rename s/use_osmux/use_osmux_cn/
That config is used to control the use of osmux between BSC<->MSC. Since
we'll add support for Osmux in BTS<->BSC, we want to test that in a
separate way. Let's rename it so that we can add a "use_osmux_bts" later
on.

Change-Id: I3bde4e6772c18043dd763d7747b5dbe40e0da3b8
2022-08-10 18:47:33 +00:00
Vadim Yanitskiy 7c29c4e2c1 BSC_Tests: add TC_chan_alloc_algo_ass_dynamic
This test case verifies the new channel allocation mode, which
is expected to switch between ascending and descending modes
dynamically based on the following two configurable parameters:

* Uplink RxLev threshold (and min number of samples),
* C0 (BCCH carrier) channel load threshold.

The test case scenario includes:

Case a) Unknown Uplink RxLev => fall-back to ascending.
Case b) Not enough RxLev samples => use ascending.
Case c) Uplink RxLev below the threshold => use ascending.
Case d) Uplink RxLev above the threshold => use descending.
Case e) Uplink RxLev above the threshold, but C0 load is not.

Change-Id: Ia522f37c1c001b3a36f5145b8875fbb88311c2e5
Related: SYS#5460
2022-08-08 20:22:17 +00:00
Vadim Yanitskiy 1a16d31b12 BSC_Tests: add TC_chan_alloc_algo_{a,de}scending
The aim of these new test cases is to verify both ascending and
descending modes of the BSC's channel allocator.  Both tests are
using BTS2, which has 4 TRX instances.

The common test scenario can be described as follows:

1. Establish an SDCCH channel, send some dummy payload on it.
2. Send a BSSMAP Assignment Request for a TCH/F channel.
3. Expect RSL CHANnel ACTIVation for a TCH/F channel.
4. Respond with RSL CHANnel ACTIVation NACK (*).
5. Expect a BSSMAP Assignment Failure.

These steps are repeated several times.  Note (*) that for the
sake of simplicity, I am aborting the assignment procedure by
sending a NACK, so that the requested logical channel becomes
BORKEN and behaves like an occupied one until the A-bis/OML
link is re-established.  This reduces the overall complexity.

Change-Id: Ic74a9cd264320a9a17648f9331b67fb2c2404122
Related: SYS#5460
2022-08-08 20:22:10 +00:00
Vadim Yanitskiy 65d879d957 bsc: release dchan in TC_cbsp_emerg_write_bts_cgi_dchan
A follow-up patch is adding BSC_Tests.f_shutdown_helper() calls to all
CBSP testcases, what makes TC_cbsp_emerg_write_bts_cgi_dchan fail due
to talloc count mismatch.  All dchans need to be released to avoid this.

Change-Id: I8b707c821693f930ab10bd8feea08ba5007da967
2022-06-23 18:47:31 +07:00
Vadim Yanitskiy 5eb06a3865 bsc: make BSC_Tests_CBSP module a friend of BSC_Tests
This allows BSC_Tests_CBSP to import friendly API from BSC_Tests.
The line importing stuff from BSC_Tests BSC_Tests_CBSP.ttcn is moved
on top for consistency with an existing friend - BSC_Tests_VAMOS.

Change-Id: Ie0bb5c2e33aadd4858f0f6d001468985c40ab152
2022-06-23 18:47:26 +07:00
Vadim Yanitskiy 31778dd5b7 BSC_Tests: fix race conditions in TC_imm_ass_pre_{ts,chan}_ack_dyn_ts
The TC_imm_ass_pre_chan_ack_dyn_ts sporadically fails on Jenkins.
Similar to [1], this is happening because the VTY command setting
the 'immediate-assignment' strategy back to 'post-chan-ack' is
being sent/processed earlier than the CHANnel REQ message.

TC_imm_ass_pre_ts_ack_dyn_ts is likely affected too, also fix it.

Change-Id: I1e38142d29d0fa2946a858eac13319aa05b42aa3
Related: [1] I38cd31041741b69eb15098a089b4d4b6b918ffd4
2022-06-15 02:08:46 +07:00
Vadim Yanitskiy cd948e4d22 BSC_Tests: remove redundant f_init()/f_sleep() calls
Calling f_init() more than once does not make sense.

Change-Id: I625763b03c78835f6c4a80edd40cb3572411f7a2
2022-06-14 20:52:03 +07:00