Commit Graph

1011 Commits

Author SHA1 Message Date
Pau Espin 482dde66cb sgsn: Add test to verify GPRS ctx deact caused by GTP ErrorInd
Change-Id: I40e877f4126e62a731b071ae1d6d855fed210433
2018-07-21 17:54:35 +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 8be4d1920d sgsn: Remove uneeded f_gtpu_send in f_gtpu_xceive_mo
It's not needed for the functionality/scenario of f_gtpu_xceive_mo. It
probably was left in when creating it from f_gtpu_xceive_mo.

Change-Id: Ide226f8501c4598e2bfaa5f1ea62c3ff20807ce4
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 72edc8ad7f sgsn: Add Test to verify timer t3395
Change-Id: I9ec0863603692045b0d8da376e65080150066173
2018-07-21 17:54:35 +00:00
Philipp Maier 28bb82990c MGCP_Test: Make sure PT in RTP-Stream and MGCP match up
At the moment the RTP stream emulation is left in its default
configuration, this means that the payload type that appears in the RTP
stream is always 0. This may mismatch the payload type that is
configured with MGCP.

If nothing else is set, we should make sure that whan we create and modify
flows, the RTP emulation is always reconfigured to use the payload-type that
we set in the flow parameters. The other rtp-emulation parameters should
be set to their defaults.

- Make sure f_flow_modify and f_flow_create set the rtp flow parameters
  properly.

Change-Id: Ie888424ac3e0bf0d960b6f071855b6dd43935a0e
Related:OS#3384
2018-07-21 08:20:59 +00:00
Philipp Maier c1e95c844c MSC_ConnectionHandler: make as_handover more race robust
The IPACC and MDCX interaction happens nearly in parallel to the
normal RSL connection that handles the handover, in particular the
channel relase from the old BTS may arrive in between IPACC and MGCP
operations.

- When the channel release arrives, check if MGCP and IPACC
  operations are done (we have seen one MDCX on MGCP and an CRCX
  plus an MDCX on IPACC level)

Change-Id: I207e9ece48ec53f872f82d981435cee7c2d0b094
Related: OS#3396
2018-07-21 08:20:59 +00:00
Neels Hofmeyr 692c9ee854 msc: add TC_mo_cc_bssmap_clear to catch OS#3062
The test currently crashes osmo-msc, which is fixed by
I5c30e0f9545fb76615776ff6cc16b56aeb5b043a (osmo-msc).

Related: OS#3062
Change-Id: Ic80646e1fba37bb6163ca3a7eead7980b4ad7a51
2018-07-20 14:03:03 +00:00
Stefan Sperling 8e7a396656 fix TC_pdp4_act_deact_with_separate_dns
Do not delete the PDP context too early, and look for the second DNS
server in the correct place (2nd match on IPCP protocol, not 1st).

Update a comment which talks about a bug which has been fixed.

Change-Id: I109491cc9ccb060792e29bf6b2999ef48723edbf
Related: OS#3319
Related: OS#3381
2018-07-19 19:58:06 +02:00
Neels Hofmeyr d07ee1396f bsc: fix as_handover(): first RSL should be EST IND, not DATA
Change-Id: I41b395eb7dbdd56796706722d79c7a3bc5a0b5b0
2018-07-19 00:10:09 +02:00
Neels Hofmeyr b0e7365974 bsc: fix f_establish_fully(): first RSL should be EST IND, not DATA
Change-Id: Ia609b67c28ce07fa3bf33e3c4a5658046474d60a
2018-07-19 00:10:09 +02:00
Philipp Maier 0a5d7e7920 MSC_ConnectionHandler: more verbosity for f_check_mgcp_expectations()
The function f_check_mgcp_expectations() checks the counters that
count the occurrence of MDCX and CRCX messages against computed
expected values. At the moment it is not easy to spot where exactly
the deviation occurred. Lets add some log output so that we can see
which type of message on which connection was missing or too much.
Also add a string parameter that is set to the calling functions
name so that we know from where the check has been triggered.

- Add more verbose log output for counters
- Add parameter to prepend to the log line

Change-Id: Ida0eba4ef3c1db977d392267ef76ec37b87133b3
Related: OS#3292
2018-07-17 09:37:49 +02:00
Philipp Maier a0976e9fde MSC_ConnectionHandler: expect additional MDCX when call is LCLS
The function f_establish_f_establish_fully does not yet handle the
case where calls get switched locally. In those cases we expect to
see one additional MDCX before the BSSMAP ASSIGNMENT COMPLETE is
sent.

- Check exp_ass_cpl if the call is expected to be LCLS and expect
  another MDCX for those cases.

Change-Id: I55fae5ab03980cd810ed7dc38208550686b1659e
Related: OS#3292
2018-07-17 09:27:07 +02:00
Pau Espin bcddb8c9b8 sgsn: Fix TC_attach_pdp_act_user_deact_mt
Expect to receive a TearDown Indicator.

Change-Id: I37dafb5e93ac06b3bd9cab2c06aa3735a8429f2f
2018-07-16 13:24:10 +02:00
Pau Espin dc27e483c8 sgsn: Add test to verify restart_ctr during echo req/reply.
Currently test doesn't fully work because it doesn't match the PDP CTX
DEL REQ correctly.

Change-Id: I1dcb250dba2079c14b857c0b89a02ac21d1c591f
2018-07-13 19:16:22 +02: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 8466722f3f sgsn: f_pdp_ctx_deact_mt: force teardown to avoid sgsn ignoring msg
According to
"""
If a GSN receives a Delete PDP context without a Teardown In
dicator or with a Teardown Indicator with value set to
"0" and only that PDP context is active for a PDN connection, then the
GSN shall ignore the message.
"""

Change-Id: Id5d4774d719685631e4b467dff833ae886c90145
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
Philipp Maier 3e2af5d4d7 BSC_Tests: count MGCP operations in as_media
as_media handles the MGCP interaction for most of the tests. However,
it does not make sure if transactions are missing or if too many
transactions are performed (e.g. if an SCCP-Lite tests still creates
the connections pointing to the core network, even if they must not
created by the BSC in this case). So lets make sure that the MGCP
transactions are performed as expected by counting them.

- Add counters to count CRCX and MDCX transactions
- Check those counters after call establishment and handover

Change-Id: Ib073b097a840ca3a8ee99c4ed41f59f574191d98
Related: OS#3292
2018-07-11 17:34:19 +02:00
Philipp Maier b242235551 MSC_ConnectionHandler: split up as_media into separate altsteps
as_media() tests both, IPACC/RSL media handling and MGCP media
handling. These two domains are technically quite separate, which
means we can split them up into two separate altsteps in order
to increase readability of the code.

- Split as_media() into as_Media_ipacc() and as_Media_mgw()

Change-Id: I539e8ffdb9f99d5a8e730dd918df502614b9e84d
Related: OS#3292
2018-07-11 10:36:57 +02:00
Philipp Maier 55f27f53ae BSC_Tests_LCLS: try call legs with different codec/rate
since the local MGW may not support transcoding, osmo-bsc should
avoid to LCLS call legs that use different codec/rate. This test
attemts to set up a call with different codec rate and checks if
those legs do not get LCLSed

Change-Id: I91b132306e530ad9ca03fb4a34012381be6b0b52
Depends: osmo-bsc I157549129a40c64364dc126f67195759e5f1d60f
Related: OS#1602
2018-07-10 15:33:53 +02:00
Philipp Maier 61f6b573b2 BSC_Tests: Also test LCLS with halfrate codecs
At the moment LCLS is only tested using GSM-FR. There are not LCLS
tests that test with GSM-HR yet. Lets make GSM-HR available and see
what happens when we run BSC_Tests_LCLS.TC_lcls_gcr_bway_connect
on HR instead of FR.

- set channelType depending on g_pars.ass_codec_list.codecElements[0]
- add testcase TC_lcls_gcr_bway_connect_hr

Related OS#1602
Change-Id: I2421519a642bdb7453ae4a9058e177845690a489
2018-07-09 11:37:21 +02:00
Daniel Willmann 17ddd852b0 BTS_Tests: Ensure mtc.stop is called after setverdict(fail, ...)
This will prevent subsequent failures from overwriting the verdict so we
can easily see the root cause of the test failure.

Change-Id: Iba59a69127e845cadbe9aaa1dabd87ff5ce8b43b
2018-07-06 18:04:52 +02: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
Pau Espin 205a384562 ggsn: Apply GPDU seqnum option to all APNs
Change-Id: I6efe926c8bb7a0056d26e15eefa282266e7bc6ca
2018-07-06 14:43:59 +00:00
Pau Espin 425b62f03e BTS_Tests: altstep as_meas_res: Check for meas timer timeout only if previously set
Should fix following spotted message in TTCN3 logs:
BTS_Tests.ttcn:1297 Timeout operation on timer g_Tmeas_exp failed: The timer is not started.

Change-Id: Ia28c40e8cb338ecc23f72474832307bba2b09503
2018-07-06 16:11:46 +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
Daniel Willmann a59afab67f Call f_shutdown after setting the verdict in TC_paging_*
Since f_shutdown now ends the testcase by calling mtc.stop we need to
set a verdict first.

Change-Id: Ia9dfcb1dd90e0f6fe61cf88a8de4c10a0cad4009
2018-07-05 16:53:30 +02:00
Daniel Willmann 3487a85d84 Stop testcase execution after failing
This hopefully prevents the verdict from changing to a dynamic test case
error during an unclean termination

Change-Id: I20e156982ae8150a9e7a145f66283de4a5d8e0bd
2018-07-05 16:53:30 +02:00
Daniel Willmann cc7bbebff3 BTS_Tests: Call mtc.stop in f_shutdown() to fix sporadic test failures
mtc.stop cleanly shuts down a testcase. This avoids errors influencing
the result after the test completed (such as ports being shutdown with
messages arriving on them causing a dynamic test case error).

Change-Id: I0f6e10006f46db0d68796c7082497af90f74cd07
2018-07-05 16:50:05 +02:00
Neels Hofmeyr bcf62bccf4 bsc: verify MultiRate Config IE in RSL Chan Activ
The current osmo-bsc refactoring causes an erratic MR Config IE. This patch
ensures that the ttcn3-bsc-tests catch this error.

Add MR Config IE expectations to g_pars, set these in the two tests that expect
an MR Config IE in the Chan Activ message:
BSC_Tests.TC_assignment_codec_amr_{f,h}

All other tests now verify that there is *no* MR Config IE in RSL Chan Activ
messages -- all other tests request no voice or a non-AMR codec for Chan Activ.

Change-Id: Ie841feed9d5e478bab1fea2bb86f300e84799013
2018-07-04 00:24:33 +02: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 4de3e377d1 MGCP_Test: do not use constant IP addresses
The RTP stream tests TC_two_crcx_and_unsolicited_rtp and
TC_two_crcx_and_one_mdcx_rtp_ho, which were introduced recently
with Change-Id I556a6efff0e74aab897bd8165200eec36e46629f, use
hardcoded ip addresses (127.0.0.1) to establish the RTP streams
that are used to test how the MGW reacts on unsolicited packets.
This works fine when everything runs on local host but on docker
it failes since the containers there have different ip-addresses.

- replace hardcoded IP-Addresses with modulepar variable in
  TC_two_crcx_and_unsolicited_rtp and TC_two_crcx_and_one_mdcx_rtp_ho

Change-Id: I5af5186f173c2b8564e8034249c82245acdd09f6
Related: OS#2703
2018-06-29 17:23:18 +02: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
Neels Hofmeyr 887e8f1e9e bsc: fix TC_{early,late}_conn_fail: dyn PDCH: clean up cfg
When leaving TS 6 in Osmocom style dyn TS mode, the initialization of the BTS
will cause a RSL Chan Activ, which the tests BSC_Tests.TC_early_conn_fail and
BSC_Tests.TC_late_conn_fail will interpret as the channel activation that they
expect to come from the Channel Request. They will hence issue the Conn Fail
message before the lchan is established, and are getting confused on what they
expect to happen.

Change-Id: I2bde987eefe7129c9f7c3b81b624d55cb66a75d0
2018-06-27 01:05:16 +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
Stefan Sperling 04fc4bcc18 check for osmo-msc crash upon overlong IMSI
Overlong IMSIs used to trigger an assertion failure in osmo-msc.
This problem has been fixed but there was no test for it yet.

A lazy way of testing for this problem is to send an overlong IMSI
from an existing test which already verifies related behaviour
and would fail if the MSC crashed: TC_lu_by_tmsi_noauth_unknown

However, osmo-msc currently accepts overlong IMSIs and silently
truncates them, so this change as-is currently breaks this test.
But I would argue that osmo-msc's current behaviour is unreasonable
anyway and have proposed a patch to change it:
https://gerrit.osmocom.org/#/c/osmo-msc/+/9739/
With that patch applied to osmo-msc, this test keeps passing.

Change-Id: I2c472bee76086f6c84ec684d2e58b3351ebc3147
Depends: I785c994f41a646d8d83d3d82f5a9ae6b572eb641
Related: OS#2864
Related: g#9739
2018-06-25 17:51:30 +02:00
Stefan Sperling b0ad3d8490 default to number of CPUs for parallel make jobs
The previous default behaviour was to always run 'make -j8', which
can cause C++ build failures on machines which are low on memory.
"Low" being a relative measure; I've seen failures with 4GB of RAM.

Rather than assuming a beefy 8-core box, try to detect the number
of available CPU cores with nproc(1) from GNU coreutils and set
the number of parallel make jobs to the number of CPU cores.

If this command is not available, default to a safe choice: -j1
Note that installing ccache will speed up repeated builds a lot
more than -jX ever will, so falling back to -j1 isn't very bad.

Change-Id: I61c3ea1b3cb5b64eecb08ad6c390594f70cdf785
2018-06-25 15:35:22 +02:00
Neels Hofmeyr dadde17425 ttcn3-tcpdump-stop.sh: print colored verdict
Change-Id: I0d2d6171430f1eebb5377edac5e237a99ddbd743
2018-06-23 11:43:00 +00:00
Philipp Maier 76a8d0160e MGCP_Test: ts_CRCX_no_lco: check media description instead of media attribute
The testcase ts_CRCX_no_lco looks at the media attributes to see
if it findes the expected default codec there. In this testcase
we expect PCMU/8000/1 as media attribute, but this is a codec from
the fixed payload type domain. The MGW may not list this info inside
the media attributes. Listing the payload type number in the media
description is sufficient. We should check this instead.

- Remove media attribute check
- Check meida description for PCMU (0)

Change-Id: I69600a1025e68011e8fc5d8bf22d842d9c63bf53
Related: OS#2658
2018-06-23 11:40:04 +00:00
Vadim Yanitskiy 2a978b9fd8 msc/USSD: use more informative names for test cases
Let's explicitly indicate is a SS/USSD message MO or MT.

Change-Id: I87f16f935f015dbd2ac2867d8ea5e155cc365e3f
2018-06-21 22:06:45 +07:00
Vadim Yanitskiy da5a405d9f msc/USSD: drop the TC_lu_and_ussd_wrong_code test case
As we are about to finish the implementation of GSM TS 09.11, in
our case it is 'SS/USSD over GSUP', OsmoMSC will not decide itself
which USSD request-code is known, and which is wrong.

Change-Id: Ic104a49bb2dce2127063bcef8443ee6b639c9f19
2018-06-21 22:06:45 +07: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
Neels Hofmeyr 92d4842022 bsc: fix TC_chan_rel_hard_rlsd_ms_dead: ignore RLL REL
The intention is to ignore RLL REL requests, and not to actually block the alt
statement in f_expect_chan_rel() if any RLL REL messages show up.

Change-Id: I3bbcdc41d186a3464cd4adb5c5b770bdec056993
2018-06-16 15:58:03 +02:00
Harald Welte ed380d135d hlr: Port HLR tests to use GSUP_Emulation
Going via GSUP_Emulation (rather than using GSUP_CodecPort directly)
adds many benefits, such as:
* ability to have multiple transactions in parallel
* no silent discard/ignore of unexpected GSUP messages, like those
  for IMSIs we don't expect.

Change-Id: Id2ddd6b81c374ad6350b62fcc5442436757d66cd
2018-06-15 17:59:40 +02:00
Pau Espin a4cecf5af7 Add README.md file for several suites
Content grabbed from [1] and converted to markdown as it's more probable
to have it displayed correctly on popular git repo hosting platforms.
Syntax for embedded graphviz taken from [2].

[1] http://git.gnumonks.org/laforge-slides/plain/2018/osmodevcon2018-ttcn3_test_suites/osmodevcon2018-ttcn3_test_suites.adoc
[2] https://github.com/stlehmann/markdown-graphviz

Change-Id: I9aad03e605569e9613665a7585d60bf308bcb54f
2018-06-14 18:55:36 +02:00
Harald Welte 99f3ca0c48 bsc: Add TC_{early,late}_conn_fail()
Those test cases simulate a BTS-originated RLL CONN FAIL IND at
"unusual" time:

a) before we actually establish any RLL
b) after / while we're tearing down the RLL

This is triggering an osmo-bsc segfault, see OS#3182.

Change-Id: I324c410d7565c189dbc91df577d92b87c036732c
Related: OS#3182
2018-06-14 12:36:13 +00:00