Commit Graph

703 Commits

Author SHA1 Message Date
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
Harald Welte 4a788a0812 bsc: Increase test coverage for CBSP emergency broadcasts
This adds new tests:
* TC_cbsp_emerg_write_bts_cgi_noreplace
* TC_cbsp_emerg_write_bts_cgi_replace
* TC_cbsp_emerg_write_bts_cgi_kill

All of the above relate to improved / fixed handling of emergency
broadcasts in some corner cases.

Related: SYS#5906
Related: OS#5539, OS#5540
Change-Id: Ic0f0b3d620f3ca73bab3d45997d0c1b9433ac1f7
2022-04-27 18:39:56 +02:00
Harald Welte 8bb2944c2f bsc: CBSP code refcator: Add f_exp_rsl_etws()
This function reduces code duplication between CBSP tests.

Change-Id: I69bedd43bc88bc619b80bf9038da901bbff9f04b
2022-04-27 18:39:56 +02:00
Harald Welte 1222f52b43 bsc: Fix TC_cbsp_write_then_kill expectations
A more clear reading of TS 48.049 is that the KILL COMPLETE should
*only* contain a Cell List IE if it relates to an Emergency message;
only the Number of Broadcasts Completed IE indicates successful
cells.

osmo-bsc fixes this in I9a43d386da01f085663d231a555b8b5acc99faca

Change-Id: Ia50e50f9812d9934d35d32b25e1079240df04a82
Related: SYS#5906
2022-04-27 18:39:55 +02: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
Harald Welte 3912895260 bsc: Expect number-of-broadcadsts-completed-list in CBSP KILL COMPLETE
When responding to a CBSP KILL with a CBSP KILL COMPLETE, make sure
we include the optional "Number of Broadcasts Completed List" IE
in order to inform the CBC about how many times the just-killed
message had been broadcast before it was killed.

It seems some CBCs expect this IE to be present, while 3GPP TS 48.049
lists it as optional.  osmo-bsc is including this IE as of Change-Id
I47aebd613dfc6dd9261ea9019a51aff0cd6470d8

This change updates the test suite to expect this IE to be included.

Change-Id: I5b56676c93479ec7b32cff66c9738fff7d0228cf
Related: SYS#5906
2022-04-15 04:54:10 +00:00
Vadim Yanitskiy 5ac8f31b38 bsc/osmo-bsc.cfg: explicitly set AMR link adaptation parameters
The default AMR link adaptation parameters have been changed in
the recent osmo-bsc, so set the old expected default explicitly.

Change-Id: I320d91a35bc50bdfe87c0384035a10b8672ef23c
Related: osmo-bsc.git Ic5f8d55d250976d8d4c9cae2d89480fd52326717
Related: SYS#5917
2022-04-14 22:51:47 +03: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
Eric Wild 66448c1e56 fix bsc test issue introduced in 49888a65dc
ranops was not isvalue because bssap_reset_retries was not set and not
explicitly omitted either, so the ran adapter decided not to create a ran
emulation...

Change-Id: Ibbef035929ec861fec1e8554460e22650b386f83
2022-04-02 12:58:38 +00:00
Vadim Yanitskiy c2696fa108 BSC_Tests_CBSP: add a new testcase TC_cbsp_write_rep_period_num
Change-Id: I169c482ea5de040df63db4c605ac9cae19f8d28f
Related: SYS#5905
2022-03-30 03:48:26 +03:00
Harald Welte 562d28e305 bsc: Add tests for CBSP MESSAGE STATUS QUERY procedure
Change-Id: I124a69c515d634bc054ed35e430af6b3c11ad46e
Related: SYS#5909
2022-03-28 21:29:04 +02: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 af2972e26f bsc: add f_cipher_mode_bssmap_to_rr()
Change-Id: I6cc8cbed96f2838af1b0e41c5dfa6760c45d9ad1
Related: SYS#5838
2022-03-16 12:47:54 +00:00
Vadim Yanitskiy 4483a22b1d bsc: use select() statement in f_cipher_mode_bssmap_to_rsl()
Change-Id: I6e1c6762d2dd1efac2bd7ead3caf25e25dd3e7ad
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
Neels Hofmeyr 52b2b26c52 bsc vamos: ensure lchan state in some places
Change-Id: I5979516cf2b2e1adf5269acd0b8e7adb5e6a1ac5
2022-02-08 16:35:34 +00:00
Vadim Yanitskiy 5f14d34642 BSC_Tests_VAMOS: fix TC_vamos_multiplex_tch_h_tch_h_tch_h_tch_h
Properly clean up conns in the end. Use COORD and new COORD2 ports to
daisy-chain coordination between the four components.

Related: OS#5444
Change-Id: I3b1dfc3b11e990893cbf182fb9f8840e198eb8aa
2022-02-08 16:35:34 +00:00
Vadim Yanitskiy 7bd04e4169 BSC_Tests_VAMOS: fix TC_vamos_multiplex_tch_f_tch_f
Properly clean up conns. To know when the multiplex is ready, use the
COORD port to tell the other component.

Related: OS#5444
Change-Id: I82b7eccd2ae30fdc3794ea9dad5d2d8f875d702d
2022-02-08 16:35:34 +00:00
Vadim Yanitskiy 41b702febc BSC_Tests_VAMOS: fix f_TC_mode_modify_to_vamos(): clean up lchan
This change makes the following test cases pass:

  * TC_mode_modify_to_vamos_fr
  * TC_mode_modify_to_vamos_hr

Change-Id: Icb47e39a5466a1232cda03e1e04b0c88f3927659
Related: OS#5444
2022-02-07 14:53:48 +06:00
Vadim Yanitskiy ce8eb85b00 BSC_Tests_VAMOS: fix TC_chan_act_to_vamos: deactivate lchan
Keeping the logical channel active may affect test cases executed
after TC_chan_act_to_vamos.  Clean up after the test to avoid that.

Change-Id: Id0e3fb6a2f7e97ef854bff95adbc715d6f41f069
Related: OS#5444
2022-02-07 14:53:43 +06: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 af249cbd69 bsc/osmo-bsc-vamos.cfg: sync logging config with osmo-bsc.cfg
Change-Id: I08580e5d8313e644908c1d7b370c5de882f3735c
2021-12-14 12:59:04 +00:00
Vadim Yanitskiy b320988578 bsc/osmo-{bsc,stp}.cfg: enable extended timestamp in logging
Change-Id: Ic9c03b367514db577be3f354a83e9fea9dc02712
2021-12-14 12:59:04 +00:00
Vadim Yanitskiy a4b7857b77 bts/osmo-bsc.cfg: fix deprecated BTS type 'sysmobts'
Change-Id: If2f81141707e6f2360fc57bbd5f76606294f8db8
2021-12-14 00:30:33 +00:00
Vadim Yanitskiy b77196e138 BSC_Tests.cfg: also execute LCLS test cases
Change-Id: I106052d6f89a85171f8c65f1dbfcbeaa4f35f887
2021-12-13 16:17:45 +00:00
Vadim Yanitskiy 68d418e344 BSC_Tests_CBSP: use proper default values for mp_cbc_ip / mp_cbc_ip6
Otherwise it's impossible to run the CBSP test cases locally, because
the remote peer address in osmo-bsc gets set to '0.0.0.0', so indeed
it cannot establish connection to the server.

Change-Id: I5b1d215818255717ed955c9f1a9c45505ab11a65
Fixes: OS#5351
2021-12-13 16:17:45 +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
Vadim Yanitskiy 999ceb6637 BSC_Tests: add TC_rll_sapi_n_reject_dlci_cc
Change-Id: I9d7042ab4f3f7dea88811bd1b90d829065063f33
Related: SYS#5047, OS#4728
2021-12-07 07:39:08 +00:00
Vadim Yanitskiy a7fc5a6e7f bsc: f_create_chan_and_exp(): ensure that SCCP connection is up
This change fixes sporadic failures of TC_cm_serv_rej:

  RAN Connection table not found by component TC_cm_serv_rej(2648)
        BSC_Tests.ttcn:11106 BSC_Tests control part
        BSC_Tests.ttcn:10550 TC_cm_serv_rej testcase

The reason is that sometimes a BSSAP/DTAP PDU (with CM Service Reject)
gets enqueued before the SUT has established an SCCP connection to the
virtual MSC.  This causes a lookup error in the RAN connection table.

A simple solution would be to add a receive statement after calling
f_create_chan_and_exp(), like it's done everywhere else:

  f_create_chan_and_exp();
  BSSAP.receive(tr_BSSMAP_ComplL3); // <---

But a more general solution is to expect and receive this message in
f_create_chan_and_exp(), so we can reduce code duplication and make
the API more convinient.  This is exactly what this change does.

Change-Id: Ic675168e29919e1234cb49440c4a630238ff5d70
Related: SYS#4878
2021-12-07 07:38:33 +00:00
Vadim Yanitskiy f63b6baa92 bsc/osmo-bsc.cfg: fix deprecated BTS type 'sysmobts'
Change-Id: If53c49157ec861163f3d993972414674ab18119f
2021-12-06 17:55:25 +00:00
Vadim Yanitskiy 9a8155c251 bsc/osmo-{bsc,stp}.cfg: tune logging configuration
Change-Id: I955c0b8dbf74761d525c6bfb195eed418af24ab6
2021-12-06 17:55:25 +00:00
Neels Hofmeyr bcfc944bf6 bsc: properly test assignment counters
Verify the BTS level assignment:attempted_speech / _sign as well as
assignment:completed_speech / _sign counters, in four selected
assignment tests (fr, hr, amr_f, amr_h).

Shows a bug where we counted a speech assignment as
assignment:completed_sign.

Related: SYS#4878
Depends: Ie9fcd1e86f27ecb2f11e2e8813faac365cb470b8 (osmo-bsc)
Change-Id: Icb1386ec2ccd70eb3c026301b9b08ad7177278f7
2021-11-30 13:21:16 +00:00
Neels Hofmeyr 734b1a3950 bsc: properly test various bts.N.chreq:* counters
Related: SYS#4878
Depends: I1fde77d5d5920093ab037184eb3518876804353d (osmo-bsc)
Change-Id: I17a7702b151ac03fd9f7ecd6927ef42133aad953
2021-11-30 13:21:16 +00:00
Neels Hofmeyr 4dec8cc384 bsc: cosmetic cleanup for f_ctrs_*_init()
Related: SYS#4878
Change-Id: I357bfa811a07336ca57dac2d49bf80189047916d
2021-11-30 13:21:16 +00:00
Oliver Smith 8b343d3655 BSC_Tests: TC_paging_counter: add bsc pag expired
Test the new bsc.N.paging:expired stat in TC_paging_counter too.

Depends: osmo-bsc I9c118e7e3d61ed8c9f1951111255b196905eba4d
Related: SYS#4878
Change-Id: I8931bf1bc2f4e0d4b168168cdb83683bb350d961
2021-11-29 21:15:31 +00:00
Neels Hofmeyr afe2ea5c4f bsc: show bug: do inter-BSC-out HO by measurement report
So far all handover tests trigger handover via VTY command. This means
that any bugs introduced in measurement report handling and handover
target selection are by definition not caught.

Almost a year ago, fixing a handover oscillation bug for intra-BSC
handover introduced a segfault for inter-BSC handover targets, because
for those the target.bts is NULL. Show this bug.

Related: OS#5324 SYS#5259
Related: I5a3345ab0005a73597f5c27207480912a2f5aae6 (osmo-bsc)
Change-Id: Iba033c32015173f57dbb1c211aefab1a9094e29d
2021-11-24 15:26:50 +01:00
Vadim Yanitskiy c18ff4734b BSC_Tests: fix a race condition in TC_fh_params_handover_cmd
As can be seen from ttcn3-bsc-test run #1565 on Jenkins [1], it may
happen that the VTY command requesting handover reaches the IUT earlier
than the SCCP 'SACK CC' message.  In this case, the 'SUBSCR_CONN' FSM
remains in state 'WAIT_CC', so we get an error:

  (bts=0,trx=0,ts=0,ss=0) (ARFCN 871) --> BTS 1 Manually triggering Handover from VTY
  SUBSCR_CONN(msc0-conn204)[0x5633b2877af0]{WAIT_CC}: Received Event HANDOVER_START
  SUBSCR_CONN(msc0-conn204)[0x5633b2877af0]{WAIT_CC}: Event HANDOVER_START not permitted

The easiest way to avoid this is to introduce and artificial delay
after the connection establishment and before triggering the handover.

[1] https://jenkins.osmocom.org/jenkins/view/TTCN3/job/ttcn3-bsc-test/1565/

Change-Id: I19f7ca942e22d7930a56d1a525414f137a9ef831
2021-11-18 19:10:34 +00:00
Vadim Yanitskiy 2bcea3dec8 MSC_ConnectionHandler: use select() in f_ChDesc2RslChanNr()
Change-Id: Iefef18b7f6330dbfb61a98c8c037c9c904cf0c24
2021-11-18 19:10:34 +00:00
Pau Espin 37a4c150e1 bsc: Always enable dynts sdcch8 tests
Release 1.8.0 is already released, so latest should support this.

Change-Id: Ifbbedde9878274d3008290ec69916e28d7adba3b
2021-11-16 19:02:27 +01:00
Neels Hofmeyr 87a6561f8b bsc: f_TC_cm_serv_rej: tweak f_sleep()ing
Make the test more stable by sleeping a bit before stopping all
components. Also reduce the f_sleep(3.0), an accidental leftover from
initial debugging.

Related: SYS#4878
Change-Id: I005af13baac4bca2a431b09b2a6bbfe7077342e0
2021-11-16 15:01:44 +00:00
Neels Hofmeyr b758187c86 bsc: add test for CM Service Reject counter
Related: I79b1261e5a281d9797eaaf9c27d90edd8e27c78b (osmo-bsc)
Related: SYS#4878
Change-Id: I0214b27da18af87eca9715ebf7eeeff945e3e12a
2021-11-10 14:32:50 +01:00
Neels Hofmeyr ac432fa4b3 bsc: add testing of incoming_intra_bsc_ho rate_ctrs
Related: SYS#4878
Related: Id9f2c6e2865ebe680879018fff08d283ce24c983 (osmo-bsc)
Change-Id: Iba229313d73fa20266f6d4eac5820579fb14c604
2021-11-10 14:32:27 +01:00
Neels Hofmeyr bd94fe7236 bsc: add TC_ratectr_all_available_allocated and _dyn
Test new rate counters all_allocated:{sdcch,tch,static_sdcch,static_tch}

Related: SYS#4878
Depends: I2fa14531f16d3f07085620f1c50eb839c420da6a (osmo-bsc)
Change-Id: Ib3997a827c9cc43d1361bb0cf3bfab9f6d91bf82
2021-11-10 13:31:48 +00:00
Neels Hofmeyr 85fa37f977 bsc: comment: tweak TS reference
Change-Id: I53ec51240d6e9a0f93f784c8afee2f54226cc51f
2021-11-06 16:14:24 +00:00
Vadim Yanitskiy f0310e312f BSC_Tests: fix DTE in TC_lost_sdcch_during_assignment()
This test case fails in ttcn3-bsc-test-sccplite due to:

  BSC_Tests.ttcn:10212 Dynamic test case error:
    Using the value of an optional field containing omit.

Change-Id: I235027c2b53b8f2ae975e25eb7c38b1959668d6f
Related: SYS#5627
2021-11-06 00:54:32 +00:00
Philipp Maier 798d895071 BSC_Tests: set band in f_TC_fh_params_set
The function f_TC_fh_params_set sets frequency hopping parameters. The
ARFCN is also part of those parameters. However, this function does not
set the respective band for the ARFCN that it configurs. This results in
an invalid setting at the BSC that might cause unexpected behavior.

Lets make sure we configure the band parameter correctly before setting
the ARFCN

Change-Id: I447e4145c68c62b11b818e28f0081c19e9107647
Related: SYS#5369
2021-11-01 10:43:31 +01:00
Neels Hofmeyr e1a7c4d938 bsc: Introduce test TC_dyn_ts_sdcch8_all_subslots_used
Related: OS#5278
Related: SYS#5309
Change-Id: Iee37eef2012ce2c2e2f0a0db4c26abb75a947d84
2021-10-26 22:18:41 +02:00
Pau Espin ce4d5bb4a5 bsc: Use NUM_SDCCH_PER_BTS in dyn ts sdcch8 tests
Change-Id: I42bfa1a1e450d15cd4122e996d7936df88917891
2021-10-25 13:31:44 +02:00
Vadim Yanitskiy 07e4b633a4 BSC_Tests: fix a minor coding style issue
Change-Id: Ife5d37ebb7850f050c7db0723dfbda4d60d2db1a
2021-10-18 23:34:17 +03:00
Oliver Smith f8fe1329e2 regen_makefile.sh: set executable name explicitly
Set the executable name in each regen_makefile.sh explicitly with -e,
instead of having it set indirectly from the first .ttcn file. Make it
consistent by placing the name on top of each of these files.

Fix for warning:
ttcn3_makefilegen: warning: File `BSC_Tests.ttcn' was given more than once for the Makefile.

Related: OS#5252
Change-Id: I5ed03f8f3ed905483620dc7bae33b617bbb8507f
2021-10-13 11:12:22 +02:00
Oliver Smith 2e0e624060 regen_makefile.sh: files/flags in separate lines
Make all regen_makefile.sh more readable and diff friendly by moving
each entry in FILES and CPPFLAGS_TTCN3 into separate lines. Order
entries alphabetically.

Related: OS#5252
Change-Id: I6b6866eb9f6ec6232e4ae434517457a4c8c1c050
2021-10-12 16:35:01 +02:00
Neels Hofmeyr 34174bde0a bsc: verify TSC in inter-BSC ho (out) RR HO Cmd
Related: SYS#4895 OS#5244
Related: Iae20df4387c3d75752301bd5daeeea7508966393 (osmo-bsc)
Change-Id: Icabcedc59d80e812c3d6ba5d6db5e2bb9b319252
2021-10-02 15:01:35 +02:00
Neels Hofmeyr 6a955cc46d bsc: verify TSC in RR HO Cmd of TC_ho_neighbor_config_*
Related: SYS#4895 OS#5244
Related: Iae20df4387c3d75752301bd5daeeea7508966393 (osmo-bsc)
Change-Id: I09cb07561a57527880b87147495619a3bbbceb3f
2021-10-02 15:01:35 +02:00
Neels Hofmeyr c741fcb426 bsc: TC_ho_int: verify TSC in HandoverCommand
For intra-BSC handovers, also verify the correct Training Sequence Code
in the RR Handover Command (not only in the Channel Activation as added
in previous patch).

Related: SYS#4895 OS#5244
Related: Iae20df4387c3d75752301bd5daeeea7508966393 (osmo-bsc)
Change-Id: I32e3553581eb17812082f1f2ee96cc978e8db668
2021-10-02 15:01:22 +02:00
Neels Hofmeyr c2cf45481a bsc: TC_ho_int: verify TSC in Chan Act
OS#5244 reports an error in the Training Sequence Code used in the
Channel Activation for a handover target channel. Verify the TSC to
uncover this bug.

Related: SYS#4895, OS#5244
Related: Iae20df4387c3d75752301bd5daeeea7508966393 (osmo-bsc)
Change-Id: I1ed6f068c85b01e5a2d7b5f2651498a1521f89af
2021-10-02 13:11:22 +02:00
Neels Hofmeyr bf7202046d bsc: add const list of TSC expected per BTS
Reduce code (comment) dup by having one const definition for default
TSCs instead of magic numbers.

Will add another use of this in upcoming patch testing correct TSC in
handover.

Related: SYS#4895
Change-Id: I3733ebbbfd74630e095a08b83023974aad177b34
2021-10-02 13:10:58 +02:00
Neels Hofmeyr 92cfa1c45a bsc: add TC_lost_sdcch_during_assignment()
Reproduce a segfault happening when the SDCCH (primary) lchan is lost
in-between a TCH Channel Activ and its Channel Activ Ack.

Related: SYS#5627
Related: I3b1cd88bea62ef0032f6c035bac95d3df9fdca7a (osmo-bsc)
Change-Id: I81cccdea450885d5241cab62000ad355d464dd49
2021-09-29 16:02:01 +02:00
Neels Hofmeyr 40a45d143f bsc: fix TC_reassignment_fr for SCCPlite test suite
In SCCPlite, there is only one DLCX. Turns out the DLCX doesn't have to
be part of the interlave, just call f_expect_dlcx_conns() which takes
care of AoIP vs SCCPlite expectations.

Related: SYS#4895
Change-Id: Id8931185dfa9f229ca7af033a97cabd040db0c2a
2021-09-23 23:00:05 +02:00
Neels Hofmeyr 969abd0f8e bsc: fixup for TC_cm_reestablishment: properly del MGCP ep
Fix SCCPlite run of TC_cm_reestablishment.

I'm not sure why it works for AoIP before this patch, but now it works
for both SCCPlite and AoIP.

Related: SYS#5130
Change-Id: I1c87272c5bb1ac452927054a9eef104d795e02f8
2021-09-23 22:27:37 +02:00
Neels Hofmeyr f65ce87f97 bsc: do not run TC_stat_num_msc_* for SCCPlite
Avoid test breakage in ttcn3-bsc-test-sccplite, due to different
osmo-bsc configuration.

Related: SYS#5542
Change-Id: Iaf976ac12dbb2ee1930a7acfcf3cb452db34beed
2021-09-23 18:41:13 +02:00
Neels Hofmeyr 5d7d13f5eb bsc: add TC_ctrl_trx_rf_locked
Related: OS#5542
Depends: Ie46fd730797b64fb185d705c3507e36f5f23ef4b (osmo-bsc)
Change-Id: I2bb5096732f75a7341c7e83951e63c5a2038b469
2021-09-14 08:31:04 +00:00
Neels Hofmeyr a41ae30a1e bsc: verify new CTRL 'rf_states' and 'bts.N.rf_states'
Related: SYS#5542
Depends: I14fa2678fc8f2c11a879c5e9615ac552782c5b7e (osmo-bsc)
Change-Id: I01e6f391a5e71b0606c42be9b57f8a1687d59bcb
2021-09-14 08:31:04 +00:00
Neels Hofmeyr 5ce3ae400d bsc: add TC_stat_num_bts_connected_* tests
Related: SYS#5542
Depends: I2057a798e681a169cc03243a09b3d6449734c010 (osmo-bsc)
Depends: Idace66b37492fe96b2f2e133a69cac7960ca279c (libosmocore)
Change-Id: Ic1b35b7406547f92818afe399a2383d154576409
2021-09-14 08:31:04 +00:00
Neels Hofmeyr 0bc470d206 bsc: add TC_stat_num_msc_connected* tests
Verify MSC connection count stats.

Related: SYS#5542
Depends: Idace66b37492fe96b2f2e133a69cac7960ca279c (libosmocore)
Depends: If76bbf9b3adb64c68d5c31c6b526fa71a99996ae (osmo-bsc)
Change-Id: I178dcf4516606aa561d47b06061b8a416d3c40cf
2021-09-14 08:31:04 +00:00
Neels Hofmeyr 9db8e0e077 bsc: reset MSC link stati in f_init()
I want to add tests that verify the stat items reflecting the MSC
connection status. To be able to run a test expecting fewer connected
MSC after a test that launched more MSCs requires the links to be reset.

Related: SYS#5542
Depends: I1975941b790d2b30d0904d41e456220cba26ecff (osmo-bsc)
Change-Id: Ice3056dc46c94f9399f8379db7aeb7193782f2f2
2021-09-14 08:31:04 +00:00
Neels Hofmeyr 58be48a16a bsc: make TC_stats_conn_fail less fragile
Add a delay between sending the RSL Conn Fail IND and checking the stats
values, so that osmo-bsc has a good chance of receiving the message and
promoting the failure into the stats values first.

Even though jenkins shows no failures, when testing locally, this test
fails a lot for me without that bit of delay.

Change-Id: Iaf0173239528337283b23f70840d36ad25f14950
2021-09-14 08:30:13 +00:00
Neels Hofmeyr 2315874f28 bsc: add TC_imm_ass_pre_ts_ack
Also test the early IA feature for non-dyn TS in 'pre-ts-ack' mode, for
completeness' sake.

Related: SYS#5559
Change-Id: I6ba84b4b618dd99ec2095aaf611209e525f2b5f4
2021-09-09 11:46:27 +00:00
Neels Hofmeyr 07603cffe9 bsc: properly check TSC and ARFCN in early IA tests
Tests have shown that the Training Sequence Set was not correct in early
IMM ASS messages. Add validation of the TSC and ARFCN in IMM ASS
messages for all early IA related tests. This makes the tests fail.

Related osmo-bsc patch linked below makes the tests pass again.

Related: SYS#5559
Related: I9f26074154600d854a0b3baee2f38a6666f4cb56 (osmo-bsc)
Change-Id: I4479244b0c53648e62e84e1ebf986f51d659484f
2021-09-07 19:24:23 +02:00
Oliver Smith 59a843cac1 Cosmetic: bsc: remove outdated comment
The mentioned bug was fixed 3 years ago, and there are already lots of
tests below so remove the comment.

Related: OS#3182
Change-Id: I3df4dbd1647dae78eccd31c49c3aec3cf9e12a6f
2021-08-27 08:26:21 +00:00
Oliver Smith af03bef6a2 bsc: add TC_stats_conn_fail
Verify that stat bts.N.chan.rf_fail_sdcch works correctly.

Related: SYS#4878
Change-Id: I310ea1609168bc26790875767943e0545ed05177
2021-08-27 08:24:23 +00:00
Neels Hofmeyr c8b95c1b04 bsc: add TC_imm_ass_pre_ts_ack_dyn_ts
Test the experimental 'immediate-assignment pre-ts-ack' implemented in
I19e6a3d614aa5ae24d64eed96caf53e6f0e8bb74

Related: SYS#5559
Change-Id: I2ae28cd92910d4bc341a88571599347a64a18fe5
2021-08-17 22:06:57 +00:00
Neels Hofmeyr 7a6d0607b2 bsc: add TC_imm_ass_pre_chan_ack_dyn_ts
Related: SYS#5559
Change-Id: Ic5a3b930c57a5c61514137986eb4f8f8c1f2a1ba
2021-08-17 22:06:57 +00:00
Neels Hofmeyr b07b295bb0 bsc: add TC_imm_ass_pre_chan_ack
Add tests for the new early IMM ASS feature in osmo-bsc:
  'immediate-assignment (post-chan-ack|pre-chan-ack)'

Related: 0b44493d3de03d2750527e224df67b473fe39f93 (osmo-bsc)
Related: SYS#5559
Change-Id: If71f4562d532b6c5faf55f5fd073449a8a137ebf
2021-08-17 22:06:57 +00:00
Neels Hofmeyr c7b1f6dd3f bsc: TC_cm_reestablishment(): do second lchan on bts 1
So far the test ran both lchans on bts 0, which is not really a
realistic scenario for a CM Re-Establishment Request. Move the second
channel to bts 1, using various RSL port args added recently.

Change-Id: Ia930f7b8986ba27c5f507478dbff0a2942f207d8
2021-08-06 14:03:28 +00:00
Neels Hofmeyr feda88e51d bsc: add TC_cm_reestablishment
Related: SYS#5130
Change-Id: I1e7d446644f46b8a0a94688e618ffb4f23a8900e
2021-08-06 14:03:28 +00:00
Neels Hofmeyr da4367875a bsc: split f_start_handler() in two, ..._create() and ..._run()
This is used by upcoming BSC_Tests.TC_cm_reestablishment().

Related: SYS#5130
Change-Id: I96954a6895a65718d943aa5e73b783a75a9f7256
2021-08-06 14:03:28 +00:00
Neels Hofmeyr d36a82fd8a bsc: add Coord_PT to communicate between components
This is used by upcoming BSC_Tests.TC_cm_reestablishment().

Related: SYS#5130
Change-Id: I093ca7f66a3106a75e409ad8ea03e7db3c3cb165
2021-08-06 14:03:28 +00:00
Neels Hofmeyr 3c5127edeb bsc: expect proper chan_nr for various RSL_MT_RF_CHAN_REL
So far we were often just expecting the message type. Instead expect a
release on the proper channel number.

While hunting a test error, this confused me for a while, because a
missing handler resulted in the release message handled in the wrong
place, even though the chan_nr mismatched.

Related: SYS#5130
Change-Id: I002c9273a387104bea062dec8879b4e19a72008d
2021-07-27 07:28:26 +00:00
Neels Hofmeyr 85bcd27bf0 bsc: add RSL, RSL_PROC port args in various places
To be able to run tests on a cell other than bts 0, there needs to be a
way to select the RSL_DCHAN_PT and RSLEM_PROC_PT in various places.

Upcoming BSC_Tests.TC_cm_reestablishment depends on this, to be able to
run through an Assignment on bts 1.

Related: SYS#5130
Change-Id: Ia14f46d4e5e8d4722224b97c346c0cb7973fff97
2021-07-27 07:28:26 +00:00
Neels Hofmeyr 3222e0eee8 bsc: add RSL port args in MSC_ConnHdlr, RSLEM
Add explicit RSL_DCHAN_PT and RSLEM_PROC_PT args to functions and
altsteps related to channel establishment and assignment. This allows
establishing and assigning a channel on cells other than bts 0.

This is required for upcoming BSC_Tests.TC_cm_reestablishment().

Related: SYS#5130
Change-Id: Ic3206b7125ee22bf98330080d9b136cefe7da03f
2021-07-27 07:28:26 +00:00
Neels Hofmeyr 8fcd8774cd bsc: f_expect_dlcx_conns(): do not rx Clear Complete
The function f_expect_dlcx_conns() is clearly related to MGCP, and
semantically should not interfere with BSSAP by also receiving the Clear
Complete.

For some tests, this incidentally makes sense, but an upcoming test
failed in a non-obvious way because of this.

Related: SYS#5130
Change-Id: I637414f4db8ea7c4b59aaee205d65926574b5ccd
2021-07-27 07:28:26 +00:00
Neels Hofmeyr e680b01650 bsc: properly f_rslem_unregister() released channels
After the RSL RF Release has happened, by definition the RSL_Emulation
should no longer direct RSL messages on that chan_nr to the test
component that used to own the chan_nr in the ConnectionTable.

Before this patch, re-using e.g. an already freed SDCCH would result in
non-obvious test failure. This is most relevant for generic functions
called from various tests, but fixing all occurences anyway.

Related: SYS#5130
Change-Id: I764ea2ed9af9358adeb42d7ed46b84f30f1e224c
2021-07-27 07:28:26 +00:00
Pau Espin 1447535a07 bsc: Test tch allocation if sdcch exhausted
Related: SYS#5548
Change-Id: I0c958de10a3643f8b94479d676dd1ac1b9140802
2021-07-23 16:45:27 +02:00
Pau Espin 2ebbe7c09f bsc: Fix TC_dyn_ts_sdcch8_tch_call_act_deact
Related: SYS#5309
Change-Id: Ibdbeefef7fd9f4c2d0dedb45f2075e776e8026b9
2021-07-23 16:27:31 +02:00
Pau Espin 23510fb721 bsc: Drop mp_enable_osmux_test
This module parameter is not needed anymore, since latest already
supports this feature for a while.

Change-Id: I3a2a4f984443a40285440a7fc54b1797a943e4b0
2021-07-20 17:00:41 +02:00
Pau Espin e076b3ff86 bsc: Allow disabling dyn TS SDCCH8 tests
With this we'll avoid running the test in latest. This way we'll not
fail after changing the TS for the test and hence other tests won't be
affected.

Related: SYS#5309
Change-Id: Ib956401030e6a97db218823c997c61c335fbd581
2021-07-20 16:45:59 +02:00
Vadim Yanitskiy 343c9eba51 BSC: fix channel combinatiron for TS5 in phys_chan_config
In the configuration file, that we use for ttcn3-bsc-test, TS5 is
configured to TCH/H.  However, f_ts_reset_chcomb() would reset
it to TCH/F.  This makes some other test cases fail.

Change-Id: I4c2c70381274949ed75d58723136e2f54eb3a7af
Fixes: [1] I6110fe0bf56f4dbf67265f0d4c97cdea0b410af4
Related: SYS#24876
2021-07-16 18:36:30 +06:00
Pau Espin 0953bf82ba bsc: Introduce test TC_dyn_ts_sdcch8_tch_call_act_deact
Related: SYS#24876
Change-Id: I6110fe0bf56f4dbf67265f0d4c97cdea0b410af4
2021-07-14 15:38:41 +00:00
Oliver Smith 7eabd31aa6 bsc: fix encryption a5/4 missing in TC_*_a5_4
After removing a5/4 from the default config, it also needs to be
explicitly enabled for these two tests.

Fixes: 26a3db ("bsc: change encryption a5 via VTY where needed")
Change-Id: Ibe00edb096f94b500869c46a39a694a73133c716
2021-07-12 14:19:05 +02:00
Oliver Smith 50b9812e45 bsc: add TC_ciph_mode_a5_2_0
Verify that A5/2 is preferred over A5/0.

Related: OS#4975
Change-Id: Ia02e9be52ccbe4b24a0bce56305be9f875e7adb1
2021-07-11 17:41:59 +00:00
Oliver Smith 1dff88d369 bsc: add TC_ciph_mode_a5_2_1
Verify that A5/1 is preferred over A5/2. Add encr_exp_enc_alg to
MSC_ConnectionHandler:TestHdlrEncrParams, so the expected encryption
algorithm can be different from what the MSC tells the BSC about the
capabilities of MS.

Related: OS#4975
Change-Id: I688d056bcfe73f7846f908a28f4621f944cf2178
2021-07-11 17:41:59 +00:00
Oliver Smith 26a3db7d70 bsc: change encryption a5 via VTY where needed
Do not assume that osmo-bsc.cfg contains "0 1 3 4" for master and "0 1 3"
for latest anymore. An upcoming test will need to change the value as
the test runs and needs a defined value to reset to.

Assume that osmo-bsc.cfg contains "0 1 3" and change it to "0 1 3 4"
only for TC_ciph_mode_a5_4.

Related: OS#4975
Related: docker-playground I55135ca00ef51de5cf6eaec75cfc20c21beef665
Change-Id: I3cf36c6ef86a0db050507f3737f4b0c10dcd52ed
2021-07-11 17:41:59 +00:00
Oliver Smith 598e1edf89 bsc/MSC_ConnectionHandler: fix typo
f_chipher_mode_bssmap_to_rsl => f_cipher_mode_bssmap_to_rsl

Change-Id: If874a3fa6f42de4f5f484e597de028715cd08043
2021-07-11 17:41:59 +00:00
Vadim Yanitskiy fc63164bac library/RSL_Types: use OCT4 for local/remote address fields
This way functions like f_inet_addr() and f_inet6_addr() can be
used directly without converting between bytes and integers.

Change-Id: I389a8cb95c025c9dddc751789223621c15d9b48f
2021-07-05 12:09:07 +00:00
Neels Hofmeyr cb8d9894af update expected-results.xml files
Change-Id: Idcf764cd2d251210bb123d2a5ea782cda0d670b7
2021-07-05 13:11:14 +02:00
Vadim Yanitskiy 4b2330474d BSC: add a test case for BCCH carrier power reduction mode
Change-Id: I084f7736cd7d09b68ed49f8ba52a14de928d4c01
Depends: I765d5e38cb0746e0458773abf3717ee9bf1cb7d1
Related: SYS#4919
2021-07-02 13:01:28 +00:00
Pau Espin cdf2614314 bsc: Introduce test TC_dyn_ts_sdcch8_act_nack
Change-Id: I388677c90203853fae584ca60d0e6645bb4ad675
Related: SYS#5309
2021-07-02 11:48:50 +00:00
Pau Espin 5b38108d71 bsc: Introduce test TC_dyn_ts_sdcch8_act_deact
Related: SYS#5309
Change-Id: I1c53c5d280ca07b000b1e951cfe1e9e5f47a2d86
2021-07-02 11:48:50 +00:00
Pau Espin 64adf3791f cosmetic: bsc: Fix wrong dyn ts type mentioned in comment
Change-Id: I020c1ee909a12540774d665f914f1115870bea7e
2021-06-28 16:25:47 +02:00
Neels Hofmeyr 8ebf19cfdf bsc: add tests for inter-BSC HO with encryption A5/{0,1,3,4}
Only ho-into-this-bsc tests are required, since the out-of-this-bsc
message (Handover Required) does not involve any encryption information.

Related: SYS#5324
Change-Id: I8de65eb9a5bd9a58add55e821f2a559c9a81edc1
2021-06-21 20:18:35 +00:00
Neels Hofmeyr af88d9dbf3 bsc: add intra-BSC handover tests with encryption
In f_tc_ho_int(), verify encryption information for the handover
target's chan act.

Add test cases calling f_tc_ho_int() with various A5/n encryption modes.

Related: SYS#5324
Change-Id: Iaab26c708c106a61b762234d42ed9a52cdc2998c
2021-06-21 20:18:35 +00:00
Neels Hofmeyr 58ffceb4ec bsc: split f_verify_encr_info() from f_cipher_mode()
The verification of correct encryption information so far is part of
f_cipher_mode(); put it in a separate new function f_verify_encr_info()
so that it can be re-used for handover channel activation.

Related: SYS#5324
Change-Id: I11602d23670f436a22b891fc744fe07e470f2b79
2021-06-21 20:18:35 +00:00
Neels Hofmeyr 3fe8460494 bsc: also allow empty key for A5/0
Change-Id: Id54abc09dd62d7247a970a03ed8c2209b641f511
2021-06-21 20:18:35 +00:00
Neels Hofmeyr 5f7a9dfcf4 bsc: f_tc_ho_int: do not override TestHdlrParams
Related: SYS#5324
Change-Id: Ibd1a887b197100bf7ffe1e37c6567690bc4c8f8c
2021-06-21 16:26:26 +00:00
Neels Hofmeyr 2bb1f0e09a bsc: drop unused kc variables
Change-Id: I08323cbe079d357dfdd44ecddacd1c772941abaa
2021-06-21 16:26:08 +00:00
Neels Hofmeyr 0faeb7afc9 bsc: add BSC_Tests.TC_assignment_fr_a5_4_fail
Allow only A5/4, but omit the Kc128 IE from MSC's msg. Expect Cipher
Mode Reject.

Related: SYS#5324
Change-Id: I7734a4a59797a9b21523c33f48815a8094f4e6ec
2021-06-21 16:26:08 +00:00
Neels Hofmeyr 0d8ec5366d bsc: add TC_assignment_fr_a5_4
Establish a TCH/F with A5/4 encryption.

Related: SYS#5324
Change-Id: I9ad899bd15a1f7ba0a44764f7d2a94f5b627053f
2021-06-21 16:26:08 +00:00
Neels Hofmeyr 81ad27fca9 bsc: add TC_ciph_mode_a5_4
Establish a Signalling channel with A5/4 encryption.

Related: SYS#5324
Change-Id: I2428c21663dfa7d67e769da0127f74e8c01dfb97
2021-06-21 16:26:08 +00:00
Neels Hofmeyr 5e31cfc63d bsc: f_cipher_mode(): verify enc alg in Cipher Mode Complete msg
Related: SYS#5324
Change-Id: I88b386c55e23cc180131e95a005d08cbc3ec102b
2021-06-21 16:26:08 +00:00
Neels Hofmeyr 7274934057 bsc: f_cipher_mode(): fail quicker on key mismatch
Related: SYS#5324
Change-Id: Ia79779f4229da4a5af271235a5e82c6fd59ea3a2
2021-06-21 16:26:08 +00:00
Neels Hofmeyr 0588cadcfd bsc: implement ttcn API and cfg for A5/4
Implement tools for OsmoBSC a5/4 support testing:

- in f_cipher_mode() and f_check_chan_act(), expect Kc128 key as
  appropriate, using recently added g_pars.encr.enc_kc128
- osmo-bsc.cfg: allow a5/4

Related: SYS#5324
Change-Id: Ifa48a8498dde7d04fb29f497013bdb5a1e5f3597
2021-06-21 16:26:08 +00:00
Neels Hofmeyr 6c388f209d bsc: reduce args to f_cipher_mode()
Instead of passing each part individually, simply pass the entire
TestHdlrEncrParams to f_cipher_mode().

Preparation for A5/4.

Add the kc128 to TestHdlrEncrParams instead of a function arg. kc128 is
so far unused, but will be used in an upcoming patch adding A5/4.

Related: SYS#5324
Change-Id: I2cb8282e55436da5ae64ab569df87d5d5a0dd2f0
2021-06-21 16:26:08 +00:00
Neels Hofmeyr 04d6e6acb6 bsc: replace TC_assignment_fr_a5_4 with TC_assignment_fr_a5_not_sup
reasons:

* TC_assignment_fr_a5_4() runs an unusual sequence of messages: it first
  fully assigns an lchan, and after that sends a Cipher Mode Command.
  Usually, the ciphering happens as part of attaching (Compl L3).
  The new test TC_assignment_fr_a5_not_sup() does the ciphering in the
  usual sequence, and properly expects a Cipher Mode Reject.

* TC_assignment_fr_a5_4 means to ask for an *unsupported* encryption
  algo. Since we are going to introduce A5/4 support shortly, we'll need
  to free up this name, for a successful A5/4 encryption test.

New test TC_assignment_fr_a5_not_sup() asks for A5/5 encryption, which
is not supported.

Related: SYS#5324
Change-Id: I83eca18d1b3d8d58177aa3750935ec5a3a985ca4
2021-06-21 12:41:21 +00:00
Pau Espin 211a714661 bsc: Validate new SRVCC counters
Change-Id: Icf2cd00f4024533a1bd8ba52816750a836bc0cb2
2021-06-17 14:05:09 +00:00
Pau Espin 9ae36d5e8c bsc: Validate new 'srvcc fast-return' VTY command
Related: SYS#5337
Change-Id: I227abc3793255e3916eba0dbc1460f46ec9926fe
2021-06-17 14:05:09 +00:00
Pau Espin 0619995974 bsc: Fix race condition exiting f_ho_out_of_this_bsc
The function didn't wait to receive the 2 messages from the BSC. As a
result, they may have arrived while tearing down the test components
shortly after exiting the function and provoke a Dynamic Test Error
while pushing the messages up the stack since some of the stack layers
may already be unavailable.

Test TC_ho_out_of_this_bsc() workarounded this by using a f_sleep(1),
but TC_srvcc_eutran_to_geran_ho_out() didn't, making it fail sometimes.

Change-Id: I590b09353900dfe6c4f648812ab675fed1908589
2021-06-15 16:43:03 +00:00
Neels Hofmeyr 9041c3b8b2 bsc-VAMOS: add cfg files to run BSC_Tests_VAMOS locally
A local tccn3 test run for VAMOS looks like:

  while sleep 1; do osmo-bts-omldummy -f vamos 127.0.0.1 1234; done

  osmo-stp

  osmo-bsc -c osmo-bsc-vamos.cfg

  make compile
  make -j 5
  ../start-testsuite.sh BSC_Tests BSC_Tests_VAMOS.cfg
  ../log_merge.sh BSC_Tests --rm

Change-Id: Iabda4c864b02e6ddbf03386c75d67a37f92992f4
2021-06-05 20:24:35 +00:00
Neels Hofmeyr 1470fc668a allow ASP_RSL_UD on MSC_ConnHdlr RSL
In BSC_Tests_VAMOS.ttcn, in f_est_and_reassign_to_secondary_lchan()
there is a missing channel release ack. By allowing ASP_RSL_UD, this rel
ack can be sent trivially.

Change-Id: Icd04184ed87c359349d86c5e0893c2ce9de2f7f1
2021-06-05 20:24:35 +00:00