Commit Graph

702 Commits

Author SHA1 Message Date
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
Harald Welte 556e4d2dbc various: update expected-results.xml
Change-Id: I21052636bf892e5da86ef736d16035ec324aedbe
2024-03-04 19:09:58 +00:00
Neels Hofmeyr 8f4db54e95 bsc: tests recovery from BORKEN after release failed
Related: osmo-bsc Ic4728b3efe843ea63e2a0b54b1ea8a925347484a
Related: SYS#6655
Change-Id: I9b4ddfc4a337808d9d5ec538c25fd390b1b2530f
2023-11-30 02:33:11 +00:00
Oliver Smith 7bb63cf0a8 library: deduplicate f_logp
Change-Id: Ie84a8a75e9f162fcbef0d07d0bc75e47a5303fa3
2023-10-23 09:10:33 +00:00
Pau Espin 577688be97 bsc: Start MGCP transaction ID sequence based on media_nr
This allows different MscConnHandlers to concurrently submit MGCP
messages with unique transaction ID through the shared MGCP-over-IPA
multiplex BSC<->MSC.

Without this, 2 MscConnHandlers would both send a
CRCX using trans_id=0, and the ConnectionTable in RAN_Emulation.cpp
would lookup and return the first MscConnHandler in the table during the
2nd CRCX ACK which was targeted at the second MscConnHandler.

Change-Id: Icb09d67a1f0207dc8501dd2b47c9162175b691b1
2023-10-02 09:40:57 +00:00
Pau Espin b522e1cadb bsc: Use different CIC in concurrent calls from same MSC
The MSC (our TTCN3 emulation) expects to assign unique CIC for each
concurrent call, so that the BSC can properly differentiate and do the
proper connection setup.

Change-Id: Iac09590693bf39ccc90bf2b0645ca672a4787c95
2023-10-02 09:40:57 +00:00
Oliver Smith 45a6dd39fc bsc: add test TC_si2_ncc_permitted
Related: SYS#6579
Change-Id: Ibff5c4392d8c19b5bce479b6fa5e33086cdb1272
2023-09-28 17:01:52 +00:00
Vadim Yanitskiy 02c086f403 BSC_Tests: drop f_osmo_repo_is() check in TC_assignment_csd
Change-Id: I38093d8ff4db9a726e8494161d0074d4b881054f
2023-09-22 12:20:10 +00:00
Andreas Eversberg 9ff96e68ff BSC_Tests: Fix test case TC_err_84_unknown
The test cases used UPLINK RELEASE message as test for an unspported
message. This message is supported and does not trigger the expected RR
STATUS message. The fix uses the unsupported DTM ASSIGNMENT FAILURE
message.

To have the DTM ASSIGNMENT FAILE, it is added to
library/L3_Templates.ttcn.

Change-Id: I35877574cf4459332229e3b941918bc0a23b939f
2023-07-26 12:45:31 +00:00
Andreas Eversberg a29b2f31da BSC_Test_ASCI: Add Talker detect with UPLINK REJECT COMMAND test
The talker requests uplink. The UPLINK REQUEST is rejected by the MSC.
The uplink is marked free again.

Change-Id: Iba4dd21a69d49e6a8508b15b823ffccc7f0dafc9
2023-07-21 11:35:40 +02:00
Andreas Eversberg 28d6b81268 BSC_Test_ASCI: Add race condition test, if MSC acknowledges talker
The existing tests (talker fails, talker establishes, talker releases)
delay, so the MSC acknowledges the UPLINK REQUEST first. It is expected
that the events of the talker (failure, establishment, release) are
forwarded to the MSC after the acknowledgement.

New tests are added, so that the MSC acknowledges the UPLINK REQUEST
late. It is expected that the events of the talker are not forwarded
before the MSC acknowledges.

The BSC (under test) must queue the events of the talker before the MSC
has acknowledged the UPLINK REQUEST.

Change-Id: I28081e62287bdc17a3b477d9368f977aedce01c8
2023-07-21 11:35:40 +02:00
Andreas Eversberg e15060252d BSC_Test_ASCI: Fix test to seize or release uplink by MSC
After sending UPLINK SEIZED COMMAND or UPLINK RELEASE COMMAND the timer
must be started, in order to collect data from the outcome of the test.
The test will fail sometimes, if this is not done.

Change-Id: Ic48e9c259b42ee6e030ea5d05b113ce2933e2247
2023-07-21 11:34:41 +02:00
Andreas Eversberg cfdbb3ef65 BSC_Test_ASCI: Add Talker detect with link fail test
The talker requests uplink. Instead of receiving link establishment from
the BTS, the BSC receives a link failure. The MSC expects to receive an
UPLINK RELEASE INDICATION, caused by radio link failure.

Change-Id: Ied56a6bdc0bfa541b1419e63e9e209ed20af804c
2023-07-20 17:27:49 +02:00
Andreas Eversberg 35874922b7 BSC_Tests_ASCI: Add test to seize or release uplink by MSC
The MSC will block (seize) or unblock (release) the uplink on one BSC,
if a talker requests or releases uplink on a different BSC. An UPLINK
BUSY or UPLINK FREE message es expected to be sent to the BTS.

Change-Id: I7ebf03662e81f59d76ca8d8fa29f581043053564
2023-07-12 16:21:44 +00:00
Andreas Eversberg 5e3dd362f6 BSC_Tests_ASCI: Do not expect UPLINK BUSY message
There is no UPLINK BUSY message sent by BSC, if the talker
requests/establishes the uplink. Due to timing reason, the message is
sent by the BTS itself towards the MS.

Change-Id: I2e3b866eca174ae212ea986980d508e48e31fa57
2023-07-12 16:21:44 +00:00
Andreas Eversberg c0870e5a08 BSC_Tests_ASCI: UPLINK FREE / UPLINK BUSY uses unit data
RSL_UNITDATA_REQ is used instead of RSL_DATA_REQ.

Change-Id: I224a520ed49ea79b95172bbc38c567a7c861abf4
2023-07-12 16:21:44 +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
Vadim Yanitskiy cf25a3a7b9 BSC_Tests: fix TC_mgwpool_keepalive_down_not_used
Current osmo-bsc master does not support the MGW keepalive yet, so
f_vty_mgw_cfg_keepalive() fails.  This leaves osmo-bsc in unclean
state and makes all LCLS testcases fail.  The problem is that before
calling it we also call f_vty_mgw_enable() and f_vty_mgw_block(),
but not calling their counterparts.

Rearrange the testcase to call f_vty_mgw_cfg_keepalive() first,
so that we fail early before calling f_vty_mgw_{enable,block}().

Change-Id: I6a94c441fe80a92c237c3c4a5481f2dac3376e35
Fixes: bd59842b6 "bsc: Introduce test TC_mgwpool_keepalive"
2023-06-20 17:36:31 +07:00
Pau Espin bd59842b67 bsc: Introduce test TC_mgwpool_keepalive
Related: SYS#6481
Change-Id: Ib3cd00dafee87258ac229df78217326a6182f028
2023-06-17 06:04:29 +00:00
Harald Welte 801ed1a0d0 Added BSC tests for terminating voice group calls
Change-Id: I6762e8adfb7d5f77df837c698ff70cd7fd715ffe
2023-06-12 13:06:26 +02: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
Oliver Smith ace447ab8c bsc: TC_assignment_csd: delete mgcp EP after clear
Fix the test for sccplite, where it fails at the third rate with:
  Crit already present{ connid := omit, endpoint := omit, transid := omit }

For each rate that gets tested, a new expectation (Crit) gets set by
f_tc_assignment_csd() (f_establish_fully() -> f_create_mgcp_expect()).

If the expectation already exists at this point, it leads to the error
above. While the rate gets tested, the expectation gets removed in
MGCP_Emulation:main() (ops.create_cb.apply -> ExpectedCreateCallback()),
but only if the EP is not known.

So without this patch:
* T_14k4: passes, EP is not known, Crit gets removed
* T_9k6: passes, EP is known, Crit does not get removed
* T_4k8: error, because Crit already exists

Related: OS#4393
Change-Id: Ib8d27a670931105f45b994799c4757fffabdf97d
2023-05-08 14:37:23 +02:00
Oliver Smith ab7354b762 bsc: as_mgcp_ack_all_dlcx: support sccplite
Fix the "Unexpected DLCX received" error in TC_assignment_csd with
sccplite. Without the patch, f_perform_clear() does not catch the DLCX
for sccplite.

Related: OS#4393
Change-Id: I9a3a4407510143af4bbc77a8cfe51a137945b716
2023-05-08 14:37:22 +02:00
Oliver Smith 545492d3e0 bsc: TC_assignment_csd: test non-transp data rates
Related: OS#4393
Change-Id: I2dce9486f3528a79bdea09bdbc1f02833e6bedc0
2023-04-24 13:18:55 +02:00
Oliver Smith cb61791491 bsc: TC_assignment_csd: test more transp data rates
Related: OS#4393
Change-Id: I9a5f0e630fefcafb1b26eabba73de7e76d9e7e5d
2023-04-24 11:16:23 +00:00
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
Neels Hofmeyr 2bc75894ee L3_Templates, bsc: set ts_PAG_RESP() arg to template (value)
Change-Id: Ib77fc2377c1cf86abca9cf3082b74926d3c2c431
2023-04-14 22:25:26 +00:00
Neels Hofmeyr 38632aa4d8 bsc: add TC_mscpool_sccp_n_pcstate_attaches_msc
Related: I3a0869598b8395601a16d78dbc46eec400c0ea84 (osmo-bsc)
Change-Id: Ib4a5330df30a73e744c316898817b2fa3271d75e
2023-04-14 22:25:26 +00:00
Neels Hofmeyr 2bdc6b6e3e bsc: add TC_mscpool_sccp_n_pcstate_detaches_msc
Related: SYS#6319 OS#5917
Related: I3a0869598b8395601a16d78dbc46eec400c0ea84 (osmo-bsc)
Change-Id: Ia1aea4e33230d6a685b72ea5ba20dd9c7d265d44
2023-04-14 22:25:26 +00:00
Pau Espin 8de5778cca bsc: Add missing tests in expected-results.xml
Change-Id: I09d503f6d61d4f4d09d83357dd1b79315803584c
2023-04-03 16:08:42 +02:00
Oliver Smith 15890b4346 bsc: TC_stats_conn_fail: fix for sccplite
Change the test so OsmoBSC always sends an BSSAP Assignment Failure by
setting the Data Indicator to an invalid value. Previously the test had
assumed that OsmoBSC would always send an Assignment Failure when
requesting CSD as it was not yet implemented.

The test only passed by chance on AoIP: OsmoBSC rejects the CSD
Assignment Request unless it has the Speech Codec List IE for AoIP.

Related: OS#4393
Change-Id: Ia4e8ab01dbadae5c9d7a964c0760dd3b016ab606
2023-03-08 14:27:25 +01:00
Oliver Smith d49f46d80c bsc: TC_ho_in_fail_no_detect: fix sporadic fails
Don't fail the test if the BSSAP Handover Failure arrives after both
MGCP DLCX. In that case, the DLCX arrive at as_Media_mgw() in
MSC_ConnectionHandler. Set pars.fail_on_dlcx := false so it gets ignored
there and stays in the queue, until f_expect_dlcx_conns() in
f_tc_ho_in_fail_no_detect() takes care of them.

Fix for:
TC_ho_in_fail_no_detect(1979)@ba5f1f91fb11: setverdict(fail): none -> fail reason: "Unexpected DLCX received", new component reason: "Unexpected DLCX received"

Timeout of T_guard
      BSC_Tests.ttcn:12410 BSC_Tests control part
      BSC_Tests.ttcn:6990 TC_ho_in_fail_no_detect testcase

Change-Id: Ie0216504b6bdac38c2f7dcc23fc8e9a7e5acff57
2023-03-08 12:23:13 +01:00
Oliver Smith 30eb882b84 bsc-sccplite: fix TC_ho_in_fail_mgw_mdcx_timeout
Make the test pass with sccplite too.

Related: OS#5787
Fixes: 7a8594a8 ("bsc: TC_ho_in_fail_mgw_mdcx_timeout: new test")
Change-Id: If09c0ab5f668aefe262905bbd4f8c676f3b05fd3
2023-03-06 12:33:51 +01:00
Oliver Smith dd0027540c bsc: TC_assignment_csd: expect BSC to handle CSD
Related: OS#4393
Change-Id: Iff19dc704af09d09d2265d8da38fc745a3936ce4
2023-03-05 17:51:18 +00:00
Oliver Smith 0033b12262 library/RSL_Types: RSL_SpeechAlgo: support CSD
Prepare to test CSD in BSC_Tests.ttcn. After sending a BSSAP assignment
request to the BSC with channel type data, the BSC will send a channel
activation via RSL to the BTS (which is emulated by the testsuite).

Without CSD support in the RSL template, the testsuite is unable to
decode the message, prints "Data remained at the end of the stream
after successful decoding" and the test fails.

Related: OS#4393
Change-Id: Ief2d95c7e9d71afb26fa74da755294226c8e158d
2023-03-05 17:51:18 +00:00
Oliver Smith a1cbec52f0 bsc: TC_ho_in_fail_mgw_mdcx_timeout: fixup
Fix that the test was torn down too early, before DLCX messages were
received from OsmoBSC. This caused a race condition that sometimes
failed the test with:

VirtMGW-MGCP-0(1996)@e5a096d6b4ff: Dynamic test case error: Sending data on the connection of port MGCP_CLIENT to 1999:MGCP failed. (Broken pipe)

Related: OS#5787
Fixes: 7a8594a8 ("bsc: TC_ho_in_fail_mgw_mdcx_timeout: new test")
Change-Id: If47fa3e0204ce841c79a67dd78a1c53d04e4a586
2023-02-22 11:14:03 +01: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
Alexander Couzens 89b4eff243 BSC_Tests: add OML tests for bts_setup_ramp
The current BSC_Tests are using osmo-bts-omldummy to keep OML out of the test context.
Add a new test file and component for OML tests.

Change-Id: I0934ea26db359b0a6649c613f01de134a3a372ee
2023-02-10 11:46:51 +00:00
Pau Espin 4e43183151 Update UIT version expectancies after Osmocom CNI release 202302
Change-Id: Iec06390a1de9391ab573e66f9bd3421f4a627c6d
2023-02-08 12:49:37 +01:00
Pau Espin 6b869f49d1 bsc: Fix regression in TC_assignment_emerg_setup_deny_bts
A recent commit introduced a regression which made
TC_assignment_emerg_setup_deny_bts fail.

The problematic commit (see hash below) set "pars.ra :=
f_rnd_ra_emerg()" in the helper function, which made the BSC early
reject the CHAN RQD with ImmAssRej in the case the BTS policy forbids
emergency calls.
In that scenario, rejection can be done early because there's no need to
wait to find out which MSC it is aimed at.
This scenario, however, is already being validated by test TC_chan_rqd_emerg_deny.

The scenario TC_assignment_emerg_setup_deny_bts was testing is actually
one where CHAN RQD doesn't contain reason="emergency call", which means
BTS doesn't early reject it, but only knows about it being an emergency
call when a CC Emergency Setup is sent to it, time at which it releases
the call.

Hence, this commit sets back pars.ra = f_rnd_ra_emerg() only on the ..._deny_msc
testcase, since it's the only test really needing it.

Fixes: 14076d3b72
Related: OS#5849
Change-Id: I8d342e5938f6293ae45ee399796417651768af5d
2023-01-17 13:22:23 +01:00
Vadim Yanitskiy 3cc065b252 fix BSC_Tests_LCLS: do not use t_def_TestHdlrPars directly
As stated in the comment near the t_def_TestHdlrPars definition,
valueof() shall not be used for getting a value of this template.
The f_gen_test_hdlr_pars() function should be used instead.

All LCLS testcases violated this, and started to fail since
recently after patch [1] has been merged:

  "MSC_ConnectionHandler.ttcn:820 : Either imsi or imei must be set!"
      BSC_Tests_LCLS.ttcn:743 BSC_Tests_LCLS control part
      BSC_Tests_LCLS.ttcn:262 TC_lcls_gcr_only testcase

Use f_gen_test_hdlr_pars() as suggested.

Change-Id: I69ab8699b0be80b12e2df590d9170a743a00d035
Fixes: [1] b27653c6b6
2023-01-06 21:42:38 +07:00
Pau Espin 14076d3b72 bsc: TC_assignment_emerg_setup_allow(_imei): Test full voice establishment
Extend tests to also test the data plane setup.

Related: OS#5849
Change-Id: I9f39f861398669a8eb1da242595de584725e5b83
2023-01-03 17:55:43 +01:00
Pau Espin 39bd33c72c bsc: Move BSSAP handling of emergency call to helper function
Change-Id: I3a88efeae6710ba005496067ecb0c8f4035404ab
2023-01-03 17:05:27 +01:00
Pau Espin 3560979cf8 cosmetic: bsc: Fix typos in comments
Change-Id: I87f351fe2ab69120a3af8d6674f2738ef2d57a3a
2023-01-03 16:56:59 +01:00
Pau Espin 1809bcee83 bsc: Use f_rnd_ra_emerg() instead of hardcoded value
Change-Id: Id10d71868dc8ef427e0353ee4b7e51d5bebc6255
2023-01-03 16:54:41 +01: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 07657aedc1 bsc: Introduce test TC_paging_imsi_nochan_ci_resp_invalid_mi
Related: SYS#6280
Change-Id: Id0d069f00bc77be33ca61ce469bea8079ae9bd16
2023-01-03 13:13:02 +01:00