Commit Graph

53 Commits

Author SHA1 Message Date
Pau Espin 44a4763b00 pgw: Always expect local TEIC when receiving DeleteSessionResponse
open5gs-smfd is since recently acting properly and setting the proper
TEIC when sending GTPv2C messages for cases where session is not found.

Related: https://github.com/open5gs/open5gs/issues/3043

Change-Id: I2086b4576a10c7b4ba8217be6e49c8f5f389bc4b
2024-04-10 10:28:28 +00: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
Pau Espin 0a228eae76 pgw: Introduce test TC_gy_ccr_update_rejected
This test currently fails because open5gs-smfd is not triggering the
tear down in smf_gy_handle_cca_update_request().

Related: SYS#6845
Change-Id: Ie58ae2a5e870b183fa1c56c90c94f5eee56386e0
2024-03-19 15:56:02 +01: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 819a3b87b7 pgw: Fix typo in comment
Change-Id: Ie768044d9f80cc3837685167d98a1e270d0abde4
2024-03-18 20:35:56 +01:00
Pau Espin d9ff19ee73 epdg: Introduce test TC_hss_initiated_deregister_new_server_assigned
Related: OS#6042
Change-Id: Ia5bf7708d11421710f3a88669d94c4f01060cdd6
2024-03-14 11:43:58 +01:00
Pau Espin 009ab6fe1c epdg: Transmit MIP6-Agent-Info AVP in S6b SAR
Inform the AAA-server about the selected PDN-GW.
Change-Id: Ia0f00a00b6474e19bb4cdc77724c75a55ef5c1f9
2024-03-05 14:44:23 +01:00
Pau Espin 297333a423 mme, pgw: Fix GTPv2_Emulation setup after recent changes
The fields were added to be used in EPDG_Tests, but they need to be
explicitly set to omit here.

Fixes: 65a7f762ef
Change-Id: I3ed3c185310082f36bbce22817b903232825567c
2024-03-05 11:26:13 +01:00
Harald Welte 556e4d2dbc various: update expected-results.xml
Change-Id: I21052636bf892e5da86ef736d16035ec324aedbe
2024-03-04 19:09:58 +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
Pau Espin 4ecc808f1d pgw: Introduce test TC_s2b_createSession_v4_apco
Make sure APCO IE is properly handled and answered back.

Change-Id: Ib01fe0512866924a5afc4d6719ceacb0b4b54df2
2024-02-28 12:54:21 +00:00
Pau Espin 518e24b861 pgw: Introduce test TC_s2b_createSession_v4_no_apco
This test allows initial testing of a session creation through the S2b
interface (emulating an ePDG).

A follow-up test will be added to test the APCO IE (feature which
open5gs-smfd still doesn't support).

Change-Id: I38e469edf0e00feca5a648035b64645e2c905937
2024-02-28 12:54:21 +00:00
Pau Espin 355a133048 PGW_Tests: refactor/improve several parameters to accomodate for different GTPv2C interfaces
So far we were only testing s5/s8 interface, but we'll want to test s2b
soon.
This commit is a mixture of refactorings and code improvements as a step
towards testing S2b interface.

Change-Id: I22b3e18d02ca828e2ea43bde2e0a602db236cf50
2024-02-23 17:44:17 +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 bddba3aa10 pgw: Expect EchoResp in CLIENT port of component who sent EchoReq
A recent commit in GTPv2_Emulation improved the routing of incoming
messages from network towards clients.
After that change, the GTPv2_Emulation properly matches the originating
component of the procedure and forwards the reply to it.
Hence, TC_tx_echo() needs to be adapter to expect the reply on its
CLIENT port.
TEID0 is now left for incoming initiating messages which have no seqnr
match.

Change-Id: I1764fdf81192597e393d79d34cb8f221aa79bbd9
Fixes: 1d2cc67036
2024-01-15 10:38:27 +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 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
Pau Espin 1344e47a59 GTPv2: Declare GTP2C_Cause as enum
Change-Id: Id26f59274d7a8813b64b9b4b7c5c39cc12d5a0ac
2023-10-24 13:51:17 +02:00
Pau Espin db017f49ae DIAMETER_Emulation: Support forwarding messages identified by ete_id to a client component
This is useful in the scenarios where the client component submits a
IMSI-based transaction such as AIR, but its answer (AIA) contains no
IMSI (as per what's specified in TS 29.272 5.2.3.1). As a result, the
received AIA message would be enqueued in the DIAMETER_UNIT.

With this new feature, the test can create an expect using the
End-to-End Identifier of the message it is going to transmit, and
receive the answer in the same DIAMETER_CLIENT port the request was
transmitted, even if it contains no IMSI.

Related: OS#5757
Change-Id: I25e44146d2c49e308c1fb490b499e70ac6045f2f
2023-08-26 07:27:15 +00:00
Pau Espin 967d871b19 pgw: improve launch program logging
Change-Id: I1feb6ddb1ed742585482dbfe3e38a0bece160e22
2023-02-28 16:34:18 +01:00
Pau Espin f97f6e2f90 pgw: stop components early if test fails
Change-Id: I3465a421a4b2a3fce72a1c54037d8dc2b4e3a0fe
2023-02-28 14:13:54 +01:00
Pau Espin 55980c4888 pgw: Avoid access to unbound global variable
This happens if GTv2C failed prior:
"""
11:30:17.577738 15 PGW_Tests.ttcn:645 setverdict(fail): none -> fail reason: "Unexpected GTPv2 while waiting for CreateSessionResp", new component reason: "Une
xpected GTPv2 while waiting for CreateSessionResp"
11:30:17.578004 15 PGW_Tests.ttcn:756 Dynamic test case error: Initializing a TTCN_Buffer with an unbound octetstring value.
"""

Change-Id: I9731b755ddc7bb3ebd56bdec550961cc36f2e2c6
2023-02-28 12:41:06 +01:00
Neels Hofmeyr 13b83db5db update various expected-results.xml
Change-Id: I850b79526145307246bca40c70ed8e4d586d8c68
2022-08-12 02:31:23 +00: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 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 2fde1efd8e pgw: Validate charging reported values
Change-Id: I5024abc672bf92d41027c4c78d2925d0537bb470
2022-05-23 11:38:05 +02:00
Pau Espin e343a88756 pgw: Improve checks around Gy messages
Change-Id: Ica3ca4cf72113d66e74dcff9f838e39cc5d63468
2022-05-19 14:13:10 +02:00
Pau Espin 7d39f9ea94 pgw: Send MSISDN in GTPv2C CreateSessionRequest
Change-Id: I71bcad944f40aa78357f2d11f54d139103ca3e24
2022-05-04 10:09:09 +00:00
Pau Espin 431f3460dd pgw: Add TC_gy_charging_cc_time
Related: SYS#5276
Change-Id: Ie4e567f62bbbdba276e6b3221111c8d9f82cde14
2022-04-25 09:21:45 +00:00
Pau Espin 251d0646e0 pgw: Initial Gy support
Related: SYS#5276
Change-Id: I04cf78cb4bc73de59f803c01208a7ef9056cb14f
2022-04-22 11:06:12 +02:00
Pau Espin 8b3123fe5f pgw: Support having several DIAMETER_ConnHdlr per PGW_Session_CT
A new intermediate component DIAMETER_ConnHdlr_CT is added which extends
the required DIAMETER_ConnHdlr by the DIAMETER_Emulation, and forwards
it to the PGW_Session_CT. This way, the PGW_Session_CT, which usually
runs the test code, will have access to GTP2, Gx and Gy messages for the
session.

Initial Gy support for PGW_Tests is added in follow-up patch.

Change-Id: I28f1ac0a013e479058f28a6feff6901b33f6c247
2022-04-20 18:34:33 +02:00
Pau Espin 5b0327b20a pgw: Don't expect Gx messages during delete of unknwon session
Same approach as implemented for GGSN_Tests in
10ec96e24b.

Change-Id: I7ad1fcae612a562d6643f9f01db3a4e7941f3666
2022-04-11 16:50:41 +00:00
Pau Espin bb5f45fb58 pgw: Wait for component to get out of SUT's Diameter SUSPECt list
Similar fix was applied to GGSN_Tests when adding Diameter support in
commit 0bcfd9de8f.

Change-Id: I95ddf6c1048f0bfd6590bae574aea15c4fc2710b
2022-04-11 16:50:41 +00: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 9c8c458fe8 pgw: Fix typo in expected-results.xml name
Change-Id: I49342db43e81d3e95fa5d13de4cd77b6a67a7af7
2022-04-07 19:26:56 +02:00
Pau Espin d4e473a21c pgw: Add expected_results.xml
Change-Id: I451b10a7b79854e630e7f2d487423dc39ade5bbd
2022-04-07 19:16:40 +02:00
Pau Espin 08880f11e9 pgw: Add T_guard
Change-Id: I9dce4aee4a0b1181bb7dc1a53fb254e6d17cf22e
2022-04-07 19:05:15 +02: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
Vadim Yanitskiy 284c68e735 PGW_Tests: f_start_prog(): redirect stdout/stderr to files
This would allow us to see the output of a program being executed.

Change-Id: I04ab92c13fcd893d39dbb6a8a8af5ff41d207e36
Related: SYS#5602
2022-02-03 12:07:24 +00:00
Vadim Yanitskiy 36ab797d46 PGW_Tests: f_start_prog_wait(): print more debugging info
Change-Id: I73314ccfdabd3860e15c732260b024f4c984bebf
Related: SYS#5602
2022-02-01 21:57:50 +06:00
Vadim Yanitskiy b46f01e130 library/DIAMETER_Emulation: implement 'raw' mode of operation
This patch implements a new mode of operation, which allows to
have direct communication between the emulation component and
the other component connected via the 'DIAMETER_UNIT' port.
This eliminates the need to have dedicated components for each
IMSI, what is not necessarily needed in some specific cases.

Change-Id: I52e22ac70cc85be5b0436b68c77356aabc4f05e1
Related: SYS#5602
2022-01-31 09:56:51 +00:00
Vadim Yanitskiy 589972fead PGW_Tests: update default values for mp_pgw_hostname/mp_pcrf_local_ip
The old values are not valid anymore when running against open5gs
version 2.4.2.  Most likely, the default addresses got changed
during the PGW split-up (now it's open5gs-smfd and open5gs-upfd).

Change-Id: I3dd7d1f0d4aebb94b8859e8d12e952917de35071
Related: SYS#5602
2022-01-20 19:38:36 +06:00
Vadim Yanitskiy bada3c927d PGW_Tests: fix f_create_session(): add missing Serving Network IE
open5gs-smfd version 2.4.2 requires this IE to be present:

[smf] INFO: [Added] Number of SMF-UEs is now 1 (../src/smf/context.c:820)
[smf] INFO: [Added] Number of SMF-Sessions is now 1 (../src/smf/context.c:2610)
[smf] ERROR: No Serving Network (../src/smf/s5c-handler.c:101)
[smf] ERROR: No Data in Serving Network (../src/smf/s5c-handler.c:105)
[smf] ERROR: Invalid Len[0] in Serving Network (../src/smf/s5c-handler.c:110)

Change-Id: Idf6d147cc4a37996ee4ae6de18158b0e140d9db6
Related: SYS#5602
2022-01-20 19:33:43 +06: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 bd78b61d6a pgw: add missing BSSGP_EncDec.cc
Fix for:
/usr/bin/ld: BSSGP_Types_part_4.so: undefined reference to `BSSGP__Types::dec__PDU__BSSGP(OCTETSTRING const&)'
/usr/bin/ld: Osmocom_Gb_Types.so: undefined reference to `BSSGP__Types::enc__PDU__BSSGP(BSSGP__Types::PDU__BSSGP const&)'

Related: OS#5252
Change-Id: I010df10396d264e67bd8c712daafcfb79262ece2
2021-10-12 16:35:01 +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 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 f400151003 pgw: Add support for PCRF emulation (CCR/CCA)
If mp_pcrf_local_ip is set to a non-empty string, the PGW testsuite
now emulates a PCRF and expects the PGW to perform the related
transactions - so far Credit-Control-Request INITIAL_REQUEST
at session creation, and TERMINATION_REQUST at session deletion.

Change-Id: I5f0c7a66d38e5c8b5f36b45717d49648a14ed7b2
2020-04-26 22:08:34 +02:00
Harald Welte 71117b689d pgw: Use bash to reliably support += syntax in shell scripts
Change-Id: Id93e83456380ade0617fe9a17eb2b92c685c749e
2020-04-26 15:29:35 +02:00