Commit Graph

4201 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
Pau Espin 831cb69a93 hnbgw: Provide proper params to set StatsD local ip/port
The StatsD init() function parameter names were misleading
(prefixed "dst_" while they are actualy "local_" ones).
As a result, the hnbgw test was passing the wrong values to it.

Change-Id: I213173c99ec314c2eebfb8836c4d3467b3a7f818
2024-04-16 12:42:30 +02:00
Vadim Yanitskiy f4ba2252de msc: expect TC_attached_imsi_lu_unknown_tmsi to pass
The "VLR evil twin" problem has been fixed in osmo-msc.git:

https://gerrit.osmocom.org/c/osmo-msc/+/36452
https://cgit.osmocom.org/osmo-msc/commit/?id=2fd69e15d36d5a8e87029741ad66632c57d24cd4

And the testcase is finally passing now.

Change-Id: I57a277fa7e6e0d10ff38e23f416ace87472e6602
Related: OS#4721
2024-04-15 15:18:28 +00:00
Neels Hofmeyr 06dec6b324 msc: expand TC_lu_tmsi_noauth_notmsi
From running this test repeatedly, I noticed that osmo-msc's new patch
to avoid storing a TMSI may also trigger more evil twin situations in
the VLR as described in OS#4721.

Always run this test twice, to probe for the evil twin problem.

This test will pass from osmo-msc patch
Ifdabe0b65bffafbf7b8e5cc10e2d225d1ed1cecd on.

Depends: osmo-msc Ifdabe0b65bffafbf7b8e5cc10e2d225d1ed1cecd
Related: SYS#6860 OS#4721
Change-Id: I5e596597add7d585efd27c850067b8d7ba34ecc0
2024-04-15 15:18:28 +00:00
Neels Hofmeyr a8a2c5e5f6 msc: add TC_lu_tmsi_noauth_notmsi
Add test case for handling a LU by TMSI MI when 'no assign-tmsi' is
configured.

This test will pass from osmo-msc patch
I583682d1a35a70b008d7bb2d89ba7c3109a60b21 on

Depends: osmo-msc I583682d1a35a70b008d7bb2d89ba7c3109a60b21
Related: SYS#6860 OS#4721
Change-Id: If10b9987395670b084ff8ad6d1f033ff46896d75
2024-04-15 15:18:28 +00:00
Neels Hofmeyr 392de2d5c5 msc: add mi arg to f_perform_lu()
Allow testing Location Updating by TMSI MI.

Prepares for TC_lu_tmsi_noauth_notmsi in
If10b9987395670b084ff8ad6d1f033ff46896d75

Change-Id: I31aad8eb751528f7237a892702e87ee5855cabbb
2024-04-15 15:18:28 +00:00
Neels Hofmeyr a250d7e962 msc: allow f_verify_vty_lac_ci() to pass for CompL3 by TMSI MI
Obviously, when only a TMSI has been used, searching for an IMSI will
return no subscriber. Don't fail in that case when testing for
verify_vlr := false.

Prepares TC_lu_tmsi_noauth_notmsi in
If10b9987395670b084ff8ad6d1f033ff46896d75

Related: SYS#6860 OS#4721
Change-Id: I4d719928f04e5a47d415c38f835451b1f10c713d
2024-04-15 15:18:28 +00:00
Vadim Yanitskiy 53f2be6b4e msc: derive altsteps from f_expect_paging() and use them
Change-Id: Ia0e787fc376acec09e8985a63862872eb89b53a4
2024-04-15 15:18:28 +00:00
Vadim Yanitskiy eb81ca46dc msc: rework f_expect_paging(): handle mismatch and timeout
When a received Paging mismatches, instead of waiting for Tguard
timeout, fail immediately.  Add a local timer and wait 4.0 seconds
by default.

Change-Id: I30273e3882e348a2ded88b7b96a5ec1473a56913
Tweaked-By: Vadim Yanitskiy <vyanitskiy@sysmocom.de>
2024-04-15 15:18:28 +00:00
Neels Hofmeyr 1af4b0f625 msc: f_expect_paging(): fix by_tmsi arg
The by_tmsi argument so far had no effect. But I actually need exactly
this in upcoming MSC_Tests.TC_lu_tmsi_noauth_notmsi(): expect a Paging
with explicitly no TMSI included.

Related: SYS#6860 OS#4721
Change-Id: I9434745b7faeb738caafed8080b9f7b1a6a8079a
2024-04-15 15:18:28 +00:00
Pau Espin c77743d544 pcu: Update component diagram
The component architecture in PCU_Tests is quite complex to follow.
Update the diagram in order to make it easier for people to gasp the big
picture.

Change-Id: Ie592a9301b7a900334650741ed633cd70535a2b1
2024-04-15 08:55:36 +00:00
Neels Hofmeyr d076e93507 ran-emu: allow receiving Paging without a TMSI
Fix access of non-present tMSI.* if tMSI == omit, allowing to match
incoming Paging with a UnitData receiver that has no TMSI.

Change-Id: I1bdf3488be0f8d4f0905665c4ba642f9468b9777
2024-04-14 13:10:09 +00:00
Harald Welte 904b5f1a56 hnbgw: Implement validation of [some] counters
Let's use the StatsD_Checker to verify that counters increment when
we expect them to.

Change-Id: Ib0e2dd23802b18f4bd417150d0b62954b1d459a4
2024-04-13 16:26:10 +00:00
Harald Welte 7a9e79645c hnbgw: Use iddentical LAC/RAC/SAC values
Let's not use different values on RANAP and HNBAP, but derive on from
the other.

Change-Id: If4d82dc350c072e3528097d850304514adf65340
2024-04-13 16:26:05 +00:00
Harald Welte f95ab2d0a0 hnbgw: Test normal and abnormal RAB release
Change-Id: I7b57d4f9bd39820829ae9d52ae6e2f098e75de71
2024-04-13 16:26:05 +00:00
Harald Welte 1818834e6f hnbgw: Use "NAS/Normal" as default release cause
We shouldn't run all of our tests with a rather exotic release
cause value (O&M intervention) but assume a normal/orderly NAS
triggered release, unless a specific test case explicitly tests
an abnormal release cause.

Change-Id: I8ddd1dccc5637431e3a8c6e607e0e45faa82b5b5
2024-04-13 16:26:05 +00:00
Harald Welte 0d4a843fd3 hnbgw: Make RAB release cause configurable
Change-Id: Ie072dafbc3378739d41411632e33a8a1ec1ed572
2024-04-13 16:26:05 +00:00
Pau Espin 32167d8052 asterisk: Introduce tests TC_internal_call_all_*registered
Related: SYS#6782
Change-Id: Id06dedb3aac4f31f06281661391bf50640f6369a
2024-04-11 10:54:38 +02:00
Pau Espin 7011bf47c5 asterisk: Introduce test TC_internal_call_momt
Lots of infrastructure added to allow call establishment and hang up
between 2 users connected to Asterisk.

SIP_Tests is updated to accomodate for necessary changes in
SIP_Templates used by Asterisk_Templates.

Change-Id: Ic5827a3e94b06fbc57f6405bf0f0aa6598c5d1fe
Related: SYS#6782
2024-04-10 14:02:11 +02:00
Pau Espin e94a64834d {SIP,Asterisk}_Tests: Mark all components alive
This fixes some dynamic errors occuring due to messages arriving while
tests is being torn down.

Change-Id: I60642071758ad1203196eddd3bbacb84f4dcf9fb
2024-04-10 13:37:58 +02:00
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 6331f5c033 SIP_Emulation: Match empty port as default port 5060
Change-Id: I8415571a5bdc99e8cc007bb4b57bcb73b7afd4fb
2024-04-08 21:34:48 +02:00
Pau Espin 0169e6038d SIP_Emulation: Fix SIPEM_register when several conns are active
"Dynamic test case error: Port CLIENT_PROC has more than one active
connections. Message can be sent on it only with explicit addressing.".

Change-Id: Ibf868394ce2c495a78ab943ddec278a45bf71088
2024-04-08 21:02:52 +02:00
Pau Espin 65dde83956 library/SIP_Templates: Fix wrong method name in tr_SIP_REGISTER
Change-Id: Ieec2124417a3294cfb469180f44285e880a46177
2024-04-08 18:17:15 +02:00
Pau Espin 05eaa1a531 asterisk: Implement and test SIP Digest Authorization
Related: SYS#6782
Change-Id: Ib469f1906927a3f246876040086ff115fbf4c032
2024-04-08 17:36:18 +02:00
Pau Espin 95058fd76c asterisk: Add missing 0-digit prefix in user
Change-Id: Ia12552cf70c4c0f2c71cd9d5b70c608c883fb170
2024-04-05 16:26:32 +02:00
Harald Welte f60044d44b hnbgw: Add TC_ue_register_tmsi_lai for UE Registration without IMSI
Change-Id: I1712a3db791c07767eba10fcea3ce15b898670df
2024-04-04 02:48:16 +02:00
Vadim Yanitskiy 3c88c35912 msc: fix race condition in TC_mm_id_resp_no_identity
This testcase is failing sporadically ever since it was introduced
back in 2019, during 36C3.  The problem is that osmo-msc does not
react to the malformed MM IDENTITY RESPONSE immediately, but only
after timeout of timer X1 (5 seconds, by default);  while the
testsuite expects the LU REJECT to be received within 5 seconds.

We should ideally fix osmo-msc to react immediately, but for now
let's enlarge the LU REJECT waiting timeout in the testcase.

Change-Id: I5d2b5d49df8f7ae1eb12fc137f4256fe6fab9117
Related: OS#6426, OS#4340
2024-04-03 07:53:27 +00:00
Harald Welte af3e21687a hnbgw: Introduce tests about UE registration
We didn't have any test coverage for HNBAP UE registration so far.

Let's start with two basic tests:
* normal / successful case
* abnormal case: UE Register without prior HNB Register

Change-Id: Ice2743d376ab8041646259fa25117d6fd0e8c2fd
2024-04-02 20:22:14 +00:00
Pau Espin 37ee0ed83c Introduce Asterisk_Tests testsuite
Add initial infrastructure to run tests against an Asterisk process.
An not-yet-finished draft test doing registration is submitted to
validate communication towards Asterisk works.

The testsuite will be improved in follow-up commits, but this way other
people can already start using it and we can set up the dockerized setup
+ jenkins jobs to run it nightly.

Related: SYS#6782
Change-Id: I66f776d5df6fb5dc488d9e589b84a6b2385406e8
2024-04-02 08:22:08 +00:00
Pau Espin fb34d863c3 SIP_Templates: Rework templates to make them more extensible
The existing template system in SIP_Templates made it difficult to craft
specific templates, since it was usually skipping several layers of
fields when passing parameters.

This commit reworks some of those templates, adds news templates, and
cleans formatting for others, as a preparation for further work which
will be done when adding Asterisk_Tests testsuite.

Change-Id: Ifd14213e9c2b8f5061f828a63ef47844828d94ea
2024-04-02 08:22:08 +00:00
Pau Espin 6052a342fe SIP: generate seq_nr within allowed range
Change-Id: Iea5f4568af1bd795db57d2b77e82d976edc9e337
2024-04-02 08:22:08 +00:00
Harald Welte 3f216c5cee hnbgw: Qualify RAC/LAI/SAI to RANAP_IEs module
This is in preparation of importing HNBAP_IEs which introduces types of
the same name.

Change-Id: I2fb7ca8dfc2011c727633e795a9d16856825379d
2024-03-29 11:16:18 +00:00
Harald Welte d71d5969ba hnbgw: Rename f_hnbap_register to f_hnbap_hnb_register
There's HNB and UE registration; let's make clear which it is.

Change-Id: I171f0385389c5f50dc7ad28525deef396fff5fbf
2024-03-29 11:16:18 +00:00
Neels Hofmeyr 649eba0456 fix MGCP_Test.TC_one_crcx_loopback_rtp_implicit expectations
osmo-mgw should not respond to unknown peers. The test expected the
wrong thing, because of an old hack for 3G voice. Fix that.

Related: OS#6424
Change-Id: Ibe2ee59d1ed2c25ffef7e8534c172ac190b4983d
2024-03-27 21:16:55 +00:00
Vadim Yanitskiy 4a011fa0db msc: use as_expect_clear() in f_tc_mt_t310()
This testcase is not Iu-compatible yet, but let's make life a bit
easier for those trying to make it such in the future.

Change-Id: I8185153502d31163fcb4c718690ee0f1cc912f5b
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy b3e42cfcdc msc: fix f_tc_mt_crcx_ran_reject(): properly handle Iu-ReleaseCommand
Previous commit [1] uncovers a problem in f_tc_mt_crcx_ran_reject():
this function uses as_clear_cmd_compl_disc(), which is expecting
A-interface (GERAN) specific BSSMAP Clear Command.  The Iu-interface
(UTRAN) specific RANAP Iu-ReleaseCommand is not handled at all.

The testcase was passing so far due to a bug in as_optional_cc_rel(),
which would unblock the alt-statemtnt on receipt of CC RELEASE, so
that we would never respond to RANAP Iu-ReleaseCommand.

Let's derive a new altstep from f_expect_clear() and use it.

Change-Id: Idd679bbf720a56a76cf37ab414b1e6d90e53278b
Related: [1] I0143b4d33b1ebe4cce99c09018540524c4626eec
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy 7093a5d9a2 msc: as_{iu_release,clear_cmd}_compl_disc: remove no-op timer arguments
Change-Id: I1d3dcf4399dccd353702e4d6c53fe8e26e16ea9b
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy d1a32e09ac msc: fix missing 'repeat' in as_optional_cc_rel()
We do activate() this altstep in several testcases, so that it's
kinda "running in background".  In reality, the defaults in TTCN-3
are just a syntax suggar, and the following code:

```
var default foo := activate(as_foo_bar());
alt {
[] PORT1.receive(tr_Msg1) { repeat; }
[] PORT1.receive(tr_Msg2) { setverdict(pass); }
}
PORT2.receive(tr_Msg3);
```

actually evaluates to:

```
alt {
[] PORT1.receive(tr_Msg1) { repeat; }
[] PORT1.receive(tr_Msg2) { setverdict(pass); }
[] as_foo_bar();
}

alt {
[] PORT2.receive(tr_Msg3);
[] as_foo_bar();
}
```

If as_foo_bar() contains no 'repeat' statement, then whenever it
triggers it would efficiently cancel (unblock) the current alt
statement, resulting in weird behavior due to messages not being
dequeued from ports as expected.  And this is exactly what we
saw happening in OS#6414.

Change-Id: I0143b4d33b1ebe4cce99c09018540524c4626eec
Related: OS#6414
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy 42fae8aed4 msc: cosmetic: fix formatting in altsteps
Change-Id: I14afa9aa076396d48043000e350885384bde4c81
2024-03-27 16:55:40 +07:00
Vadim Yanitskiy 5f1018f954 msc: fix f_tc_ho_inter_bsc0(): properly patch n_sd
Assuming n_sd should be 3 is only valid for non-A5 testcases, in which
we are *not* doing ciphering and authentication.  For the A5 testcases
(TC_ho_inter_bsc_a5_*), this assumption is incorrect and osmo-msc is
definitely not happy about that:

  Duplicate DTAP: bin=0, expected n_sd == 0, got 3 (ran_msg.c:159)
  Dropping duplicate message ... (msc_a.c:1363)

Why and how the A5 testcases passed so far?  It was a pure luck, which
sailed away when we started executing ttcn3-msc-test with io_uring.

The A5 testcases were passing thanks to the as_optional_cc_rel() that
gets activate()d in background before calling f_call_hangup().  This
altstep does not have the 'repeat' statement, and as a side effect it
may cancel any normal alt-statements and even standalone receive()
statements.

In the successful scenario, it would cancel (unblock) the following
receive operation in f_call_hangup():

  MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref));
  log("f_call_hangup 2: rx MNCC REL ind");
  BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id)));
  // ^^^^^^^^^^ as_optional_cc_rel() triggers here and cancels this one

which is a pure luck because our CC RELEASE was sent with incorrect
sequence number and got dropped, so osmo-msc would never send us
CC RELEASE COMPLETE.  It would instead send us CC RELEASE due to
expire of T306, and the as_optional_cc_rel() would kick in handling
this message and responding with CC RELEASE COMPLETE.

In the failing scenario though (when running with io_uring), that
same altstep running in backround may trigger *earlier* and unblock
another standalone receive() statement:

  MNCC.receive(tr_MNCC_REL_ind(cpars.mncc_callref));
  // ^^^^^^^^^ as_optional_cc_rel() triggers here and cancels this one
  log("f_call_hangup 2: rx MNCC REL ind");
  BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_REL_COMPL(cpars.transaction_id)));

so that we will be stuck waiting for CC RELEASE COMPLETE until the
Tguard expires.

This patch fixes n_sd patching, so that our CC RELEASE message is
handled properly and the call gets released as expected, without
requiring as_optional_cc_rel() to kick in.  The missing 'repeat'
is to be added to as_optional_cc_rel() in a follow-up patch.

Change-Id: Iddde391eade716ca5c6c48cb631450ddb543e0d4
Related: OS#6414
2024-03-27 16:55:40 +07:00
Harald Welte 9e8db33f2d [cosmetic] mgw: fix spelling in comments
Change-Id: I2fb69463b070cdc183fff63ee7dc422169f8928a
2024-03-26 15:10:31 +01: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
Vadim Yanitskiy 33f9eea8af msc: osmo-msc.cfg: move MGW params to 'mgw' node
This fixes deprecation warnings printed by recent osmo-msc.

Change-Id: I724ec44ea37bb61b457361befee3e6e92c886c0d
Related: osmo-mgw.git I95f717a0fcd3c4ca622e3989baa28fac1f7ec1ca
2024-03-25 17:35:32 +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
Harald Welte c1aa231d3a Add funding link to github mirror
see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository

Change-Id: I2ceef868ae52c52329413a7caeaa3ca00a40b983
2024-03-23 16:58:46 +01:00
Harald Welte 0fc90c622b Add README.md file (to show up in gitea / github / etc.)
Change-Id: Ic176636930e9a36cc428360147140a7339aa58b5
2024-03-23 16:58:41 +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 f371375798 sip: Get Rid of private copy of f_mgcp_addr2addrtype()
The function was copied from MGCP_Templates.ttcn since the logic is the
same for SDP, but copied in order to avoid depending on whole MGCP file.
Since now SDP logic has been moved to its own SDP_Templates and a new
f_sdp_addr2addrtype() was added, use that one.

Change-Id: I27ce46b6d23ba0f2704dd0cee290ed519dec278e
2024-03-22 11:28:54 +01:00
Pau Espin 1158cc629c Move SDP templates to its own SDP_Templates.ttcn file
SDP is used in other protocols than MGCP, eg. SIP.

Change-Id: I0610b4cf5533e46a3401c65e60c7cce975c85412
2024-03-22 11:28:51 +01:00