Commit Graph

86 Commits

Author SHA1 Message Date
Pau Espin 9a5b8ffc5b CTRL: Introduce support to run osmocom CTRL server
Change-Id: I37db9962f51baf2c63bd58ec47ec89f773d7a255
2021-01-07 15:06:39 +01:00
Pau Espin 956bfd247d msc: Validate RTP addr+port passed from MNCC to MGCP MDCX
Change-Id: I0b53643ed3a8f8550b2ea6e8832068d603a676e1
2020-09-16 10:36:44 +00: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 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
Pau Espin cb4c59d131 msc: Fix wrong mgcp conn expected in several places
Change-Id: I0bb15881e640fe49552108679894d5df15339fc8
2020-09-07 08:05:28 +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
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 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 98bb2d5eea library/GSM_RR_Types: do not duplicate Mobile Identity records
All the records related to Mobile Identity IE (see 3GPP TS 24.008,
section 10.5.1.4) are defined in [1], so there is no real need to
dumplicate them. Moreover, most of the related templates in
library/L3_Templates.ttcn are based on these records.

[1] titan.ProtocolModules.MobileL3_v13.4.0/src/MobileL3_CommonIE_Types.ttcn

Change-Id: I27c2743c59db770d6f7e9447dc8c1f539b228ced
2020-03-28 03:29:22 +07:00
Vadim Yanitskiy 2dd9661220 MSC/GSUP: make session ID for MT SS/USSD configurable
This would allow to run multiple SS/USSD transactions in parallel.

Change-Id: I326b5e47f4c1e9f9209efa64c143c3dc64132edb
2020-01-07 21:49:45 +01:00
Vadim Yanitskiy afb15a8424 MSC: fix SM-RP-OA (SMSC Address) expectations for MT SMS
Since [1] we started to match the SMSC Address in f_mt_sms_expect().
That change caused test case failures because OsmoMSC hard-codes
a different SMSC Address. Let's fix this.

[1] Ib467eeca6439bc6cce72293fbb5bb48f6d233db9

Change-Id: I3bdb6a74c8b02e4bf8dc88634e2380c924242b4b
2020-01-05 21:06:43 +01:00
Vadim Yanitskiy 04dd5f7aa0 MSC_Tests.ttcn: fix: verify the contents of SM-RP-DA/OA for MO/MT SMS
Change-Id: Ib467eeca6439bc6cce72293fbb5bb48f6d233db9
Related: OS#4324
2020-01-03 12:27:17 +00:00
Vadim Yanitskiy 437b5a6c7d MSC/BSC_ConnectionHandler: only keep SMSC address in SmsParametersRp
When sending MO or MT SMS, we never include both SM-RP-DA/OA IEs
at the same time. In case of MO SMS, SM-RP-OA is omitted, and in
case of MT SMS - SM-RP-DA is omitted.

Change-Id: Ia60bdd2498034b6b849f874cf1eee272abef2b47
2020-01-03 12:27:17 +00:00
Pau Espin d3d54a91fa msc: Introduce test TC_lu_imsi_timeout_tmsi_realloc
Related: OS#4336, OS#4337
Change-Id: I603b2b2b1ae7edd6360ea38c6bbbfedc46e9fa5d
2020-01-01 16:12:20 +00:00
Pau Espin 7e9178df28 msc: Remove trailing whitespace
Change-Id: I934dd3504fa91e2006fbc9b1133836060eb0591e
2019-12-17 17:52:42 +01:00
Neels Hofmeyr 8df6962dec msc: add f_tc_invalid_mgcp_crash
Make sure that osmo-msc doesn't crash if a successful CRCX response contains an
invalid IP address.

Originally/recently, osmo-msc did not validate the IP addresses at all. In an
intermediate patch I added error handling, releasing the call. That uncovered a
use-after-free problem in libosmo-mgcp-client. This problem is fixed by
osmo_fsm_set_dealloc_ctx() and an osmo-mgw fix (see
I7df2e9202b04e7ca7366bb0a8ec53cf3bb14faf3 in osmo-mgw).

Add this test to make sure the crash is not re-introduced.

Change-Id: I0c76b0a7a33a96a39a242ecd387ba3769161cf7a
2019-11-23 07:59:07 +00:00
Neels Hofmeyr ba960a140d msc: log tweaks for call / call hangup
Change-Id: I06474e3d592195a8c422493166d9f042da1ac7e6
2019-11-23 07:59:07 +00:00
Neels Hofmeyr 8fe8a90da2 msc: add and fix Iu mt call
Change-Id: I3ce29f3d9254656dc295674e8cec72a741b7764a
2019-11-23 07:59:07 +00:00
Neels Hofmeyr 0b16bf1fcb msc: fix Iu mo call
Change-Id: I0ead36333ab665147b8d222070ea5cf8afc555ec
2019-11-23 07:59:07 +00:00
Neels Hofmeyr 3c89a6bce6 msc: overhaul voice call testing
* Semantic:

We don't really know which side the MSC first creates a CRCX for. Instead of
assuming that the RAN side is always CRCX'd first, simply handle a "first" and
a "second" CRCX, not making any assumptions which is for which side.
Notably, there still are quite a few places assuming which CRCX corresponds to
the RAN/CN side, but the changes are sufficient to still pass the tests when
osmo-msc swaps the CRCX order; sometimes for slightly obscure reasons, for
example because it doesn't matter that the wrong port number is returned during
a subsequent MDCX... Cleaning up the rest is still todo for later.

Remove code dup from call establishing code, particularly for MGCP.

Use f_mo_call_establish() and f_mt_call() where ever possible, to make all of
the call establishing tests handle upcoming changes in osmo-msc's order of
messages, without re-implementing the changes for each test individually.

The X-Osmux parameter was so far expected to appear in the first CRCX received,
assuming that this first CRCX is for the RAN.  Instead, detect whether X-Osmux
is contained in a CRCX, and reply with an Osmux CID if so, regardless of it
being the first or second CRCX.  Count the number of X-Osmux parameters
received in CRCX messages, and compare after call setup to verify X-Osmux
presence.

Since f_mo_call_establish() can't handle RANAP assignment, a few Iu tests that
worked with the older code dup will break by this patch. This is fixed by a
subsequent patch, see I0ead36333ab665147b8d222070ea5cf8afc555ec.

* Details, per patch chunk:

Change ts_BSSMAP_IE_AoIP_TLA4 to a non-value template, so that we can use a
wildcard for the assigned port number from MGCP (depending on RAN or CN CRCX
first, the RAN port number can be one or the other).

In CallParameters, move MGCP handling instructions into a separate record
"CrcxResponse", and have two of them for handling the first and the second
CRCX, replacing mgw_rtp_{ip,port}_{bss,mss} and mgcp_connection_id_{bss,mss}.

In CallParameters, add some flags for early-exiting call establishment with a
particular desired behavior, for specialized tests.

In CallParameters, use common default values and don't repeat them in each and
every call establishing test.

Set cpars.mo_call := {true,false} implicitly when f_{mo,mt}_call_establish()
are invoked.

Remove CRCX comments implying RAN or CN side, instead just talk of the "first"
and the "second" CRCX.

Implement one common f_handle_crcx() function, which is used by
f_mo_call_establish(), f_mt_call_complete(), as_optional_mgcp_crcx(), and
implicitly uses the first/second CRCX handling.

For Assigment, use a wildcard RTP port so that we don't have to assume which
CRCX was for the RAN side.

In f_mo_call_establish(), insert special case conditions to make it enact
errors at specific times, for individual tests. That saves re-implementing the
entire call establishment (code dup).

For error cases, add expectation of a CC Release message in the call
establishment. This should not apply for normal successful operation, but
because interleave does not support conditionals, add flags
got_mncc_setup_compl_ind and got_cc_connect to break the interleave when
establishing is complete, so that the CC Release is skipped.
A CC Release always breaks the interleave, at whatever time it arrives.

Tests adopting f_{mo,mt}_call instead of code dup:
  f_tc_mo_setup_and_nothing()
  f_tc_mo_crcx_ran_timeout()
  f_tc_mo_crcx_ran_reject()
  f_tc_mo_release_timeout()
  f_tc_mo_cc_bssmap_clear()

Change-Id: I8b82476f55a98f7a94d5c4f1cd80eac427b2d20f
2019-11-23 07:59:07 +00:00
Neels Hofmeyr eccaa994e2 cosmetic: remove brace from comment
This '{' in the comment gets my auto indenting / syntax brace matching all
confused.

Change-Id: I303abe800037abd0c9694ae750a7acaa79c9754f
2019-11-04 00:17:41 +01:00
Neels Hofmeyr 3d22e4a1c2 improve/fix f_tc_mo_setup_dtmf_dup
- Fix error log for a missing final DTMF.

- Instead of code dup to establish a call, use f_mo_call_establish().  This
  will make the test benefit from changes to f_mo_call_establish() (which will
  soon come up to accomodate changes in osmo-msc's codec negotiation).

- Instead of hardcoding the expected N_SD counter values to detect DTAP
  duplicates, use f_bssmap_last_n_sd() and f_next_n_sd(), so that the N_SD
  counter is correct regardless of how many DTAP were sent in
  f_mo_call_establish().

- Instead of hardcoding a correct N_SD in the end, use skip_seq_patching ==
  false, so that the ttcn DTAP correctly tracks N_SD for subsequent call
  release messages.

- Release the call.

Change-Id: Ibfa8b906764f2d5ed75fe74125be42af4546e864
2019-11-04 00:17:41 +01:00
Neels Hofmeyr d9d835db4a msc-test: improve error log on Assignment RTP port mismatch
Before this, if an Assignment Request contains an unexpected Transport Layer
Address, the test completely rejects the Assignment Request.

Instead, accept any tla in the Assignment, and compare the expected tla in the
Assignment's interleave action. Thus we directly get logging hinting at the tla
instead of a T_guard timeout.

Change-Id: I04847c10d6c3bf9e04cfda6e343dfd4a65be71a5
2019-11-04 00:17:41 +01:00
Oliver Smith 91bfa1c436 msc: check IMEI: move reject LU into new function
Change-Id: Ifad259e21df035a89e97831a57c0675502308eb6
2019-07-23 15:07:48 +02:00
Oliver Smith 1d118ff753 msc: add check IMEI tests
Extend BSC_ConnHdlr with new check IMEI related parameters. Add tests
for check IMEI and check IMEI early for multiple auth variations, as
well as variants where the HLR would respond with NOK or ERR.

Note that we can safely set "check-imei-rqd 0" in f_init(), because the
latest OsmoMSC version already suppors this VTY command.

Two tests do not always pass, sometimes the RAN connection breaks
before the test finishes (TC_lu_imsi_auth_tmsi_check_imei_err and
TC_lu_imsi_auth_tmsi_check_imei_nack). I have added them as expected
errors in the expected-results.xml.

Related: OS#2542
Change-Id: Ic34bb8dc8547cafb5a53df03884554dd4f72956d
2019-07-12 06:05:39 +00:00
Pau Espin c6b78ff2f9 Add and set transport field for RanOps structure
This will allow RAN_Emulation to have better knowledge on the protocol
stack in use, and behave differently based on that information.
For intance, forthcoming commit will append OsmuxSupport IE only if
transport is BSSAP AoIP.

Change-Id: Ife62e328af2d3f2475ff93249f2138820c7ddabb
2019-06-06 17:06:29 +02:00
Pau Espin f8034480a0 msc: Fix Iu tests timing out due to explicit CM ServiceAccept not recvd
Even if ciphering it not enabled, osmo-msc still sends a
SecurityModeCommand to use IntegrityProtection, and as a result osmo-msc
assumes implicit ACCEPT in all UTRAN CM service requests.

Fixes: OS#3991
Change-Id: Ida91f907dd6dfae68cbc63752ddc6f2948792689
2019-06-03 14:04:50 +00:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +00:00
Pau Espin a65697dba0 msc: Introduce Osmux infra and one test for osmo-msc
Change-Id: Ibcb82d1a2d570c6c0ad0c3b6504bffe2244eccd9
2019-05-27 09:56:51 +00:00
Pau Espin c6a53dbb2a bsc: Introduce Osmux infra and one test for osmo-bsc
Test verifies once osmux is enabled in osmo-bsc, BSSMAP RESET (ACK)
contains Osmux Support IE and that it correctly handles BSSMAP ASsign
Req with Osmux CID.

Related: OS#2551
Depends: osmo-bsc 6de754cdde5319af3059d8fc6abf85037ec7eacc
Depends: titan.ProtocolModules.BSSMAP Iaf1e137269c0da20b2c96fd104b57edf336693af
Change-Id: If69c716dc06d61d810c32d1720a237c7535baca8
2019-05-27 09:56:51 +00:00
Stefan Sperling a2d59c6e6e add three tests for CIPHER MODE COMPLETE without algo
Add three tests which exercise MSC behaviour when a CIPHER MODE
COMPLETE command lacks the optional chosenEncryptionAlgorithm IE.
Check for behaviour with A5/1, A5/3, and A5/1 + A5/3 configured
in the network, and expect the location update to succeed.

These tests pass on master, but they should somehow verify the
cipher the MSC ends up using. I am not quite sure how to do that.
Would inspecting the MSC's VTY be a reasonable approach? How
could his be done by code which runs on BSC_ConnectionHandler?

Change-Id: I1a2a126795c544613a7a87e238e1fc8c4e943885
Related: OS#2872
2019-05-11 12:26:49 +02:00
Harald Welte a183a5ddc2 msc: Separate as_GSUP_SAI from f_mm_auth
In some cases we might want to match on (and perform) the GSUP
SEND AUTH INFO without also expecting/performing a MM authentication
on the Iu/A interface.  Hence it makes sense to split those two.

Change-Id: I7b298d589930bab976b478ac84553a6352f25c93
2019-05-11 12:26:49 +02:00
Harald Welte 62113fce7a msc: Don't require protocolExtensions in RANAP Paging
We were using '?' for the protocolExtensions in RANAP messages,
which required that such extensions existed.  In reality, we want
to use '*' which accepts paging messages whether or not there
are any protocolExtensions present.  As this is the default in
all our RANAP receive template, callers don't even need to specify
it.

This should fix all Iu paging related test failures in MSC_Tests*.ttcn

Change-Id: If22e16ecb301c86b9073ffde0af9e03bc85fbcc7
2019-05-09 13:04:02 +02:00
Neels Hofmeyr 0ac6315212 msc: add inter-BSC and inter-MSC Handover tests
Change-Id: I7d76c982ad4e198534fa488609c41e8892b268ab
2019-05-09 00:55:11 +02:00
Neels Hofmeyr 2ca1ab492a msc: mo and mt voice call tests: add lots of missing parts
Both f_mo_call_establish() and f_mt_call_establish() were testing barely half a
voice call setup.  For example, f_mo_call_establish() used to be satisfied with
just two CRCX, but no actual RTP connections being made.

Add numerous MNCC and MGCP messages more closely resembling an actual call.

The main reason is to achieve a state that passes both current osmo-msc master
as well as the upcoming inter-MSC Handover refactoring.

Add log markers to f_*_call_*(): often when a test halts, it is not at all
clear why. With these log markers it is saner to figure out what has happened
and what hasn't.

Change-Id: I162985045bb5e129977a3a797b656e30220990df
2019-05-07 01:20:09 +02:00
Harald Welte 475a2c1d2c move as_iu_release_compl_disc from BSC_ConnHdlr to RAN_Emulation
... this way other tests beyond MSC_Tests.ttcn can use it.

Change-Id: If6d4bbbd09c6261bd665aa66e0d4d027aeaa4d16
2019-05-02 19:11:14 +02:00
Harald Welte 07d99c8e7b move imsi_hex2oct to Osmocom_Types.ttcn
This function is required not only for the MSC_Tests, but also for
the upcoming Iu related SGSN tests

Change-Id: Ic23669671ce79151046f2330726bb68542faeb0e
2019-05-02 18:35:43 +02:00
Harald Welte e13cfb2d22 msc: Add Iu related tests for most existing 2G tests
This might look a bit like copy+paste programming for our testcases.

However, we actually want the Iu related tests show up as separate
'testscase' in the TTCN-3 sense, so there's no way that's more elegant
than this :/

Change-Id: I3b56e17487c9df839e67ed390a1ff89979683e8e
2019-04-30 22:36:01 +02:00
Harald Welte dceacc77e7 msc: Introduce f_cl3_or_initial_ue as replacement for f_bssap_compl_l3()
The new function will check the RAN type and dispath to
f_bssap_compl_l3() in case of 2G/GERAN and to f_ranap_initial_ue()
on case of 3G/UTRAN.

Change-Id: Ia27afa265d441d1a0cbb40cc2d938aff46fa25f9
2019-04-30 19:07:47 +02:00
Harald Welte 9b751a6575 msc: Add RANAP to msc tests
Integrate RANAP to MSC_Tests.ttcn

Related: OS#2856
Change-Id: Idfa54b7607ad6e7016ed9411b0cc5330c901ea34
2019-04-30 19:07:47 +02:00
Harald Welte 2fce7887f4 RAN_Emulation: Modularize protocol support
The RAN_Emulation currently unconditionally provides BSSAP and MGCP support.
Let's re-structure the code so that support for those protocols is now
possible to enable/disable at compile time.

This patch is in preparation of introducing RANAP support in RAN_Emulation.

Change-Id: Id53ba3ff05f9946230e0e4a759245de14a0f9fbd
Related: OS#2856
2019-04-25 20:07:11 +00:00
Harald Welte c1f937a15b msc: f_mm_auth(): Add support for UMTS AKA
Change-Id: Id57adcebd63a06cfa555824e493561fe08f13d6d
2019-04-25 20:06:50 +00:00
Harald Welte f9abf8d26c MSC_Tests: Allow test cases to specify RAN index
This allows to start ConnHdlr on specific RAN connections, i.e.
on different emulated BSCs (and soon RNCs).

Change-Id: I3d7ec567a7b69d8c6f79d26971bf1c94e077d5f5
2019-04-21 17:44:59 +02:00
Harald Welte a89fecf08c f_perform_lu(): Use f_expect_clear(), reduce code duplication
Change-Id: I64b183ad6615f2b0b9565a711de87fe4249625a1
2019-04-21 17:44:59 +02:00
Harald Welte e035e3e182 Add f_expect_paging() rather than using tr_BSSMAP_Paging directly
this will ease the introduction of RANAP support

Change-Id: I213303337373c349676be4f8ac4175acdc701e47
2019-04-21 17:44:59 +02:00
Harald Welte 6811d10af7 Rename BSSMAP_Emulation -> RAN_Emulation
So far, BSSMAP_Emulation supported only a transport over BSSMAP.
However, we soon intend to merge support for RANAP in order to
simulate RANAP/Iu connections as well as BSSMAP.  Let's start
by renaming some of the existing types/functions/ports/modules
without introducing any functional changes just yet.

Related: OS#2857, OS#2856
Change-Id: Iecbcb0c6c136baad9460eca40606bb4010d8882d
2019-04-21 17:44:59 +02:00
Harald Welte 408a7ef9fc BSC_ConnectionHandler: Define SDP template for CN-side CRCX
Change-Id: I90546249c41de8f99ce4a558e76cb46597413518
2019-04-21 17:44:59 +02:00
Philipp Maier c09a13116a MSC_Tests: allow disabeling GSUP
The GSUP link between testsuit and osmo-msc is currently on by default
and can not be disabled. However, there may be situations where a
missing GSUP connection must be simulated. Lets add add a parameter to
disable GSUP if necessary.

Change-Id: I7c86aa0a906a0d7e8be765f9109a65b4b4387bc6
Related: OS#3859
2019-04-09 16:05:26 +02:00
Neels Hofmeyr 59e0c6f764 msc: for mo and mt call, interleave MGCP and Assignment
Upcoming osmo-msc changes move away from the current ordering of MGCP and
Assignment messages. Allow these async dialogs to appear in any order.

Change-Id: Ia06af1e347601949f4ddb19f963daa400766d9e7
2019-03-17 14:39:58 +00:00
Neels Hofmeyr 82fd04b13b msc: add codec to all Assignment Complete messages
So far we omit a Speech Codec (Chosen) from Assignment Complete messages, which
is actually a mandatory parameter. osmo-msc seems to carry on nevertheless, but
it actually shouldn't be able to.

Always send a Speech Codec (Chosen).

Change-Id: Ib35f019383db8ace05a9dc349648e2da7ba58bfa
2019-03-14 03:43:52 +00:00