Commit Graph

3340 Commits

Author SHA1 Message Date
Harald Welte 5f9747fe02 CBSP: wip
Change-Id: Ic0f0b3d620f3ca73bab3d45997d0c1b9433ac1f7
2022-04-27 16:57:24 +02:00
Harald Welte 41b18606bb bsc: CBSP code refcator: Add f_exp_rsl_etws()
This function reduces code duplication between CBSP tests.

Change-Id: I69bedd43bc88bc619b80bf9038da901bbff9f04b
2022-04-25 13:27:54 +02: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 09b9bad21e bsc: Introduce test TC_paging_500req
Related: SYS#5922
Change-Id: I4f7185939c20804deef92f476ed19248ba885f29
2022-04-22 17:38:02 +02: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 cb1e8278f9 ggsn: Fix TC_addr_pool_exhaustion not answering Gy CCR termination
Change-Id: If126840001b1e10d3dee86d678e624a0584337e8
2022-04-20 14:43:43 +02:00
Harald Welte 3912895260 bsc: Expect number-of-broadcadsts-completed-list in CBSP KILL COMPLETE
When responding to a CBSP KILL with a CBSP KILL COMPLETE, make sure
we include the optional "Number of Broadcasts Completed List" IE
in order to inform the CBC about how many times the just-killed
message had been broadcast before it was killed.

It seems some CBCs expect this IE to be present, while 3GPP TS 48.049
lists it as optional.  osmo-bsc is including this IE as of Change-Id
I47aebd613dfc6dd9261ea9019a51aff0cd6470d8

This change updates the test suite to expect this IE to be included.

Change-Id: I5b56676c93479ec7b32cff66c9738fff7d0228cf
Related: SYS#5906
2022-04-15 04:54:10 +00:00
Vadim Yanitskiy 5ac8f31b38 bsc/osmo-bsc.cfg: explicitly set AMR link adaptation parameters
The default AMR link adaptation parameters have been changed in
the recent osmo-bsc, so set the old expected default explicitly.

Change-Id: I320d91a35bc50bdfe87c0384035a10b8672ef23c
Related: osmo-bsc.git Ic5f8d55d250976d8d4c9cae2d89480fd52326717
Related: SYS#5917
2022-04-14 22:51:47 +03:00
Harald Welte 67881aef23 Avoid generating zero-length packets
I used the construct like f_rnd_octstring(f_rnd_int(100)) in a number
of places to generate random-length packets with randomized length.

The problem I didn't realize is that f_rnd_int() of course can also
return '0', which would generate zero-length packets.  This may be
permitted in some protocols, but it leads to problems e.g. when trying
to send a UDP packet of zero length (which the kernel will not do).

So let's introduce
* f_rnd_int_nonzero() for returning non-zero randomized integers
* f_rnd_octstring_rnd_len() for returning a random-length random payload
  octet string
* replace all f_rnd_octstring(f_rnd_int()) call sites with the new
  function.

Change-Id: I818a113ff8d2a2f7cab2ec7d9c8661607c6331d6
Closes: OS#5528
2022-04-12 22:52:47 +02:00
Pau Espin 12c4aa8bb7 GTPv2_Emulation: Increase reset_all_stats timeout
Release of 256 tuns + threads takes quite a reasonable amount of time.
Let's increase the timeout since reset_all_state can take around 10
seconds sometimes.

Related: OS#5523
Change-Id: Ie01e07bd698cb5c386f757f4ec315f4892ad61cb
2022-04-12 09:44:52 +00:00
Neels Hofmeyr 2677b87978 bsc: fix sccplite test fallout: deactivate as_Media in f_ho_into_this_bsc()
Deactivate as_Media() once the handover is completed, so that it does
not fail on the expected MGCP DLCX from release.

Fix fallout seen in these tests:
SCCPlite
 BSC_Tests.TC_ho_into_this_bsc
 BSC_Tests.TC_ho_into_this_bsc_a5_0
 BSC_Tests.TC_ho_into_this_bsc_a5_1
 BSC_Tests.TC_ho_into_this_bsc_a5_3
 BSC_Tests.TC_ho_into_this_bsc_a5_4
 BSC_Tests.TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
 BSC_Tests.TC_ho_into_this_bsc_a5_1_3
 BSC_Tests.TC_srvcc_eutran_to_geran
 BSC_Tests.TC_srvcc_eutran_to_geran_a5_3
 BSC_Tests.TC_srvcc_eutran_to_geran_src_sai
 BSC_Tests.TC_srvcc_eutran_to_geran_forbid_fast_return
 BSC_Tests.TC_ho_into_this_bsc_sccp_cr_without_bssap

All of these tests use f_ho_into_this_bsc().

(It is not clear to me why only the SCCPlite tests show the fallout, the
AoIP should be similarly affected, but isn't.)

The failures were introduced by recent merge of
I0633f60f09d58802f6be0238ef41a632d93a4327, which made as_Media()
stricter by failing on early DLCX.

Related: SYS#5916
Change-Id: Ic5650a48eb3d90f2b42f16685178c97b54473429
2022-04-12 01:53:00 +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 b335f01ef2 DIAMETER_Emulation: Allow up to 256 IMSI Diameter components
TC_createSession_ping4_256 requries 256 concurrent connections.

Change-Id: Idc305a868f827dee63a476979fc9de9fc12580c5
2022-04-11 12:04:55 +00:00
Pau Espin 69730a29a4 DIAMETER_Emulation: Fix typo in comment
Change-Id: I6163fc9153082598c7211b16a7c18fb95cf3d08a
2022-04-11 12:04:55 +00:00
Pau Espin e4361705c1 DIAMETER_Emulation: Rename association table
The table has no direct relation to SGSAP, it tracks IMSI connections in
a generic way.

Change-Id: I12399465549739fb99af193e7071fff8bc452b0b
2022-04-11 12:04:55 +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
Vadim Yanitskiy 93ad8143f1 BTS_Tests: tune waiting timeout in TC_rsl_ms_pwr_dyn_up
Since recenly, osmo-bts is using P_CON_INTERVAL=2 by default.  This
means that the MS power loop gets triggered every 4th SACCH block
(1.92s), so we need more time to reach the maximim Tx power.

Change-Id: I9266f7284fcdb0afa3473f575640689e334e89a8
Related: osmo-bts.git I91c505447f68714239a4f033d4f06e91893df201
Related: OS#5517
2022-04-11 12:04:21 +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
Neels Hofmeyr a47a8c60ee bsc: add TC_emerg_call_and_lcs_loc_req
An emergency call often comes with a Location Request. Make sure
osmo-bsc handles it well.

Related: SYS#5916
Change-Id: I95037374c45943cb14401bc48f16a39c2fcbe1f5
2022-04-07 14:18:28 +00:00
Neels Hofmeyr 9b320c10f2 bsc: as_Media_mgw: fail on DLCX
as_Media_mgw() is used to establish a voice stream. If a DLCX happens as
part of that, that should be flagged as a problem.

In fact the Mode Modify test with current osmo-bsc does exhibit a DLCX
right upon the Assignment Complete message, which is a bug fixed in
I5ab10ee7fd9c5d7608e8a06893881d990943feed.

This patch now correctly flags this as a failure.

In the two tests
TC_ho_in_fail_no_detect, TC_ho_in_fail_no_detect2
the expected failure causes expected DLCX, so exempt those.

Related: SYS#5916
Change-Id: I0633f60f09d58802f6be0238ef41a632d93a4327
2022-04-07 14:18:28 +00:00
Pau Espin 5a778ae426 Diameter_Templates.ttcn: Avoid sending AuthAppId Relay in CEA
We don't really act as rely agents in the emulation, so let's not
announce it.

Furthermore, this aids libfreediameter selecting proper routes, since it
seems to only underscore peers not matching the AppId if they are not
rely agents (see dont_send_if_no_common_app() in freeDiameter.git)

Change-Id: I0a9daf094f4c27c0b4de5581ddd56feced8e5732
2022-04-06 13:41:03 +02:00
Vadim Yanitskiy a144e3c786 BTS_Tests: add altstep as_dl_sacch_lapdm_ab
Change-Id: I3ba17683892e8aa1694bb6dd32d8b37660020026
2022-04-05 13:52:53 +00:00
Pau Espin 6844c161f9 pcu: Introduce test TC_dl_llc_sapi_priority
Related: OS#5508
Related: SYS#5908
Change-Id: I26308a59718a6470853c964583a39986006e59c0
2022-04-05 10:22:14 +00:00
Pau Espin b8b1c0d626 RLCMAC_EncDec: Fix bug decoding LI[0]=0
Change-Id: I86c1b48c922f50013257c8dce405cbad1d77d868
2022-04-05 10:22:14 +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
Eric Wild 66448c1e56 fix bsc 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: Ibbef035929ec861fec1e8554460e22650b386f83
2022-04-02 12:58:38 +00:00
Eric Wild 49888a65dc ran emulation: allow multiple reset attempts
bsc-nat introduces a delay that will lead to failed tests, since the
reset attempt happens too early and times out, and the tests do not
retry.

Change-Id: I9f6db2a24e984eef31e76f9d42a80eb6a1bb6928
2022-03-31 17:49:10 +00:00
Vadim Yanitskiy c2696fa108 BSC_Tests_CBSP: add a new testcase TC_cbsp_write_rep_period_num
Change-Id: I169c482ea5de040df63db4c605ac9cae19f8d28f
Related: SYS#5905
2022-03-30 03:48:26 +03:00
Harald Welte 562d28e305 bsc: Add tests for CBSP MESSAGE STATUS QUERY procedure
Change-Id: I124a69c515d634bc054ed35e430af6b3c11ad46e
Related: SYS#5909
2022-03-28 21:29:04 +02:00
Harald Welte f42c787ce6 CBSP_Types: Fix typo num_bcats_compl -> num_bcast_compl
Change-Id: Ic51b3071ea9233a053cb1ee837b910d9250010d2
2022-03-28 21:28:42 +02:00
Vadim Yanitskiy dcbdb820ea library/BSSMAP_Templates: add missing LCS {Priority,QoS} IEs
According to 3GPP TS 48.008, section 3.2.1.71, the LCS QoS IE shall
be present if location of the target MS is requested and is optional
otherwise.  Since [1], osmo-bsc started to check presence of this IE,
so let's add it to ts_BSSMAP_Perform_Location_Request.

Taking a chance, let's also add LCS Priority IE.

Change-Id: If2bd6e636d3ee695abab9ed40417dc53ec68fd12
Related: [1] osmo-bsc.git Ifeb359b0468845da0b4fed9e2e4b79256067fa81
Related: SYS#5891
2022-03-23 16:27:57 +03:00
Vadim Yanitskiy 2ae269b9ac library/BSSMAP_Templates: add missing LCS Client Type IE
According to 3GPP TS 48.008, section 3.2.1.71, the LCS Client Type
IE shall be present if the location type indicates a request for a
location estimate and is optional otherwise.  Since [1], osmo-bsc
started to check presence of this IE, so let's make sure that
it's present in ts_BSSMAP_Perform_Location_Request by default.

Change-Id: I5c8d6962e957d587dc4b65d08bf56bd4ef2f0d6e
Related: [1] osmo-bsc.git Id3262e67c3dc25cb93fbd52a40689c5529ca2d41
Related: SYS#5891
2022-03-23 16:27:57 +03:00
Vadim Yanitskiy 00bfcb548d library/BSSAP_LE_Types: fix wrong IEI in record BSSMAP_LE_IE_LcsClientType
Change-Id: Ifae1efa1717a5dbc7ecd4b5ba83e3866ff803390
Related: SYS#5891
2022-03-23 16:27:53 +03:00
Vadim Yanitskiy a25fe23aae BSC_Tests: avoid code duplication in f_expect_chan_rel()
Using a guard statement makes no sense given that we match the
cellSelectionIndicatorValue conditionally within the alt branch
itself.  Removing that guard statement eliminates the need to
have an additional alt branch with identical body.

Change-Id: I373376637a083637ce01f3ac59fe5fd2836ac6cd
2022-03-22 18:25:53 +00:00
Vadim Yanitskiy bc7c35a3ae BSC_Tests: add '(present)' restriction to 'expect_rr_cause'
RR Cause is a mandatory IE, so it cannot be omitted.  Therefore it
makes no sense to check if istemplatekind(expect_rr_cause, "omit").

Change-Id: I564d00a4715b86d248bce449d2b9193ac5e99008
2022-03-22 18:25:53 +00:00
Vadim Yanitskiy 35c9a33418 bsc: fix some inadequate template restriction warnings
Change-Id: Icfc69aff2c923f4e12dbd6cc42c792d5712a7b27
2022-03-22 18:25:53 +00:00
Pau Espin bedb1fd1e2 gen_links.sh.inc: Fix globbing writing '*.ttcn' to */.gitignore
This was the case under ggsn_tests, which in turn prevents search text
tools like "ag" to find stuff in .ttcn files (because it skips code in
.gitignore).

Change-Id: Iaef3cfd5ae29db352046664ab4949b037ca80307
2022-03-22 17:49:55 +00:00
Vadim Yanitskiy 9e55abdfb1 library/BSSLAP_Types: fix receive template used in ts_BSSLAP_Reset
Change-Id: I6ed967c18346263b05b624b0bb5698f23ee842f7
2022-03-16 20:33:51 +03:00
Vadim Yanitskiy 634f75d31e bsc: add new testcase TC_srvcc_eutran_to_geran_a5_3
According to 3GPP TS 44.018, section 9.1.15, the RR Handover Command
message may optionally contain the Cipher Mode Setting IE (10.5.2.9).
Section 9.1.15.10 states that this IE may be omitted in case of the
intra-RAT GERAN-to-GERAN handover, however in case of the inter-RAT
handover (e.g. EUTRAN-to-GERAN), this IE *shall* always be included.

In f_ho_into_this_bsc(), check presence and correctness of the Cipher
Mode Setting IE.  Add TC_srvcc_eutran_to_geran_a5_3, which is similar
to TC_srvcc_eutran_to_geran, but enables ciphering on the target channel.

This patch makes all SRVCC relates test cases fail, until [1] is merged.

Change-Id: Ic3dfc4e31a7ed078cdfdaced9986ee9551c5aa7c
Related: [1] osmo-bsc.git I1d270e82d0a9b12897fc94dae4e8999aa132a22f
Related: SYS#5838
2022-03-16 12:47:54 +00:00
Vadim Yanitskiy af2972e26f bsc: add f_cipher_mode_bssmap_to_rr()
Change-Id: I6cc8cbed96f2838af1b0e41c5dfa6760c45d9ad1
Related: SYS#5838
2022-03-16 12:47:54 +00:00
Vadim Yanitskiy 4483a22b1d bsc: use select() statement in f_cipher_mode_bssmap_to_rsl()
Change-Id: I6e1c6762d2dd1efac2bd7ead3caf25e25dd3e7ad
Related: SYS#5838
2022-03-16 12:47:54 +00:00
Vadim Yanitskiy d12db41526 BTS_Tests: fix some compilation warnings (template restrictions)
Change-Id: I53286a7b4b78a3e816d94d880ae290771cdd7ee8
2022-03-14 11:30:36 +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
Vadim Yanitskiy 1ab332ff86 BTS_Tests: add new test case TC_ho_physical_info
The test case scenario can be summarized as follows:

1. Activate a logical channel for async handover.
1.a. Tune the MS side to that channel.
1.b. Make sure that no Downlink DCCH is received.
2. Send a handover Access Burst to the BTS.
2.a. Expect RR Physical Information to be received Ny1 times.
2.b. Expect no other data to be received on Downlink DCCH.

Currently the new test case fails for several reasons:

* osmo-bts-trx starts transmitting on DCCH before the handover
  Access Burst is received, this is wong;
* trxcon immediately starts sending dummy frames on Uplink
  DCCH, causing osmo-bts to stop sendig RR Physical Info.

Change-Id: I9469027ce88fb2750f1eceef2d8a56d4b8ee4d03
Related: SYS#5838
2022-03-14 10:52:36 +00:00
Vadim Yanitskiy f8a9df558f BTS_Tests: add a hierarchy of L1CTL/LAPDm/DCCH altsteps
In TTCN-3 it's possible to call one altstep from another.  This
allows us to build complex hierarchies of simple altsteps, where
one is built on top of the others.  I call this altstep-oriented
programming.  This change adds the following hierarchy:

* as_l1ctl_dl_msg() - triggers on receipt of a L1CTL DATA.ind
  matching the given RSL chan_nr/link_id and data templates;

* as_dl_lapdm_dummy() - triggers on receipt of dummy LAPDm
  func=UI frames with empty payload (repeats by default);

* as_dl_dcch_lapdm_ab() - triggers on receipt of a Downlink DCCH
  containing a L2 payload that matches the given LAPDm frame;

* as_dl_dcch_pdu() - triggers on receipt of a LAPDm AB frame
  with a L3 payload matching the given template.

All of these altsteps (except as_dl_lapdm_dummy()) expect an 'out'
parameter, which will hold the matched (and possibly decoded) data.

Example:

  var PDU_ML3_NW_MS pdu;
  alt {
  [] as_dl_lapdm_dummy(); /* Ignore empty LAPDm func=UI frames */
  [] as_dl_dcch_pdu(pdu, tr_CM_SERV_ACC) { setverdict(pass); }
  [] as_dl_dcch_pdu(pdu, tr_CM_SERV_REJ) { setverdict(fail); }
  [] as_dl_dcch_pdu(pdu, ?) { setverdict(inconc, "Unexpected PDU"); }
  }

Change-Id: Ia4d502488cbb6bccc4d2656206ae6649bfa71007
Related: SYS#5838
2022-03-14 10:52:36 +00:00
Vadim Yanitskiy 5e05ea1310 bts/expected-results.xml: expect TC_sacch_chan_act_ho_async to pass
Change-Id: I9ceb0a71549d293ff0f270c414f667a0bae4df62
2022-03-14 10:40:16 +00:00