Commit Graph

435 Commits

Author SHA1 Message Date
Alexander Couzens 4786b3f5ed library/GSUP_Types: correct value of the GSUP_CancelType
The comment in the c header of OSMO_GSUP_CANCEL_TYPE_UPDATE says:
1 = /* 0 on the wire */,
2 = /* 1 on the wire */

Change-Id: I4d22af9fee19e6036dbb555422759e3c1285416a
2018-09-16 03:33:30 +02:00
Alexander Couzens d24973deb1 GSUP_Types.ttcn: add tr_GSUP_SAI_REQ_UMTS_AKA_RESYNC
Match only on AKA RESYNC packages

Change-Id: Ibab8a76fde78db6e7a84794e0b641bcb7b1fd1a7
2018-09-11 16:20:28 +00:00
Alexander Couzens 387f7f37b1 L3_Common: extend the AuthVector to contain AUTS
AUTS is used in the UMTS AKA resync procedure.

Change-Id: Id1afa47778e6220cab375ae4b54b251801724fdb
2018-09-11 18:04:14 +02:00
Alexander Couzens 15faf92611 L3_Template: add template ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC
ts_GMM_AUTH_FAIL_UMTS_AKA_RESYNC send a Authentication & Ciphering failure
to resync the USIM with the HLR.

Change-Id: Ia58dc1483757887ca14cfae19e30f9c91fef5874
2018-09-04 17:15:03 +00:00
Stefan Sperling 6a90be4bae improve connection failure message in IPA emulation
Show addresses and ports which were attempted in the IPA
connection failure message.

Example output:
Verdict: fail reason: Could not connect IPA socket from "" port -1 \
	to "127.0.0.1" port 4238; check your configuration

Change-Id: I828fe67d66bcd668aa14922b89a2feac56dc2d9a
2018-08-31 15:07:40 +02:00
Stefan Sperling 02585905fb show return code when sending L1CTL_FBSB_REQ fails
Provide a little bit more information when a BTS test fails
due to L1CTL FBSB failure.

Example output:
Test case TC_si_sched_default finished. Verdict: fail reason: \
  FBSB Failed with non-zero return code 255

Change-Id: I5e8f23a2615b64bdf3167d486ba808c93f0f4b23
2018-08-30 17:06:48 +02:00
Neels Hofmeyr 3bf31d216a fix SCCPlite BSC tests: send IPA ID ACK, not GET
From libosmo-sccp.git Icffda98579e676ab6ca63c9c22cf5d151c4fe95f on, we expect
an IPA ID ACK upon first connecting, not an IPA ID GET. This might be specific
to the one MSC tested so far, but it's the status quo.

Make the IPA server in IPA_Emulation configurable, to conform and send the IPA
ID ACK upon connecting.  This fixes the ttcn3-bsc-tests,SCCPlite suite, broken
by above libosmo-sccp commit.

For other IPA clients, it is so far required to send the IPA ID GET, so only
configure the SCCPlite server in BSSAP_Adapter.ttcn to send IPA ID ACK, and
leave the others unchanged.

Related: OS#3500 OS#3498
Related: Icffda98579e676ab6ca63c9c22cf5d151c4fe95f (libosmo-sccp)
Change-Id: I34b6296a1a408729802a9659c6524c0f67a2f4fe
2018-08-24 18:29:48 +02:00
Alexander Couzens 56101c935e BSSGP_Emulation: dont fail when removing a non-exitent client
On multiple BSSGP tests the IMSI might not anymore registered to the first BSSGP

Change-Id: Ibad8971e5acc2691da29cf7fa394d1d58eea79a4
2018-08-14 13:26:47 +00:00
Alexander Couzens 7eb5b85f39 BSSGP_Emulation: remove unused BSSGP_SP.receive(PDU_L3_MS_SGSN)
As the llc is handled outside, this function is not anymore needed

Change-Id: Ib910dec4a54e155573c162a70731f20cbf1e9c5d
2018-08-14 13:26:47 +00:00
Alexander Couzens cdfb7515ba BSSGP_Emulation: move LLC layer out of BSSGP
The LLC layer needs to be accessed by the SGSN tests
in order to do multi-BSSGP tests.
Otherwise the sgsn will see LLC frame with wrong sequence
numbers and drop them.

Change-Id: Ie9e9d7da0a78a96f4f431c9085b9e273a39535f1
2018-08-14 13:26:47 +00:00
Alexander Couzens 6b449fbf84 BSSGP_Emulation: add type record LLC_Entities
In prepartion of moving the LLC layer out of the BSSGP

Change-Id: I1a8c6a608c84a984e542510482bbfc5394ae6658
2018-08-14 13:26:47 +00:00
Alexander Couzens 0e510e693d BSSGP_Emulation.ttcn: extend BSSGP_Client_CT to hold 3 instances of BSSGP
Change-Id: Ibd7abba826a08b582361e9c255e9c44185e14067
2018-08-14 13:26:47 +00:00
Alexander Couzens 2c12b24a47 NS_Emulation: support multiple instances at the same time
The NS_Emulation has configuration values hardcoded or bound
to module parameters which prevents multiple instances.
Replace the module parameter based configuration with configuration
given when starting the NS_Emaulation.

Change-Id: I9128f9ad5c372779c38799269393137ba52576cd
2018-08-13 16:23:50 +00:00
Stefan Sperling 4880be4385 add DTX fill frame BTS tests
Add tests TC_tch_sign_l2_fill_frame and TC_tch_sign_l2_fill_frame_dtxd.

TC_tch_sign_l2_fill_frame is already passing and verifies that fill
frames are sent if there is nothing else to transmit on a SDCCH4/SDCCH8,
TCH/H, or TCH/F signalling channel where DTX is disabled for downlink.

TC_tch_sign_l2_fill_frame_dtxd is currently failing. It verifies that
only specific fill frames are sent, as required by GSM 05.08 for TCHF
signalling channels with DTX enabled for downlink. At present, our
implementation generates no fill frames in this case, which is one
piece of the problem described in issue OS#1950.

Change-Id: Id4e0de6e78b62cd408f600a57a28617d91da64af
Related: OS#1950
2018-08-09 11:08:44 +00:00
Harald Welte f9d449edd6 HLR: Add HLR_EUSE.ttcn to implement minimal external USSD Entity
As OsmoHLR is getting support for external USSD Entities (EUSEs),
we have to implement this function in the test logic in order to
test it.

Change-Id: Ibab210b06abfd5a21e81c7f7fbe574c4f67414a0
2018-08-08 11:06:31 +02:00
Harald Welte b409ff2819 move USSD_Helpers.ttcn to library
We want to use those also from the HLR_Tests, not just from MSC_Tests.

Change-Id: I22be6c03d85dc6d6a8266b5ebce5d0c69c0551ed
2018-08-07 23:32:32 +02:00
Harald Welte 95686e0bd7 IPA_Emulation: Add missing zero byte to strings in IPA CCM ID RESP
Change-Id: I3fdc0f47381d5ba1763197d5f264696f04d0396f
2018-08-02 15:14:03 +02:00
Stefan Sperling 23b45974ce detect VTY TELNET port connection failures (attempt #2)
Pass the CTRL_DETECT_CONNECTION_ESTABLISHMENT_RESULT parameter to
the TELNET port by default. This allows tests to make progress
into an error handling path if they are started while the osmo-*
program they want to connect on VTY is not running.

Observed with osmo-ggsn tests, where if the one test runs
into a VTY connection failure the subsequent test would get
stuck forever in a map() call on the VTY TELNET port.

Teach the function f_vty_wait_for_prompt() about connection
reports by the TELNET module. We may now receive an integer which
represents the socket file descriptor for the telnet connection.
This case was not handled by the previous change made in
commit cb111b21ab. As a result,
BSC tests started failing with "VTY Timeout for prompt" because
the alt-statement in f_vty_wait_for_prompt() would not progress
past the integer sitting on the VTY port's receive queue.

Change-Id: I56925f93af6c55e93f3f417099db135744da6a40
Related: OS#3149
2018-07-27 17:20:38 +02:00
Philipp Maier 3629139790 MGCP_Test: add function to check for RTP err counters
At the moment we check the error counters of the RTP statistics in
the testcases. However, in most situations we will do the check to
make sure that no errors occurred (all counters == 0). Rather than
having a long tail of if statements in the testcases we should have
a function for this. This also makes it much easier in case we add
more error countes lateron.

- add and use function f_rtpem_stats_err_check()

Change-Id: I69e5f80b0765284ec99056ce62c315461967d2a1
Related: OS#3384
2018-07-25 18:44:54 +00:00
Stefan Sperling c307e689b4 introduce a TTCN3 test suite for SCCP
This test suite acts as an SCCP server on top of M3UA.

SCCP tests are run against the sccp_demo_user program which
can be found in libosmo-sccp/examples. This program must be
started in client mode: sccp_demo_user -c
The SCCP test suite should then work out of the box with
the provided SCCP_Tests.cfg file and this additional change
to sccp_demo_user default point codes:
https://gerrit.osmocom.org/#/c/libosmo-sccp/+/9652/

There is currently only one test, for the libosmo-sccp crash
reported as issue OS#2666. The implementation of this test
is currently using an ugly workaround due to shortcomings of
the M3UA Emulation layer (see source code comments). Whether
a better solution is feasible is still to be determined.

The test requires a patch to the SCCP Protocol Emulation which
has been submitted upstream: https://git.eclipse.org/r/#/c/124552/

Change-Id: I03f5e8b282a7396b45417495c88d8fb81b26cda8
Related: OS#2666
2018-07-24 19:05:10 +00:00
Philipp Maier c290d7292e MGCP_Test: check payload type of received RTP packets
When an RTP packet is received, the payload type is not checked,
so we will not detect if the MGW emits packets with a wrong payload
type for some reason.

- Introduce a statistics counter that counts packets with wrong PT
- Update testcases so that they check for the statistics for wrong
  PT count.

Change-Id: I83d4b04656a16ced624024245a2fcb7a0ad48a8a
Related: OS#3384
2018-07-24 19:01:27 +02:00
Daniel Willmann a6ea2ef867 Fail if f_streamId_by_trx() can't find a stream id
Change-Id: Ie58278edf7050254d7cdced48b4b7870e0e8d577
2018-07-24 14:19:42 +02:00
Daniel Willmann e4ff537f9b 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:54:18 +00: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