Commit Graph

3270 Commits

Author SHA1 Message Date
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

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
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
Neels Hofmeyr 93182e0dfd fixup for bsc: add TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
Change-Id: Icba4df8d28982e5b61512002e2b5fb15b7860114
2022-02-17 23:52:02 +01:00
Neels Hofmeyr e81a079ee4 fixup for bsc: improve encryption testing config TestHdlrEncrParams
Fix test fallout in TC_ho_into_this_bsc_a5_4: add the kc128 for the A5/4

Related: SYS#5539
Change-Id: I13b7bb55d4870ffd6ceb34e2aef024ee20e23ca3
2022-02-17 23:51:23 +01:00
Pau Espin a8ef3bea24 bsc: Introduce test TC_srvcc_eutran_to_geran_src_sai
Related: SYS#5838
Change-Id: I186b9b9436bf82bcd54ca348df1e5e4b6424ca6e
2022-02-17 19:34:51 +00:00
Pau Espin 8ad031aa9a ggsn_tests: Early exit and improve logging on some setverdict fail cases
Change-Id: I25b84419b2278ce883b0dbc526ab7ffe30b17d0c
2022-02-17 18:52:42 +00:00
Daniel Willmann dd7c075040 Makefile: Include hnbgw in SUBDIRS
Change-Id: I04616434cf8b5e67b67803040c3a03e4a0e3d182
2022-02-17 16:09:41 +00:00
Neels Hofmeyr 1951be2272 bsc: add TC_ho_into_this_bsc_a5_1_3_no_chosen_enc_alg
Report: in inter-BSC incoming handover, when the MSC omits the Chosen
Encryption Algorithm IE in the Handover Request message, then osmo-bsc
starts an unencrypted lchan even if A5/0 is not permitted.

This test verifies that the Encryption Information is present in the
Channel Activation when the Chosen Enc Alg is omitted.

Related: SYS#5839
Change-Id: Ia94cc29bf66339ed782cb5101f3640f69cf73131
2022-02-17 02:16:40 +01:00
Neels Hofmeyr d23e8a0a76 bsc: improve encryption testing config TestHdlrEncrParams
Clean up: absorb pars.encr_exp_enc_alg into TestHdlrEncrParams as

Remove the automagic encr alg choice from test procedures, instead put
all magic in the pars.encr configuration setup; like this all encr alg
values remain fixed through the tests, less confusing.

Add separate alg_chosen for BSSMAP: So far, we have only one algorithm
field for both the mask of permitted algorithms in the Encryption
Information IS and the Chosen Encryption Algorithm IE. However, in the
Chosen Enc Alg there must be only one bit set. Thus we cannot easily run
a test where more than one alg is permitted and where the BSSMAP Chosen
Enc Alg IE is involved.

We've recently come to realize that the Chosen Encryption Algorithm IE
may also be omitted from BSSMAP messages, in which case osmo-bsc should
still work. To be able to test BSSMAP messages with omitted Chosen
Encryption Algorithm, allow to set alg_chosen == omit.

Keep t_EncrParams() in a way that all current tests (that set only one
bit in alg_permitted) still run the same as they always did.

Add t_EncrParams2() for a proper template.
Add a convenience function to configure encryption testing.

Related: SYS#5839
Change-Id: I6590ecf4a146dbed494d9d72f5a79441877e9010
2022-02-17 02:14:27 +01:00
Pau Espin cd326c5a59 ggsn: Introduce test TC_pdp4_act_update_teid/teic
This test validates that changing the local TEID through UpdatePDPContext
is correctly followed by the GGSN.

Change-Id: Ic6af25866bf7efc2cabf029e49abaf15d5857592
2022-02-16 17:21:49 +01:00
Pau Espin 3ede4f65d7 ggsn: Configure GTP_CodecPort to decode proper UpdatePDPContextRequest/Response
From GTPC_Types.ttcn:
// determines SUT, needed for decoding updatePDPContextRequest
// and updatePDPContextResponse messages
type enumerated SystemUnderTest{SGSN(0),GGSN(1),CGW(2),MME(3)};

Otherwise decoded UpdatePDPContextResponse is decoded taking choise

Change-Id: I52a27222d0e37ed2170972af3fd0e07da49a8c61
2022-02-16 15:47:15 +00:00
Daniel Willmann 95263ca618 ranap: Add present constraint to rab_id receive templates
Change-Id: I0006c57b4879ae9678aeca58b8b025bdbe9cb022
2022-02-16 13:13:43 +00:00
Daniel Willmann 19b8d909e5 Add hnbgw tests
Some tests for osmo-hnbgw with mgw support:
* hnb register
* ranap connect/disconnect
* rab assignment/release

Change-Id: I0a2fb795aec83337eda8d9972e6ff264ead61076
2022-02-16 13:13:43 +00:00
Pau Espin c6ac6950c2 ggsn: Rework tests validating wrong ipv6 saddr on IPv4v6 APNs
The existing test TC_pdp46_act_deact_gtpu_access_wrong_global_saddr_ipv6
was wrong, because the global address was being finally encoded as a
link local address by f_gen_icmpv6_router_solicitation().
Let's rewrite the test and add a new one for source link local addresses
simlar to the ones used to test IPv6-only APNs.

Change-Id: I3d0790104abea7acb4fa5e33109fe93cc51d94ea
2022-02-15 17:13:00 +00:00
Pau Espin 5760421255 ggsn: Support IPv4v6 PDP contexts in helper icmpv6 functions
Change-Id: I564d51e02ea4b3cb5fedb79dfc1903c04619bd61
2022-02-15 17:13:00 +00:00
Daniel Willmann 1f2d740c1a ranap: Add templates for RAB Assignment ReleaseRequest
Change-Id: Ie22253c84651119c4da91053eb4d79ad8f4abe7d
2022-02-14 16:44:59 +01:00
Daniel Willmann fdb48680ba MGCP_Templates: Add receive templates for SDP and use those in {CR,MD}CX
Change-Id: Ibc46888b1b7913d399c79ab735841844ff0487ad
2022-02-14 16:44:59 +01:00
Daniel Willmann fc5e17adab ranap: Add more RAB-related templates
Change-Id: I363428ab4af869bb1aa4470b33fa52366cbda8b4
2022-02-14 16:44:59 +01:00
Vadim Yanitskiy 04ef7d82ab library/Native_Functions: add f_inet6_ntoa()
We have f_inet_ntoa() for converting IPv4 addresses to strings,
but so far there was no similar function for IPv6 addresses.

Change-Id: I0858cf8cb44a6673e19f3496c362d68fcdd7b18d
2022-02-11 15:05:46 +00:00
Harald Welte 1e3bbbeac2 RAN_Emulation: Add f_ran_register_exp()
For some reason this helper function was misssing; we only had
the version to register an imsi.

Change-Id: I9d38dbdf589ed0f5999a5aeeb31b10ca5d07de16
2022-02-11 15:27:11 +01:00
Harald Welte 0af7615981 RAN_Emulation: Don't decode L3 if g_ran_ops.decode_dtap == false
We must respect this flag not only in "normal" PDUs but also
in the code path processing the "expect" handling.

Change-Id: I04a9197ac0b68c2dcb7542d035dc70c9f2b90473
2022-02-11 15:27:11 +01:00
Harald Welte cb3e2d75b8 Iuh_Emulation: Introduce Iuh_ConnHdlr component type
Like RAN_ConnHdlr, this contains the ports required for
a ConnHdlr attaching to Iuh_Emulaiton

Change-Id: Icbffedceb65f791306fde74f3bc5b8fe964148b9
2022-02-11 15:27:11 +01:00
Pau Espin c8c0341b16 ggsn: Split gtpu_access tests into several separated tests
Those tests validated several different scenarios, let's better handle
them separately one at a time, it makes it easier to understand the
behavior of the SUT and see what needs to be fixed.

Change-Id: I39342fcf2366030ce743dd4b4773f0fff5d61b9f
2022-02-11 13:39:29 +01:00
Pau Espin 480e67f00d ggsn: Test GTP-U Echo Request/Response
Change-Id: Id92180be948ee3f5246c7befec666698a1b074f3
2022-02-11 13:10:20 +01:00
Vadim Yanitskiy 134aea932d Makefile: run $(nproc) parallel jobs for target 'deps'
Change-Id: I53112a20d78d12bcc2764c1fc5567eb26bfa46cc
2022-02-10 00:47:52 +06:00
Vadim Yanitskiy d344b4af03 GGSN_Tests: fix DTE due to passing out-of-bound values to int2oct()
This patch fixes the following DTE happening sporadically:

  04:09:29.373271 mtc GGSN_Tests.ttcn:1478 Dynamic test case error:
    The first argument of function int2oct(), which is 256, does not fit in 1 octet.

Change-Id: I517b8e5d5872c36f7c759433a1cde338c90f16da
2022-02-09 18:28:23 +06:00
Neels Hofmeyr 52b2b26c52 bsc vamos: ensure lchan state in some places
Change-Id: I5979516cf2b2e1adf5269acd0b8e7adb5e6a1ac5
2022-02-08 16:35:34 +00:00
Vadim Yanitskiy 5f14d34642 BSC_Tests_VAMOS: fix TC_vamos_multiplex_tch_h_tch_h_tch_h_tch_h
Properly clean up conns in the end. Use COORD and new COORD2 ports to
daisy-chain coordination between the four components.

Related: OS#5444
Change-Id: I3b1dfc3b11e990893cbf182fb9f8840e198eb8aa
2022-02-08 16:35:34 +00:00
Vadim Yanitskiy 7bd04e4169 BSC_Tests_VAMOS: fix TC_vamos_multiplex_tch_f_tch_f
Properly clean up conns. To know when the multiplex is ready, use the
COORD port to tell the other component.

Related: OS#5444
Change-Id: I82b7eccd2ae30fdc3794ea9dad5d2d8f875d702d
2022-02-08 16:35:34 +00:00
Pau Espin b63d85f6a2 ggsn: Expect no linklocal-addr forwarding when testing open5gs
It's not really clear whether GTP should really be forwarding packets
with link-local address outside the tunnel. In theory the link-local
address should be used to communicate with the GGSN in order to get the
global link address, that's it. Running against open5gs it can be
observed that they are not forwarded, while osmo-ggsn forwards them
Since it seems more like an implementation dependent detail, let's
accept any and adapt expectancies depending on what are we testing, this
way it ends up documented the current situation in case it ever changes
in the future.

Change-Id: Ieafd24c059b9341c702311c78caad3312db5f1f3
2022-02-08 15:34:09 +01:00
Vadim Yanitskiy 41b702febc BSC_Tests_VAMOS: fix f_TC_mode_modify_to_vamos(): clean up lchan
This change makes the following test cases pass:

  * TC_mode_modify_to_vamos_fr
  * TC_mode_modify_to_vamos_hr

Change-Id: Icb47e39a5466a1232cda03e1e04b0c88f3927659
Related: OS#5444
2022-02-07 14:53:48 +06:00