Commit Graph

573 Commits

Author SHA1 Message Date
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