Commit Graph

232 Commits

Author SHA1 Message Date
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 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 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
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
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
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
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 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
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 97dc91f14f msc: f_mt_call_initiate: fix typo
Change-Id: Idfa381a036efcc21044700d069db434150fcaadf
2023-06-19 13:09:11 +00: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
Neels Hofmeyr e81ef42d05 msc: f_tc_mt_t310: detect MNCC failure explicitly
Helped me find a failure cause: instead of T_guard timeout, immediately
show an unexpected MNCC event.

Related: SYS#5066
Change-Id: I49a15142a4b6c51ca767a884c0574f96e01d7cb1
2022-08-12 02:30:54 +00:00
Neels Hofmeyr d8a4aee1c6 msc: f_tc_mt_t310: allow CRCX in either order
continued from Id0c98bc267daff352fc7db7712f967111970fd4d

Upcoming changes to osmo-msc move the CN side CRCX to an earlier point
in time, reversing that order. Introduce an 'interleave' to not care
about the ordering of MGCP and BSSAP messages.

Related: SYS#5066
Related: Ie433db1ba0c46d4b97538a969233c155cefac21c (osmo-msc)
Change-Id: I0ec348df08aa49ed58b3465de51b259fb74c0aea
2022-08-12 02:30:54 +00:00
Neels Hofmeyr 02d513efd8 msc: call: allow using MGW conn IPs in either order
So far, the first CRCX dispatched by osmo-msc is used for the RAN side,
and the second one for the CN side. Upcoming changes to osmo-msc move
the CN side CRCX to an earlier point in time, reversing that order.

Allow both RTP addresses from the two MGCP CRCX OK to appear in the
Assignment Request message to RAN, so that the test succeeds for both
the current osmo-msc and the upcoming patch (see below).

Related: SYS#5066
Related: Ie433db1ba0c46d4b97538a969233c155cefac21c (osmo-msc)
Change-Id: Id0c98bc267daff352fc7db7712f967111970fd4d
2022-08-07 15:48:17 +02:00
Vadim Yanitskiy c5fcb89b8d MSC_Tests: SpeechCodecList IE shall be present in BSSMAP HandoverRequest
According to [1], 3GPP TS 48.008 does indicate that on AoIP the MSC
Preferred Codec List IE shall be present in BSSMAP HandoverRequest.
Let's verify that the IUT actually includes this IE.

Change-Id: I2e0ecbcced9f94d2b44d981db353007cad3ae959
Related: osmo-bsc.git I117cc29d6d11db77d160de654f43f5993db6ee21
Related: OS#5529
2022-08-05 17:38:43 +00:00
Eric Wild 85cc161c0d msc tests: fix test so they don't depend on previous test runs
The test currently implicitly check the vlr state left by preceding tests.

Change-Id: Iebaecd28a426b15baf4729f40b46dd33da79cbae
2022-05-24 08:32:45 +00:00
Neels Hofmeyr 07ea7f26be msc: add test for OS#5532: crash from CM Serv Rej
Reproduce the assertion trigger crashing osmo-msc reported in OS#5532,
i.e. a CM Service Request that contains a mismatching Mobile Identity.

Causes osmo-msc to crash with an assertion, so run it last.
Fix of the crash: I6c735b79b67108bcaadada3f01c7046e262f939b

Related: OS#5532
Depends: I6c735b79b67108bcaadada3f01c7046e262f939b (osmo-msc)
Change-Id: I3f84d00f456aaee578787059d7010c25efcdcf56
2022-05-05 01:45:57 +02:00
Eric Wild 49888a65dc ran emulation: allow multiple reset attempts
bsc-nat introduces a delay that will lead to failed tests, since the
reset attempt happens too early and times out, and the tests do not
retry.

Change-Id: I9f6db2a24e984eef31e76f9d42a80eb6a1bb6928
2022-03-31 17:49:10 +00:00
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