Commit Graph

355 Commits

Author SHA1 Message Date
Vadim Yanitskiy f4ba2252de msc: expect TC_attached_imsi_lu_unknown_tmsi to pass
The "VLR evil twin" problem has been fixed in osmo-msc.git:

https://gerrit.osmocom.org/c/osmo-msc/+/36452
https://cgit.osmocom.org/osmo-msc/commit/?id=2fd69e15d36d5a8e87029741ad66632c57d24cd4

And the testcase is finally passing now.

Change-Id: I57a277fa7e6e0d10ff38e23f416ace87472e6602
Related: OS#4721
2024-04-15 15:18:28 +00:00
Neels Hofmeyr 06dec6b324 msc: expand TC_lu_tmsi_noauth_notmsi
From running this test repeatedly, I noticed that osmo-msc's new patch
to avoid storing a TMSI may also trigger more evil twin situations in
the VLR as described in OS#4721.

Always run this test twice, to probe for the evil twin problem.

This test will pass from osmo-msc patch
Ifdabe0b65bffafbf7b8e5cc10e2d225d1ed1cecd on.

Depends: osmo-msc Ifdabe0b65bffafbf7b8e5cc10e2d225d1ed1cecd
Related: SYS#6860 OS#4721
Change-Id: I5e596597add7d585efd27c850067b8d7ba34ecc0
2024-04-15 15:18:28 +00:00
Neels Hofmeyr a8a2c5e5f6 msc: add TC_lu_tmsi_noauth_notmsi
Add test case for handling a LU by TMSI MI when 'no assign-tmsi' is
configured.

This test will pass from osmo-msc patch
I583682d1a35a70b008d7bb2d89ba7c3109a60b21 on

Depends: osmo-msc I583682d1a35a70b008d7bb2d89ba7c3109a60b21
Related: SYS#6860 OS#4721
Change-Id: If10b9987395670b084ff8ad6d1f033ff46896d75
2024-04-15 15:18:28 +00:00
Neels Hofmeyr 392de2d5c5 msc: add mi arg to f_perform_lu()
Allow testing Location Updating by TMSI MI.

Prepares for TC_lu_tmsi_noauth_notmsi in
If10b9987395670b084ff8ad6d1f033ff46896d75

Change-Id: I31aad8eb751528f7237a892702e87ee5855cabbb
2024-04-15 15:18:28 +00:00
Neels Hofmeyr a250d7e962 msc: allow f_verify_vty_lac_ci() to pass for CompL3 by TMSI MI
Obviously, when only a TMSI has been used, searching for an IMSI will
return no subscriber. Don't fail in that case when testing for
verify_vlr := false.

Prepares TC_lu_tmsi_noauth_notmsi in
If10b9987395670b084ff8ad6d1f033ff46896d75

Related: SYS#6860 OS#4721
Change-Id: I4d719928f04e5a47d415c38f835451b1f10c713d
2024-04-15 15:18:28 +00:00
Vadim Yanitskiy 53f2be6b4e msc: derive altsteps from f_expect_paging() and use them
Change-Id: Ia0e787fc376acec09e8985a63862872eb89b53a4
2024-04-15 15:18:28 +00:00
Vadim Yanitskiy eb81ca46dc msc: rework f_expect_paging(): handle mismatch and timeout
When a received Paging mismatches, instead of waiting for Tguard
timeout, fail immediately.  Add a local timer and wait 4.0 seconds
by default.

Change-Id: I30273e3882e348a2ded88b7b96a5ec1473a56913
Tweaked-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
2024-04-15 15:18:28 +00:00
Neels Hofmeyr 1af4b0f625 msc: f_expect_paging(): fix by_tmsi arg
The by_tmsi argument so far had no effect. But I actually need exactly
this in upcoming MSC_Tests.TC_lu_tmsi_noauth_notmsi(): expect a Paging
with explicitly no TMSI included.

Related: SYS#6860 OS#4721
Change-Id: I9434745b7faeb738caafed8080b9f7b1a6a8079a
2024-04-15 15:18:28 +00:00
Vadim Yanitskiy 3c88c35912 msc: fix race condition in TC_mm_id_resp_no_identity
This testcase is failing sporadically ever since it was introduced
back in 2019, during 36C3.  The problem is that osmo-msc does not
react to the malformed MM IDENTITY RESPONSE immediately, but only
after timeout of timer X1 (5 seconds, by default);  while the
testsuite expects the LU REJECT to be received within 5 seconds.

We should ideally fix osmo-msc to react immediately, but for now
let's enlarge the LU REJECT waiting timeout in the testcase.

Change-Id: I5d2b5d49df8f7ae1eb12fc137f4256fe6fab9117
Related: OS#6426, OS#4340
2024-04-03 07:53:27 +00:00
Vadim Yanitskiy 4a011fa0db msc: use as_expect_clear() in f_tc_mt_t310()
This testcase is not Iu-compatible yet, but let's make life a bit
easier for those trying to make it such in the future.

Change-Id: I8185153502d31163fcb4c718690ee0f1cc912f5b
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy b3e42cfcdc msc: fix f_tc_mt_crcx_ran_reject(): properly handle Iu-ReleaseCommand
Previous commit [1] uncovers a problem in f_tc_mt_crcx_ran_reject():
this function uses as_clear_cmd_compl_disc(), which is expecting
A-interface (GERAN) specific BSSMAP Clear Command.  The Iu-interface
(UTRAN) specific RANAP Iu-ReleaseCommand is not handled at all.

The testcase was passing so far due to a bug in as_optional_cc_rel(),
which would unblock the alt-statemtnt on receipt of CC RELEASE, so
that we would never respond to RANAP Iu-ReleaseCommand.

Let's derive a new altstep from f_expect_clear() and use it.

Change-Id: Idd679bbf720a56a76cf37ab414b1e6d90e53278b
Related: [1] I0143b4d33b1ebe4cce99c09018540524c4626eec
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy 7093a5d9a2 msc: as_{iu_release,clear_cmd}_compl_disc: remove no-op timer arguments
Change-Id: I1d3dcf4399dccd353702e4d6c53fe8e26e16ea9b
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy d1a32e09ac msc: fix missing 'repeat' in as_optional_cc_rel()
We do activate() this altstep in several testcases, so that it's
kinda "running in background".  In reality, the defaults in TTCN-3
are just a syntax suggar, and the following code:

```
var default foo := activate(as_foo_bar());
alt {
[] PORT1.receive(tr_Msg1) { repeat; }
[] PORT1.receive(tr_Msg2) { setverdict(pass); }
}
PORT2.receive(tr_Msg3);
```

actually evaluates to:

```
alt {
[] PORT1.receive(tr_Msg1) { repeat; }
[] PORT1.receive(tr_Msg2) { setverdict(pass); }
[] as_foo_bar();
}

alt {
[] PORT2.receive(tr_Msg3);
[] as_foo_bar();
}
```

If as_foo_bar() contains no 'repeat' statement, then whenever it
triggers it would efficiently cancel (unblock) the current alt
statement, resulting in weird behavior due to messages not being
dequeued from ports as expected.  And this is exactly what we
saw happening in OS#6414.

Change-Id: I0143b4d33b1ebe4cce99c09018540524c4626eec
Related: OS#6414
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy 42fae8aed4 msc: cosmetic: fix formatting in altsteps
Change-Id: I14afa9aa076396d48043000e350885384bde4c81
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy 5f1018f954 msc: fix f_tc_ho_inter_bsc0(): properly patch n_sd
Assuming n_sd should be 3 is only valid for non-A5 testcases, in which
we are *not* doing ciphering and authentication.  For the A5 testcases
(TC_ho_inter_bsc_a5_*), this assumption is incorrect and osmo-msc is
definitely not happy about that:

  Duplicate DTAP: bin=0, expected n_sd == 0, got 3 (ran_msg.c:159)
  Dropping duplicate message ... (msc_a.c:1363)

Why and how the A5 testcases passed so far?  It was a pure luck, which
sailed away when we started executing ttcn3-msc-test with io_uring.

The A5 testcases were passing thanks to the as_optional_cc_rel() that
gets activate()d in background before calling f_call_hangup().  This
altstep does not have the 'repeat' statement, and as a side effect it
may cancel any normal alt-statements and even standalone receive()
statements.

In the successful scenario, it would cancel (unblock) the following
receive operation in f_call_hangup():

  MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref));
  log("f_call_hangup 2: rx MNCC REL ind");
  BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id)));
  // ^^^^^^^^^^ as_optional_cc_rel() triggers here and cancels this one

which is a pure luck because our CC RELEASE was sent with incorrect
sequence number and got dropped, so osmo-msc would never send us
CC RELEASE COMPLETE.  It would instead send us CC RELEASE due to
expire of T306, and the as_optional_cc_rel() would kick in handling
this message and responding with CC RELEASE COMPLETE.

In the failing scenario though (when running with io_uring), that
same altstep running in backround may trigger *earlier* and unblock
another standalone receive() statement:

  MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref));
  // ^^^^^^^^^ as_optional_cc_rel() triggers here and cancels this one
  log("f_call_hangup 2: rx MNCC REL ind");
  BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id)));

so that we will be stuck waiting for CC RELEASE COMPLETE until the
Tguard expires.

This patch fixes n_sd patching, so that our CC RELEASE message is
handled properly and the call gets released as expected, without
requiring as_optional_cc_rel() to kick in.  The missing 'repeat'
is to be added to as_optional_cc_rel() in a follow-up patch.

Change-Id: Iddde391eade716ca5c6c48cb631450ddb543e0d4
Related: OS#6414
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy 33f9eea8af msc: osmo-msc.cfg: move MGW params to 'mgw' node
This fixes deprecation warnings printed by recent osmo-msc.

Change-Id: I724ec44ea37bb61b457361befee3e6e92c886c0d
Related: osmo-mgw.git I95f717a0fcd3c4ca622e3989baa28fac1f7ec1ca
2024-03-25 17:35:32 +00:00
Pau Espin 1158cc629c Move SDP templates to its own SDP_Templates.ttcn file
SDP is used in other protocols than MGCP, eg. SIP.

Change-Id: I0610b4cf5533e46a3401c65e60c7cce975c85412
2024-03-22 11:28:51 +01:00
Vadim Yanitskiy 5cefd81a0b msc/expected-results.xml: add missing testcases
Change-Id: I1604bb955707d0e44bfd08ecd3a28a936731c166
2024-03-01 08:03:59 +00:00
Vadim Yanitskiy 4199a701c3 msc/MSC_Tests.cfg: remove commented out testcase list
Change-Id: I573b55e235ebb093b1166c1fe78feaa4f296ce8c
2024-02-28 15:30:10 +07:00
Pau Espin ce1d3cb08c gsup: Add PCO IE
This commit adds a new file PCO_Types.ttcn which allows generically
encoding decoding PCOs.

Change-Id: I9a1ae74712d6e8e0cd524ccd7fc2529b1a15dd97
2024-02-21 20:00:24 +01:00
Pau Espin 8f1403a471 Move templates from GSUP_Types.ttcn to GSUP_Templates.ttcn
Follow similar structure that we have for other protocols.

Change-Id: I54cc8c99d1e91d57c3d5a92f6529ef2055e9d4ed
2024-01-18 20:22:34 +01:00
Andreas Eversberg a8aa16e1eb ASCI: Correctly confirm talker, so originator can be identified
Fix the issue that MSC rejects call termination, because talker can't
be identified as originator of the call.

Fixes: OS#6325
Change-Id: I0381e25e15624e6b7577910c95700a355ed3f811
2024-01-10 16:06:13 +00:00
Vadim Yanitskiy 5389e3a625 library/GSUP_Types: add Source Name IE to receive templates for SMS
Old osmo-msc versions do not include the Source Name IE in SMS related
GSUP messages, unless it's set explicitly in the config file ('hlr' /
'ipa-name').  Recent osmo-msc versions (see the related osmo-msc patch)
do include this IE even if it's not set explicitly ('unnamed-MSC').

Because of this, some testcases in ttcn3-msc-test are currently
failing for osmo-msc master, but still passing for the -latest.

Let's set the 'ipa-name' explicitly in osmo-msc.cfg, and expect the
Source Name IE to be present in SMS related receive templates.

Change-Id: Ic24d3082fe3dce08e43e8f3ecb6d6132503c55c6
Related: docker-playground.git I7757aae1d01b679f530b5c0a6c95b224cb9f204f
Related: osmo-msc.git I7bacd001b81326c32bc262c7d0c0491ded822fa8
Related: OS#6135
2024-01-09 19:34:49 +07:00
Vadim Yanitskiy 286b042b53 MSC_Tests: indicate the failure reason in setverdict()
... so that there is no need to check logs to see why a test failed.

Change-Id: I159bc54f6f4561d42aeabe825e16fa77e60c2dae
2024-01-09 18:11:27 +07:00
Andreas Eversberg 1733de3393 ASCI: Add tests for voice group/broadcast calls at MSC
Related: OS#4854
Change-Id: I4bbe739ea55ecf9f7ebf9ee413df69f29aa642f8
2023-08-30 09:18:55 +00:00
Oliver Smith caa36c958d msc: TC_ho_inter_msc_out_csd: new test
Related: OS#4394
Change-Id: Id45a634888776265a88d607080b951a2cc33820d
2023-08-25 13:18:45 +00:00
Oliver Smith be922911d7 Cosmetic: msc: f_tc_ho_inter_msc_out: fix indent
Change-Id: Ie648a485991aff0c28182955a7df2d1505457978
2023-08-25 13:18:45 +00:00
Oliver Smith 44424db278 msc: TC_ho_inter_bsc_csd: new test
Related: OS#4394
Change-Id: I391856282d046e915c374e0efb06d4da870bff1f
2023-08-25 13:18:45 +00:00
Oliver Smith c4a0c3c2df msc: add helper func f_set_cpars_csd()
Prepare to add new CSD related tests that also need to configure the
call parameters for CSD.

Related: OS#4394
Change-Id: I49c29af736cc37c393cecde4c45c4ffd41322bf7
2023-08-25 09:34:22 +00:00
Oliver Smith 90f31bbd4b msc/BSC_Conn…: ass req/compl: check/use CSD codec
Verify that the MSC sends the CSData codec in the Assignment Request and
send this codec in the Assignment Complete towards the MSC.

Related: OS#4394
Change-Id: I7906e6fdb82c27f071aa55f2f73ba4108bfb46db
2023-08-25 09:34:22 +00:00
Andreas Eversberg 5ada75dd89 ASCI: Add GCC and BCC service requests to BSC_ConnectionHandler.ttcn
Related: OS#4854
Change-Id: Ic4875fde45dfc8d6928a48c0f6edc91d994bfa97
2023-07-28 15:15:51 +02:00
Andreas Eversberg e5a6ef1d31 ASCI: Rename handoverRequest to n_connect in RAN_Emulation.ttcnpp
The expectation table is used to deliver new connections with Handover
Request as well as with VGCS/VBS Setup and VGCS/VBS Assignment Request.
"handoverRequest" is renamed to "n_connect".

Related: OS#4854
Change-Id: I941c5db5235785841f3368ef908a409bbb12150e
2023-07-28 15:14:48 +02:00
Oliver Smith 98e24bcfa8 msc: TC_lu_and_mt/mo_csd: reduce call open time
Related: OS#4394
Change-Id: Ie733028f7953d5d9fa1907efdb19485dee93ece9
2023-07-18 09:33:52 +00:00
Oliver Smith 9c417f2066 msc: TC_lu_and_mo_csd: test multiple bearer services
Related: OS#4394
Change-Id: I74f983e1f5c0fef61018a9a5b92ed3b3cdbdfb5f
2023-07-18 09:33:52 +00:00
Oliver Smith 6f546a9a90 msc: f_call_hangup: add missing rx MNCC_REL_cnf
Add the missing rx of MNCC_REL_cnf to f_call_hangup for the MO case
(called with release_by_ms = false, see f_mo_call()).

This is in preparation for running f_mo_call several times in a row to
test multiple bearer services in a CSD test (follow up patch). Without
this patch, calling f_mo_call_establish() for the second time fails to
rx the MNCC_RTP_CREATE because the REL cnf is still in the port. This
leads to a timeout of X2 and OsmoMSC sending a CC RELEASE.

Adjust the log numbers next to f_call_hangup to re-use numbers 2 and 3
from above, as only one of the two code paths gets executed (similar to
numbers 5 and 6 below).

Related: OS#4394
Change-Id: Ia2ed7ce092e73e17c4243e83bfd239ead8266b49
2023-07-18 09:33:52 +00:00
Oliver Smith 8cf75abec9 msc: TC_lu_and_mt_csd: test multiple bearer services
Related: OS#4394
Depends: osmo-msc I7297cc481fbe36355b5231ca800cf566a1ee93c0
Change-Id: Idf6502c826a441b8dd18257c85f9a3323883825e
2023-07-18 09:33:52 +00:00
Pau Espin 578fa193ae */osmo-stp.cfg: Explicitly define role & sctp-role
It was recently decided it's a good practice to always specify the role
 and sctp-role for all ASPs configured in the VTY, since it's an
 important configuration providing feedback on the network setup
 expectancies.

Change-Id: If48ca06f2cc3c0986daa5f6264d80138d468332a
2023-07-11 11:48:41 +00:00
Oliver Smith 3a33e5595b msc/BSC_ConnHdlr: f_mt_call: unregister IMSI
Fix the missing call to f_ran_unregister_imsi when running f_mt_call.

This is in preparation for calling f_mt_call multiple times during one
test, to test various CSD bearer services. Without this patch, it will
result in a "No space left in ImsiTable" error.

I've also considered adding it to f_call_hangup instead, but this gets
called by f_mo_call (mo instead of mt) as well, which does not run
f_ran_register_imsi.

Related: OS#4394
Change-Id: Ie9b180b95348d7e84650c14a331c5091a1e67d1f
2023-07-09 07:53:30 +00:00
Oliver Smith f89620db26 msc: BSC_ConnectionHandler: fix cpars.csd
Fix for:
BSC_ConnectionHandler.ttcn:1546 Dynamic test case error: Using the value of an unbound boolean variable.

Fixes: 92b280c8 ("msc: new test: TC_lu_and_mo_csd")
Change-Id: I733db4dbc3ba3dd52ba501901b8b0ed36ff13344
2023-06-21 18:21:25 +02:00
Oliver Smith c1dd36a71b msc: new test: TC_lu_and_mt_csd
Related: OS#4394
Change-Id: Ie1701546e3dc18a5b0da4608b44a580237c979a6
2023-06-20 13:20:19 +00:00
Oliver Smith 92b280c8a6 msc: new test: TC_lu_and_mo_csd
Related: OS#4394
Depends: https://gitlab.eclipse.org/eclipse/titan/titan.ProtocolModules.MobileL3_v13.4.0/-/merge_requests/3
Change-Id: Ia863a63a318a9b0a8b4bfc1dc425cbc0235256b3
2023-06-20 13:20:19 +00:00
Oliver Smith d6c90065c4 msc: f_mo_call_establish: improve AoIP IE check
Check if the AoIP Transport Layer IE is present before checking its
value. This gives a more meaningful error than Dynamic Testcase Error if
it is not present.

Change-Id: I52fc829b017848b6afe7e637f1911a0976f9c91d
2023-06-20 07:51:42 +00:00
Oliver Smith 97dc91f14f msc: f_mt_call_initiate: fix typo
Change-Id: Idfa381a036efcc21044700d069db434150fcaadf
2023-06-19 13:09:11 +00:00
Pau Espin 56fafdd3a6 Explicitly configure ASPs asp-clnt-* as role=asp & sctp-role=client
Until recently, the asp-clnt-* ASPs, which have specific handling in osmo_sccp_simple_client_on_ss7_id(),
were being always forcedly set to sctp-role CLIENT by code in that
function.
This prevented user of that API from explicitly configuring the ASP as
"sctp-role server" through the VTY as the option would be overwritten silently.

Now, the sctp-role from config is followed if the ASP is
defined/configured through the VTY (not dynamically created at the time
osmo_sccp_simple_client_on_ss7_id() is called).

Since the default for a VTY-specified ASP is to be in "sctp-role
server", the config files need to be updated to properly configure the
ASP to be in "sctp-role client", which is the desired mode here.

Same applies for "role", where the default is SG but it is actually used
as "ASP" here.

Change-Id: I4eb5b5f6b4b24df079b4c74e2a2e2ebb8769b0bd
2023-06-08 18:41:32 +02:00
Neels Hofmeyr c47ce855c1 msc: detect RTP to CN failure in call tests
When CN RTP is missing, the X2 timer will fire after all other call
signalling looks successful. So far we establish an MT call, wait three
seconds and directly disconnect, long before X2 or X2427 can fire.

Make X2 shorter. (By means of f_vty_config() from ttcn, so that we don't
need to edit various osmo-msc.cfg in various repositories. The short
timer is always critical for the test to be accurate.)

Add proper function to detect premature disconnect. Otherwise we just
get a cryptic message like "Couldn't find MnccExpect for incoming call"
because of MNCC messaging after the unexpected release event.

Change-Id: I3ccf541360cc8440e664f0e29494b9ce7b6f8943
2023-03-14 20:19:48 +00:00
Neels Hofmeyr 0560615125 msc: TC_mt_t310: avoid sporadic failure from X2 timeout
Change-Id: Ic23cbca5775031dcb0ea1744454e20cda090701c
2023-03-14 20:19:48 +00:00
Neels Hofmeyr 3ad76a406c msc: CC Re-Est: allow MNCC_RTP_CREATE upon Assgmt
In f_tc_call_re_establishment_2(), after Assignment Complete, optionally
allow an MNCC_RTP_CREATE.

When Re-Establishing a call, the Assignment Complete usually affects
codec and RTP address, so an MNCC_RTP_CREATE should happen after the
Assignment Complete message.

Current osmo-msc master does not send this MNCC_RTP_CREATE. This is
unlikely to be correct (would be ok if no RTP port changes), likely
omitted due to a bug.

An upcoming patch adds the MNCC_RTP_CREATE in Call Re-Establishment to
osmo-msc.

Related: Ie433db1ba0c46d4b97538a969233c155cefac21c (osmo-msc)
Change-Id: I06d19947ba2e9b6696269db0e4f3d47d4b98bde6
2023-03-14 20:17:37 +00:00
Neels Hofmeyr c29e6dcdf4 msc: TC_mt_t310: fix an interleave
the MNCC.receive doesn't depend on the MGCP really.

Change-Id: If29e755c2c061836ce2ba472e44a621eadba4fc6
2023-03-14 20:17:37 +00:00
Neels Hofmeyr 13eeb55442 msc fix log typo
Change-Id: Id6767c5e7f00ad7e44c569dcba1a56e2717d2e1a
2023-03-14 20:17:37 +00:00
Neels Hofmeyr e860fc49d9 msc: test auth options, and fall-back to no-auth
Test 12 permutations of
(auth optional,required) x (a5 '0', '0 3', '3') x (hlr has auth info)

In TC_auth_options_2(), expect behavior after implementing OS#4830: if
the HLR fails to return auth info and auth + ciph are configured
optional, fall back to no authentication. This test will start
succeeding starting with commit
I5feda196fa481dd8a46b0e4721c64b7c6600f0d1 in osmo-msc.git.

All other tests yield the current behavior of osmo-msc.

Related: I5feda196fa481dd8a46b0e4721c64b7c6600f0d1 (osmo-msc)
Related: OS#4830
Change-Id: I8e3b02ca83e56ef5349d85f08407509e19fa353c
2022-10-26 15:35:12 +00:00