Commit Graph

145 Commits

Author SHA1 Message Date
Pau Espin 47384ba910 ggsn: TC_gy_charging_volume_quota_threshold: Fix Gy Threshold/Quota expectancies
open5gs got the Gy Thresholds fixed recently
(e078b33f0c4d6f34d8991f8ad211dd2d9ea977a0).

AS shown in 3GPP TS 29.244 C.2.1.1 diagram, in Diameter Gy the value
sets the trigger for the "remaining credit", not the "used credit".
"ThresholdPFCP = Quota - ThresholdGy"

The test needs to be adapted since it was wrong too.

Change-Id: Ia283ad4919813241e3c33465ba4be2d2e33f5e54
2024-04-16 11:06:55 +00:00
Harald Welte 5dc20d7417 ggsn: Avoid dynamic test case error
During TC_addr_pool_exhaustion, if all of the pdp context activations
were unsuccessful, teic_list is an empty list. We therefore cannot
unconditionally obtain its first element.

This patch avoids the related "Index overflow in a value of type
@PreGenRecordOf.PREGEN_RECORD_OF_OCTETSTRING: The index is 0, but the
value has only 0 elements."

Related: OS#6423
Change-Id: I7c7a84ed8343fb48e841248f86d37972f4674ed0
2024-03-26 14:35:25 +01:00
Pau Espin 97f9547c94 Diameter Gy CCR: Expect RATType AVP in PS-Information instead of MSCC
open5gs-smfd was recently modified to send RAT-Type inside
PS-Information instead of MSCC, since having it in the former is
supported since older spec releases and having it in the later creates
problems in some real world OCS implementation like PortaOne OCS.

Related: SYS#6837
Related: open5gs.git d0b31177cca360865ebc6ab0b89eee7ee4fc8d1a,
Related: open5gs.git 3b5e851f5d1328536052031e66a7b9b03c3057f6
Change-Id: I7ce77d08847a0876291f76e901e5c89c339db27d
2024-03-25 12:17:45 +01:00
Oliver Smith b856108071 ggsn: add m_ggsn_conf modulepar
Prepare to run the GGSN tests in different configurations:
* v4_only: one APN with v4
* v6_only: one APN with v6
* v4v6_only: one APN with v4v6
* all: multiple APNs with all of the above

Related: OS#6096
Related: docker-playground Ia2fe0c3ed4ccf06e72fd258d085e4a79cecd5f26
Change-Id: I6d94a8b18200fbb2119406827b74b83e912e3ecc
2024-03-22 19:23:28 +00:00
Pau Espin 06fba9c8a7 pgw: Set Gy CCA Result-Code based on settings
This allows the test to change the Result-Code being transmitted during
Gy CCA at any time.

Related: SYS#6845
Change-Id: I2c3b1057908c1c76a55c41a7f45728a0fdee3cf0
2024-03-19 13:11:34 +01:00
Pau Espin e16e928f14 ggsn_tests: Split out generic ICMP(v6) related templates and functions
Change-Id: I53a5da05caeef4cdd59778840a6f4eed489f1b93
2024-03-04 21:47:55 +00:00
Pau Espin 4b090c95d5 Split GTP_CodecPort/GTP_Templates into C and U variants
The Types are already split in the dependent modules in GTPC_Types and
GTPU_Types.
There's no point in keeping them together in the same file since those 2
protocols are mostly independent.
Furthermore, testsuites using GTPv2C + GTPv1U don't need GTPv1C.

Change-Id: Ic15c9a2e92828cbafb4dda7355ee534107051e2d
2024-03-01 10:28:22 +00:00
Oliver Smith 9daae3e49b ggsn_tests: f_wait_icmp4: don't shutdown on error
Use setverdict(fail, …) instead of shutting down the test. Otherwise we
don't close the PDP context. This fixes TC_pdp6_act_deact failing if it
runs after a failed TC_pdp4_act_update_teid.

Change-Id: Ib31481e79fc81983ae0c36f0512c6b7dba3f28a8
2024-02-29 07:22:05 +00:00
Oliver Smith bbbe05df68 ggsn_tests: fix typo
Change-Id: Iefd1bfead68878553cbfd0f34ea8aaa4bdd40a41
2024-02-29 07:22:05 +00:00
Pau Espin cff72f8d16 ggsn: Validate IPCP identifier in answer matches the one in the request
Related: https://github.com/open5gs/open5gs/pull/2920
Related: SYS#6582
Change-Id: I0e0cefaeb303b4e284173011231170554e225561
2024-01-26 16:59:09 +01:00
Pau Espin 867b13025b DIAMETER: Split Gy and Gx messages to their own TS files
Those interfaces reuse messages from other Diameter RFCs, but changing
the contents of the messages, eg some Mandatory fields like
Service-Context-Id which are mandatory in RFC5006, doesn't even appear
in Gx CCR in TS 29.212.

Keeping them well separated helps in avoiding confusion on users fo the
messages.

Change-Id: Ibe0d5f263813d5083e020c942283f214983162b4
2024-01-24 16:14:30 +01:00
Pau Espin 117a94f333 Split Diameter TS 29.272 templates into its own file
This allows more easily finding, understanding and using the tons of
templates coming from different specs.

Change-Id: I2e6b813a9e4ff98eef575aaaf46dbcf9f1a5d2d4
2023-12-21 16:16:17 +01:00
Pau Espin ae04c793b1 ggsn: Allow receiving MTU ICMPv6 Option in RouterAdv
This Option is not mandatory, but open5gs-smfd started transmitting it
recently (ab64ff9514d8da121500be7b92c9d793ef20b894). Allow it.

Change-Id: Icf3e10dc599d41fb65051670fc3aec5ff0c67510
2023-12-06 14:11:45 +00:00
Pau Espin 229ceed4ef ggsn: Fix restriction type on several template definitions
Change-Id: I47a0c3fbf1b4078c2d8157b148330f7750cc3266
2023-12-06 14:11:45 +00:00
Pau Espin 9c1c2ae6b6 ggsn: Early exit test if f_wait_icmp6() fails
Change-Id: Ida6be6194f98de44dca804759c85016031cae61c
2023-12-06 14:11:45 +00:00
Pau Espin f749cbf93f GGSN_Tests: Don't expect Used-Service-Unit AVP in Gy CCR INITIAL
open5gs 125740727e558c7604897eda711d4d40f2906239 changed behavior and is
no longer sending the Used-Service-Unit AVP during INITIAL_REQUEST,
which makes sense since those values should be only initialized and
spec seems to more or less expect it that way, though receiving it at
INITIAL time should be accepted too AFAICT.

Related: https://github.com/open5gs/open5gs/pull/2721
Change-Id: Ia16a86ff10089974e0b5d49e594467fcd437ce7e
2023-10-31 14:50:50 +01:00
Oliver Smith 95722c6550 ggsn: log start of test in SUT
Change-Id: I2baccc2b49e8bcbf0d1ca6dae41624b2d18fc0fa
2023-10-23 09:10:33 +00:00
Pau Espin fc8fa3fbad ggsn: Speed up tests by lowering retransmission T3,N3 timers
The params are set in GGSN_Tests.cfg and not in GGSN_Tests.default,
because those lower values are not really good default ones as per spec.
For instance when running against open5gs-smfd, these values should be
left to the default in code of 5 and 3 seconds, because open5gs-smfd
doesn't support changing the values through cfg file yet.

Related: OS#5485
Change-Id: I3798fba89c2c357afeaa83a73759442c6c433cea
2023-04-18 10:01:02 +00:00
Pau Espin 71ba8d66a1 ggsn: Add osmo-ggsn.cfg
Taken from docker-playground/ttcn3-ggsn-test/osmo-ggsn.cfg

Change-Id: Ifbd50b6c1ebfd0371bd384c4ae0c4dc763478f49
2023-04-13 09:35:08 +00:00
Pau Espin bfad97fa2b ggsn: Parametrize T3-RESPONSE and N3-REQUESTS
Since osmo-ggsn.git Ia15c1cfd201d7c43e9a1d6ceb6725ddf392d2c65 osmo-ggsn
supports configuration of X3 timer, which should be set to (T3-RESPONSE
* N3-REQUESTS) configured at the peer.
The default values are 5 and 3 respectively, hence X3 is by default
5*3=15 seconds.
Let's use that default value for now.
Once new osmo-ggsn version is released, we can speed up test duration by
decreasing the values of the module parameters introduced in this commit
and configure VTY gtp timers at osmo-ggsn accordingly.

Related: OS#5485
Change-Id: I02c0982674b43317a5fc8f341c03eeeb1efee77f
2022-11-05 00:20:53 +00:00
Pau Espin 5fa8f781c3 ggsn: Fix TC_gy_charging_volume_quota_threshold expectations
in Diameter, the CC-Input/Output direction is defined as follows in
RFC4006:
"""
8.24.  CC-Input-Octets AVP

The CC-Input-Octets AVP (AVP Code 412) is of type Unsigned64 and
contains the number of requested, granted, or used octets that can
be/have been received from the end user.

8.25.  CC-Output-Octets AVP

The CC-Output-Octets AVP (AVP Code 414) is of type Unsigned64 and
contains the number of requested, granted, or used octets that can
be/have been sent to the end user.
"""

So:
* 3GPP uplink is from end user to PGW, and hence 'CC-Input-Octets'
* 3GPP downlink is to end user to PGW, and hence 'CC-Output-Octets'

This test started failing a few days ago since a bug was recently
fixed in open5gs which was swapping the counters in open5gs-upfd:
https://github.com/open5gs/open5gs/pull/1793
f72a1edc6e

Change-Id: I2f64649ce70d85634f14b84eff98731f7711cbad
2022-10-03 14:00:02 +02:00
Pau Espin 51dca9fa15 ggsn,pgw: Expect Multiple-Services-Indicator AVP in Initial CCR
Multiple-Services-Indicator AVP is only meant to be sent in CCR Init.
Let's not expect it in Update nor in Termination CCR, open5gs stopped
sending it there recently in 9948fba05afb8e1b118f0c29a84ffe38c0f21b75.

Change-Id: Ic4d6be4bf28c65817ce912a8be10937db0b5dba9
2022-06-21 17:07:20 +02:00
Pau Espin 6477d7358a DIAMETER: Introduce and rework some AVP templates
All the AVP ecosystem in DIAMETER is quite a mess. There's AVPs defined
in several different specs, sometimes even with the same name and
different AVP code and vendor.
Hence, as we add more templates it becomes important to start using the
prefix in order to differentiate where they come from.

Change-Id: Iec7c51dae136629d6b754de4dd798e988ac51f6b
2022-06-07 08:15:19 +00:00
Pau Espin 52562c9ca1 ggsn: test Gy Volume-Quote-Threshold feature
Change-Id: If10171589e915db8e78278d2d802e38c66b37687
2022-05-25 16:13:56 +02:00
Pau Espin cba0f6d292 ggsn/pgw: Fix Gy CCR Reporting-Reason expectancies
The Reporting-Reason can be in different places depending on its values.
In the case of TERMINATION, we expect it to be FINAL so we know its
location.

Change-Id: Id33b9bb2f7b469e03a0761dc8807770cfdf77fcc
2022-05-25 14:13:02 +00:00
Pau Espin 8fa2284189 ggsn: Validate charging reported values
Change-Id: I497309bb0b30c61bdb00e0c08f18294ecd4dd485
2022-05-23 11:35:37 +02:00
Pau Espin 733369ab20 cosmetic: ggsn: document and clean up section in GT_CT
Change-Id: I8bafb546d5d8b819cb0962b50049005ff2b85cb4
2022-05-20 18:39:55 +02:00
Pau Espin d6b51330ab ggsn: TC_act_deact_retrans_duplicate: Fix case where initial seq_nr is 65535
Change-Id: I2a7a399cf962311aaf7270260cb2e4e00e5a676a
2022-05-19 17:48:49 +02:00
Pau Espin 82a7f7033a ggsn: Fix seq_nr overflow
As seen running a test:
GTP_Templates.ttcn:87 Dynamic test case error: The first argument of function int2oct(), which is 65536, does not fit in 2 octets.

Change-Id: Icbaf42879bade6f5b4e39144ec123bc1b3f893f8
2022-05-19 17:41:40 +02:00
Pau Espin a2af578a1a ggsn: Improve checks around Gy messages
Change-Id: I702796f2f941b78da904faa2ffdba4185333bc0d
2022-05-19 14:13:07 +02:00
Pau Espin d25095f7ce ggsn: Properly encode MISDN IE in GTP
ISDN-AddressString contains an initial byte at the start.
We didn't care so far because we were not yet checking the content of
msisdn, so the usual first '12'O byte was being considered as a header.

Let's store it in GTP format as before, but let's pass it as a
charstring when initializing the PdpContext, so that the human-style is
visible in the test for easy visualization/comparison (It will be
verified in a follow-up patch in Gy Diameter interface).

Change-Id: Ie1b65707d4b08f2201572e1fa44a1f9f985eb096
2022-05-18 20:01:44 +02:00
Pau Espin 535ca2658b ggsn: Append MS TimeZone IE to CreatePDPCtxReq
TS 29.060 states that it shall be included for primary PDP context
activation if the information is available, so let's add it by default.

Change-Id: I8c7e491a07cadfe09403504a82d34e412673a531
2022-05-16 17:11:08 +02:00
Pau Espin 38968e9ba9 ggsn: Append IMEISV IE to CreatePdpCtxReq
Change-Id: I00975328e94afd116e59c88fd96c5b0154810a1e
2022-05-13 17:41:15 +02:00
Pau Espin 0e127870fb ggsn: Append ChargingCharacteristics IE to CreatePdpCtxReq
This IE is conditionally added if the HLR provides it to the SGSN.
Let's add it by default so that we test code paths where GGSN parses it.

Related: SYS#5925
Change-Id: Ia0f74041d2107afeaa36b94e33474370b7b07c0e
2022-05-13 11:54:27 +02:00
Pau Espin 2fe8895baf ggsn: Use larger MSISDN number
Change-Id: I8a1eeb48efdddaa4f5466cdbe72545523ce31cb8
2022-05-04 10:08:12 +00:00
Pau Espin cb1e8278f9 ggsn: Fix TC_addr_pool_exhaustion not answering Gy CCR termination
Change-Id: If126840001b1e10d3dee86d678e624a0584337e8
2022-04-20 14:43:43 +02:00
Pau Espin 77fdd0b5aa ggsn: Initial testing of open5gs Gy interface
Related: SYS#5276
Change-Id: I10027d4f8adc6b47ce97b90514d1f13e9aa3d40d
2022-04-11 12:04:55 +00:00
Pau Espin 33b4749fcf lib/DIAMETER: Allow sending CEA with AuthAppId
The new message is to be used by Gy interface emulation, which according
to RFC4006 uses AppId 4 "Credit Control Application". The application
is apparently not 3GPP vendor specific.

Change-Id: I0e33673d65140aad34d2efcae3c7f49154ceb99f
2022-03-14 12:05:37 +01:00
Pau Espin 45d5702063 ggsn: Rename diameter generic ports to Gx
We'll start emulating other Diameter-based interfaces soon (Gy), so
let's rename existing stuff which is Gx specific.
The DIAMETER_Emulation only supports handling 1 application-id per
component, and that's fine anyway since the OCS is in general expected
to run in a different conn/node from PCRF.

Change-Id: I1eb03d907b46c4bb24491f390ef468e831190e08
2022-03-09 11:10:11 +01:00
Pau Espin c441ce001c ggsn_tests: Wait for retrans queues to drain after each test
Otherwise a new test may reuse the same GTP seqnum, and if it's still in
the gtp retransmit resp queue of the GGSN, it may be identified as a
duplicate retransmittion of a previous message (previous test) and send
back the previous response instead of processing the request.

Related: OS#5485
Change-Id: I1b04691987b883f63c95c0322a477db4a43df2b1
2022-03-09 09:07:39 +00:00
Pau Espin bfea83536d ggsn: Introduce test TC_addr_pool_exhaustion
Related: OS#5469
Related: https://github.com/open5gs/open5gs/pull/1397
Change-Id: Iee24384b35f9277475b02cb59bf04cd6c9f23b1c
2022-02-28 16:16:02 +01:00
Pau Espin 68c2af54e7 ggsn: Introduce test TC_lots_of_concurrent_pdp_ctx
Change-Id: Iab19963f8e869af8fe0c385abd0fd7bbd9221790
2022-02-28 11:43:38 +01:00
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