Commit Graph

427 Commits

Author SHA1 Message Date
Vadim Yanitskiy 59f292dbb3 [WIP] BSC_Tests: add TC_assignment_crcx_nack
Change-Id: I3cfa86c9a338f5c2b8ab6ff824e546dc1642d448
Related: OS#5572
2022-06-28 04:00:12 +07: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
Neels Hofmeyr 2677b87978 bsc: fix sccplite test fallout: deactivate as_Media in f_ho_into_this_bsc()
Deactivate as_Media() once the handover is completed, so that it does
not fail on the expected MGCP DLCX from release.

Fix fallout seen in these tests:
SCCPlite
 BSC_Tests.TC_ho_into_this_bsc
 BSC_Tests.TC_ho_into_this_bsc_a5_0
 BSC_Tests.TC_ho_into_this_bsc_a5_1
 BSC_Tests.TC_ho_into_this_bsc_a5_3
 BSC_Tests.TC_ho_into_this_bsc_a5_4
 BSC_Tests.TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
 BSC_Tests.TC_ho_into_this_bsc_a5_1_3
 BSC_Tests.TC_srvcc_eutran_to_geran
 BSC_Tests.TC_srvcc_eutran_to_geran_a5_3
 BSC_Tests.TC_srvcc_eutran_to_geran_src_sai
 BSC_Tests.TC_srvcc_eutran_to_geran_forbid_fast_return
 BSC_Tests.TC_ho_into_this_bsc_sccp_cr_without_bssap

All of these tests use f_ho_into_this_bsc().

(It is not clear to me why only the SCCPlite tests show the fallout, the
AoIP should be similarly affected, but isn't.)

The failures were introduced by recent merge of
I0633f60f09d58802f6be0238ef41a632d93a4327, which made as_Media()
stricter by failing on early DLCX.

Related: SYS#5916
Change-Id: Ic5650a48eb3d90f2b42f16685178c97b54473429
2022-04-12 01:53:00 +02:00
Neels Hofmeyr a47a8c60ee bsc: add TC_emerg_call_and_lcs_loc_req
An emergency call often comes with a Location Request. Make sure
osmo-bsc handles it well.

Related: SYS#5916
Change-Id: I95037374c45943cb14401bc48f16a39c2fcbe1f5
2022-04-07 14:18:28 +00:00
Neels Hofmeyr 9b320c10f2 bsc: as_Media_mgw: fail on DLCX
as_Media_mgw() is used to establish a voice stream. If a DLCX happens as
part of that, that should be flagged as a problem.

In fact the Mode Modify test with current osmo-bsc does exhibit a DLCX
right upon the Assignment Complete message, which is a bug fixed in
I5ab10ee7fd9c5d7608e8a06893881d990943feed.

This patch now correctly flags this as a failure.

In the two tests
TC_ho_in_fail_no_detect, TC_ho_in_fail_no_detect2
the expected failure causes expected DLCX, so exempt those.

Related: SYS#5916
Change-Id: I0633f60f09d58802f6be0238ef41a632d93a4327
2022-04-07 14:18:28 +00:00
Vadim Yanitskiy a25fe23aae BSC_Tests: avoid code duplication in f_expect_chan_rel()
Using a guard statement makes no sense given that we match the
cellSelectionIndicatorValue conditionally within the alt branch
itself.  Removing that guard statement eliminates the need to
have an additional alt branch with identical body.

Change-Id: I373376637a083637ce01f3ac59fe5fd2836ac6cd
2022-03-22 18:25:53 +00:00
Vadim Yanitskiy bc7c35a3ae BSC_Tests: add '(present)' restriction to 'expect_rr_cause'
RR Cause is a mandatory IE, so it cannot be omitted.  Therefore it
makes no sense to check if istemplatekind(expect_rr_cause, "omit").

Change-Id: I564d00a4715b86d248bce449d2b9193ac5e99008
2022-03-22 18:25:53 +00:00
Vadim Yanitskiy 35c9a33418 bsc: fix some inadequate template restriction warnings
Change-Id: Icfc69aff2c923f4e12dbd6cc42c792d5712a7b27
2022-03-22 18:25:53 +00:00
Vadim Yanitskiy 634f75d31e bsc: add new testcase TC_srvcc_eutran_to_geran_a5_3
According to 3GPP TS 44.018, section 9.1.15, the RR Handover Command
message may optionally contain the Cipher Mode Setting IE (10.5.2.9).
Section 9.1.15.10 states that this IE may be omitted in case of the
intra-RAT GERAN-to-GERAN handover, however in case of the inter-RAT
handover (e.g. EUTRAN-to-GERAN), this IE *shall* always be included.

In f_ho_into_this_bsc(), check presence and correctness of the Cipher
Mode Setting IE.  Add TC_srvcc_eutran_to_geran_a5_3, which is similar
to TC_srvcc_eutran_to_geran, but enables ciphering on the target channel.

This patch makes all SRVCC relates test cases fail, until [1] is merged.

Change-Id: Ic3dfc4e31a7ed078cdfdaced9986ee9551c5aa7c
Related: [1] osmo-bsc.git I1d270e82d0a9b12897fc94dae4e8999aa132a22f
Related: SYS#5838
2022-03-16 12:47:54 +00:00
Vadim Yanitskiy 348b07c5be BSC_Tests: also match band indicator in SI6 Rest Octets
Due to a bug in the current osmo-bsc master, osmo-bsc inverts
the band indicator bit in SI6 Rest Octets.  This change extends
testing coverage to demonstrate the problem (see TC_si_default).

Change-Id: I93e1fcfaea973ec2461e30f656d5f5f0d829909b
Related: osmo-bsc.git Iaa8377919a144e7f3799b76249f579c8f3874145
2022-03-10 19:04:20 +03:00
Neels Hofmeyr 9fe1320a78 bsc: add missing codec list in AoIP Handover Request
So far, osmo-bsc ignored the Codec List (MSC Preferred) in inter-BSC
incoming HO Request messages. Starting with osmo-bsc
I117cc29d6d11db77d160de654f43f5993db6ee21, a missing codec list on AoIP
causes incoming inter-BSC HO to fail, as it should (3GPP TS 48.008
indicates that a codec list shall be included on AoIP). To avoid test
fallout when merging above osmo-bsc patch, add a codec list to HO
Request on AoIP.

Related: OS#5839
Change-Id: If06de9c9b43d79f749447a4e2a340176eef75c79
2022-03-07 14:38:11 +01:00
Neels Hofmeyr a23f3b1ecb bsc: inter-BSC incoming HO in with empty SCCP CR
Test inter-BSC incoming HO where the Handover Request message is not
included in the initial SCCP N-Connect, but follows in a separate DT1.

Related: SYS#5864
Depends: I535c791fa01e99a2226392eb05f676ba6c3cc16e (osmo-bsc)
Change-Id: I6732153cdd0d529bfaf0925387e765f3403a756b
2022-03-03 04:58:20 +01:00
Neels Hofmeyr 907b23b93a bsc: add TC_ho_into_this_bsc_a5_mismatch
Since I just fixed the encryption behavior, I also want to know whether
the case of no A5 intersection is handled properly.

The tiny test comes with a lot of changes to allow a handover failure
code path. The 'expect_ho_fail' flag goes via function arguments to
g_pars and the general ho test code uses it to branch for exp-failure.

Related: SYS#5839
Change-Id: I44b464a0bedbff09c467c4bccd7c985480fb883a
2022-03-03 04:55:53 +01:00
Neels Hofmeyr 46e16e50ab bsc: inter-BSC HO in: expect codecs in HO Request ACK
Expect IEs Speech Codec (Chosen) and Codec List (BSS Supported), they
are missing in current osmo-bsc.

Related: SYS#5839
Depends: I3c0576505a3ceb3cd5cc31dc69c5bc4a86a4ea08 (osmo-bsc)
Change-Id: Ib2b4e27be241e2a92c0c3bffdf906bf22c09352b
2022-03-03 04:55:49 +01:00
Neels Hofmeyr 731ddc558f bsc: fix TC_ho_into_this_bsc_a5_4
This test should be failing as it is, because A5/4 is not permitted in
the BSC's configuration! It only passed all this time because osmo-bsc
is/was/is going to have been flawed and just takes the Chosen Encryption
Algorithm IE as the basis for choosing an encryption algorithm. Instead
it should intersect the pemitted algos with the BSC config. It will soon
do that, and then this test would fail as it should have. After fixing
the BSC config for the test with this patch, we'll not see it failing in
the transition.

Related: SYS#5839
Change-Id: Ic6bbbeea36e6ea26d16bbb510fd08f5c0defb955
2022-02-18 01:43:14 +01:00
Neels Hofmeyr 93182e0dfd fixup for bsc: add TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
Change-Id: Icba4df8d28982e5b61512002e2b5fb15b7860114
2022-02-17 23:52:02 +01:00
Neels Hofmeyr e81a079ee4 fixup for bsc: improve encryption testing config TestHdlrEncrParams
Fix test fallout in TC_ho_into_this_bsc_a5_4: add the kc128 for the A5/4
test.

Related: SYS#5539
Change-Id: I13b7bb55d4870ffd6ceb34e2aef024ee20e23ca3
2022-02-17 23:51:23 +01:00
Pau Espin a8ef3bea24 bsc: Introduce test TC_srvcc_eutran_to_geran_src_sai
Related: SYS#5838
Change-Id: I186b9b9436bf82bcd54ca348df1e5e4b6424ca6e
2022-02-17 19:34:51 +00:00
Neels Hofmeyr 1951be2272 bsc: add TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
Report: in inter-BSC incoming handover, when the MSC omits the Chosen
Encryption Algorithm IE in the Handover Request message, then osmo-bsc
starts an unencrypted lchan even if A5/0 is not permitted.

This test verifies that the Encryption Information is present in the
Channel Activation when the Chosen Enc Alg is omitted.

Related: SYS#5839
Change-Id: Ia94cc29bf66339ed782cb5101f3640f69cf73131
2022-02-17 02:16:40 +01:00
Neels Hofmeyr d23e8a0a76 bsc: improve encryption testing config TestHdlrEncrParams
Clean up: absorb pars.encr_exp_enc_alg into TestHdlrEncrParams as
pars.encr.alg_expect.

Remove the automagic encr alg choice from test procedures, instead put
all magic in the pars.encr configuration setup; like this all encr alg
values remain fixed through the tests, less confusing.

Add separate alg_chosen for BSSMAP: So far, we have only one algorithm
field for both the mask of permitted algorithms in the Encryption
Information IS and the Chosen Encryption Algorithm IE. However, in the
Chosen Enc Alg there must be only one bit set. Thus we cannot easily run
a test where more than one alg is permitted and where the BSSMAP Chosen
Enc Alg IE is involved.

We've recently come to realize that the Chosen Encryption Algorithm IE
may also be omitted from BSSMAP messages, in which case osmo-bsc should
still work. To be able to test BSSMAP messages with omitted Chosen
Encryption Algorithm, allow to set alg_chosen == omit.

Keep t_EncrParams() in a way that all current tests (that set only one
bit in alg_permitted) still run the same as they always did.

Add t_EncrParams2() for a proper template.
Add a convenience function to configure encryption testing.

Related: SYS#5839
Change-Id: I6590ecf4a146dbed494d9d72f5a79441877e9010
2022-02-17 02:14:27 +01:00
Vadim Yanitskiy 6e06801a07 BSC_Tests: add module parameter 'mp_verify_talloc_count'
This parameter allows to enable/disable checking of the IUT's talloc
report in f_shutdown_helper().  This may be useful when running the
test suite against '-latest' with unfixed memory leaks.

Change-Id: Ic7bf8d9def21083ebda1b94659d72dde2bb5e664
2022-02-05 21:41:19 +06:00
Neels Hofmeyr c3c6ee6c63 bsc: fixup for conn cleanup, fixing three failing tests
Three tests fail after recent patch
"bsc: properly clean up conn after each test"
I9396efcabc085d2850244c6468b83c5f3a3ff3a2

In TC_assignment_emerg_setup_deny_bts(), do not expect an RR Rel.

In TC_assignment_emerg_setup_deny_msc() and TC_cm_reestablishment(),
drop the additional f_expect_dlcx_conns().

Related: OS#5337
Change-Id: I1d1d27f0927e640a430b24c6dc3d5d851a5c4cb9
2022-01-26 01:23:06 +01:00
Neels Hofmeyr 9c0f9c8871 bsc: logp("start") also for handler_mode := false
Change-Id: I4421a674055cd7013d21c52e9de6e369d1a72b6b
2022-01-23 01:21:12 +01:00
Neels Hofmeyr 4d4cd7e7e5 bsc: properly clean up conn after each test
Make all tests clean up BSSAP conn and RSL link. Now all
f_verify_talloc_count() in f_shutdown_helper() should pass, verifying no
conn or bsc_subscr leaks.

Related: OS#5337
Change-Id: I9396efcabc085d2850244c6468b83c5f3a3ff3a2
2022-01-23 00:13:53 +01:00
Neels Hofmeyr 6289af1197 bsc: f_perform_clear: ack all DLCX and RSL REL REQ
ACK any MGCP DLCX or RLL REL REQ during f_perform_clear(), which makes
it more universally applicable to invoke at the end of a test.

Related: OS#5337
Change-Id: Ie5b77c266a5d8f47edd187c474df281a799a81de
2022-01-23 00:13:51 +01:00
Neels Hofmeyr 189974920d bsc: detect subscr and conn leaks during f_shutdown_helper()
Invoke f_verify_talloc_count() for bsc_subscr and
gsm_subscriber_connection, expecting none to remain after each test.

This makes numerous tests fail, where the test does not properly release
the RSL and BSSAP connections. An upcoming patch fixes all of those
cases: I9396efcabc085d2850244c6468b83c5f3a3ff3a2

Related: OS#5337
Change-Id: I69d4c5c6f8d499bb7f0b96a48af045361433c57b
2022-01-23 00:13:07 +01:00
Neels Hofmeyr 8bdafe5be6 bsc: make perform_clear() work when VTY is not initialized
To be able to invoke perform_clear() also in tests where the VTY isn't
used, in f_logp() only access the VTY when it is actually ready.
Otherwise this causes an error and a failed test, for no good reason.

Related: OS#5337
Change-Id: I8116075f32937bd06ba14b426010bf6fec2ef402
2022-01-23 00:12:17 +01:00
Pau Espin 121f27ff32 bsc: Fix test TC_rll_sapi_n_reject_dlci_cc expectancies
Cause GSM0808_CAUSE_MS_NOT_EQUIPPED is to be transmitted only in the case
BSC receives a RelInd from the MS/BTS. In this test, an ErrorInd is
sent, as in TC_rll_err_ind_sapi_n_reject, so it is expected that the
BSC will send the N_Reject message with cause
GSM0808_CAUSE_BSS_NOT_EQUIPPED.

Related: OS#4728
Related: SYS#5047
Fixes: 999ceb6637
Change-Id: Ieebe3465b31d98fcae0e2c1993477c5021c99b3b
2022-01-12 13:22:09 +01:00
Pau Espin af0c61e06d bsc: Fix TC_rsl_drop_counter due to IPA_Emulation component being alive-type
IPA_Emulation component was marked with the "alive" type recently, in
order to avoid race conditions leading to errors during tear down of the
test.

It turns out, the way "alive" keeps the component alive is by means of
not closing the sockets when the component is stopped. As a result,
TC_rsl_drop_counter test stopped working properly because it was
specting a TCP FIN to be sent to osmo-bsc when the component was
stopped.

In order to fix it, add a new CFG port to the IPA_Emulation component on
which one can operate. Add a a new method to tell the component to close
the socket.

Then, put that in BSC_Tests into a function which was actually unsued
until now, and use it in the test in order to have the specific logic
enclosed in a function helper.

Fixes: 7138913d66
Change-Id: I68163b053313d9907ba8e40954a5933d14cb7db6
2022-01-12 11:15:24 +01:00
Neels Hofmeyr 6cc90ebcac bsc: fix ho-out test failures: cleanup neighbor cfg cruft
In the out-of-this-BSC handover tests, a neighbor config of LAC 99 left
behind from a previous test obstructed the test from working:

 % BTS 0 already had neighbor LAC:99 ARFCN-BSIC:123-45
 % ERROR: duplicate Cell ID in neighbor config, with differing ARFCN+BSIC: LAC:99 ARFCN-BSIC:123-any

Add a 'no neighbor lac 99' before configuring the neighbor via VTY.

Also add the missing neighbor config to
f_tc_srvcc_eutran_to_geran_ho_out_main().

Affects tests:
BSC_Tests.TC_ho_out_of_this_bsc
BSC_Tests.TC_srvcc_eutran_to_geran_ho_out
BSC_Tests.TC_srvcc_eutran_to_geran_ho_out_forbid_fast_return

Change-Id: I7a7c97a47a06abb59c0d89638c6b503ab66eb359
2022-01-04 13:32:59 +00:00
Vadim Yanitskiy 58b165383f library/RSL_Types: fix CHAN ACT templates for dynamic timeslots
* t_RSL_IE_ActType_PDCH is actually a constant, not a template.
* tr_RSL_CHAN_ACT_PDCH makes no use of parameter 'mode'.
* Accomplish tr_RSL_CHAN_ACT_PDCH with a send template.
* Use 'present' qualifier for receive template parameters.

Change-Id: Ie62a92daaacf4de5f05dd1f3f5b4a2a5e4ee6dd6
2021-12-20 14:55:00 +00:00
Harald Welte 7138913d66 Use alive-type components for "infrastructure" components
According to feedback received from TITAN developers in
https://www.eclipse.org/forums/index.php?t=msg&th=1106652&goto=1848616&#msg_1848616
the use of alive-type components has the following advantage:

> Also the DTE during the shutdown can be avoided to use alive type
> components.  The test ports of the alive components are not
> disconnected/unmapped when the component finished only when killed or
> the MTC terminated.

So the idea of this patch is to use alive-type components for all the
underlying infrastructure, such as the *_Emulation_CT starting from M3UA
to SCCP and further up the stack.  This way, only the MTC and the
highest level of components (such as ConnHdlr) remain as normal
components.

The hope is that using more alive-type components in the lower protocol
layer emulations will reduce the probability of DTE during shutdown if
some message is received during the component shutdown after the MTC
has completed.

Change-Id: I61d791d6d1bfe9226aabbe223baafc5f8f6d4f04
2021-12-15 20:20:30 +00:00
Vadim Yanitskiy 96bb9cb047 BSC_Tests: ramdomize IMSI in f_gen_test_hdlr_pars()
Using the same IMSI in each test case makes it harder to correlate
subscriber connections in the SUT with particular test cases.  A
good example is a problem described in OS#5337: some test cases
create dangling subscriber entries that never got released:

  OsmoBSC# show subscriber all
   IMSI             TMSI      Use
   001019876543210  ffffffff  3 (3*paging-start)
   001010000100001  ffffffff  1 (conn)

With this patch I am getting the following output:

  OsmoBSC# show subscriber all
   IMSI             TMSI      Use
   001016017428234  ffffffff  1 (paging-start)
   001014631230680  ffffffff  1 (paging-start)
   001011161500382  ffffffff  1 (paging-start)
   001010000100001  ffffffff  1 (conn)

so I was able to correlate the following test cases:

* (001016017428234) TC_lcs_loc_req_for_active_ms_ta_req,
* (001014631230680) TC_lcs_loc_req_for_active_ms_le_timeout2,
* (001011161500382) TC_cm_service_during_lcs_loc_req,
* (001010000100001) TC_no_msc.

Change-Id: Ie008b5566b207b13cd562c55625bad38c09b3927
Related: OS#5337
2021-12-11 02:03:22 +03:00