Commit Graph

1203 Commits

Author SHA1 Message Date
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
Neels Hofmeyr e23496ad23 vty: add f_verify_talloc_count()
Counts talloc objects via VTY and waits for a specific object count.
Useful to test against leaks.

The intended use is to check against leakage of bsc_subscr and
gsm_subscriber_connection after each BSC_Tests.*, see patch in 'Related'
below.

Related: OS#5337
Related: I69d4c5c6f8d499bb7f0b96a48af045361433c57b (osmo-ttcn3-hacks)
Change-Id: Iafe720a4931270e868f40c4f623d10bb9c14dc80
2022-01-23 00:13:07 +01:00
Vadim Yanitskiy bada3c927d PGW_Tests: fix f_create_session(): add missing Serving Network IE
open5gs-smfd version 2.4.2 requires this IE to be present:

[smf] INFO: [Added] Number of SMF-UEs is now 1 (../src/smf/context.c:820)
[smf] INFO: [Added] Number of SMF-Sessions is now 1 (../src/smf/context.c:2610)
[smf] ERROR: No Serving Network (../src/smf/s5c-handler.c:101)
[smf] ERROR: No Data in Serving Network (../src/smf/s5c-handler.c:105)
[smf] ERROR: Invalid Len[0] in Serving Network (../src/smf/s5c-handler.c:110)

Change-Id: Idf6d147cc4a37996ee4ae6de18158b0e140d9db6
Related: SYS#5602
2022-01-20 19:33:43 +06:00
Vadim Yanitskiy 5313af9c40 library/GTPv2_Emulation: fix timer not being started in f_uecups_xceive()
This change fixes the following error:

  Dynamic test case error: None of the branches can be chosen in
                           the alt statement in file GTPv2_Emulation.ttcn
                           between lines 362 and 370.

which may happen when osmo-uecups-daemon fails to create a tunnel
due to insufficient permissions.

Change-Id: Icb229aed7fa9dedcf999837ec6ad249ab4fdebb7
Related: SYS#5602
2022-01-20 19:33:30 +06:00
Pau Espin af0c61e06d bsc: Fix TC_rsl_drop_counter due to IPA_Emulation component being alive-type
IPA_Emulation component was marked with the "alive" type recently, in
order to avoid race conditions leading to errors during tear down of the
test.

It turns out, the way "alive" keeps the component alive is by means of
not closing the sockets when the component is stopped. As a result,
TC_rsl_drop_counter test stopped working properly because it was
specting a TCP FIN to be sent to osmo-bsc when the component was
stopped.

In order to fix it, add a new CFG port to the IPA_Emulation component on
which one can operate. Add a a new method to tell the component to close
the socket.

Then, put that in BSC_Tests into a function which was actually unsued
until now, and use it in the test in order to have the specific logic
enclosed in a function helper.

Fixes: 7138913d66
Change-Id: I68163b053313d9907ba8e40954a5933d14cb7db6
2022-01-12 11:15:24 +01:00
Pau Espin 5c50503e87 RTP_Emulation: Fix race condition where Init is answered while connect is in progress
HNB test connects the RTP socket on the HNBGW side once it receives the
Audio-CONN_ESTABLISH.cnf with the ip+port info. However, while doing so,
osmo-hnodeb is already sending an Init which then the RTP_Emulation
(connection in progress) tries to answer with an Init-ACK.

RTP_Emulation.ttcn:201 Called on RTPEM_CTRL to TC_cs_mo_call-RTPEM(6) @RTP_Emulation.RTPEM_connect : { remote_host := "172.18.33.20", remote_port := 16384 }
...
IuUP_Emulation.ttcn:76 dec_IuUP_PDU(): Decoded @IuUP_Types.IuUP_PDU: { type_14 := { pdu_type := 14, ack_nack := IuUP_ACKNACK_CTRL (0), frame_nr := 0, iuup_version := 0, procedure_ind := IuUP_PRI_INITIALIZATION (0), header_crc := 55, payload_crc := 637, u := { proc_sending := { payload := '060051673C0127000082000000000300'O } } } }
...
RTP_Emulation.ttcn:355 Sent on RTP to system @RTP_CodecPort.RTP_Send : { connId := 1, msg := { rtp := { version := 2, padding_ind := '0'B, extension_ind := '0'B, CSRC_count := 0, marker_bit := '0'B, payload_type := 96, sequence_number := 0, time_stamp := '00000000000000000000000000000000'B, SSRC_id := '11011110101011011011111011101111'B, CSRCs := omit, ext_header := omit, data := 'E4002400'O } } }
...
RTP_Emulation.ttcn:355 Message enqueued on RTP from system @Socket_API_Definitions.PortEvent : { result := { errorCode := ERROR_SOCKET (4), connId := 1, os_error_code := 89, os_error_text := "Destination address required" } } id 2

Change-Id: I61200ddb035b310eced871a9954dfcbf1dc49360
2022-01-07 14:48:25 +01:00
Pau Espin 735ba7aa53 RTP_Emulation: Several fixes and improvements for IuUP streams
* Immediate tx of IuUP (N)ACK control packets. Without this, INIT ACK
is delayed until the TX side of the RTP endpoint is enabled.

* Allow and handle IuUP control messages even if g_rx_enabled is false.

* Properly validate user data payload if IuUP is in use.

Change-Id: Id4f8b02a8123bb30b659c40148c8ab4c7c2078a1
2022-01-05 11:27:16 +01:00
Pau Espin b204a4e322 RTP IuUP Emulation: Avoid spamming with retransmitted Init
Until now, an Init was sent on each RTP transmit period, clogging the
pcap files. Moreover, this is break by design, since transmitting
another Init so close the the previous one would give no time to the
transmitter to receive the Init ACk and move state, which means the
other end would potentially be reconfigured each time (for each Init).

Change-Id: I8e299a3fe49f9d31cae182f7ed4dc0ea3fc22ba2
2022-01-05 09:48:26 +00:00
Daniel Willmann aa9220aeac IPL4asp: Fix ppid always shows 0, remove Iuh workaround
Change-Id: I941a794849c347ed61ca5170bca32f5329818d92
2022-01-05 09:25:07 +01:00
Daniel Willmann a79e9bbccc hnbap: Add tr_HNBAP_HNBRegisterAccept template
Change-Id: Iae35653e337acffc9190d2e4dc68f25f00bd6812
2022-01-05 09:25:07 +01:00
Daniel Willmann 645b888db5 library/rua: Add missing templates (ts_/tr_)
Change-Id: Iad6525f4a337ac2399bec71d2e16f8540f78b247
2022-01-05 09:10:08 +01:00
Pau Espin 58a69df9a5 hnodeb: Updates in HNBLLIF and HNBGW_COnnectioNHandler to support and test IuUP
Depends: osmo-hnodeb.git Change-Id Ibe356fa7b1abaca0091e368db8478e79c09c6cb0
Related: SYS#5516
Change-Id: I19612fce8190dfe14f98d346adb5db4e1c2a08d9
2021-12-23 15:12:47 +01:00
Pau Espin 066f46f9d6 Iuh_Emulation: Avoid sending events to HNBAP if socket is not connected
This should hopefully fix HNB_Tests errors showing up in jenkins after
the test finishes:
Iuh_Emulation.ttcn:203 Dynamic test case error: Port HNBAP has neither connections nor mappings. Message cannot be sent on it.

Change-Id: Ide201425e81dcfe2fd395d820bdcbd74f5415ef5
2021-12-23 15:12:47 +01:00
Pau Espin 64fd02b80d IuUP_Emulation: Fix frame number wrap-around
As seen when running a test:
IuUP_Emulation.ttcn:150 Dynamic test case error: While RAW-encoding type '@IuUP_Types.IuUP_PDU': There are insufficient bits to encode '@IuUP_Types.IuUP_PDU_Type_0.frame_nr'

Change-Id: Ic9e69115c49545a7b9797d8f85568d5e91dfb329
2021-12-22 15:03:17 +00:00
Vadim Yanitskiy 58b165383f library/RSL_Types: fix CHAN ACT templates for dynamic timeslots
* t_RSL_IE_ActType_PDCH is actually a constant, not a template.
* tr_RSL_CHAN_ACT_PDCH makes no use of parameter 'mode'.
* Accomplish tr_RSL_CHAN_ACT_PDCH with a send template.
* Use 'present' qualifier for receive template parameters.

Change-Id: Ie62a92daaacf4de5f05dd1f3f5b4a2a5e4ee6dd6
2021-12-20 14:55:00 +00:00
Pau Espin 2514245bbd hnodeb: Adapt HNBLIF to latest changes
Change-Id: I50a1b9be579ace9f0f85c6c68b5648d504f5f51c
2021-12-16 16:39:36 +00:00
Harald Welte 7138913d66 Use alive-type components for "infrastructure" components
According to feedback received from TITAN developers in
https://www.eclipse.org/forums/index.php?t=msg&th=1106652&goto=1848616&#msg_1848616
the use of alive-type components has the following advantage:

> Also the DTE during the shutdown can be avoided to use alive type
> components.  The test ports of the alive components are not
> disconnected/unmapped when the component finished only when killed or
> the MTC terminated.

So the idea of this patch is to use alive-type components for all the
underlying infrastructure, such as the *_Emulation_CT starting from M3UA
to SCCP and further up the stack.  This way, only the MTC and the
highest level of components (such as ConnHdlr) remain as normal
components.

The hope is that using more alive-type components in the lower protocol
layer emulations will reduce the probability of DTE during shutdown if
some message is received during the component shutdown after the MTC
has completed.

Change-Id: I61d791d6d1bfe9226aabbe223baafc5f8f6d4f04
2021-12-15 20:20:30 +00:00
Pau Espin 9e18372690 hnodeb: Add gtp SAPI
Change-Id: Ie4de00641089abbd03273ce5a2d9325659ac7d42
2021-12-15 14:23:23 +00:00
Pau Espin 32fb54e610 hnodeb: Add audio SAPI
Change-Id: I20544f67c2450bc3cd4bcb3ee638de1958bf5783
2021-12-15 14:23:23 +00:00
Pau Espin a6bbb8c45d hnodeb: Add initial infra to emulate HNB LL socket iface
Change-Id: Ia864a672643a0e42f5afea6fd901e621478c87c0
2021-12-15 14:23:23 +00:00
Vadim Yanitskiy 3f7a6dc297 library/DIAMETER_Emulation: handle DWR/DWA ping-pong
Change-Id: I0291eccd0467f8fe15ddcb88259618365c33befd
Related: SYS#5602
2021-12-15 05:42:49 +03:00
Vadim Yanitskiy b57ef873e0 library/DIAMETER_Templates: add missing AVPs to AIR
Change-Id: I948072dbfa05d158483a727fb708f853741ab23f
Related: SYS#5602
2021-12-15 05:42:49 +03:00
Vadim Yanitskiy 463d826cca library/DIAMETER_Templates: fix missing app_id in ts_DIA_AIR
Change-Id: I7b06d9cad09f1fd7858bd745d0aaa2fbcb1983dd
Related: SYS#5602
2021-12-15 05:42:49 +03:00
Vadim Yanitskiy 21fd7db556 library/DIAMETER_Templates: fix flags in AIR templates
According to RFC 6733, section 3 "Diameter Header", if the 'R' bit
is set, the message is a request.  If the 'P' bit is set, the
message may be proxied, relayed, or redirected.

ts_DIA_AIR is a template for Authentication Information *Request*,
so the 'R' bit must be set.  Also, let's allow this message to be
proxied, relayed, or redirected by setting the 'P' bit by default.

In tr_DIA_AIR, do not match all command flags, just ensure that
the message is a request.  Other flags do not matter.

Change-Id: I7db3b632189eed09c1bdf98f9d588491d928e2f5
Related: SYS#5602
2021-12-15 05:29:47 +03:00
Vadim Yanitskiy 446edae4bc library/DIAMETER_Templates: add receive template for AIA
Change-Id: Ie4aca42c3024aa7f46123b2df4a42c5d43f5b9da
Related: SYS#5602
2021-12-15 05:28:41 +03:00
Vadim Yanitskiy 2dba494201 library/DIAMETER_Templates: prettify & enrich AIR/AIA templates
* Make both {hbh,ete}_id parameters last among the others;
* Use more elegant and consistent template formatting;
* Make DestinationRealm value configurable;
* Make SessionId value configurable.

Change-Id: Iaf6472fecbadd58e86b78c59348d9924ab57f97d
Related: SYS#5602
2021-12-15 05:12:13 +03:00
Vadim Yanitskiy 5e1bdc04d1 library/DIAMETER_Templates: add missing templates for ULR/ULA
Change-Id: If0b8daf5717eb4c26da231489118e200faeee9a2
Related: SYS#5602
2021-12-15 05:06:24 +03:00
Vadim Yanitskiy 0e8f516d22 library/DIAMETER_Templates: rework existing ULR/ULA templates
* Make both {hbh,ete}_id parameters last among the others;
* Use more elegant and consistent template formatting;
* Make Origin{Host,Realm} values configurable;
* Make DestinationRealm value configurable;
* Make SessionId value configurable.

Change-Id: I0585e306a87453c212c6b5ac5635181c47b34b4f
Related: SYS#5602
2021-12-15 05:00:54 +03:00
Vadim Yanitskiy f28b2550f2 library/DIAMETER_Templates: add templates for DWR/DWA
Change-Id: I2abe33a3ac08c8855342f4277288cacb3545771b
Related: SYS#5602
2021-12-15 04:59:03 +03:00
Vadim Yanitskiy 00720bd851 library/DIAMETER_Templates: set default {hbh,ete}_id in ts_DIAMETER
Having default values for these parameters allows omitting them
in subsequent send template definitions based on ts_DIAMETER.

Change-Id: I714b18bbe77949593803e999d25e4ef8e1827917
Related: SYS#5602
2021-12-15 04:54:21 +03:00
Pau Espin ecd1225858 library/rua: Add some more templates
Change-Id: Iab2afbc6ebaa8a41d3e951155609d4c0a2d6866b
2021-12-13 18:58:31 +01:00
Vadim Yanitskiy c041e9902f library/Osmocom_Types: use f_rnd_bitstring() in f_rnd_ra11_ps()
Change-Id: I122d386b0c8ce320687016b6cab883b8a36bdffc
2021-12-11 02:11:35 +03:00
Vadim Yanitskiy 6a2a11ff4c library/Osmocom_Types: fix maximum values passed to f_rnd_int()
It's clearly stated in a comment to this function that the returned
value is 0 <= x < max, so it's always less than the maximum.

Change-Id: If127fc6a2feeddbdd3ea636b56dadf8957941758
2021-12-11 02:08:46 +03:00
Pau Espin 17e0f8c5a0 break GTP_Templates dependency on Osmo_Gb_Types, BSSGP_Types, NS_Types
The resulting set of dependencies needed just to have one simple CellId
struct is huge. That was fine for sgsn testsuite since anyway those were
being used, but it's not acceptable for other testsuites (hnodeb) which
only really require the GTP side.

After this change, GTP_Templates only requires GSM_Types, which ends up
in a much smaller subset of dependencies being pulled in.

Change-Id: Icd8234908af445b798517fe110cd0648969179a4
2021-12-09 15:25:50 +00:00
Vadim Yanitskiy a47cd4e6aa library/BSSMAP_Templates: parametrize codec list for tr_BSSMAP_ComplL3
Change-Id: I4abd77ebe47791adf2708e1c31614383d18e54b8
2021-12-07 07:38:33 +00:00
Oliver Smith 8b6d1804e1 library/Misc_Helpers: add f_osmo_repo_is()
Create functions to check which from Osmocom repository the SUT is
running. Put it in Misc_Helpers instead of a new library file since
Misc_Helpers is already available in many/all? tests and it fits there
too.

Depends: docker-playground Ic06532f7a67e59458652c5cf4c8f6fee8113e703
Related: OS#5327
Change-Id: Ic33d08992ea84af006d133db6aec508a7b7c7f28
2021-11-29 21:15:31 +00:00
Daniel Willmann ef8e50ef30 BSSGP_Emulation: Handle FLUSH_LL_ACK differently
The BVCI that this message might contain should not be used to route it.
It referes to the BVCI that the PDUs were transferred to (BVCI (new)).

Instead broadcast to all components.

Change-Id: Ia1df35da44ef28d91501bb898e1059bf1390129b
2021-11-26 12:05:20 +01:00
Pau Espin b54acca15f hnb: Introduce HNB_Tests testsuite
A new Iuh CodecPort + Emulation is introduced to (de)mux RANAP and RUA
in the same SCTP socket.
The Iuh_CodecPort.ttcn file has currently a hack to be able to test
HNBAP, since titan seem to be reporting sinfo_ppid=0 when in fact it
received sinfo_ppid=20 (HNBAP).

A couple tests are added to validate HNBAP HNBRegister Request  + Accept
or Reject. In current osmo-hnodeb state, both tests pass if run
separately, but fail if run sequentially since osmo-hnodeb still doesn't
re-connect properly after first test finishes and connection is dropped.

Related: SYS#5516
Change-Id: I7227917148e98a2c777f4b05d8d2eca6e9c121b7
2021-11-24 17:52:49 +00:00
Neels Hofmeyr afe2ea5c4f bsc: show bug: do inter-BSC-out HO by measurement report
So far all handover tests trigger handover via VTY command. This means
that any bugs introduced in measurement report handling and handover
target selection are by definition not caught.

Almost a year ago, fixing a handover oscillation bug for intra-BSC
handover introduced a segfault for inter-BSC handover targets, because
for those the target.bts is NULL. Show this bug.

Related: OS#5324 SYS#5259
Related: I5a3345ab0005a73597f5c27207480912a2f5aae6 (osmo-bsc)
Change-Id: Iba033c32015173f57dbb1c211aefab1a9094e29d
2021-11-24 15:26:50 +01:00
Vadim Yanitskiy 89f198cb8c library/DNS_Helpers: type 'char' was substituted with 'charstring'
Change-Id: I0c93002cf915a8ce7e63f208693b2b63ae52ac38
Related: SYS#5602
2021-11-19 03:31:19 +03:00
Pau Espin e8a9444356 pcu: Introduce test TC_t3172_*
Related: OS#3928
Change-Id: I3f4368c99b00453b471c3d741fecb8864ecdc628
2021-11-16 11:32:25 +01:00
Neels Hofmeyr b758187c86 bsc: add test for CM Service Reject counter
Related: I79b1261e5a281d9797eaaf9c27d90edd8e27c78b (osmo-bsc)
Related: SYS#4878
Change-Id: I0214b27da18af87eca9715ebf7eeeff945e3e12a
2021-11-10 14:32:50 +01:00
Neels Hofmeyr bd94fe7236 bsc: add TC_ratectr_all_available_allocated and _dyn
Test new rate counters all_allocated:{sdcch,tch,static_sdcch,static_tch}

Related: SYS#4878
Depends: I2fa14531f16d3f07085620f1c50eb839c420da6a (osmo-bsc)
Change-Id: Ib3997a827c9cc43d1361bb0cf3bfab9f6d91bf82
2021-11-10 13:31:48 +00:00
Vadim Yanitskiy f9e31d281b BTS_Tests: add test cases for Temporary ACCH Overpower
Change-Id: Ibdb94aa2779ae4b08f08cfef78c2959ae451a784
Related: SYS#5319
2021-11-10 03:35:19 +03:00
Vadim Yanitskiy e243ef6bf0 library/L1CTL_PortType: add f_L1CTL_rx_data() helper
Change-Id: I254171c6dc83f046b5ad1a72586c097deebb0fa7
Related: SYS#5319
2021-11-09 12:57:48 +00:00
Vadim Yanitskiy 66d3c338c3 library/RSL_Types: add templates for RSL_IE_OSMO_TopAcchCap
Change-Id: If2e287699925c6bb7f93439d0729e16682fab019
Related: SYS#5319
2021-11-09 12:57:48 +00:00
Vadim Yanitskiy a203d3b5e2 library/RSL_Types: add missing RSL_IE_OSMO_TOP_ACCH_CAP
Change-Id: I3bd491fba5b72f0fdd262992a97895f037be69d8
Related: SYS#5319
2021-11-09 12:57:48 +00:00
Vadim Yanitskiy 1f53215f45 library/RSL_Types: add missing RSL_IE_OSMO_REP_ACCH_CAP
Change-Id: I198cbfd176e41c55f67d625d9587ba5b6062f0c4
Related: SYS#5114
2021-11-09 12:57:48 +00:00