Commit Graph

3299 Commits

Author SHA1 Message Date
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
Vadim Yanitskiy ce96d3547f BTS_Tests: exec TC_sacch_chan_act_ho_{sync,async} on g_AllChanTypes[]
Currently we execute both test cases on *all* available dedicated
channels from g_AllChannels[].  Given that SACCH is slow, and in
some cases we intentionally wait for a timeout of 3.0 seconds to
expire, the overall execution time is quite long.  We have a risk
of the test execution being aborted due to the guard timeout.

I agree that using g_AllChannels[] makes sense for TC_ho_rach, which
tests handover RACH detection.  There we want to be sure that detection
works on all slots of all DCCH types (especially when running a setup
with real MS/BTS hardware).

But for both TC_sacch_chan_act_ho_{sync,async} it's enough to run
on different channel types (see g_AllChanTypes[]), because what
we actually want to test is the Downlink SACCH operation.

Change-Id: Ic1937edd72ff842cb619e153d0f6a624ceb95281
Related: SYS#5838, OS#4008, OS#4009
2022-03-14 10:40:16 +00:00
Vadim Yanitskiy f9136a1ec3 BTS_Tests: fix expectations in TC_sacch_chan_act_ho_{sync,async}
According to 3GPP TS 48.058:

* 4.1.3 async handover: "If the MS Power IE is present the BTS
  *may* start transmission also on the SACCH".
* 4.1.4 sync handover: "If only the MS Power IE is present the BTS
  *may* start transmission also on the SACCH".

"May" does not mean "shall", so osmo-bts does not.

Change-Id: I5e97944e56b7860f2d912cd8d3c978a0f1e08645
Related: SYS#5838, OS#4008, OS#4009
2022-03-14 10:40:16 +00:00
Vadim Yanitskiy 443891b773 library/L1CTL_Types: fix t_RslChanNr_RACH used in send templates
Change-Id: Id7570df09bea04c60475d91519c6aac63bf6f749
2022-03-13 21:59:07 +00:00
Vadim Yanitskiy dc79b328d7 BTS_Tests: remove completed TODO points
* TC_ho_rach - handover RACH detection,
* TC_rsl_rf_resource_ind - RF RESource INDication.

Change-Id: I12b6331b445650437cc66130765369bbcd01ba5f
2022-03-13 14:05:34 +00:00
Vadim Yanitskiy a4254e7a79 library/L3_Templates: add templates for RR Physical Information
Change-Id: Icc0f9d0987e77a714e9eaffaedd851a982063582
Related: SYS#5838
2022-03-13 14:04:18 +00:00
Vadim Yanitskiy 16e2991bf1 library/LAPDm_Types: add 'padding' field to the LapdmFrameAB record
TTCN-3 offers a very convinient way of matching an octetstring
against a record template (decoding target) on the fly, so that
there is no need to attempt decoding it manually beforehand.
This can be done by using the 'decmatch' keyword (see B.1.2.9).

Unfortunately, decmatch fails if an octetstring is longer than
the encoded variant of the decoding target (e.g. has padding).
Let's work this around by adding a 'padding' field, so during
decoding all remaining octets will be stored in it.

Change-Id: I0151adf7790127617f7cb57c9a9ec6c28721e95a
Related: SYS#5838
2022-03-13 14:04:18 +00:00
Vadim Yanitskiy 77a65f8eb1 BTS_Tests: cosmetic: use setverdict() in f_sacch_{present,missing}()
This eliminates the need for using log2str() and improves readability.

Change-Id: Iaf9b03fb81ec4fa2ca4f0a0b2f0b50491c6a9d80
Related: SYS#5838, OS#4008, OS#4009
2022-03-11 15:00:19 +03:00
Vadim Yanitskiy 5a67f17232 BTS_Tests: remove misleading comments in f_sacch_{present,missing}()
Change-Id: Ib6264da51d17d8d5d932109afad79d6a9916911b
Related: SYS#5838, OS#4008, OS#4009
2022-03-11 14:59:52 +03: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
Vadim Yanitskiy 348b07c5be BSC_Tests: also match band indicator in SI6 Rest Octets
Due to a bug in the current osmo-bsc master, osmo-bsc inverts
the band indicator bit in SI6 Rest Octets.  This change extends
testing coverage to demonstrate the problem (see TC_si_default).

Change-Id: I93e1fcfaea973ec2461e30f656d5f5f0d829909b
Related: osmo-bsc.git Iaa8377919a144e7f3799b76249f579c8f3874145
2022-03-10 19:04:20 +03:00
Vadim Yanitskiy dbd2f61e37 library/GSM_RestOctets: add partial definition of SI 6 Rest Octets
Change-Id: I5aeed4986820a71f761f21b57c87782d3000293f
2022-03-10 17:34:21 +03: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
Neels Hofmeyr 9fe1320a78 bsc: add missing codec list in AoIP Handover Request
So far, osmo-bsc ignored the Codec List (MSC Preferred) in inter-BSC
incoming HO Request messages. Starting with osmo-bsc
I117cc29d6d11db77d160de654f43f5993db6ee21, a missing codec list on AoIP
causes incoming inter-BSC HO to fail, as it should (3GPP TS 48.008
indicates that a codec list shall be included on AoIP). To avoid test
fallout when merging above osmo-bsc patch, add a codec list to HO
Request on AoIP.

Related: OS#5839
Change-Id: If06de9c9b43d79f749447a4e2a340176eef75c79
2022-03-07 14:38:11 +01:00
Neels Hofmeyr a23f3b1ecb bsc: inter-BSC incoming HO in with empty SCCP CR
Test inter-BSC incoming HO where the Handover Request message is not
included in the initial SCCP N-Connect, but follows in a separate DT1.

Related: SYS#5864
Depends: I535c791fa01e99a2226392eb05f676ba6c3cc16e (osmo-bsc)
Change-Id: I6732153cdd0d529bfaf0925387e765f3403a756b
2022-03-03 04:58:20 +01:00
Neels Hofmeyr 907b23b93a bsc: add TC_ho_into_this_bsc_a5_mismatch
Since I just fixed the encryption behavior, I also want to know whether
the case of no A5 intersection is handled properly.

The tiny test comes with a lot of changes to allow a handover failure
code path. The 'expect_ho_fail' flag goes via function arguments to
g_pars and the general ho test code uses it to branch for exp-failure.

Related: SYS#5839
Change-Id: I44b464a0bedbff09c467c4bccd7c985480fb883a
2022-03-03 04:55:53 +01:00
Neels Hofmeyr 46e16e50ab bsc: inter-BSC HO in: expect codecs in HO Request ACK
Expect IEs Speech Codec (Chosen) and Codec List (BSS Supported), they
are missing in current osmo-bsc.

Related: SYS#5839
Depends: I3c0576505a3ceb3cd5cc31dc69c5bc4a86a4ea08 (osmo-bsc)
Change-Id: Ib2b4e27be241e2a92c0c3bffdf906bf22c09352b
2022-03-03 04:55:49 +01: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
Harald Welte 97c7197bb0 simtrace: Add support for slot_mux_nr to CardEmu_BD_Config
This catches up with a recent change in simtrace2.git
(Change-Id I4cdb250d2e1dbc5b8b0169f8b7c21e288b492e1d) adding
a new optional field to CardEmu_BD_Config

Change-Id: Id29584764a2f27b9de5fa9ff67fd0ae3e912f02e
2022-02-25 19:02:01 +00:00
Harald Welte 6220dc7bf0 ccid: Lots of CCID helpers have been moved to titan.TestPorts.USB
Change-Id: Ie110ad1511b01fe84e1ad181b0e053e25f80f522
2022-02-25 16:56:16 +01:00
Harald Welte 73018522f4 move SIMTRACE_{Types,Templates,Emulation}.ttcn to library
this will allow us to us SIMTRACE as part of a test suite testing
e.g. CCID readers.

Change-Id: I4349019e2deac114f4c040f1441b70663a521ec2
2022-02-25 16:56:16 +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 001b3e8767 GTP_Templates: Fix runtime error in tr_EuaIPv*() templates
Doing this when receiving an IPv4 EUA thwos an error:
"if (not match(cpr.endUserAddress, tr_EuaIPv4(?)) and not match(cpr.endUserAddress, tr_EuaIPv6(?)))"

Dynamic test case error: Performing lengthof() operation on an octetstring template with no exact length.

This happens if for instance received spare bits are set to '0000'.

Change-Id: I70ad3c10e2ecfed8f733ff906272a9597b2ab9bd
2022-02-24 13:35:28 +00:00
Pau Espin 835fd300f8 pcu: Start PCUIF related components as alive-type
This should prevent following race conditions at shutdown:
"""
131 - Terminating component type PCUIF_Components.RAW_PCU_BTS_CT.
...
PCUIF_Components.ttcn:642 Dynamic test case error: Sending data on the connection of port BTS to 131:PCUIF failed. (Broken pipe)
"""

Change-Id: I17b2cfed2edbea7427e608380059bb1b422ca600
2022-02-24 11:47:43 +00: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 3bb9edf95d pcu: usse alive-type for NS and BSSGP created components
Internal BVC components in BSSGP are now created as alive. We have to
create also BSSGP one as alive in order to avoid having the BVC
component sending stuff to the BSSGP when it has already been killed:

BSSGP_Emulation.ttcnpp:1133 Dynamic test case error: Sending data on the connection of port BVC to 486:BVC failed. (Broken pipe)

Change-Id: I369a5e2246204416c2f29a114bde6bc21f7eaf4f
2022-02-24 11:47:43 +00:00
Pau Espin ee57d1cd68 BSSGP_Emulation: usse alive-type for internal BVC created components
Otherwise, during shutdown of all components we may end up in a
situation where the BVC is already killed and BSSGP Emulation receives
a packet which tries to forward to BVC and fails.

This can be seen quite a lot in PCU_Tests.TC_pcuif_suspend:
"""
PCU_Tests.ttcn:394 setverdict(pass): none -> pass
...
PCUIF_Components.ttcn:246 Stopping test component execution.
...
GPRS_Components.ttcn:222 Connection of port BSSGP[0] to TC_pcuif_suspend-BVCI1234(6):BSSGP_SP was closed unexpectedly by the peer.
...
GPRS_Components.ttcn:222 Port BSSGP[0] was disconnected from TC_pcuif_suspend-BVCI1234(6):BSSGP_SP.
...
Component type BSSGP_Emulation.BSSGP_BVC_CT was shut down inside testcase TC_pcuif_suspend
...
BSSGP_Emulation.ttcnpp:317 Dynamic test case error: Sending data on the connection of port BVC to 6:BVC failed. (Broken pipe)
"""

Change-Id: Ib0adcf64eb5ca876cd9e9b91f2b597804c03bdc2
2022-02-24 11:47:43 +00:00
Pau Espin 8afdee10b3 BSSGP_Emulation: Fix ttcn3 runtime warning
Should fix following TTCN3 warning during runtime of
PCU_Tests.TC_pcuif_suspend:
"""
BSSGP_Emulation.ttcnpp:462 Timeout operation on timer g_T2 failed: The timer is not started.
"""

Change-Id: Ic74572a21b5abee8e530741466360ff7e16a357d
2022-02-24 11:47:43 +00:00
Pau Espin e5fe6e7527 pcu: Fix race condition in TC_t3141
The test was expecting to always receive at least 1 DL packet with
USF_UNUSED, but since we implemented idle blocks in PCUIF that may not
always be the case anymore. If the TBF is freed in between last
requested block and next one, there may be no TBF and hence no MS
listening on the TS, so PCU will optimize and send an idle block.

Change-Id: Ia301c01a3f5c3fd0b11d8f20e39061aa7abc6127
2022-02-24 11:47:43 +00:00
Daniel Willmann 0886215539 msc: Avoid race condition when setting osmux options via VTY
If the RAN_Emulation is started before the VTY reconfiguration we could
get a BSSMAP Reset/ResetAck with Osmux support advertised even though
the test expects it to be disabled (or vice versa).

Do the VTY configuration before starting the RAN_Emulation.

Fixes sporadic/load-related TTCN3 failures with message
"BSSMAP: Timeout waiting for RESET-ACK after sending RESET"
(e.g. TC_iu_and_mt_call_osmux, TC_iu_and_mo_sms in run +1567)

Change-Id: Ife23f70c6523034f3c3c53b6c1c81428566fd43e
2022-02-22 18:00:24 +00:00
Daniel Willmann 9e789bec1b ranap: Allow RAB ReleaseList inside RabAssReq template
Related: OS#5152
Change-Id: If5dabf24ab410ef95f92be1cb865ac06330b495e
2022-02-22 17:22:54 +01:00
Daniel Willmann 37c877fd1e hnbgw: Test behaviour when CRCX times out
Change-Id: Iba219641498aeacbba742de926cd7f15e3fe9d06
Related: OS#5152
2022-02-22 17:22:54 +01:00
Daniel Willmann cd8b71c4fa ranap: Fix criticality in IuReleaseRequest
Change-Id: Ib636f5d5ca02962b1592f64d0af30b4b3c9f0053
Related: OS#5152
2022-02-22 17:22:54 +01:00
Daniel Willmann 3e15b7b41a Add test for RABAssingResponse with FailedList
Change-Id: I043014929de5145f06d0a650f36d59c15e0d4044
Related: OS#5152
2022-02-22 17:22:54 +01:00
Philipp Maier 6289ea86c6 RANAP_Templates: add sending of RAB_FailedList to tx_RANAP_RabAssResp
The templates ts_RANAP_RabAssResp and tr_RANAP_RabAssResp miss the
option to send a RAB_FailedList. This is needed to simulate a RAB
assignment that fails at the HNB

Change-Id: I95c7c51587981d9f478b9d31fcde139f228fa87f
Related: OS#5152
2022-02-22 16:45:14 +01:00
Pau Espin 67f23547d2 GTP_Codec_Port: Check length field of GTPV1C received packets
Change-Id: Ie9447b7ec7f7f5ee35cd0393265f5edb5578bdaf
2022-02-21 16:01:52 +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
Daniel Willmann 7af5a2a5c1 hnbgw: Fix encoding of AssignmentRequest with RABs to be released
Also change the name to avoid mistaking it for a RABReleaseRequest

Change-Id: Ifb52ed9e5559e9566b0d7a02246fdf29ff0b6dce
2022-02-18 17:12:07 +01:00
Neels Hofmeyr 731ddc558f bsc: fix TC_ho_into_this_bsc_a5_4
This test should be failing as it is, because A5/4 is not permitted in
the BSC's configuration! It only passed all this time because osmo-bsc
is/was/is going to have been flawed and just takes the Chosen Encryption
Algorithm IE as the basis for choosing an encryption algorithm. Instead
it should intersect the pemitted algos with the BSC config. It will soon
do that, and then this test would fail as it should have. After fixing
the BSC config for the test with this patch, we'll not see it failing in
the transition.

Related: SYS#5839
Change-Id: Ic6bbbeea36e6ea26d16bbb510fd08f5c0defb955
2022-02-18 01:43:14 +01:00