Commit Graph

133 Commits

Author SHA1 Message Date
Oliver Smith ce2dd69588 bsc: AssignmentState: voice_call -> rtp_stream
Now that CSD is supported, rename the variable. It is true for both
voice calls and for CSD.

Related: OS#4393
Change-Id: Idfd9a102ad172d3aeaa4222a21357cdcd51680df
2023-04-21 08:05:01 +00:00
Oliver Smith bc392a8377 bsc: improve TC_assignment_csd
Verify that CSD ipaccess CRCX/MDCX has the CSD RTP payload type, and
that the RSL_IE_IPAC_RTP_CSD_FMT IE is set with
RSL_IPA_RTP_CSD_TRAU_BTS.

Related: OS#4393
Change-Id: Id0e0c5631d7a36635e1ef49cf5bf554f0336556b
2023-04-20 08:43:37 +00:00
Oliver Smith 4eed06f3f2 bsc: TC_ho_in_fail_ipa_crcx_timeout: new test
Verify that OsmoBSC runs into a timeout and aborts the handover if the
IPA CRCX is not answered by the BTS. This test ensures it still works
after removing a redundant timer, as discussed here:
https://gerrit.osmocom.org/c/osmo-bsc/+/30307/1#message-9e02be4de78c03ed25b8422d6eee4ba9c6dda9ff

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

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

Related: OS#5787
Change-Id: I30e1811f97406cff6ba794fcd6882e2bb0205087
2023-02-15 20:00:23 +00:00
Pau Espin b27653c6b6 bsc: Introduce test TC_assignment_emerg_setup_allow_imei
Related: OS#5849
Change-Id: I5a95cb0cd6903801db8cfcc1542bd6147461eebe
2023-01-03 14:33:17 +01:00
Pau Espin 3c63053fe8 bsc: Support running several MGW node emulations
Change-Id: Ic84726c09ad3c6bea3ce6f0198db862d7dbb6dd3
2022-10-20 19:00:11 +02:00
Pau Espin 29c6dfb46d bsc: Add testscase & infra to validate Osmux support BTS<->BSC
New TC_assignment_osmux_bts is added which tests Osmux used only
BTS<->BSC.
Existing TC_assignment_osmux is renamed to TC_assignment_osmux_cn,
and a new TC_assignment_osmux is added which tests using Osmux on both
sides (towards BTS and CN).

Related: SYS#5987
Change-Id: I6e82eb9d995de988b812001e1c4cf6923509de66
2022-09-13 11:20:11 +00:00
Pau Espin f967afc2ec bsc: Rename s/use_osmux/use_osmux_cn/
That config is used to control the use of osmux between BSC<->MSC. Since
we'll add support for Osmux in BTS<->BSC, we want to test that in a
separate way. Let's rename it so that we can add a "use_osmux_bts" later
on.

Change-Id: I3bde4e6772c18043dd763d7747b5dbe40e0da3b8
2022-08-10 18:47:33 +00:00
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 35c9a33418 bsc: fix some inadequate template restriction warnings
Change-Id: Icfc69aff2c923f4e12dbd6cc42c792d5712a7b27
2022-03-22 18:25:53 +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
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
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 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 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 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 2bcea3dec8 MSC_ConnectionHandler: use select() in f_ChDesc2RslChanNr()
Change-Id: Iefef18b7f6330dbfb61a98c8c037c9c904cf0c24
2021-11-18 19:10:34 +00: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 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 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
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 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 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 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
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
Neels Hofmeyr b5b7a6ea27 bsc: test TSC in various messages
In a recent osmo-bsc patch:

"allow explixit TSC Set and TSC on chan activ / modif / assignment"
c33eb8d56943b8981523754b081967e6ff5f245d
Ic665125255d7354f5499d10dda1dd866ab243d24

I accidentally changed the default behavior of the Training Sequence
Code sent to BTS and MS. So now, make sure that we verify the expected
Training Sequence Code in BSC_Tests, in:

RSL Channel Activate
RR Immediate Assignment
RR Assignment Command
RR Channel Mode Modify
RSL Mode Modify

Related: OS#5172 SYS#5315
Change-Id: Id67a949e0f61ec8123976eb8d336f04510c55c01
2021-06-05 22:14:46 +02:00
Neels Hofmeyr d601f9c0d6 MSC_ConnectionHandler: fix race in f_create_chan_and_exp()
During f_create_chan_and_exp() (part of f_establish_fully()), announce
the BSSAP L3 expectation before activating the lchan.

In RSL_Emulation f_chan_est(), we go through Chan Request, Channel Act
and Immediate Assignment followed by EST IND. Right after that, osmo-bsc
sends a Complete Layer 3 on BSSAP. But in f_create_chan_and_exp(), we
only create the expectation of the BSSAP right after the call to
f_chan_est(), i.e. only after sending the EST IND. So far it was always
juuust in time to work, but when I added a little check to the end of
f_chan_est(), or alternatively an f_sleep(0.2), then BSC tests always
fail with:

Test case TC_reassignment_fr finished. Verdict: fail reason: Couldn't find Expect for incoming connection { [...] pdu := { bssmap := { completeLayer3Information... }

With the BSSAP expectation done first, this error is avoided.

Change-Id: I1d4af737dcc0f9c9fa6cdaff3a92813d532e730c
2021-06-05 22:11:20 +02:00
Neels Hofmeyr 9c3b82f5dc GSM_Types, bsc: add VAMOS cbits
Change-Id: I2d98495b8c4c9a8466f2154af9bb29124c2cb0b5
2021-05-29 21:50:11 +02:00
Neels Hofmeyr 9d68630a74 bsc: f_establish_fully: verify lchan ESTABLISHED state
Change-Id: I341e2fa1e8946e7516705fa079e6e54fce9e58b0
2021-05-25 22:27:08 +02:00
Neels Hofmeyr 559d5d0f86 bsc: add TC_assignment_codec_fr_by_mode_modify
Test the lchan mode modification code path of OsmoBSC, in preparation of
adding VAMOS bits to the mode modification procedure.

Related: SYS#4895
Change-Id: Idf4efaed986de0bbd2b663313e837352cc139f0f
2021-04-28 22:35:27 +00:00
Neels Hofmeyr c2425cc580 f_channel_needs_modify(): ask actual TCH lchan mode via VTY
I am introducing a BSC test case that runs through a assigning a TCH
channel for signalling, and then using Channel Mode Modify to change its
mode from signalling to speech. For this to work,
f_channel_needs_modify() needs to actually look up the channel mode of
the TCH and not assume that a TCH is always in speech mode.

Related: SYS#4895
Change-Id: If30e2cec65da91cb5899ee29e2afb6696437a4c9
2021-04-28 22:35:27 +00:00
Pau Espin c08d552544 bsc: Introduce TC_srvcc_eutran_to_geran
Related: SYS#5337
Change-Id: If26cc9241b1b0eb4112f1227427008ece242bb41
2021-04-19 11:38:18 +02:00
Neels Hofmeyr ffd2ef1de4 as_handover: fix for signalling channel, without MGCP
Change-Id: I276f82841c07f8a885ee0659002d4a41e5b180e4
2020-10-13 08:43:10 +00:00
Harald Welte 47cd0e3350 bsc: Add Lb interface support
This introduces the Lb interface stack, which allows BSC_Tests.ttcn
to emulate a SMLC towards the BSC.

In accordance with https://osmocom.org/projects/cellular-infrastructure/wiki/Point_Codes
we use 0.23.6 as point code for emulating the SMLC.

Change-Id: Id41246f0dd812f7ddee9d920bfd07a4e3aac3504
2020-10-13 08:43:10 +00:00
Philipp Maier a208389c07 MSC_ConnectionHandler: allow to use IPV4 as default
When the BSC sends a CRCX without an IP address in it, the testcase will
automatically assign an IPV6 address in the response. However, this
breaks compatibility with older versions of osmo-bsc that do not have
IPV6 support. Lets add a module parameter in order to be able to use
IPV4 as default if required.

Change-Id: I30c77abef63636bb02db12d2f2b2d79ea244b96c
2020-09-29 21:28:59 +00:00
Philipp Maier 09f1c6da7d MSC_ConnectionHandler: do not allow as_Media_mgw to exit
The altstep as_handover needs to repeat until the IPACC and the MGCP rtp
negotiation is done (MDCX). By setting the norepeat flag of the sub
altsteap as_Media_mgw to true, we allow as_handover to exit early, even
when the handover is not done yet, which eventually causes the testcase
to fail.

Change-Id: I303879a9153d25a02743dc1d4713ae74918b9be7
fixes: OS#4752
2020-09-20 10:05:06 +00:00
Pau Espin 078666329d bsc: Introduce test TC_assignment_aoip_tla_v6 and TC_ho_into_this_bsc_tla_v6
Change-Id: Iba24fae66c80b64bf81bbfd616294af757e5dca3
2020-09-09 12:48:28 +02:00
Harald Welte 8cb5825ffc Revert "bsc: Add Lb interface support"
This reverts commit c47fdb2e52 - as
osmo-bsc currently doesn't yet have a Lb interface, we shouldn't try
to test it yet.

Change-Id: I7898dd336cbef27553d97857ac22f1a539da1380
2020-08-31 16:50:43 +02:00
Harald Welte c47fdb2e52 bsc: Add Lb interface support
This introduces the Lb interface stack, which allows BSC_Tests.ttcn
to emulate a SMLC towards the BSC.

In accordance with https://osmocom.org/projects/cellular-infrastructure/wiki/Point_Codes
we use 0.23.6 as point code for emulating the SMLC.

Change-Id: I854618cc08de1a716784f52542a4df3c7f7ad900
2020-08-30 16:07:00 +00:00
Daniel Willmann ebdecc0309 bsc: Add statsd checker and use it in TC_assignment_sign
Related: SYS#4877
Change-Id: I8526b645dc4af59adcc1855699421a026f505c1d
2020-08-13 15:02:15 +00:00