Commit Graph

414 Commits

Author SHA1 Message Date
Daniel Willmann 5fdb9bba17 Fail if f_streamId_by_trx() can't find a stream id
Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577
2018-07-24 09:57:46 +02:00
Daniel Willmann 5169d6e167 library: Ensure setverdict(fail is followed by mtc.stop
This will prevent subsequent failures from overwriting the verdict so we
can easily see the root cause of the test failure.

Using testcase.stop instead for errors internal to our test
infrastructure to mark them as test errors instead of failed.

Change-Id: Idc6819aaf0b01e70c38fad828dd44dcec6bdd778
2018-07-24 09:50:02 +02:00
Pau Espin f3e25384d7 lib: gtp: Add templates to send ErrorIndiciation
Change-Id: I7c20bc3b62a953efe57eb05a8ba89f9f0830a816
2018-07-21 17:54:35 +00:00
Pau Espin 940134537a sgsn: Add Test to verify Recovery procedure during CreatePdpResp
Change-Id: Ic81b854967492194367b7ce8a667c29c777791bf
2018-07-21 17:54:35 +00:00
Pau Espin 67e47dd328 lib: L3_Templates: Fix DEACT PDP REQ msg type and make tearDownInd optional
Specs state in 3GPP TS 24.008 that TearDownInd IE is optional, so allow
possibility to omit it.

Also fix protocolConfigOpts being passed as parameter but not being used
in template tr_SM_DEACT_PDP_REQ_MT.

Change-Id: I006d64f51c17a22a42a225ddfa4119933e48a022
2018-07-13 19:16:22 +02:00
Pau Espin 20e16c1983 lib: GTP_Emulation: Allow receiving packets with TEID 0
Some GTP messages like Echo Request, Echo Reply and Ind Error don't use
the TEID value. According to 3GPP TS 29.060 sec 9.3.1 in those cases the TEID is
set to 0:

"""
- TEID: Contains the Tunnel Endpoint Identifier for the tunnel to which this T-PDU belongs. The TEID shall be
used by the receiving entity to find the PDP context, except for the following cases:
- The Echo Request/Response and Supported Extension Headers notification messages, where the Tunnel
Endpoint Identifier shall be set to all zeroes.
- The Error Indication message where the Tunnel Endpoint Identifier shall be set to all zeros.
"""

Change-Id: Ic702b78028e850ed961ef805f35e10a42da34e56
2018-07-11 20:16:34 +00:00
Daniel Willmann 8273fb9ceb RSL_Emulation: Stop with error verdict if conn table runs out of space
Change-Id: If1a002da97cf1b66855f2e7a0fe2a54a6428bc81
2018-07-06 18:04:52 +02:00
Philipp Maier 33e5261154 GGSN_Tests: test what happens when PCO contains only one DNS entry
When the protocol configuration options (PCO) contain an IPCP container
then lists only one one DNS server (normally there are two included, a
primary and a secondary). Than the parser in osmo-ggsn runs into an
endles loop. This testcase tries to provoke this behavior by sending
PDP CONTEXT ACTIVATE messages with PCO that contain only a single DNS
entry per IPCP container.

The hanging of osmo-ggsn is already fixed (see Depends). However when
Primary and Secondary DNS are in separate IPCP containers, then only
the first IPCP container is parsed (see also OS#3381)

Change-Id: I71761e1f9db7ceac3c3df43d2e539f8c8d53c4fc
Depends: osmo-msc Icffde89f9bc5d8fcadf6e2dd6c0b4de03440edd5
Closes: OS#3288
Related: OS#3381
2018-07-05 15:40:43 +00:00
Harald Welte 15de8ba162 bts: Extend Osmocom-specific RSL "supplementary meas info IE"
In osmo-bts Change-Id Iea4a4781481f77c6163d82dcd71a844a5be87bf2
we introduce an Osmocom specific "supplementary measurement info IE"
into the RSL MEAS REP message.  This commit adds the related type
definitions and extends the related matching in BTS_Tests.ttcn.

Change-Id: I5d1114c73508c67ad7cd9864d7370367612b1241
2018-06-29 17:53:10 +00:00
Philipp Maier 2321ef92a3 MGCP_Test: add tests to verify actual RTP flows
The test coverage of the RTP aspects of the MGW is currently very
minima. Lets add a few more testcase to verify RTP behaves as
expected in various situations.

- Add testcase TC_one_crcx_receive_only_rtp:
  Test recvonly mode of the MGW. All packets must be absorbed by
  the MGW, no packets must come back.

- Add testcase TC_one_crcx_loopback_rtp:
  Test loopback mode of the MGW. All packet sent to the MGW must
  come back.

- Add testcase TC_two_crcx_and_rtp_bidir:
  We already test unidirectional transmissions. This test does
  the same as TC_two_crcx_and_rtp but for both directions.

- Add testcase TC_two_crcx_mdcx_and_rtp:
  Simulate a typical behaviour of a normal call. First create
  two half open connections and complete the connections later
  using MDCX.

- Add testcase TC_two_crcx_and_unsolicited_rtp:
  Test what happens when a RTP packets from rogue source are mixed
  into the RTP stream.

- Add testcase TC_two_crcx_and_one_mdcx_rtp_ho:
  Test a typical handover situation. An existing connection is
  handovered to another source on one end but the old source will
  keep transmitting for a while.

Change-Id: I556a6efff0e74aab897bd8165200eec36e46629f
Closes: OS#2703
2018-06-28 14:15:10 +02:00
Philipp Maier 11a5894165 BSC_Tests: use correct payload types and encoding names on MGCP
The test currently use a hardcoded payload type and encoding name.
This does mean in practice that even when an assignment with EFR
is happeining. The MGCP responses to the BSC tell that the codec
is AMR. This is not correct. The testcases should always pick a
suitable payload type / encoding name in the MGCP response

- Add constants for IANA/3GPP assigned payload types
- Add function to lookup the right encoding name for a payload type
- Initalize the encoding name and payload type in g_media according
  to the BSSAP PDU.

Change-Id: I2735267091059e2f2169da80bdcd30abc2b1554b
Realted: OS#2728
2018-06-25 19:55:09 +00:00
Vadim Yanitskiy 911257ebb2 library/GSUP_Types.ttcn: SS Info IE is optional for GSUP_PROC_SS_*
The 'SS Info' IE is optional for GSUP_PROC_SS_{REQ|RSP} messages,
and is not carried in some cases, e.g. when a subscriber aborts
an active transaction by pressing the 'red button'.

Change-Id: I20d9028acbe0c457d2a2cf72eff372b749d8dc30
2018-06-21 21:58:39 +07:00
Vadim Yanitskiy 52f8b6ee1d library/L3_Templates.ttcn: fix f_facility_or_wc(omit)
According to GSM TS 04.80, table 2.5, the Facility IE is optional
for RELEASE COMPLETE message. So, if this IE is omitted, then the
whole TVL shall be omitted. It's time to fix this.

Change-Id: I216195ef71c95997708dad8c31b172b6f6cdc461
2018-06-19 22:20:35 +07:00
Vadim Yanitskiy b59ae2dfcf library/SS_Templates.ttcn: add empty Return Result template
According to GSM TS 04.80, table 3.4, the Return Result component
may be empty, i.e. may not contain any results nor operation code.
It is used, for example, in responce to the network-originated
USSD notification.

Change-Id: Iaaff110c5f61cc87eda6143cd841f9832f6074bf
2018-06-19 22:20:35 +07:00
Neels Hofmeyr 378a49ce60 bsc: handover: actually send Handover Detect
Until now, the test went from RR Handover Command directly to RR Handover
Complete, and osmo-bsc didn't mind it. However, the normal handover procedure
requires an RSL Handover Detect to be sent in-between those. Send that.

Change-Id: I6e54edcc3a99e116d852eca8e48c7a5bc685e832
2018-06-18 17:54:33 +02:00
Alexander Couzens 2c15342ae7 lib/BSSGP_Emulation: fix removal of items in ClientList
Previous the old entries aren't removed. This only had an
impact if two different f_TC_* were using the same imsi.
When the second function tried to remove the Client again from
the ClientList, the BSSGP_Emulation failed.

Change-Id: I71103e8f8c5f18e8ebadc057cd62d85affd7ca8c
2018-06-13 15:43:24 +02:00
Alexander Couzens 1e6d990540 Osmocom_VTY_Functions: introduce f_vty_transceive_not_match()
fails when vty response match template.

Change-Id: I489d2a47cd4690dcfc3f1042c332014593d082a2
2018-06-12 13:51:14 +02:00
Alexander Couzens 98aa59e064 Osmocom_VTY_Functions: move f_vty_transceive_match from HLR to this library
f_vty_transceive_match will be used by future SGSN tests.

Change-Id: Ia69ab6d5639c2e10059f88c8cc97463820cb72e6
2018-06-12 13:51:14 +02:00
Harald Welte e8d750e668 bts: More complete AGCH / IMM.ASS testing
The existing test simply sent 1000 messages via RSL without checking
what actually arrived on the radio interface, or without
expecting/counting any RSL DELETE IND.

Let's fix this by introducing test sending IMM.ASS at three different
rates, with related expectations in terms of nubmer of IMM.ASS arriving
on Um vs. RSL DELETE IND arriving at BSC.

Change-Id: Ib6043b76ba1d7aaff107bb612f63b5a747d8720c
Related: OS#2990
Related: SYS#2695
2018-06-10 21:44:29 +02:00
Pau Espin 752ffd565a bts: Set L1CTL rxlev_exp as module parameter
Change-Id: If63e5c2d6abe1dd6dddd1a12e703ed069b940ab4
2018-06-07 17:15:27 +00:00
Philipp Maier 45635f4379 MGCP_Test: Test non LCO crcx
When a CRCX without an LCO option (codec) is sent, then older versions
of osmo-mgw will omit the port number in the SDP part of the response.
Also no default codec is selected and reported back. This testcase
pinpoints the problem.

Change-Id: Ie16cdab936ce468fe378d4ec9e1c61f81c07fb4e
Related: OS#2658
2018-06-06 17:16:21 +02:00
Alexander Couzens d8604ab9ae L3_Templates: tr_GMM_DET_REQ_MT: use * instead of omit for `cause`
The omit force this field to be not present, while a * allows to be present or not.
As user of this tr I would expect to ignore this field rather than an explicit omit.

Change-Id: Iae91f752789273934a6382bdd474594c3c50bbe9
2018-06-05 13:04:41 +00:00
Harald Welte cc0b014903 bsc: Add LCLS related test cases
This is an early WIP, we actually will need to establish two calls/legs
before the BSC is able to locally correlate them.

Related: OS#1602
Change-Id: Ie6d0b9c38027abf65c7c564fc79b889d013fa6a7
2018-06-03 10:33:41 +00:00
Vadim Yanitskiy b761d14e58 GSUP_Types.ttcn: add SS related messages and IEs
Recently we introduced a few new GSUP IEs, related to TCAP-like
session management and Supplementary Services in libosmocore.
Let's sync the TTCN-3 implementation and add the corresponding
templates for SS payloads.

Change-Id: I54767e49ae98db67f71dd28278b14435860313e0
2018-06-02 18:57:35 +00:00
Vadim Yanitskiy 4019ec9691 library: introduce Facility IE templates for SS/USSD
Change-Id: Ibc3e8f70230d656b2f0994ea0c63e6554b6165de
2018-06-02 04:55:18 +07:00
Vadim Yanitskiy 0319813c41 L3_Templates: add GSM 04.80 RELEASE_COMPLETE message
Change-Id: Iaf295aeb4ef475d41d0eeddcca5e864016fd91cc
2018-06-02 04:55:18 +07:00
Harald Welte 354722e252 BSSMAP_Templates: Fix LCLS related template definitions
They should all have been derived from the tr_BSSAP_BSSMAP /
ts_BSSAP_BSSMAP base templates.

Change-Id: Ib9ef03fe1c5f2eedde9e274a50dfedb2fb6b6a0f
2018-06-01 18:25:57 +02:00
Harald Welte 0b50aeda34 BSSMAP_Templates: Add templates for LCLS related IEs + messages
We will soon implement some LCLS related test cases, and hence
we need some templates for sending and matching received messages.

Change-Id: I5300418ae493f6c315248562938b47ae1931b452
2018-06-01 12:00:56 +02:00
Harald Welte e32ad992af *_Emulation.ttcn: Specify destination when replying on procedure ports
procedure ports (like message ports) require us to specify the
destination of a message ("reply") in case it is connected 1:N and not
just 1:1.  This didn't show up as a problem so far, as we typically only
had one component talking to those procedure ports at any given point
in time.

Change-Id: I696ec67080815348bb95e43ecbbf262e533e39a3
2018-06-01 12:00:56 +02:00
Harald Welte 53603961fe L3_Templates: Add templates related to Supplementaryt Services
Change-Id: I919fa542a2e037b3fcf8cd5b0b9d7599b8c09070
2018-05-31 13:30:18 +00:00
Harald Welte d879e2ff9a RSL_Emulation: Handle ID_ACK event in BSC role
In I483ddd45c1cf631a5a9d8f862b6ca728b38bdc14 we introduced code
that makes the IPA_Emulation code to emut an ASP_IPA_EVENT_ID_ACK
[also] to the RSL port, irrespective of client/server status.

However, RSL_Emulation only handled this event in the BTS role
for BSC testing, but not in in the BSC role for BTS testing.

Change-Id: I99a5c58ea8d1e74b2ad51aed23009af6322a1007
2018-05-27 20:24:07 +02:00
Harald Welte d5833a8dcc BSSAP_Adapter: Split f_bssap_start() from f_bssap_init()
In non-handler mode, the SCCP emulation is currently started before
there's a user registered to SCCP_SP_PORT.  If the first BSSMAP
package arrives from the network, then the SCCP_Emulation will crash
as it cannot deliver the resulting SCCP user primitive to the user.

Let's split start from initialization, so user code can still register
something to SCCP_SP_PORT before starting SCCP_Emulation.

Change-Id: I55c94f18531bb7e5369500dc90f4b0ff3a420774
2018-05-27 15:33:27 +00:00
Harald Welte 710ec2154f BSSAP_Adapter: cosmetic typo fix
Change-Id: I2aba2316f12c2f752d58e58687c1ef529b983b96
2018-05-27 15:33:27 +00:00
Harald Welte 4239918711 BSSAP_Adapter: Connect ConnHdlr:MGCP to IPA MGCP in SCCPlite case
Change-Id: Ic86dd023693df5ad593eec090af815c926f87d34
2018-05-27 15:33:27 +00:00
Alexander Couzens 4cfff3a2bf GSUP_Types.ttcn: allow other TLV appear in Cancel Location Errors
Change-Id: I21ee02556f0734dad871a6294b21ca6f2864dea0
2018-05-26 21:03:54 +00:00
Alexander Couzens d62fba5401 L3_Templates: add template tr_GMM_DET_REQ_MT/ts_GMM_DET_ACCEPT_MT
Change-Id: Ifea650994408c4dd83f46f6256565d38968bf843
2018-05-26 21:03:54 +00:00
Alexander Couzens b6ab45606a L3_Templates: add values for c_GMM_DTT_MT_*
GMM detach type values

Change-Id: I4903fa4c915add3062ab6b82a1d39d60426b5681
2018-05-26 21:03:54 +00:00
Stefan Sperling f82bbb6829 make PCU tests send PS paging requests on BVCI zero
osmo-pcu discards PAGING-PS messages unless received on the
signalling BVCI 0. The BVCI value must be set to zero both
in the NS header and the BSSGP header. Create new ports between
the PCU_Test components which the TC_paging test case can use
to ensure that both layers send frames with BVCI value of zero.

This does not make PCU_Tests.tc_paging work yet, however the PS
paging request is now processed by osmo-pcu rather than discarded.

Change-Id: I0437123b04b7320a4f690f0646578c57abf6bc87
Related: OS#2404
2018-05-25 14:26:19 +02:00
Harald Welte 2e32e4321b BSSAP/IPA integration: Wait for SCCPLite to be established
Before this patch, we had some problems related to synchronization
between the IPA transport, SCCP emulation and BSSAP layer in SCCPlite
configurations.

This code ensures that f_bssap_init() will block until the IPA
connection (client or server) is established, and then start the SCCP
and BSSAP emulation components in the right order.

This in turn ensures that the initial BSSMAP RESET that we're sending
from the TTCN-3 side is only sent once the IPA connection is fully
established, and the CCM Identity handshake has happened before.

Change-Id: I483ddd45c1cf631a5a9d8f862b6ca728b38bdc14
Related: OS#2544
2018-05-24 20:02:55 +02:00
Pau Espin b1eaa6fc91 library: PCUIF_CodecPort: Log PCU socket connect error string
Change-Id: I7045061770cda5b50d05dbf756656e380084a703
2018-05-24 12:59:42 +02:00
Harald Welte 9220f6336e Print more self-explanatory error message on bind/connect failures
When sockets cannot be bound or connected, the existing TTCN-3 code prints
the following rather cryptic error messages:

"IPA-CTRL-IPA(47)@f70ff1fd5cfd: Dynamic test case error: Using the value of an optional field containing omit. (Transport endpoint is not connected)"

The "Transport endpoint is not connected" sort-of gives it away, but
let's make it more explicit by introducing explicit checks for the
res.connId and manual setverdict(fail) statements with proper error
message.

Change-Id: Id22a1b5189d81c4fca03d5e7aff60ffdd1ad56bf
2018-05-23 20:27:02 +02:00
Harald Welte e613f96593 bts: ciphering tests
Change-Id: If450e36cfd8cde713f304e57ec09bc1239bdf7ea
2018-05-10 18:36:59 +02:00
Harald Welte 1bbe0b733d LAPDm_Types: Fix encoding of S+I frames
For some reason, the "FIELDORDER(lsb)" only worked for U-frames,
but not for S- and I-frames.  Probably a TITAN bug, but rather than
debugging that now, let's rewrite the LAPDm types as "FIELDORDER(msb)"
as that appears to work.

Change-Id: Id90ff80576fd8007def4d8d027b481eef693ddc0
2018-05-10 18:35:34 +02:00
Harald Welte 0472ab4415 bts: Add RLL tests
This adds a series of test cases to BTS_Tests.ttcn implementing testing
of the RLL sub-layr of RSL, i.e. the translation between LAPDm frames
on the Um interface and the RLL frames on the Abis side (and vice vrsa).

Related: OS#3174
Change-Id: I336378de6106e5369600cbb49e0c47cc59864630
2018-05-09 08:54:53 +02:00
Neels Hofmeyr 0ecb2e3516 sgsn: test umts aka with gsm sres response
Add ability to test UMTS AKA, by f_gmm_attach() with flags to select UMTS AKA
and to respond to it with GSM AKA SRES.

Add TC_attach_umts_aka_umts_res and TC_attach_umts_aka_gsm_sres.

Change existing TC_attach_* to also call f_gmm_attach(). (Actually,
f_gmm_attach() is almost exactly the previous TC_attach function body.)

osmo-sgsn change I36807bad3bc55c0030d4f09cb2c369714f24bec7 will implement
proper handling of GSM AKA response and make TC_attach_umts_aka_gsm_sres pass.

Related: OS#3193 OS#3224
Change-Id: I201ffeaee4439a413ab8289aceeccca9aba40a7a
2018-05-02 09:14:36 +00:00
Harald Welte efa7d919f5 RSL: Introduce template (value) annotations
Change-Id: I18828ccbc7d28dd190e745f020c724acdb0cdc8b
2018-04-18 23:23:22 +02:00
Harald Welte d879bd9aa0 LAPDm: Re-structure: Merge Frame type A+B which are really the same
A is B with zero-length payload.  No need to separate them.

Change-Id: I7b3079899f42a61d67be03e3a17346af80d7b3be
2018-04-18 23:23:22 +02:00
Harald Welte 2d86affc8c IPA: Fix wrong CCM ID_ACK logic; disable CCM on CTRL interface
Our TTCN3 implementation of the IPA multiplex with CCM handshaking
has been based on some wrong assumptions about the protocol logic.

To make the code stricter, we
* send an ID_ACK immediately after connecting TCP in a client
* separate client and server CCM responder logic
* always respond with ID_ACK to ID_RESP (we accept any identity)

Also, as the Osmocom CTRL interface uses an IPA multiplex but no CCM,
we introduce a boolean variable (and function argument) to clearly
enable/disable CCM support in a given IPA_Emulation component.  The
CTRL_Adapter has been modified to use this flag to disable CCM.

This also removes the need of cherry-picking
	"HACK: Work around IPA CCM bug in OsmoBSC"
	Change-Id: I304535d28a165f76a0a140dc0a15dd81a9db28c8
from the laforge/bsc-workaround branch.

Change-Id: I6d9eaf0d69457caacc03b9049a8bc57976480617
2018-04-17 19:52:30 +00:00
Harald Welte 7ef51aa2a2 BSSAP_Adapter: Introduce transport over IPA/SCCPlite
In addition to the existing 3GPP AoIP stacking, allow BSSAP to
run on top of a SCCPlite stacking.  Implement both the server and the
client role for IPA.

Related: OS#2544
Change-Id: Ie844c4de62e0ef5d5c4c366185968211a7f6d676
2018-04-17 21:49:05 +02:00
Harald Welte 80f7687f18 RSL_Emulation: Less verbose logging
Don't use explicit log() statements for normal message forwarding
between ports.  This will be visible in the automatically-generated log
statements anyway...

Change-Id: Idcfb1897dd00df1839cf1a0182a5a030bf71c0cb
2018-04-15 11:21:55 +02:00