Commit Graph

458 Commits

Author SHA1 Message Date
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
Pau Espin 80d4b4fc12 bsc: Fix IPA_CFG_PORT handling several connections
Recent commit changing the layout of bts/trx port config made
IPA_CFG_PORT be connected severa times when calling f_ipa_rsl_start()
for each BTS/TRX.

Let's have separate ports per BTS/TRX as done in other ports in the
test_CT component.

This avoid this error when calling f_ipa_rsl_stop():
"""
Dynamic test case error: Port IPA_CFG_PORT has more than one active
connections. Message can be sent on it only with explicit addressing.
"""

Change-Id: I916186c87c398ebb2d7f82f73b94de75034e346d
2022-06-10 18:51:58 +02:00
Vadim Yanitskiy 7a3d293c62 BSC_Tests: configure 3 additional TRX instances for BTS2
Change-Id: Ie1241c54abac9a56906c525155cbf7482bca738e
Related: Iba4fbd5c9ed59783df4ac64e68b2beef73a812ff
Related: SYS#5460
2022-06-07 09:50:10 +00:00
Vadim Yanitskiy e5d393c556 BSC_Tests: add support for per-TRX RSL connections
So far it was possible to communicate with multiple BTS instances,
however we were limited to only one IPA/RSL connection per BTS.
Communicating with additional TRX instances requires establishing
additional per-TRX IPA/RSL connections.  This patch extends the
testsuite infrastructure, so that it becomes possible to have
up to 4 individual TRX instances for each BTS.

* Introduce record 'BtsParams', store per-BTS params in an array.
* IPA_RSL_PT: test_CT.IPA_RSL[NUM_BTS] -> test_CT.IPA_RSL[NUM_BTS][NUM_TRX].
* BTS_State: test_CT.bts[NUM_BTS] -> test_CT.bts[NUM_BTS][NUM_TRX].
* f_init_bts_and_check_sysinfo() accepts number of TRX instances.
* f_init_bts() accepts number of TRX instances to configure.
* f_ipa_rsl_start() accepts a BtsTrxIdx param.

* Introduce record BtsTrxIdx allowing to specify BTS/TRX index values.
* f_ipa_tx(), f_exp_ipa_rx() accept a BtsTrxIdx param (default {0, 0}).
* f_est_dchan[_dyn]() accept a BtsTrxIdx param (default {0, 0}).
** and store the given BtsTrxIdx in returned DchanTuple.
* f_chreq_act_ack() accepts a BtsTrxIdx param (default {0, 0}).
* f_expect_chan_rel() accepts a BtsTrxIdx param (default {0, 0}).
* f_exp_ipa_rx_nonfatal() accepts BtsTrxIdx (default {0, 0}).
* f_exp_chan_rel_and_clear() uses BtsTrxIdx indicated in the given DchanTuple.

* Fix CTRL/statsd expectations in TC_stat_num_bts_connected_[123].
* Fix CTRL expectations in TC_ctrl_trx_rf_locked.

The major limitation is that MSC_ConnHdlr components still have no
access to additional TRX instances - this can be implemented later.

Change-Id: Ic0fd97234464ef624010a5f01189aa61f3393b84
Related: SYS#5460
2022-06-07 09:50:10 +00:00
Vadim Yanitskiy 6be4cf414b BSC_Tests: fix TC_lost_sdcch_during_assignment (SCCPlite)
When running ttcn3-bsc-test against osmo-bsc in SCCPlite mode,
TC_lost_sdcch_during_assignment fails with the following output:

  Local verdict of MTC: fail reason: "Timeout of T_guard"
  Final verdict of PTC: fail reason: "Unexpected DLCX received"

One key problem is that in f_TC_lost_sdcch_during_assignment() we
expect to receive a DLCX message on port MGCP, but somehow it gets
caught by the as_Media_mgw earlier than we attempt to receive it.

* Fix this race condition by activating the as_Media_mgw with
  fail_on_dlcx := false, so that it does not catch DLCX messages.

Another problem is that for SCCPlite we're running the MGCP_Emulation
component with multi_conn_mode=true, so that all MGCP messages are
arriving at port MGCP_MULTI (not MGCP) wrapped into MGCP_RecvFrom.

* Expect the DLCX message on either of the two ports depending
  on the value of g_pars.aoip (AoIP or SCCPlite mode).

This change makes BSC_Tests.TC_lost_sdcch_during_assignment pass.

Change-Id: If4807d3d7d196682f7f22732ad47bcbb72858ed3
2022-06-04 22:14:01 +06:00
Vadim Yanitskiy 69170519b0 BSC_Tests: fix a race condition in TC_imm_ass_pre_[ts,chan]_ack
These test cases sporadically fail on Jenkins and 9/10 times on my
machine.  The problem appears to be that we are sending both the
RSL CHANnel ReQuireD and the VTY command simultaneously, and the
later may be handled earlier than the former by osmo-bsc.

Ensure that the RSL message is handled first by sending the VTY
command after we have received the RSL CHANnel ACTivation message.

Change-Id: I38cd31041741b69eb15098a089b4d4b6b918ffd4
2022-06-03 14:12:14 +06:00
Neels Hofmeyr 61f9dc5a70 bsc: test lchan rel during LCS Loc Req
Test this scenario:

Emergency call is started;
Location Request is started to locate the emergency;
lchan releases early for any reason;
(Do not send Clear Request immediately);
Location Request is completed, locating the emergency.

Related: SYS#5912
Related: Ib44dd05b0adee84234f671313b156ff6625357cc (osmo-bsc)
Change-Id: Idea690a4aa4aecbe4642a16e96d086cc0538564a
2022-05-26 19:29:58 +00:00
Pau Espin d3339a78f8 bsc: Fix dangling subscriber talloc ctx in f_TC_paging_Nreq
First, page only on BTS0, not all the BTS. This simplifies the test and
also makes the subscriber be refcounted only on BTS0.
Then, drop the OML connection after receiving all the expected paging
requests; it will make the BSC flush the paging queue and hence avoid
TTCN3 checks erroring due to dangling subscriber talloc contexts.

Change-Id: Ibbd9168f3ac2c1cd4f4577644d75499d49c2823f
2022-05-03 12:57:08 +00:00
Pau Espin 189bf1b8c1 bsc: Introduce test TC_paging_450req_no_paging_load_ind
Change-Id: I787cba895f1cb6c5bfef95259bcf69b4291a9237
2022-05-02 20:43:48 +02:00
Pau Espin f01f305e31 bsc: Avoid sending CCCH Load Ind (paging) when RSL C0 becomes up
The paging CCCH Load Ind should only be sent when the BTS is over the
threshold, which is not the case when it starts up.
The BSC should underststand that the BTS under threshold and be able to
send paging requests.

Change-Id: I19a97e97ec96ba8ea2e28b1be8ac3b706b43e1b7
2022-04-29 12:22:33 +00:00
Pau Espin ef7ef632da bsc: TC_paging_500req: Validate initial transmissions have higher prio
After osmo-bsc Change-Id I1ae6d97152c458247bc538233b97c2d245196359,
initial requests are prioritized over retransmits.
Before that feature was in place, when sending 500 requests in this test
to the BSC, it could happen that the paging scheduler triggered (every
500ms) before all the 500 requests were received at the BSC. As a
result, the scheduler would put some requests to the end of the queue
after sending an initial request for it towards the BTS. If later more
requests where received from TTCN3, they'd be put at the end, after the
retransmissions.
As a result, the emulated BTS would in general receive retranmits for
the first bunch of requests before receiving the initial transmit of the
later requests.
Ths is no longer the case since the osmo-bsc is prioritizing now the
initial requests. Hence, we'll only start receiving retransmits after
all the new paging requests are received.

Depends: osmo-bsc.git I1ae6d97152c458247bc538233b97c2d245196359
Change-Id: I5876f828b43e1e51bd892ce3c9a4dbed6b53f066
2022-04-26 10:12:17 +00:00
Neels Hofmeyr de564b1f57 bsc: TC_emerg_premption: check BSSMAP Clear Req cause
On the first TCH, establish Layer 3 so that the BSC will issue a Clear
Request at all.

Verify the cause value of the Clear Request.

Tear down the established Layer 3: clean up for the leak check.

Related: OS#5535
Depends: I20108f7b4769400b89b7b0d65c8dab883bf87c46 (osmo-bsc)
Change-Id: Ib13be73119cfc96712f32899c02e655e1751d547
2022-04-25 21:19:22 +00:00
Neels Hofmeyr ace698cdee bsc: TC_emerg_premption: test RR rel cause
Related: OS#5534
Depends: I0423621d15ace11a53ae1653e5e7f5cb93605edb (osmo-bsc)
Change-Id: I47e919edc25a8427f49d654f97f05e46a89da16d
2022-04-25 21:19:22 +00:00
Neels Hofmeyr 32ef591fee bsc: TC_emerg_premption: clarify chan_nr
Rename chan_nr to first_tch, and more clearly show that the TCH that is
released gets assigned to the emergency call.

Related: OS#5534
Change-Id: I0c540d76eedfd4115b410921bf5a0b6c2d00b5c2
2022-04-25 21:19:22 +00:00
Pau Espin 09b9bad21e bsc: Introduce test TC_paging_500req
Related: SYS#5922
Change-Id: I4f7185939c20804deef92f476ed19248ba885f29
2022-04-22 17:38:02 +02:00