Commit Graph

1250 Commits

Author SHA1 Message Date
Harald Welte 5f9747fe02 CBSP: wip
Change-Id: Ic0f0b3d620f3ca73bab3d45997d0c1b9433ac1f7
2022-04-27 16:57:24 +02: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
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
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
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
Pau Espin b8b1c0d626 RLCMAC_EncDec: Fix bug decoding LI[0]=0
Change-Id: I86c1b48c922f50013257c8dce405cbad1d77d868
2022-04-05 10:22:14 +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
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 9e55abdfb1 library/BSSLAP_Types: fix receive template used in ts_BSSLAP_Reset
Change-Id: I6ed967c18346263b05b624b0bb5698f23ee842f7
2022-03-16 20:33:51 +03: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 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 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 dbd2f61e37 library/GSM_RestOctets: add partial definition of SI 6 Rest Octets
Change-Id: I5aeed4986820a71f761f21b57c87782d3000293f
2022-03-10 17:34:21 +03: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
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 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 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 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
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 cd8b71c4fa ranap: Fix criticality in IuReleaseRequest
Change-Id: Ib636f5d5ca02962b1592f64d0af30b4b3c9f0053
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
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
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 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
UpdatePDPContextResponseSGSN.

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
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 480e67f00d ggsn: Test GTP-U Echo Request/Response
Change-Id: Id92180be948ee3f5246c7befec666698a1b074f3
2022-02-11 13:10:20 +01:00
Pau Espin ca587f154c ggsn: Submit User Location Information in CreatePDPContextReq
According to TS 29.060, sec 7.3.1 Create PDP Context Request:
"""
The SGSN shall include the User Location Information IE in the PDP
Context Activation procedure. The SGSN shall include the CGI or SAI
in the "Geographic Location" field of the User Location Information
IE depending on whether the MS is in a cell or a service area
respectively.
"""

Change-Id: Iaea95e5779d4f878023ce3f160ac69f092452056
2022-02-02 10:46:17 +01:00
Pau Espin 38aeffb9be ggsn: Submit RATType in CreatePDPContextReq
According to TS 29.060, sec 7.3.1 Create PDP Context Request:
"The SGSN shall include the RAT Type IE during Primary PDP Context
Activation procedure."

Change-Id: Ibc57798e50ccd08ef6126f75f7c8134e56d2778a
2022-02-02 10:46:17 +01:00
Vadim Yanitskiy b46f01e130 library/DIAMETER_Emulation: implement 'raw' mode of operation
This patch implements a new mode of operation, which allows to
have direct communication between the emulation component and
the other component connected via the 'DIAMETER_UNIT' port.
This eliminates the need to have dedicated components for each
IMSI, what is not necessarily needed in some specific cases.

Change-Id: I52e22ac70cc85be5b0436b68c77356aabc4f05e1
Related: SYS#5602
2022-01-31 09:56:51 +00:00