Commit Graph

1377 Commits

Author SHA1 Message Date
Alexander Couzens 0163666beb start-testsuite.sh: allow to skip the configuration file parameter
Allows to use the default configuration file while setting a specific test case.

Change-Id: I6b318aea9e1f8b23c283d08e7b06f055fc907cdd
2019-05-16 17:08:36 +02:00
Alexander Couzens b97efef848 start-testsuite.sh: remove superflouse `set -e`
The set -e will not interfere with the next command,
as it's executed and not included.
The exit code of the last command is returned with and without -e.

Change-Id: I820d59b29b4ba4a1d094c5c2a2af367e6ef4e5b6
2019-05-16 16:57:00 +02: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 b2284bd2d9 msc: Add a test for LU with invalid MCC/MNC in BSSAP/RANAP
Verify that the MSC rejects a location update from a Cell/BSC that
contains a PLMN which does not match the core network's PLMN.

Related: OS#3162
Change-Id: I676894358259b9cc0f973769ce552ba58a2a58a1
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 d29a64c6d3 Fix regression in tr_GSUP_PROC_SS_ERR during inter-MSC-ho
In Change-Id I7d76c982ad4e198534fa488609c41e8892b268ab we merged
various changes to GSUP_Templates.ttcn, mostly related to adding
the tr_GSUP_IE_Message_Class IE.

In most caes, the specified MessageClass is correct.  However in
tr_GSUP_PROC_SS_ERR we accidentially used OSMO_GSUP_MESSAGE_CLASS_SMS
instead of OSMO_GSUP_MESSAGE_CLASS_USSD.

This makes TC_lu_and_ss_session_timeout pass again.

Change-Id: I04fa1be24ec63ed1eb767a33de0297722b4366f1
2019-05-11 12:26:49 +02:00
Harald Welte 0622a9f7b6 Make f_gen_tr_ss_ies() work for both 'latest' and 'master'
This fixes the partial revert of c43c8cd275
to work for both situtions:  Messages that have the OSMO_GSUP_MESSAGE_CLASS_USSD
and messages that don't.

The particular implementation is rather ugly, but we're waiting for
a response to https://www.eclipse.org/forums/index.php/t/1098847/
on how to solve this kind of problem in a more elegant way.  Meanwile,
we make it work first.

Change-Id: Ibf137de6a41aaa43894cc0b6da8341ceb88b0756
2019-05-11 11:09:09 +02:00
Harald Welte 1e5a02d766 BSSGP_Emulation: More/improved comments
Change-Id: I04250667a498f3f00d4fbb4cd22a4f7b71e2bba1
2019-05-11 06:03:12 +00:00
Alexander Couzens 6bee087573 SGSN_Tests: add test case TC_attach_pdp_act_gmm_detach
MS  -> SGSN: Attach Request
MS <-> SGSN: [..]
MS  -> SGSN: Attach Complete
MS  -> SGSN: PDP Activate Request
MS <-  SGSN: PDP Activate Accept
MS  -> SGSN: GMM Detach Request
MS <-  SGSN: GMM Detach Accept

Related-to: OS#1881
Change-Id: Ibafbbb8ed99357d1e2e13d576b2624939388e85b
2019-05-11 06:00:43 +00:00
Alexander Couzens 44aa077bbd SGSN_Tests: fail when receiving any layer 3 package for a power off station
Change-Id: I27d798c1866ed7ae9b03b9c0ffdd7400431551f9
2019-05-11 06:00:01 +00:00
Alexander Couzens 8e0fd46a27 SGSN_Tests: correct verdict failure message in f_detach_mo()
Change-Id: I5c03ef7dd7486025d35d4482a7fe150dd36de907
2019-05-11 05:58:59 +00:00
Alexander Couzens ad35222d3a SGSN_Tests: fix regression in f_send_l3_gmm_llc() which breaks TC_attach_rau_a_b
The gb_index was forgotten to given to the new function f_send_l3().
All testcases which only used the default BSSGB connection #0 continued
to work, but the TC_attach_rau_a_b is the only testcase which uses #0
and #1 at the same time.

Fixes: a05b807922 ("sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet")
Change-Id: Ie3dd8c613d3b3440447a282dc4545078cb927274
2019-05-11 05:57:39 +00:00
Alexander Couzens c43c8cd275 Revert partial of 0ac6315212 ("msc: add inter-BSC and inter-MSC Handover tests")
Commit 0ac6315212 breaks all related GSUP SS tests because it require
all GSUP SS packages to have a OSMO_GSUP_MESSAGE_CLASS_USSD IE.

Change-Id: Iadbc37105fa67cf6383fb63b86ed653ccc7bddf7
2019-05-10 23:23:52 +00:00
Harald Welte 1b85bf3a3d BSSGP_Emulation: Implement LLC sending also for SGSN-role
We used to support sending of LLC messages only for the MS role,
where we generated BSSGP UL UNITDATA.  Let's also support the
SGSN role, where we have to generate BSSGP DL UNITDATA

Change-Id: If86f4b7c9e7c3c799c274f37a350dec4a788f124
2019-05-10 22:39:02 +00:00
Harald Welte 425f782d25 BSSGP_Emulation: Pass uplink L3 to BSSGP Uplink Unitdata
Change-Id: I71c19cd0f11927eb70667210a4ba1ee5873fd534
2019-05-10 22:39:02 +00:00
Harald Welte 8d1d893e7f BSSGP_Emulation: Fix transmission of MT L3 in LLC/BSSGP
it seems that some part of the code was commented out, breaking
the path where a ConnHdlr is sending a L3 MT message.

Change-Id: Ie652598292f2fbd2e1e0c4aa679ff0d68d78c88c
2019-05-10 22:39:02 +00:00
Harald Welte 2fa771f90d SGSN_Tests: Introduce NUM_GB to avoid '3' as magic value
Change-Id: I28b7dd26c5c129ec41c6349de9ddc9ef0ffee8ac
2019-05-10 22:38:17 +00:00
Harald Welte f7191679aa SGSN_Tests: Make more helper functions gb_index aware
The gb_index indicates through which Gb link (simulated
RAN/PCU) a given message shall be sent.

Change-Id: I3825634f581897f6951d9673984f138e977cc7ac
2019-05-10 22:38:17 +00:00
Harald Welte ca36246737 SGSN_Tests: Make f_gmm_attach() and f_gmm_auth() work on gb_idx != 0
Let's make sure the related functions can be used on other gb_idx,
i.e. via another Gb interface (and hence simulated RAN/PCU) than
the first one.

Change-Id: Ie88cbf0c70269cc3e2c2fd2a0c65c8f2130ec2b1
2019-05-10 22:38:17 +00:00
Harald Welte 9b06488116 library: Add PAP_Types for PPP Authentication Protocol (RFC 1334)
Change-Id: I31cb766bb701b8107df5de978d2b0b085977045a
2019-05-10 10:46:26 +00:00
Harald Welte 79737b4193 ggsn: Verify that there are no duplicate PCO protocolIDs
Introduce a function to verify there's no duplicate ProtocolIDs
in the PCO returned from the GGSN.

Change-Id: I9d439dab1696196cd125f4d7113b426f1711a405
Related: OS#3914
2019-05-10 10:46:04 +00:00
Harald Welte 03d4e2b8f2 RAN_Emulation: Fix IMSI table lookup on RANAP paging
We need to check explicitly for '== null'.  isvalue() is of no help
here, as 'null' apparently is a value in TTCN-3.

Change-Id: I4b2793937a201c5535051092d871ded6cb053f5f
2019-05-10 00:45:40 +02:00
Harald Welte b78179968f msc: Permit optional authentication before reject/timeout
Tests like TC_lu_imsi_reject, TC_lu_imsi_timeout_gsup and
TC_cmserv_imsi_unknown all expected a reject straight in response
to the LU REQ / CM SERV REQ.  However, the MSC may very well decide
to perform authentication beforehand.  It's an implementation
detail when a MSC/VLR performs authentication, so the tests should
be tolerant to this.

This primarily shows up in 3G/Iu/RANAP related tests, as authentication
is mandatory there.

Change-Id: Icdd3f34eca08092703ab2ba9a8e755e2d609a59b
2019-05-09 13:15:39 +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
Neels Hofmeyr 61ca08d724 bsc: deterministic TC_ho_in_fail_msc_clears: wait for MGW setup
Randomly, this test issues the Clear Command so fast that the MGW has not yet
been set up, and hence the test cannot possibly see DLCX for endpoint conns
that haven't been set up at all. So, simply wait a bit before clearing.

Change-Id: Idd0b3810916efd02a499e0ac060a6a275265b8c3
2019-05-07 00:14:33 +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 bc04327e28 RAN_Adapter: More verbose logging
Change-Id: I16a2c4858d8cac65f39e37d23051fa77c15d4c6f
2019-05-02 18:35:43 +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 2aaac1b1d1 sgsn: Add initial XID handshake related tests
Change-Id: I5d4b3cba2fe05dffe10c843f16cfec343bc67b5f
2019-05-02 10:03:32 +02:00
Harald Welte d21f6a2005 LLC_Templates: Add XID related templates
Change-Id: I383e8761f91fac18625a442088e865ad6a9b472b
2019-05-02 10:03:32 +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 01e72d56e8 regen-makefile: Use '-U 5' to split C++ files in multiple chunks
Particularly the C++ files generated for the rather comprehensive
3GPP asn.1 specified protocols like MAP, RANAP, ... result in very
large source files and subsequently g++ processes that consume well
into the multiple gigabyte range of memory.

Let's use the '-U 5' option to ask the ttcn3_compiler to split all
c++ files into 5 chunks, resulting in more files to compile, but
smaller individual files.

I also tested '-U type' before, but it was still grinding my 16GB RAM
laptop to unusable deep-swapping state when running 'make -j8' for
the IuCS extended MSC test suite.

Change-Id: I013b623e98d58a39dd7bb2b0db4a911725028535
2019-04-30 19:07:47 +02:00
Philipp Maier e63229e920 BTS_Tests: use 0.0 as default for mp_ipa_up_delay
The module parameter mp_ipa_up_delay ads a delay after the ipa bring up.
This is relevant for the tests with real BTS hardware, but it is not
relavent for the regular TTCN3 tests.

Lets set the default to 0.0, since the delay caused problems with
TC_rsl_ms_pwr_ctrl and TC_si_sched_13_2bis_2ter_2quater.

Change-Id: I7663cad5df1ee5a8bcdbbf522881999f1be9f4fe
Related: OS#3960
2019-04-26 12:37:06 +00:00
Harald Welte 5b02762adf RAN_Emulation: Add RANAP support
So far, RAN_Emulation only handled BSSAP and hence could be used
to emulate BSCs towards the MSC.  Let's extend it with RANAP support
so we can also emulate RNCs towards the MSC.

We try to share as much code and logic as possible betweeb the two.

Related: OS#2856, OS#2857
Change-Id: Ie79bda764162e5c5a42608bde5c5f486ea531f33
2019-04-25 20:07:11 +00:00
Harald Welte a013e68fc9 HNBAP, RUA and RANAP protocol codecs
This patch introduces protocol codecs for the HNBAP, RUA and RANAP
protocols, which is mandatory for testing IuCS, IuPS or Iuh in
the future.

As Eclipse TITAN ASN.1 only supports the BER codec and the above
protocols all use APER, we need to use an external transcoder from
APER to BER and vice-versa.  This was implemented using a proprietary
ASN.1 compiler / trnaslator which sysmocom is packaging as
libfftranscode, which is made available as binary package
for Debian 9 at https://ftp.osmocom.org/binaries/libfftranscode/

Related: OS#2856, OS#2857, OS#2858
Change-Id: If4a72de9bc54d6e6a7daaca78a4d4aa5684203a5
2019-04-25 20:07:11 +00:00
Harald Welte 3e16b4d2f3 RAN_Adapter: Support build without IPA / BSSAP support
Change-Id: I5370f0ea6f2f6cfdc3370a6f3d3bf2e6c32af4d2
2019-04-25 20:07:11 +00:00
Harald Welte 3ca0ce13b2 RAN_Adapter: Rename functions from f_bssap_* to f_ran_adapter_*
Change-Id: I73818247f1dfc71c8ece11660e6c18f5f153d186
2019-04-25 20:07:11 +00: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 8a397ae7ba msc: Add testcase for UMTS AKA over GERAN TC_lu_imsi_auth3g_tmsi()
Change-Id: I10cc7ed214e83b4624587c60f332034d3f19b22d
2019-04-25 20:06:50 +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 645a151f69 sgsn: Add test cases to verify SABM handling on LLGMM + LL5
As OsmoSGSN doesn't implement ABM, the correct resposne to any SABM
is DM.

RelateD: OS#3953
Change-Id: Ib0d371a3356d6cb481b794945476ab40f5e0f02a
2019-04-25 20:06:15 +00:00
Harald Welte a05b807922 sgsn: Add TC_llc_null to test if SGSN survives a LLC NULL packet
This test case reproduces a bug in OsmoSGSN where it would crash
as a result to sending LLC NULL frames.

Change-Id: I38326f2ebaaff009d4357edad9511ce2ce7736fd
Related: OS#3952
2019-04-25 20:06:15 +00:00
Harald Welte ceaff26682 LLC_Templates: Add templates for NULL and DISC
Change-Id: Ia5b350990379bba1677a0c1c99cf37e6651ba84d
2019-04-25 20:06:15 +00:00
Harald Welte 2216b75a58 deps/Makefile: Use osmocom fork of LLC protocol module
Change-Id: I8b9f107f0a99dcbd8148a3d431a101d194dfe788
2019-04-25 20:06:15 +00:00
Harald Welte f7a5c3ca02 LLC_Templates: Add SABM, UA, FRMR, DM templates
Related: OS#3953
Change-Id: Idb40dcd53310b76ea9df6c0090e31175a4382460
2019-04-25 20:06:15 +00:00
Philipp Maier d95f340a01 BTS_Tests: wait until BTS supplies stable signal
When running tests with real hardware it is important to wait for some
time (3 sec. should be enough) before exiting f_init(). This is to
ensure that the BTS supplies a stable carrier before the test proceeds.

Change-Id: Ib78633a33a15cd40514e15b6ebf9a0a8fb7b9c68
Related: OS#3863
2019-04-24 14:55:19 +02:00