Commit Graph

103 Commits

Author SHA1 Message Date
Pau Espin 0f464d68a6 ggsn: Support rx cause 'New PDP type due to network preference'
Related: OS#5449
Change-Id: Iace6a4bd0c2372601dc43108ec4eb78602dbcf30
2022-02-24 14:35:42 +01:00
Pau Espin 10ec96e24b ggsn: TC_act_deact_retrans_duplicate: expect no diameter upon retrans
Change-Id: Ic579832bcaebfb22eb11156060c4385e41a5685a
2022-02-21 12:08:45 +01:00
Pau Espin 0511802ebc ggsn: Add timeout to TC_pdp_act_restart_ctr_echo
Change-Id: Id9d71504b2da1438239934bfe21934d365b6e333
2022-02-21 09:36:20 +00:00
Pau Espin 8ad031aa9a ggsn_tests: Early exit and improve logging on some setverdict fail cases
Change-Id: I25b84419b2278ce883b0dbc526ab7ffe30b17d0c
2022-02-17 18:52:42 +00:00
Pau Espin cd326c5a59 ggsn: Introduce test TC_pdp4_act_update_teid/teic
This test validates that changing the local TEID through UpdatePDPContext
is correctly followed by the GGSN.

Change-Id: Ic6af25866bf7efc2cabf029e49abaf15d5857592
2022-02-16 17:21:49 +01:00
Pau Espin 3ede4f65d7 ggsn: Configure GTP_CodecPort to decode proper UpdatePDPContextRequest/Response
From GTPC_Types.ttcn:
"""
// determines SUT, needed for decoding updatePDPContextRequest
// and updatePDPContextResponse messages
type enumerated SystemUnderTest{SGSN(0),GGSN(1),CGW(2),MME(3)};
"""

Otherwise decoded UpdatePDPContextResponse is decoded taking choise
UpdatePDPContextResponseSGSN.

Change-Id: I52a27222d0e37ed2170972af3fd0e07da49a8c61
2022-02-16 15:47:15 +00:00
Pau Espin c6ac6950c2 ggsn: Rework tests validating wrong ipv6 saddr on IPv4v6 APNs
The existing test TC_pdp46_act_deact_gtpu_access_wrong_global_saddr_ipv6
was wrong, because the global address was being finally encoded as a
link local address by f_gen_icmpv6_router_solicitation().
Let's rewrite the test and add a new one for source link local addresses
simlar to the ones used to test IPv6-only APNs.

Change-Id: I3d0790104abea7acb4fa5e33109fe93cc51d94ea
2022-02-15 17:13:00 +00:00
Pau Espin 5760421255 ggsn: Support IPv4v6 PDP contexts in helper icmpv6 functions
Change-Id: I564d51e02ea4b3cb5fedb79dfc1903c04619bd61
2022-02-15 17:13:00 +00:00
Pau Espin c8c0341b16 ggsn: Split gtpu_access tests into several separated tests
Those tests validated several different scenarios, let's better handle
them separately one at a time, it makes it easier to understand the
behavior of the SUT and see what needs to be fixed.

Change-Id: I39342fcf2366030ce743dd4b4773f0fff5d61b9f
2022-02-11 13:39:29 +01:00
Pau Espin 480e67f00d ggsn: Test GTP-U Echo Request/Response
Change-Id: Id92180be948ee3f5246c7befec666698a1b074f3
2022-02-11 13:10:20 +01:00
Vadim Yanitskiy d344b4af03 GGSN_Tests: fix DTE due to passing out-of-bound values to int2oct()
This patch fixes the following DTE happening sporadically:

  04:09:29.373271 mtc GGSN_Tests.ttcn:1478 Dynamic test case error:
    The first argument of function int2oct(), which is 256, does not fit in 1 octet.

Change-Id: I517b8e5d5872c36f7c759433a1cde338c90f16da
2022-02-09 18:28:23 +06:00
Pau Espin b63d85f6a2 ggsn: Expect no linklocal-addr forwarding when testing open5gs
It's not really clear whether GTP should really be forwarding packets
with link-local address outside the tunnel. In theory the link-local
address should be used to communicate with the GGSN in order to get the
global link address, that's it. Running against open5gs it can be
observed that they are not forwarded, while osmo-ggsn forwards them
correctly.
Since it seems more like an implementation dependent detail, let's
accept any and adapt expectancies depending on what are we testing, this
way it ends up documented the current situation in case it ever changes
in the future.

Change-Id: Ieafd24c059b9341c702311c78caad3312db5f1f3
2022-02-08 15:34:09 +01:00
Pau Espin 0bcfd9de8f ggsn: Set up diameter for open5gs
Change-Id: Iedadb98be2a2e851b75e4e67c22bca7047191fec
2022-02-05 20:12:53 +00:00
Pau Espin c1b1ddff61 ggsn: Add module parameter to run tests against open5gs
Change-Id: I4ebb3ed73f0f9a20c14d73891ba8b8051f823ab8
2022-02-03 13:58:56 +01:00
Pau Espin ca587f154c ggsn: Submit User Location Information in CreatePDPContextReq
According to TS 29.060, sec 7.3.1 Create PDP Context Request:
"""
The SGSN shall include the User Location Information IE in the PDP
Context Activation procedure. The SGSN shall include the CGI or SAI
in the "Geographic Location" field of the User Location Information
IE depending on whether the MS is in a cell or a service area
respectively.
"""

Change-Id: Iaea95e5779d4f878023ce3f160ac69f092452056
2022-02-02 10:46:17 +01:00
Pau Espin 38aeffb9be ggsn: Submit RATType in CreatePDPContextReq
According to TS 29.060, sec 7.3.1 Create PDP Context Request:
"The SGSN shall include the RAT Type IE during Primary PDP Context
Activation procedure."

Change-Id: Ibc57798e50ccd08ef6126f75f7c8134e56d2778a
2022-02-02 10:46:17 +01:00
Oliver Smith f8fe1329e2 regen_makefile.sh: set executable name explicitly
Set the executable name in each regen_makefile.sh explicitly with -e,
instead of having it set indirectly from the first .ttcn file. Make it
consistent by placing the name on top of each of these files.

Fix for warning:
ttcn3_makefilegen: warning: File `BSC_Tests.ttcn' was given more than once for the Makefile.

Related: OS#5252
Change-Id: I5ed03f8f3ed905483620dc7bae33b617bbb8507f
2021-10-13 11:12:22 +02:00
Oliver Smith 2e0e624060 regen_makefile.sh: files/flags in separate lines
Make all regen_makefile.sh more readable and diff friendly by moving
each entry in FILES and CPPFLAGS_TTCN3 into separate lines. Order
entries alphabetically.

Related: OS#5252
Change-Id: I6b6866eb9f6ec6232e4ae434517457a4c8c1c050
2021-10-12 16:35:01 +02:00
Pau Espin 6b3124ec73 ggsn: Fix build broken since recent commit
Fixes: 8c74cbbf5a
Change-Id: Id6238a3b79a4439ab3b17909c7b1c65028efbec3
2021-05-18 11:37:08 +02:00
Pau Espin 8c74cbbf5a sgsn: Introduce test TC_rim_eutran_to_geran
GTP_Templates.ttcn new templates use BssgpCellId, hence it depends on Osmocom_Gb_Types.ttcn.

Related: SYS#5314
Change-Id: I9dcf6ee2dc55bc6aba178eca30080233254f025e
2021-05-17 20:33:00 +00:00
Harald Welte 7ef6d10145 ggsn: Fix TC_pdp4_act_deact_with_single_dns()
In TC_pdp4_act_deact_with_single_dns we activate, deactivate and then
re-activate a PDP context. Hoewver, we re-use the same variable and
don't reset the state in between.  This results in the second PDP CTX
activation to include an end-user-address (static IP allocation), which
OsmoGGSN doesn't implement.

Before osmo-ggsn Change-Id Iac8868438655fe4e5e07d167d7dbd6273dbb7678,
the test passed as osmo-ggsn simply ignored the requested static address.
After that change, we reject static addresses and hence the test starts
to fail.

Change-Id: I1b1869bc2cee39c8fddd8fa63f48bdaa6a65e462
Related: OS#5097
2021-04-01 21:27:33 +02:00
Pau Espin c04c69e689 ggsn: Terminate immediately on pipong altstep failure
Change-Id: I1ae66afc562c6bf968b0b3bfa9a254fac0bd7404
2020-03-03 16:48:34 +01:00
Pau Espin 6f319f9794 ggsn: Drop unneeded m_ggsn_supports_echo_interval
Latest osmo-ggsn release is 1.5.0, so this param is not needed at all.

Change-Id: Ie1c3cde2a01e8ea49aadcb1f7384995cb68039cb
2020-01-05 11:21:07 +00:00
Pau Espin 0361193a55 Update README.md of several TTCN3 test suites
Some stuff was wrong and some was missing after new features being
implemented in tests over time.

Change-Id: I7a279592a68ffc76408a8e728e76151534265cc0
2019-11-15 18:49:09 +00:00
Pau Espin bb2bb061e5 ggsn: Delete previously activated pdp ctx in *_interact()
This change fixes some GGSN_Tests failing lately since osmo-ggsn
correctly sends DeleteCtxReq for dangling pdp ctx upon increased
Recovery counter received, and tests are not expecting that (because
they don't expectect dangling pdp ctx from previous tests).

Change-Id: I232298e2bfd8bfc99d82cbf5803d11db7eb1786a
2019-09-03 13:19:29 +02:00
Pau Espin fa1ca02d34 ggsn: Introduce test TC_pdp_act2_recovery
Some code is moved out of f_pdp_ctx_act() into f_handle_create_req() in
order to re-use it in the test.

Related: OS#4165
Change-Id: I48c1bc9287ce8b820e5ea672dffbc5a8503f16d7
2019-08-23 19:13:34 +02:00
Pau Espin 6916ec4648 ggsn: Introduce test TC_pdp_act_restart_ctr_echo
VTY functionalities to enable and disable echo requests in osmo-ggsn are
added too as part of the test.

Depends: osmo-ggsn.git Id2c84165dc59dff495106758146a701ca488834f
Related: OS#4165
Change-Id: Ia37e48e7ff9ad063f9eabf447f8a6a0a3fc380d9
2019-08-23 18:32:49 +02:00
Pau Espin 22d597ff94 ggsn: Introduce test TC_pdp46_act_deact_apn4
Related osmo-ggsn.git libgtp fix: I6c6215a4ce478afabc78ffaf5ffb0cf829e41226

Related: OS#4154
Change-Id: Ia1893e0c181307ac1ceb07ee5f496507f7a603c8
2019-08-21 16:31:35 +02:00
Pau Espin b7f01781d9 ggsn: Update test xfail->pass in expected-results.xml
Commit below fixed the test but forgot to update this file.

Fixes: 8e7a396656
Change-Id: Ia5006c9258de9b442b32ae92ae75ef08670de7cf
2019-08-21 16:31:17 +02:00
Pau Espin 2302341275 ggsn: Add missing v4v6 tests in expected-results.xml
Change-Id: I80598fad57b8e7172ac073ebe2b3445e5ab132f0
2019-08-21 16:13:30 +02:00
Harald Welte f82985484b ggsn: Add TC_pdp4_act_deact_ipcp_pap_broken()
This test case reproduces a real-world PCO capture including a broken
PAP AuthenticationReq.  It triggers some weird behavior in OsmoGGSN
1.3.0 where it would send duplicate IPCP repsonses and no PAP response.

Change-Id: Ie89d984ed9e26fbbb2e4914bdb8623446d462a4c
Related: OS#3914
2019-07-03 16:24:19 +00:00
Pau Espin 9a5f42f997 ggsn: Add test to verify retransmit queue_resp
Related: OS#3997
Change-Id: I8d937d0af9af8462418b174a54022655f9d77a5f
2019-05-28 21:03:16 +00:00
Harald Welte 34b5a95d09 cosmetic: Update copyright statement, license notice and SPDX
Some of our files didn't have a copyright notice at all, let's add
it.  Also, update the notices in other files and ensure a SPDX
identifier is present in all but the most trivial files.

Change-Id: If7fa19ce484b415bc645e39b3d0d666b44b5f0fd
2019-05-27 10:00:06 +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
Oliver Smith ee6a088f37 ggsn: add tests to validate IPv4v6 pdp ctx
Add related templates based on 3GPP TS 29.060 Figure 37A and create
tests based on existing IPv4 and v6 ones.

Related: OS#2900
Change-Id: I3bab7df5caddc5c8b973c81544f954d5473ac234
2019-03-14 09:10:45 +00:00
Daniel Willmann d93047434b Add Misc_Helpers.ttcn to centralize TTCN3 shutdown handling
This function can now be called from anywhere to try and safely shutdown
a testcase. It is not optimal as we can't call "all component.stop" from
outside the mtc, but without any proper and orderly shutdown handling of
all our emulation components I believe this is the best we can do.

To use it:

import from Misc_Helpers all;

in your module and then call

Misc_Helpers.f_shutdown(__BFILE__, __LINE__);

You can also pass the function a verdict and a message and it will take care
of calling setverdict, but beware of the following:

While setverdict would accept any number of arguments as log message
and convert them to a log string f_shutdown expects one charstring.
It's possible to use the log2str function to use the log arguments in
setverdict for f_shutdown, for example

setverdict(fail, "Template didn't match: ", tmpl_foo);
would become
Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Template didn't match: ", tmpl_foo));

Change-Id: I84d1aa6732f6b748d2bfdeac8f6309023717f267
2018-10-24 15:10:13 +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
Neels Hofmeyr bf3cf5c8bc Revert "detect VTY TELNET port connection failures in TTCN3 tests"
With this patch, I see all ttcn3-bsc-tests failing with
"Verdict: fail reason: VTY Timeout for prompt"

This reverts commit cb111b21ab.

Change-Id: I215d7ab5eee75cf6d3afaac760af64356c943140
2018-07-27 13:01:26 +00:00
Stefan Sperling cb111b21ab detect VTY TELNET port connection failures in TTCN3 tests
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.

Change-Id: I9acf7793d5d68aec6d087cff254a10d8b673dab1
Related: OS#3149
2018-07-27 07:40:10 +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
Pau Espin 205a384562 ggsn: Apply GPDU seqnum option to all APNs
Change-Id: I6efe926c8bb7a0056d26e15eefa282266e7bc6ca
2018-07-06 14:43:59 +00: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
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 d2394e9032 ggsn: Disable GTP-U tx sequence number by default
GTP-U transmit sequence numbers are entirely optional and probably
don't serve any real purpose in real-world deployments.

While OsmoGGSN in userspace implements support for it, the kernel GTP-U
implementation doesn't.  This means a number of tests fail against
kernel GTP-U only for that reason.

Let's switch all tests to disable GTP-U sequence numbers, and only
enable it in one specific test.  This way, we can execute the tests
also against kernel GTP-U.

Related: OS#3215
Change-Id: I666f5276749ef6a1a4dc170a3b9a747f626f6b2c
2018-04-26 09:09:32 +00:00
Harald Welte 3e0b039c56 ggsn: Fix typo: 'gptu' -> 'gtpu'
Change-Id: I1da2e0da6b94dc43c742ec551d3b5de100ce405f
2018-04-26 09:09:31 +00:00
Neels Hofmeyr fc0384a046 mask timestamps and source file nrs in expected-results.xml files
Prepare for upcoming updates with concise diffs.

Change-Id: Ic9f006aa8db1b477598605e0525faeb229b03641
2018-04-11 19:32:01 +02:00
Neels Hofmeyr 1fd6679d9d fix build: don't clean out expected-results.log: rename to *.xml
'make clean' as generated by ttcn3_makefilegen removes all *.log files, which
of course cleans out expected-results.log, which should not happen. Since this
is a junit XML file, rename the suffix to .xml.

Change-Id: Ic334f6b758eef865e3a497aa430691a3ae696d25
2018-04-11 19:29:18 +02:00
Stefan Sperling c479e4fa3b test GGSN support for optional GTP-U sequence numbers
Add VTY functionality to GGSN tests, and use the VTY to enable/disable
GTP-U Tx sequence numbers in the running osmo-ggsn.

The GTPU packet template now makes sequence numbers optional.
A template created with its sequence number set to 'omit' will result in
a packet without a sequence number, i.e. the 'sequence number present' bit
in the packet header is cleared, and the sequence number field is omitted
from the encoded GTPU T-PDU packet.

Re-use the existing TC_pdp4_clients_interact() test for testing the
behaviour of osmo-ggsn. This test is now run twice, once with and
once without GTP-U Tx sequence numbers. Verify that packets relayed by
osmo-ggsn match its "g-pdu tx-sequence-numbers" configuration setting.

Change-Id: I1dc299407c61b1c865035add44067b8ab89001b3
Related: OS#2519
2018-04-06 12:43:25 +00:00
Neels Hofmeyr 3cf797d7a5 add compare-results.sh, call from start-testsuite.sh
Compare current test results to the expected results, and exit in error on
discrepancies.

Add compare-result.sh: (trivially) grep junit xml output to determine which
tests passed and which didn't, and compare against an expected-result.log,
another junit file from a previous run. Summarize and determine success.

Include an "xfail" feature: tests that are expected to fail are marked as
"xfail", unexpected failures as "FAIL".

In various subdirs, copy the current jenkins jobs' junit xml outputs as
expected-results.log, so that we will start getting useful output in both
jenkins runs and manual local runs.

In start-testsuite.sh, after running the tests, invoke the results comparison.

Due to the single-line parsing nature, the script so far does not distinguish
between error and failure. I doubt that we actually need to do that though.

Related: OS#3136
Change-Id: I87d62a8be73d73a5eeff61a842e7c27a0066079d
2018-04-06 01:07:15 +02:00
Stefan Sperling cb782b99ff document the purpose of IP addresses used by GGSN tests
The purpose of the various IP addresses used by our GGSN tests is not
immediately clear. Add documentation based on the current status quo.

Change-Id: I079efcff3dab09d71330625f5b661cd81e42bf38
2018-04-04 08:07:25 +00:00