Commit Graph

224 Commits

Author SHA1 Message Date
Vadim Yanitskiy 96c6afa996 sgsn: fix f_send_l3_initial_ue(): indicate PS domain, not CS
Change-Id: Ic499bcd036ef02d4e3ac7a94ccc3ff141df9b17b
2024-05-15 01:37:36 +05:00
Vadim Yanitskiy 3bed6a4634 sgsn: fix TC_iu_attach_geran_rau: register the new TLLI
We're getting a new TLLI assigned during the attach procedure (see
Allocated P-TMSI in the GMM Attach Accept message), which needs to
be registered in order to receive BSSGP PDUs from BSSGP_Emulation.

Change-Id: Idafcbd7e44a523a26dc34dc72e38ff879782148e
2024-05-15 01:33:34 +05:00
Vadim Yanitskiy e42f8d634d sgsn: reset encryption in SGSN_Tests_Iu.f_vty_config()
Ensure the expected default UEA configuration, which is always
reset properly even if one of the testcases aborts due to a DTE.

Change-Id: Ic2c5a11e86e4349796fa7508076ac27ef22815cd
2024-05-15 00:55:30 +05:00
Vadim Yanitskiy b5a002edbf sgsn: fix TC_iu_attach failing for recent -master
Since recently, osmo-sgsn is requesting encryption (UEA1 + UEA2)
in RANAP Security Mode Command by default [1].  The testcase
TC_iu_attach is assuming no encryption (UEA0) and thus failing.

Fix this by explicitly setting UEA0 via the VTY, similarly to
what testcase TC_iu_attach_encr does.

Change-Id: Ibaf83db1ab0f82f7e934e89ae3f6c19d014be197
Related: [1] osmo-sgsn.git I4eb9451b4267fc1436ed90a55ff200cf36f16bf6
2024-05-15 00:55:30 +05:00
Vadim Yanitskiy f0bbadc13b sgsn: add Iu specific, module local f_init()
Change-Id: Iea23b847b363da518a8dc121405522df9e4e0f77
2024-05-15 00:55:30 +05:00
Vadim Yanitskiy aaf7ce4ae8 fixup: sgsn: fix unused param in f_routing_area_update()
In 1ee1edd2 I changed f_routing_area_update() to actually use the
given RAI as Old RAI in the Routing Area Update Request.  Not only
this broke the testcase scenario (Old RAI shall remain unchanged!),
but also started triggering a use-after-free bug in osmo-sgsn.

Passing 'ran_index := 1' is enough for the second Routing Area Update
Request to show up with a different RAI (at BSSGP level), however the
Old RAI IE shall obviously indicate the *old* RAI, not the new one.

A follow-up commit will add a separate testcase to reproduce the
use-after-free problem in osmo-sgsn.

Change-Id: Ib16985cb08834a238ca4f7a747c43097f430ed6f
Fixes: 1ee1edd2 "sgsn: fix unused param in f_routing_area_update()"
Related: OS#6439
2024-04-21 20:49:15 +07:00
Vadim Yanitskiy 74b12c7592 sgsn: TC_sgsn_context_req_in: match MM Context & GSN Address IEs
Change-Id: Ie68794c309e548279381d044a3e34dcdf405084f
Related: SYS#6603, OS#6294
2024-04-19 17:34:18 +07:00
Vadim Yanitskiy acd0b39f79 sgsn: add testcases for SGSN Context Request procedure
Change-Id: If71de10897a8a9f6612cd46c760cd89c0299ac2c
Related: SYS#6603, OS#6294
2024-04-19 17:34:15 +07:00
Vadim Yanitskiy 3d81576263 sgsn: derive altsteps from f_routing_area_update()
Change-Id: I7d5ec9c42a37a5746c36745ac738fd77e1632675
Related: SYS#6603, OS#6294
2024-04-18 09:56:49 +00:00
Vadim Yanitskiy 1ee1edd20e sgsn: fix unused param in f_routing_area_update()
Change-Id: I582b2836eba3188cfd4c640b1febbd25c50001e0
Related: SYS#6603, OS#6294
2024-04-18 09:56:49 +00: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
Vadim Yanitskiy fdf0206ecc sgsn: osmo-*.cfg: tune logging configuration
Change-Id: I2f2cc69a481709e862d569b0298561b61506dfa7
2024-03-01 08:03:59 +00:00
Vadim Yanitskiy 472f8c0569 sgsn/expected-results.xml: add missing testcases
Change-Id: I09cc32bffde9d9dec59befa181a995e88112b2d2
2024-03-01 08:03:59 +00:00
Pau Espin ce1d3cb08c gsup: Add PCO IE
This commit adds a new file PCO_Types.ttcn which allows generically
encoding decoding PCOs.

Change-Id: I9a1ae74712d6e8e0cd524ccd7fc2529b1a15dd97
2024-02-21 20:00:24 +01:00
Pau Espin c63fa8ee87 GSUP: Fix missing and wrongly sorted IEs in ts_GSUP_IE_PdpInfo
Sort them to follow libosmocore implementation.

Change-Id: I65e586187d7230f122644c101f8467becae6e204
2024-01-23 11:21:37 +01:00
Pau Espin 7b7a1e8ed1 GSUP: Convert PDP-Type IE to PDP-Address IE
The previous PDP-Type IE should have been a PDP-Address from the
start, since having only PDP-Type with no address is only a specific
case (dynamic addressing).
This becomes clear by looking at other similar protocols like:
* MAP: APN-Configuration IE has servedPartyIP-IP{v4,v6}-Address IEs
* Diameter S6b, 3GPP TS 29.272 7.3.35 APN-Configuration contains
  Served-Party-IP-Address AVPs
* Diameter SWx, 3GPP TS 29.273 APN-Configuration.
* GTPv1C Ts 29.060 7.7.29 PDP Context containing PDP Address.

Since PDP-Type on its own really makes no sense, being it a special case
of PDP-Address, let's keep the IE by renaming it (keeping old name too
for API backward compat) and extend it to support lengths > 2 bytes.

Old implementation of libosmogsm gsup actually ignored lengths > 2
bytes, so we are safe acting against older implementations here, both
on the sending and receiving side on the wire.

Change-Id: I3e92368fff61694bcef6a48320595b59ae8f54ca
Related: OS#6091
Related: libosmocore.git Change-Id I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
Related: osmo-gsm-manuals.git Change-Id I775ff9c3be165d9f30d6ab55d03f99b6104eadd6
2024-01-19 20:56:18 +01:00
Pau Espin 8f1403a471 Move templates from GSUP_Types.ttcn to GSUP_Templates.ttcn
Follow similar structure that we have for other protocols.

Change-Id: I54cc8c99d1e91d57c3d5a92f6529ef2055e9d4ed
2024-01-18 20:22:34 +01:00
Philipp Maier 7e9acc3c4e SGSN_Tests: add RIM ROUTING ADDRESS field in request
When sending the RAN INFORMATION REQUEST on GTP-C, we do not add a RIM
ROUTING ADDRESS + RIM ROUTING ADDRESS DISCRIMINATOR field. Those fields
are optional but commonly added so that the SGSN does not have to
disassemble the RAN TRANSPARENT CONTAINTER to know the destination
address.

see also: 3gpp TS 29.060, section 7.5.14 and
          3GPP TS 23.060, section 8.1.5.2.2

Change-Id: Id944c66f28d787a18c6c6f7c9dc885997d83e94c
Related: OS#6095
2023-08-15 09:42:51 +00:00
Pau Espin 578fa193ae */osmo-stp.cfg: Explicitly define role & sctp-role
It was recently decided it's a good practice to always specify the role
 and sctp-role for all ASPs configured in the VTY, since it's an
 important configuration providing feedback on the network setup
 expectancies.

Change-Id: If48ca06f2cc3c0986daa5f6264d80138d468332a
2023-07-11 11:48:41 +00:00
Vadim Yanitskiy 805d5b196d SGSN_Tests: fix compilation warnings (template restrictions)
This patch fixes multiple compilation warnings like this one:

  Inadequate restriction on the referenced template variable
  `attach_req', this may cause a dynamic test case error at runtime

Change-Id: Iee7760d3dcf2a35d7fe612ed80dc13c1d11e0897
2023-06-28 12:20:15 +00:00
Vadim Yanitskiy d2f1bc9cf5 SGSN_Tests: fix TC_attach_timeout_after_pdp_act
This patch fixes several problems:

* missing "vc_conn.done": the actual testsuite logic, which can be
  found in f_TC_attach_timeout_after_pdp_act(), was never executed
  fully because we did not wait for the BSSGP_ConnHdlr to complete;
* too short Tguard value: the testsuite logic takes slightly more
  time to complete than the default timeout of 30.0 seconds;
* osmo-sgsn does not require authentication for the second ATTACH.req:
  the testsuite logic gets stuck in f_gmm_auth() after sending the
  second ATTACH.req because:
** osmo-sgsn is waiting for a response to GMM IDENTITY REQUEST,
** osmo-sgsn does not send GSUP SendAuthInfo.req again.

As can be seen from the test execution artifacts on Jenkins, this
testcase never passed: either failing due to an error, or declaring
no verdict at all.  The average execution time is 650 ms.

Change-Id: Ibaf2134247153471bd45d7a7f91155294c6c6de5
Fixes: 3ede9e32b "sgsn: Add TC_attach_timeout_after_pdp_act"
Closes: OS#4221
2023-06-28 12:20:15 +00:00
Vadim Yanitskiy 24d2282a37 SGSN_Tests: turn f_gmm_gsup_lu_isd() into an altstep
This way it can be used in the alt statements.

Change-Id: I1baaf6ed66cfaa75237b0abdce82ffdc7e672b96
2023-06-28 12:20:15 +00:00
Pau Espin 56fafdd3a6 Explicitly configure ASPs asp-clnt-* as role=asp & sctp-role=client
Until recently, the asp-clnt-* ASPs, which have specific handling in osmo_sccp_simple_client_on_ss7_id(),
were being always forcedly set to sctp-role CLIENT by code in that
function.
This prevented user of that API from explicitly configuring the ASP as
"sctp-role server" through the VTY as the option would be overwritten silently.

Now, the sctp-role from config is followed if the ASP is
defined/configured through the VTY (not dynamically created at the time
osmo_sccp_simple_client_on_ss7_id() is called).

Since the default for a VTY-specified ASP is to be in "sctp-role
server", the config files need to be updated to properly configure the
ASP to be in "sctp-role client", which is the desired mode here.

Same applies for "role", where the default is SG but it is actually used
as "ASP" here.

Change-Id: I4eb5b5f6b4b24df079b4c74e2a2e2ebb8769b0bd
2023-06-08 18:41:32 +02:00
arehbein 3ede9e32b0 sgsn: Add TC_attach_timeout_after_pdp_act
Related: OS#4221
Change-Id: Ib3e3c021707b707811388616e28d7d7cc22f7b53
2023-06-06 09:09:42 +00:00
Vadim Yanitskiy 94e60c851c {sgsn,gbproxy}: do not link non-existent TCCConversion.hh
Change-Id: If1a3b0bac7438aa49faa905c8879d096248edfb7
2022-11-24 03:56:46 +07:00
Vadim Yanitskiy c6c194323b {ns,sgsn,gbproxy}: gen_links.sh: do not link unused modules
Change-Id: I8fddd010e2a3ce88c892887fc571ae54d84e931f
2022-10-21 10:35:10 +00:00
Neels Hofmeyr 13b83db5db update various expected-results.xml
Change-Id: I850b79526145307246bca40c70ed8e4d586d8c68
2022-08-12 02:31:23 +00:00
Eric Wild 6e511ce624 fix sgsn and hnbgw test issue introduced in 49888a65dc
ranops was not isvalue because bssap_reset_retries was not set and not
explicitly omitted either, so the ran adapter decided not to create a
ran emulation...

Change-Id: Ib2d3f1fbcfbd53af1e627bd2cf36c3153fa7d012
2022-04-02 19:38:52 +00:00
Neels Hofmeyr 3ee71d8521 sgsn: add TC_iu_attach_encr with UEA > 0
Test new osmo-sgsn Iu attach with UEA (encryption) enabled

Related: SYS#5516
Depends: I27e8e0078c45426bf227bb44aac82a4875d18d0f (osmo-sgsn)
Change-Id: I1a7c3b156830058c43f15f55883ea301d2d01d5f
2022-03-10 18:58:22 +01:00
Pau Espin 494e8b3e55 Start BSSGP_CT and NS_CT as alive-type component in all testsuites
This was already done in PCU_Tests and Gbproxy_Tests, let's to it
everywhere.

Change-Id: I6e3b08710b4502e2b9805f7c9f7bd89f34e4085c
2022-02-24 11:47:43 +00:00
Pau Espin 17e0f8c5a0 break GTP_Templates dependency on Osmo_Gb_Types, BSSGP_Types, NS_Types
The resulting set of dependencies needed just to have one simple CellId
struct is huge. That was fine for sgsn testsuite since anyway those were
being used, but it's not acceptable for other testsuites (hnodeb) which
only really require the GTP side.

After this change, GTP_Templates only requires GSM_Types, which ends up
in a much smaller subset of dependencies being pulled in.

Change-Id: Icd8234908af445b798517fe110cd0648969179a4
2021-12-09 15:25:50 +00: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
Neels Hofmeyr cb8d9894af update expected-results.xml files
Change-Id: Idcf764cd2d251210bb123d2a5ea782cda0d670b7
2021-07-05 13:11:14 +02:00
Vadim Yanitskiy 60fcc63f48 SGSN: fix using non-existing VTY command for encryption
Change-Id: I366ccd5a562c86e6df79bbc200fb46d1aef69b39
Fixes: [1] Iad65cbf9840aa883cb34e53554b94a4142c82638
Related: SYS#5324
2021-07-04 01:02:34 +02:00
Eric Wild c555be597f sgsn a54 tests
This adds a few tests that ensure that the encryption algorithm dynamically chosen is
1) one actually supported by both the sgsn and the UE
2) the strongest one available both have in common

Change-Id: Iad65cbf9840aa883cb34e53554b94a4142c82638
Related: SYS#5324
2021-06-16 06:32:53 +00:00
Alexander Couzens bd6e9a1da9 RAW_NS/NS_Provider_IPL4: allow to use the new NSVC interface
RAW_NS used previous a single TTCN3 port for a single UDP port
(source/listen side).
This has the limitation that only a single NSVC could be tested for a
local UDP port. However SNS tests require multiple NSVCs over a single UDP port.
NS_Provider_IPL4 already supports multiple NSVCs for the NS_Emulation.
Extend the support in NS_Provider_IPL4 to also allow RAW_NS to use
multiple NSVCs.

Related: OS#5036
Change-Id: Iafd9310e04066958914201da0cbdcd563bd5c976
2021-06-15 20:20:44 +00: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
Pau Espin dab2fbd897 sgsn: TC_bssgp_rim_single_report: Avoid useless component start
The componenet is not needed/used at all, so there's no need to start
it.

Change-Id: I63baadbb8b09843a653d3f5c11df204f5a1a761e
2021-05-04 16:41:57 +02:00
Pau Espin 7bac69f253 sgsn: Fix default value for mp_ggsn_ip
Make it match the osmo-sgsn.cfg files present in the same directory.

Change-Id: I798b3c8b6e4a4787b8a9d5ecd9d2b1aad2b931ee
2021-05-04 15:53:47 +02:00
Harald Welte 79ed4b1685 remove deprecated 'logging level all everything' from configs
it has been deprecated in libosmocore.git 2.5 years ago:

commit 7e0686c6b4b456ec4e6e15689694b1bcf96c301f
Author: Neels Hofmeyr <neels@hofmeyr.de>
Date:   Mon Sep 10 20:58:52 2018 +0200

Change-Id: Ieb9e958278e7bb9d5e798f83b70dcb873a25d06d
2021-04-21 16:40:49 +00:00
Harald Welte d73ba5801c ns/gbproxy/sgsn: Update configs to use logging level lnssignal'
In libosmocore I34b8fde2955ecc010d1dcd9512e1bba9211e2c0d we introduced
a new log subsystem; enabel it in the related configs here

Change-Id: Ie3d178e68aa81d5636c87940074cb6582ac2f131
2021-04-21 07:17:38 +00:00
Harald Welte 424ec5211c SGSN: Some initial SNS tests for IP-SNS in OsmoSGSN
Change-Id: I821d998704756fa30278f41d0371051db9d3fc58
2021-04-01 21:27:33 +02:00
Harald Welte 09e04ba648 sgsn: sync config files with those from docker-playground.git
Change-Id: Ice00a0a4d00629e30b4fec029353d590eba8877f
2021-03-20 15:41:36 +01:00
Harald Welte d5836dca12 sgsn: Avoid race condition in TC_suspend_rau()
In f_routing_area_update() we are sending a RAU Complete to the SGSN
and then immediately afterwards send a GTP-U from the simulated
GGSN to the SGSN.  That GTP might reach the SGSN faster than the
RAU Complete, resulting in a test failure.

Change-Id: Ic489e0857115cf24965e413a39918edc5a8f44f8
2021-03-20 15:40:00 +01:00
Vadim Yanitskiy 418e806df5 SGSN_Tests: add setverdict(pass) to TC_bssgp_rim_single_report()
Change-Id: If5295cc8eccda2d1b3baae7d2169fac5da2a085c
2021-02-28 16:27:12 +01:00
Vadim Yanitskiy 7bc13eae26 SGSN_Tests: fix coding style in TC_bssgp_rim_single_report
Change-Id: I667c1e8a94393e2b5afc6e2e3f7503b73198822c
2021-02-28 16:26:03 +01:00
Harald Welte dd9fb84b58 sgsn: Fix regression regarding g_pars.bssgp.cell_id[] array overflow
This was introduced in I7d859fd710dba96eb9b46c428243281183e1be12
and caused Iu related TTCN3 tests to fail with:

SGSN_Tests.ttcn:771 Dynamic test case error: Index overflow in a value of type @SGSN_Tests.BssgpCellIds: The index is 3, but the value has only 3 elements.

Change-Id: Iaae0015f5e7c7eabc426add91b5de1b63bf6d9f6
2021-02-16 20:43:56 +01:00
Pau Espin 7c05216e01 sgsn: Introduce tests for several cell change related scenarios
Test TC_cell_change_different_ci_data provides test case for
fix in osmo-sgsn.git Change-Id I2c14e1d65575f54212924f7c5f0a2f4c1b76ec81

Related: SYS#4909
Change-Id: I2158685bf817d4bf064bb4d2ef5aa96ca252fe21
2021-02-16 17:31:37 +01:00