Commit Graph

197 Commits

Author SHA1 Message Date
Daniel Willmann 0886215539 msc: Avoid race condition when setting osmux options via VTY
If the RAN_Emulation is started before the VTY reconfiguration we could
get a BSSMAP Reset/ResetAck with Osmux support advertised even though
the test expects it to be disabled (or vice versa).

Do the VTY configuration before starting the RAN_Emulation.

Fixes sporadic/load-related TTCN3 failures with message
"BSSMAP: Timeout waiting for RESET-ACK after sending RESET"
(e.g. TC_iu_and_mt_call_osmux, TC_iu_and_mo_sms in run +1567)

Change-Id: Ife23f70c6523034f3c3c53b6c1c81428566fd43e
2022-02-22 18:00:24 +00:00
Neels Hofmeyr 48e4d7d71a msc: add MSC_Tests.TC_call_re_establishment_ciph
Invoke TC_call_re_establishment with ciphering required.

Related: SYS#5130
Change-Id: I8bbe53fc9fced3e455aa30c571ef7684890adb99
2021-08-06 14:03:28 +00:00
Neels Hofmeyr a9b2dcf5ef msc: add MSC_Tests.TC_call_re_establishment_auth
Invoke TC_call_re_establishment with authentication required.

Related: SYS#5130
Change-Id: I8110a6b432de734d53b111c7b69aabca12129691
2021-08-06 14:03:28 +00:00
Neels Hofmeyr 4f099b4e94 msc: add MSC_Tests.TC_call_re_establishment
The osmo-msc patch that makes this test pass is
I6fa37d6ca9fcb1637742b40e37b68d67664c9b60

Related: SYS#5130
Change-Id: Ifdff5573eeb3b3d41e8599b9b0228411d2576864
2021-08-06 14:03:28 +00:00
Neels Hofmeyr e1a1b63549 msc: split f_start_handler_with_pars()
To allow running connect() on the COORD ports of test components before
starting the test component but after creating it, split
f_start_handler_with_pars() into f_start_handler_create() and _run().

Will be used by MSC_Tests.TC_call_re_establishment in
Ifdff5573eeb3b3d41e8599b9b0228411d2576864

Related: SYS#5130
Change-Id: Ic7e9dbb8c9db5948fe35fc3051bb988d65622782
2021-08-06 14:03:28 +00:00
Neels Hofmeyr 8853afbcf4 msc: add as_mgcp_ack_all_dlcx
Will be used by MSC_Tests.TC_call_re_establishment in
Ifdff5573eeb3b3d41e8599b9b0228411d2576864

Related: SYS#5130
Change-Id: Ic63fa41fa2e5d392d39f6b5f9edd3952aa6a9ee9
2021-08-06 14:03:28 +00:00
Neels Hofmeyr 49bbb511e7 msc: allow another reject cause in TC_cm_reest_req_reject
osmo-msc will soon have CM Re-Establishing support, and it will start
returning a different reject code instead of
GSM48_REJECT_SRV_OPT_NOT_SUPPORTED. In TC_cm_reest_req_reject, there is
no previous ongoing connection let alone a voice call, so osmo-msc will
return GSM48_REJECT_CALL_CAN_NOT_BE_IDENTIFIED.

Related: SYS#5130
Change-Id: I3eebab2b26016fb0ef7bf958208eaba6ae4c7836
2021-08-06 14:03:28 +00:00
Neels Hofmeyr 60122f8076 msc: eliminate bssap_idx
There is a pars.ran_idx, no need for an explicit bssap_idx argument.

There is only one occurence passing a nonzero bssap_idx, use
pars.ran_idx instead.

Preparation for patch "msc: split f_start_handler_with_pars()"
Ic7e9dbb8c9db5948fe35fc3051bb988d65622782

Related: SYS#5130
Change-Id: Ib5c5585f098ff269920cf9d5781c4366234854c5
2021-08-06 14:03:28 +00:00
Neels Hofmeyr 8913b9eaeb msc: fix conn id in 'MGCP OK' msg (as_mgcp_ack_all_mdcx)
The MDCX OK message should contain the same connection identifier as the
MDCX contained. So far we were always sending the second conn id,
regardless of which conn id was sent in the MDCX message.

Related: SYS#5130
Change-Id: If6f7f135d95c04ee0240f3fa9ba0b18ffc6fa24a
2021-08-06 14:03:28 +00:00
Pau Espin 7593a8a5f8 msc: Fix CommonId expectancies on subscr from A iface
When back on the A interface, the subscriber should no longer contain a
Last Eutran PLMN Id related entry in the VLR, since the SGs association
is no longer alive.

Related: SYS#5337
Change-Id: I8c72eaa4d41b8523f483ac3a343b782d1ef7c937
2021-07-06 07:16:23 +00:00
Pau Espin cefe9da445 cosmetic: msc: Fix typo in comment
Change-Id: Ia7b8c089866744621d22f9182d4293685f8e2563
2021-07-04 18:00:24 +00:00
Neels Hofmeyr 36ebc33153 msc: inter-MSC HO test: use CGI cell ID, not LAI
Fixes inter-MSC handover tests: in the inter-MSC 'Handover Required', do
not send a LAI cell identifier, but a CGI one.

This is analogous to the fix applied to inter-BSC HO in
I48276acf923626db171683dfa03ef43614a71380.

Rationale:

As explained in OS#5188, 3GPP TS 48.008 allows a LAI identification only
in the Cell Identifier List IE, but not in the single Cell Identifier
IE.

In the inter-MSC HO test's Handover Required message, we so far send a
LAI identifier in a List IE to osmo-msc. And so far, osmo-msc simply
echos that in the Handover Request message's single Cell Id IE.

The LAI is, as actually defined in the spec, omitted from the single IE
in deps/titan.ProtocolModules.BSSMAP/src/BSSAP_Types.ttcn, and when
osmo-msc sends the non-standard LAI Id, ttcn3 fails to parse the BSSMAP
Handover Request message: the Cell Identifier IE gets wrong values, and
all remaining IEs are parsed as 'omit' even though they are present on
the wire. So as long as osmo-msc sends back a LAI Id, we cannot sanely
verify the Handover Request received from the MSC.

The CGI identifier type is supported in both IEs. So when the test sends
a CGI identifier in the Handover Required, osmo-msc will also reflect a
CGI identifier in the Handover Request, and ttcn3 parsing works.

Related: OS#5188 SYS#5324
Change-Id: I525b5deaa9634fcdb63fbd2c97c767aff045767c
2021-07-02 17:10:26 +02:00
Neels Hofmeyr ec2e1f701d msc: rather not use decmatch in f_tc_ho_inter_msc_out()
TC_ho_inter_msc_out fails on jenkins in a way that i cannot reproduce. A
possible source is the decmatch for the Handover Request message. The
jenkins logs show:

MSC_Tests.ttcn:6005 Warning: Decoded content matching failed, because the buffer was not empty after decoding. Remaining octets: 22.

Change-Id: I20b5594c7e083af791525231f24d3ed089c18910
2021-07-02 02:12:04 +02:00
Neels Hofmeyr 906af1089c msc: fix inter-msc ho tests: do not attempt to send "*"
Recently, encryption testing was added to the inter-MSC HO test. Instead
of sending the chosenEncryptionAlgorithm from the receive-template side
forward the actual received one (rx "*" usually means tx is "omit").

Change-Id: Icae084cfd63d666f3b0778fade7ba558bd161a0f
2021-07-01 12:11:59 +02:00
Neels Hofmeyr 666d39abb9 msc: add inter-MSC HO tests with A5 encryption
Related: SYS#5324
Change-Id: Ia1df783be33bf752d291acb857d3c48882c65975
2021-06-29 16:17:54 +02:00
Neels Hofmeyr 0d841d98b6 msc: add inter-BSC HO tests with A5 encryption
Related: SYS#5324
Change-Id: I57e43c60d4389bd301d0195179321a34401bd1dc
2021-06-29 16:17:54 +02:00
Neels Hofmeyr b00c5b095d msc: add vec_keep to lock the AuthVector
Next to AuthVector vec, add boolean vec_keep. When set to true,
as_GSUP_SAI() skips the vector regeneration.

An upcoming patch adds encryption to inter-BSC handover, which will use
vec_keep := true. (See I57e43c60d4389bd301d0195179321a34401bd1dc )

Rationale:

Usually, a random auth vector is generated during as_GSUP_SAI(). For
inter-BSC handover, there are two separate virt-BSC components running.
But to be able to verify that the correct key is passed on from the old
to the new BSS, both titan components need to have the same AuthVector
data. The easiest solution is to generate the AuthVector before
launching the components, and then prevent that it is changed by
as_GSUP_SAI().

Related: SYS#5324
Related: I57e43c60d4389bd301d0195179321a34401bd1dc
Change-Id: I4bca739c2aad8342915e00a218f90fc19be7eafe
2021-06-29 16:17:54 +02:00
Neels Hofmeyr 2822d07ab2 msc: inter-BSC HO test: use CGI cell ID, not LAI
In the inter-BSC 'Handover Required', do not send a LAI cell identifier,
but a CGI one.

Rationale:

As explained in OS#5188, 3GPP TS 48.008 allows a LAI identification only
in the Cell Identifier List IE, but not in the single Cell Identifier
IE.

In the inter-BSC HO test's Handover Required message, we so far send a
LAI identifier in a List IE to osmo-msc. And so far, osmo-msc simply
echos that in the Handover Request message's single Cell Id IE.

The LAI is, as actually defined in the spec, omitted from the single IE
in deps/titan.ProtocolModules.BSSMAP/src/BSSAP_Types.ttcn, and when
osmo-msc sends the non-standard LAI Id, ttcn3 fails to parse the BSSMAP
Handover Request message: the Cell Identifier IE gets wrong values, and
all remaining IEs are parsed as 'omit' even though they are present on
the wire. So as long as osmo-msc sends back a LAI Id, we cannot sanely
verify the Handover Request received from the MSC.

The CGI identifier type is supported in both IEs. So when the test sends
a CGI identifier in the Handover Required, osmo-msc will also reflect a
CGI identifier in the Handover Request, and ttcn3 parsing works.

This prepares for adding verification of the ciphering in inter-BSC
handover, in turn a preparation for adding tests of A5/4.

Related: OS#5188 SYS#5324
Change-Id: I48276acf923626db171683dfa03ef43614a71380
2021-06-23 03:55:26 +02:00
Eric Wild 26f4a62642 msc: add first a5/4 tests
All msc tests involving classmarks suffer from the same problem: if a
existing subscriber is reused the old classmarks will stick, since the
msc only overwrites updated parts of the cm when receiving a new cm, so
"downgrading" the existing classmark information is not possible.

This is circumvented here here by using different imsi suffixes,
the last param passed to f_start_handler.

Additionally the handler will now properly respond to cm requests
by the msc, i.e. in case the early cm is not sufficient for a5/4
because it lacks cm3, so the msc attempts once to query the cm,
hoping to get a cm3.

Related: SYS#5324
Change-Id: Idc055a006b325f58a5eafa88bc4415181b3500a2
2021-05-19 17:49:52 +00:00
Pau Espin e979c40e4b msc: Verify CommonID contains LastUsedEutranPLMNId when in CSFB
Validate in test that MSC sends Last Used E-UTRAN PLLMN Id IE when call
is started by SGs (CSFB).

Related: SYS#5337
Change-Id: I161529fd9c8cacb7d17ea18660998df06bb0b575
2021-05-11 16:15:31 +02:00
Pau Espin 3768a6fc34 msc: MME emulation should send TAI during SGs LU for CSFB support
3GPP TS 23.272 sec 4.3.3:
"During the SGs location update procedure, obtaining the last used LTE
PLMN ID via TAI in SGsAP-LOCATION-UPDATE-REQUEST as specified in TS
29.118".

Related: SYS#5337
Change-Id: I7057a7c41794d62f7cbc412da3e805c1f0c69511
2021-04-28 14:24:26 +02:00
Pau Espin 3acd19ea41 msc: Fix typo in func description
Change-Id: I828fe1efbdd38b12ba29f9ac0141fc456ce3c7bf
2021-04-28 12:59:52 +02:00
Pau Espin 174fac25a3 msc: Get rid of several uneeded module params
These params are not needed anymore since new releases used in -latest don't
need to disable it.

Change-Id: I16575ae4f615bf7c42d5921917003007ba4872a0
Related: OS#5042
2021-02-26 13:20:10 +01:00
Vadim Yanitskiy 109e755161 msc: test reaction on Clear Request during a MO/MT Call
Change-Id: Id16969fe0de04445d1320a96d35cf1d48cc8cf09
Related: SYS#5340
2021-02-08 20:18:13 +00:00
Vadim Yanitskiy b56701e021 msc: finish and enable test case for MT Call T310 timer
The test suite needs to handle MGCP messages, otherwise the related
FSMs in the IUT would tear everything down before T310 is expired.

Change-Id: I79d9ae3b086d05c3d7c0a1241720d6c3f1e90281
Related: SYS#5340
2021-02-08 20:18:13 +00:00
Pau Espin 9a5b8ffc5b CTRL: Introduce support to run osmocom CTRL server
Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
2021-01-07 15:06:39 +01:00
Pau Espin 563b3d013b mncc: Support IPv6 addresses (new version mncc 7)
Apparently commit 06b859ca31 forgot to
bump the MNCC_SOCK_VERSION field from 5 to 6.

Change-Id: I5448ff931ec33f24f4837a51376f1703fe97683b
2020-09-16 10:36:44 +00:00
Pau Espin 609f1d6c10 msc: Introduce module param to disable crashing test in latest
Otherwise all tests run after ruing MSC_Tests_Iu.control fail.

Change-Id: I46f1066323e19dfe708402a8c9c68e257f62751c
2020-09-15 20:46:00 +00:00
Pau Espin 9a732a4f48 msc: Drop parameter mp_enable_osmux_test
That was needed for osmo-msc <= 1.3.0, and we are at 1.6.1 now.

Change-Id: I8bc0551ec91a5fd8ea2f291a1e16a06a739c7a75
2020-09-15 20:46:00 +00:00
Pau Espin 833174e7fb msc: Introduce tests to verify BSSAP and MGCP handling with IPv6
It tests IPv6 Transport Address are passed correctly through BSSAP, and
forwards handles them correctly as an MGCP client too.

Change-Id: Id616926dd4a9febc4268eea2ee1e377b2d22753a
2020-09-09 12:48:32 +02:00
Neels Hofmeyr 14d0b13f5f msc: add TC_paging_response_[it]msi_unknown
These uncover crashes of current osmo-msc master, when a Paging Response
contains an unknown mobile identity. Hence run them last.

The crash is fixed by osmo-msc Ia2c8fa745cfab17ed7114d433f625ddc02ae7b11

Related: OS#4724
Related: Ia2c8fa745cfab17ed7114d433f625ddc02ae7b11 (osmo-msc)
Change-Id: I40496bbccbbd9c496cfa57df49e26f124a2b1554
2020-08-25 11:41:25 +00:00
Neels Hofmeyr 13737fbb5d msc: add TC_cmserv_tmsi_unknown()
We already have TC_cmserv_imsi_unknown, but lack a test that shows CM Service
Request behavior for an unknown TMSI.

Looking at OS#4721 I vaguely expected an ID Request to also happen during CM
Service Request, but instead we reject the unknown TMSI completely, and require
the MS to perform a proper LU subsequently.

Related: OS#4721
Change-Id: I54e5efcf4c31625205c99338379a2055633acde9
2020-08-25 11:41:25 +00:00
Neels Hofmeyr fc06c73f39 msc: add TC_attached_imsi_lu_unknown_tmsi()
The test currently fails with osmo-msc master. It uncovers the evil twin aspect
of osmo-msc's VLR, for an attached IMSI re-attaching with an unknown TMSI.

Related: OS#4721
Change-Id: Ia53733fc5bc414b0e3d3897f25b549f5183c862d
2020-08-25 11:41:25 +00:00
Harald Welte 4d15fa7379 msc: Fix repeated execution of TC_sgsap_unsol_ud()
Change-Id: I6c2f1a5d5b5316ffe462335f8461c31564ce4274
Closes: OS#4722
2020-08-20 06:10:42 +00:00
Harald Welte 4a3fa71d9d msc: Make TC_lu_and_mo_call_sccp_tiar_timeout() more reliable
There is a race condition when shutting down, as a DLCX might arrive
while we are half-shutdown.  Expect both DLCX before terminating
the ConnHdlr.

Change-Id: Ia0342a9bb346929e0e538f4cb571abfc4acac6bf
2020-08-20 06:10:42 +00:00
Neels Hofmeyr f1c3c21ef4 msc: fix log typo in f_tc_cmserv_imsi_unknown()
Change-Id: If7aa20cd7fea81107f3748251070c32bb08f1f4e
2020-08-19 14:19:01 +00:00
Harald Welte 79f1e45436 msc: Expect CommonID from MSC by default
As of osmo-msc Change-Id I2552736477663adb250c55728093500e8ae83ebb,
osmo-msc is always sending BSSMAP CommonID to the BSC.  Let's adjust our
test expectation, while allowing the user to start the tests with
BSC_ConnectionHandler.mp_expect_common_id := false
to get the existing behavior (expect no bSSMAP CommonId) can be
restored, e.g. for testing 'latest'.

Change-Id: I4976d9bb1f07c8ab4ffa02848414f8ddd1bdfd3f
Related: OS#2969
2020-08-19 08:59:13 +02:00
Harald Welte 4698a4c4e3 msc: Use random chosen unused local TCP port number for SMPP client
The existing code passed -1 as TCP port number to the SMPP client.
This - very unintuitively - causes TITAN to always chose port number
9999, as that's the default value in IPL4asp.  Let's use '0' instead.

Change-Id: I4db38f4099c388bed23f9a3611619866ede9cbc5
2020-08-18 23:14:16 +02:00
Neels Hofmeyr 4e18cccb9c msc: verify conn and VLR cell id in most tests
osmo-msc failed to record the Complete Layer 3 Information LAC and CI in the
MSC-A as well as the VLR record. Since osmo-msc
Iee1781985fb25b21ce27526c6a3768bf70d4dc9a and
I194271af2acb37b4f8cc2d106ab2fd2b0d443589, osmo-msc properly records these for
successful Complete Layer 3 procedures.

Incorporate verification of the LAC and CI in all tests calling f_perform_lu()
and f_expect_clear(). Implement by scraping the output of vty
	'show subscriber imsi 1234 conn'

Some tests model a failure to attach, or expire the VLR record: for those, add
parameter verify_cell_id to g_pars, and pass it as false, to skip checking the
LAC and CI.

Disable CI checking for all Iu tests globally in f_verify_vty_lac_ci(), see
OS#4634.

For the latest build, which does not yet record LAC and CI properly, provide
mp_enable_cell_id_test, which skips all cell id verification if set to false.
Put to effect by docker-playground I052fea208021509e12826c50474b96474e7a58c2.

Related: OS#4627
Depends: Iee1781985fb25b21ce27526c6a3768bf70d4dc9a (osmo-msc)
Change-Id: Ie410714a96353f74a52a104c56fa0a08683e0004
2020-07-08 01:45:09 +00:00
Neels Hofmeyr 7985aebeb3 move type RAN_Configurations to RAN_Adapter.ttcnpp
So far used only in MSC_Tests.ttcn, but soon to be used also in BSC_Tests.ttcn.

Change-Id: If8f7fd50a88302af645ab337a907d8f0ad79a306
2020-06-14 10:54:11 +00:00
Vadim Yanitskiy 61564be045 library/IPA: split t_ASP_IPA_EVT_UD into send / receive templates
Change-Id: Ib5494bff3f9aa0ac396b729c326e7b4a64c5a5dd
2020-05-18 20:47:14 +07:00
Neels Hofmeyr b58d974ea5 msc: add tests for SMS and voice call while Paging
Start a second
- MT SMS
- MT call
while a Paging is already ongoing.

The second trans being an SMS works.

The second trans being a call fails with current osmo-msc master; a fix is in
the related patch (s.b.).

Related: Idd4537b5f4817d17e5c87d9a93775a32aee0e7be
Change-Id: Ieeae6322d4e80893ea3408c6b74bf8e32bea8e46
2020-05-11 17:33:05 +00:00
Vadim Yanitskiy 2521906537 MSC: add a test case to check T3212 expiration during paging
Long story short: some time ago I noticed that OsmoMSC crashes if
T3212 expires during the Paging procedure. This is not the case
anymore (as the test case shows) and apparently the bug has been
fixed, hovewer I believe it makes sense to add this test case.

Change-Id: If9147ae8b07d5120d2853b9acda2313910ac48be
2020-01-20 20:54:00 +00:00
Vadim Yanitskiy 2d3f846572 MSC/SMPP: fix RP-ACK expectations in TC_smpp_mo_sms
The MSC shall not send RP-ACK before the response from ESME.

Change-Id: Ide1376cae8e75412039b7dc9f0b8bb390eab2280
Related: OS#4351
2020-01-15 16:08:31 +00:00
Vadim Yanitskiy 3382076554 MSC/SMPP: introduce TC_smpp_mo_sms_rp_error for OS#4351
This test case reproduces the problem described in OS#4351:

  1. MS/UE submits a MO SMS which it getting touted to an ESME;
  2. MSC prematurely responds with RP-ACK to the MS/UE;
  3. ESME responds with DELIVER-SM error;
  4. SMS transaction is already terminated (by RP-ACK).

Expected behaviour:

  1. MS/UE submits a MO SMS which it getting touted to an ESME;
  2. ESME responds with DELIVER-SM error;
  3. MSC terminates the SMS transaction with RP-ERROR.

Change-Id: I33c6ea0ffdf8b8a45f587d690bdceb38fc42c898
Related: OS#4351
2020-01-15 16:08:31 +00:00
Vadim Yanitskiy a358dd4398 MSC/SMS-over-GSUP: cosmetic: use a single log() call to print received PDU
Change-Id: I862766ac87715d5ad141405f343f0563fd75150f
2020-01-15 16:08:31 +00:00
Vadim Yanitskiy da77459579 MSC: fix coding style in f_tc_lu_and_mt_sms_paging_and_nothing()
Change-Id: Ide647f62150b2ca64e12044ae8dae5bb33e600c2
2020-01-15 16:08:31 +00:00
Pau Espin a42745c93b msc: Introduce test TC_(iu_)chan_rel_sccp_tiar_timeout
Verify SCCP T(iar) timeout triggers release of established channel.

Related: OS#4343
Change-Id: Id6488a262e656f5c8fabb4e81f4797b305eb09e2
2020-01-12 13:11:39 +00:00
Vadim Yanitskiy 1c9754dc0d MSC: add test cases for concurrent MO/MT SS/USSD transactions
Both test cases make use of the existing functions:

  - TC_multi_lu_and_mo_ussd: f_tc_lu_and_mo_ussd_single_request(),
  - TC_multi_lu_and_mt_ussd: f_tc_lu_and_mt_ussd_notification(),

starting several (*) BSC_ConnHdlr components in parallel.

(*) The maximum amount is limited by 16 - this is as much
    as both GSUP and SCTP emulation components can handle.

Change-Id: I2fb1c5d285163d5245d92fa24c197a5027ecbe6f
Related: OS#2931
2020-01-10 16:03:27 +00:00
Vadim Yanitskiy ae74774138 MSC: f_ran_register_imsi(): allow passing omit as TMSI
Change-Id: I6dd2f77283a79e83f028115f4cc42f05db885838
2020-01-10 16:03:27 +00:00