Commit Graph

1402 Commits

Author SHA1 Message Date
Oliver Smith a983d44be5 WIP
Change-Id: I4f9de4221de5d38730040961ee0d70ec0dcb4702
2019-05-27 14:15:38 +02:00
Harald Welte 4832c86acd bts: Add TC_pcu_rts_req() to verify PCUIF_RTS_REQ
This new test verifies that the expected amount of PCUIF_RTS_REQ are
observed on the PCU Interface for both PTCCH and PDTCH.

Change-Id: Ic27cdd4f4adf11f871b84bd72692a03280274fe2
Related: OS#4023
2019-05-25 14:57:18 +02:00
Harald Welte 07bd2d265b Add TC_pcu_oml_alert() for testing PCU-originated OML alerts
As we don't yet speak OML directly from the TTCN3 test suite,
this requires a currently "RFC/WIP" state patch turning OML
Failure Event Reports into CTRL TRAP on the BSC, see
https://gerrit.osmocom.org/#/c/osmo-bsc/+/14177

Change-Id: I6c7641b37b6ee2177d43127140cc0b625409379c
Depends: osmo-bsc I4f8a9737c6ef1b951ea8e742cdbd3689371a99d5
Related: OS#4023
2019-05-25 11:03:30 +02:00
Harald Welte d66c9b8d13 bts: Add Test for receiving PCUIF_TIME_IND on BTS PCU interface
Change-Id: Ib6b99a52790162b0227847d9aec5143cf959e2d0
Related: OS#4023
2019-05-25 09:06:27 +02:00
Harald Welte 3453ab48d6 bts: Add tests for CCCH LOAD IND (RACH)
Add three BTS_Tests.ttcn test cases for verifying the BTS behavior
regarding CCCH LOAD IND (RACH).

Related: OS#3750
Change-Id: I6c9dee1d7d3eaa218fdce7ebb8e334858aedb736
2019-05-24 21:24:36 +02:00
Eric Wild 6833cc9464 bts: Extend BTS_Tests.ttcn with test for RSL channel activation with TA from initial activation onwards
Change-Id: I4b2eec223e961aeedfd8afa77cb671d2842910fb
Related: OS##3750
2019-05-23 19:34:44 +02:00
Pau Espin 9495524bd0 MSC_Tests: Remove duplicated structures from BSSMAP_Templates
Change-Id: Ia82b65fe7e53cc0ab73df94b844b9b85aba9468b
2019-05-23 15:32:54 +02:00
Pau Espin 5eff975b23 BSSMAP_templates: Update templates to set Osmux fields
After new fields (osmux osmocom extensions) were added to BSSMAP Reset
and BSSMAP AssignReq/AssignCompl in titan.ProtocolModules.BSSMAP, we
need to set them in ts_* templates, otherwise TTCN3 runtimes fails with:
"""
BSC_Tests.ttcn:143 Dynamic test case error: Performing a valueof or send
operation on a non-specific template of type @BSSAP_Types.BSSMAP_IE_Osmo_OsmuxSupport.
"""

Fixes: fe0c6083bd
Depends: titan.ProtocolModules.BSSMAP Iaf1e137269c0da20b2c96fd104b57edf336693af
Change-Id: I568100376cf8a47c01a33bada97bf8eaa7c07fcd
2019-05-23 15:03:57 +02:00
Harald Welte 4a129f83ce bts: Add tests for CBCH LOAD IND (underflow, overflow)
Change-Id: Ia0a82771ba2912ef06fb0d9ee0816e8150701005
Related: OS#4011
2019-05-21 16:40:57 +02:00
Harald Welte 60bd92bddb bts: Add TC_sms_cb_cmd_sdcch{4,8}_extd_multi
Those tests verify operation of the EXTENDED CBCH.

Change-Id: I06c193d59f21472fb5e4c69a7af1ccb18fba7487
Related: OS#4011
Related: OS#3535
2019-05-21 16:36:51 +02:00
Harald Welte d522ca09dc bts: Test case for mixed NORMAL and DEFAULT SMSCB
This adds TC_sms_cb_cmd_sdcch{4,8]_default_and_normal() which test
the correct behavior in case of a DEFAULT SMSCB and normal one-shot
SMSCBs.

Change-Id: I0782b121cd69158903b09f935b298ddbf5a9ffb5
Related: OS#4011
2019-05-21 16:36:51 +02:00
Harald Welte a3ff670c5f bts: Refactor code to support mixed DEFAULT + NORMAL and EXTENDED CBCH
The existing code structure could only test for normal messages with a
NULL default, but didn't handle situations where normal and/or schedule
messages were superimposed on top of DEFAULT messages.

Also, prepare the infrastructure for testing both CBCH BASIC and CBCH
EXTENDED.

No new tests are introduced, the code should behave identical before
and after this patch.

Change-Id: I144c7d833b79c648b1ac69a6155f3603025ede5c
Related: OS#4011
2019-05-21 16:36:50 +02:00
Harald Welte df4d0f0b8c bts: Test for removal of CBCH DEFAULT message
Add a new testcase TC_sms_cb_cmd_sdcch4_default_then_null() which first
installes a DEFAULT message, verifies that, then removes the default
message and verifies only NULL CBCH blocks are sent anymore.

Change-Id: I9608d42a164a6210f100d10cb3ccfb7735975011
Related: OS#4011
2019-05-21 16:36:50 +02:00
Harald Welte 88e5dffd19 bts: Add TC_sms_cb_cmd_cbch_sdcch{4,8}_default_only
Add a most basic CBCH DEFAULT message test: Ensure *only* the
default message is sent if a default is set.

Related: OS#4011
Change-Id: Iab03fa88b759759a493516d43090c4df63f7b06f
2019-05-21 16:36:50 +02:00
Harald Welte e0026c3fb5 bts: Add TC_sms_cb_cmd_cbch_sdcch{4,8}_multi()
These new tests verify that multiple SMSCB commands are equeued,
and that each related message is sent exactly once.

Change-Id: Ice22fd2689a42c3b1951a02e65664102d4eaccc2
Related: OS#4011
2019-05-21 16:36:50 +02:00
Harald Welte 505cf9b519 bts: CBCH related tests for OsmoBTS
This introduces a set of CBCH related tests for osmo-bts.

Warning: Those tests currently require a patched trxcon to work.

Related: OS#4011
Change-Id: I955b4000c12180a39b0205b69b7b2c8cee8c9da3
2019-05-21 16:36:50 +02:00
Pau Espin fe0c6083bd Depend on our own fork of titan.ProtocolModules.BSSMAP
Since we use some BSSMAP extensions to signal Osmux, we need to maintain
our own fork of BSSMAP_Types in order to supports those IEs in BSSMAP
RESET and BSSMAP Assin Req/Compl. Hence, switch all build componenets to
fetch and use our fork.

Depends: titan.ProtocolModules.BSSMAP Iaf1e137269c0da20b2c96fd104b57edf336693af
Change-Id: Ic8debe5f3ffe8e1d4258fa6b4632a3871b99af40
2019-05-21 10:28:53 +00:00
Pau Espin e38bfe0683 RTP_Emulation: Avoid failure if T_transmit triggers between bind and connect
During MGCP_Test's f_flow_modify, an RTP socket may be Tx-enabled, and
f_flow_modify first calls bind, then connect, with MDCX transaction in
the middle (which can take some time).

If T_transmit from RTP_Emulation triggers (RTP packet to be send),
during that time, TTCN3 will fail to send the packet:
RTP_Emulation.ttcn:312 Message enqueued on RTP from system @Socket_API_Definitions.PortEvent : { result := { errorCode := ERROR_SOCKET (4), connId := 2, os_error_code := 89, os_error_text := "Destination address required" } } id 1

Change-Id: I20e7aed35bb28200e30ee5efc718f77e036d8262
2019-05-21 10:25:42 +00:00
Harald Welte 8b01c794f0 bts: Add TC_sacch_chan_act_ho_async + TC_sacch_chan_act_ho_sync
Those two new tests test the subtle rules related to how the presence
of certain IEs in the RSL CHAN ACT influence when exactly DL SACCH
transmission should start during hand-over related channel activation.

Change-Id: Ia88f3ab160891cdbbb8fa6e765f137edd04c6e81
Related: OS#3570
Related: OS#4008
Related: OS#4009
2019-05-20 00:15:09 +02:00
Harald Welte 1028017e14 RSL_Types: Add ts_RSL_IE_MS_Power() template for MS Power IE
Change-Id: I646208c3c6e755978162e207a4f2030be117883d
2019-05-20 00:15:09 +02:00
Harald Welte 921f9e0732 RSL_Types: Add dissected RSL_IE_ActivationType and related templates
This is required for supporting normal and handover assignments.

Change-Id: I116d589d0ec4aa6bffba4da6e3bfe1974dd04db2
2019-05-20 00:15:09 +02:00
Harald Welte b05fd2d294 L1CTL: Add f_L1CTL_DM_EST_REQ() for activation without IMM.ASS
In any normal or handover related assignments, we don't have an
ImmediateAssignment that we can hand to f_L1CTL_DM_EST_REQ_IA(),
so let's intrduce a version that works with arfcn, chan_nr and TSC
directly.

Change-Id: Ie5b85d3bac57032f4762ea9cdc21fdcd70fd5c2a
2019-05-20 00:15:09 +02:00
Harald Welte c8d363cd3c bts: Add TC_sacch_chan_act() to test SACCH INFO at RSL CHAN ACT
According to 3GPP Ts 48.058, every logical channel can receive some
specific SACCH filling at the time of RSL channel activation.  This
overrides the global SACCH FILLING.

Related: OS#3750
Change-Id: I8adb371a7e0b80792dd2fa35e5204802068df5ba
2019-05-19 20:43:51 +02:00
Harald Welte a670615e5a RSL_Types: Add support for RSL_IE_MSG_ID as used in ERROR REPORT
Change-Id: I5f971dc7ec797a311841ac5b947c5c493780786f
2019-05-19 20:41:28 +02:00
Harald Welte ee25aaed96 bts: Extend BTS_Tests.ttcn with test for RSL error handling
Section 7 of the RSL specification (3GPP TS 48.058) describes how the
BTS shall respond in various error situations, including wrong message
type, wrong message discriminator and invalid message sequences.

Let's add three test cases for the above three scenarios.

Change-Id: If507a14bbed9cdcc62cd966468222186590fc965
Related: OS##3750
2019-05-19 14:34:58 +02:00
Alexander Couzens c18fe7f651 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-19 07:33:56 +00:00
Vadim Yanitskiy c78ea26f21 library/PCUIF_Types.ttcn: add explicit ALIGN(left) attribute
In the documentation of Eclipse Titan compiler before [1] it was clearly
stated that if the length of the actual value can be determined and it
is less than the specified FIELDLENGTH, the remaining bits / bytes will
be padded with zeros. The attribute ALIGN specifies the sequence of the
actual value and the padding within the encoded field:

  Attribute syntax: ALIGN(<parameter>);
  Parameters allowed: left, right;
  Default value: 'right'.

Since [1], the default value is:

  'left' for octetstrings, 'right' for all other types.

[1] 3cbafbd31d

In the most 'BTS_Tests.TC_pcu_*', including both 'TC_pcu_data_req_agch'
and 'TC_pcu_data_req_imm_ass_pch' we do pass the payload of length 23
bytes to ts_PCUIF_DATA_REQ(), what is less than the actual field length
(162 bytes). Thus when using titan.core <= 6.5.3, the payload appears
at the end of the buffer on the BTS side, so it reads 23 zero-bytes
from the beginning and does transmit them.

Let's explicitly add ALIGN(left) to field 'data' of 'PCUIF_data', so
the alignment would be done correctly, as expected by the BTS. Let's
also drop 'OCT162' type, as it doesn't make sense outside the
message definition.

This change makes the following test cases pass:

  - 'TC_pcu_data_req_agch' and
  - 'TC_pcu_data_req_imm_ass_pch'.

Change-Id: Ic4f358e5053e30e0dd7be8b6ac9c1d86cf9d8065
2019-05-17 01:08:22 +07: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