Commit Graph

3215 Commits

Author SHA1 Message Date
Harald Welte 96774c8682 fixup templ
Change-Id: I15ace6865e07910925aadb5c5da468fa8a9bc196
2022-01-27 12:29:47 +01:00
Harald Welte 24fa9b76a3 [WIP] DIAMETER_Templates: Add Gx related templates
Change-Id: Ie4080205717ebec714e0325b7062451293687a10
2022-01-27 11:26:04 +01:00
Harald Welte a43265c8ae WIP: Tests for osmo_dia2gsup
Change-Id: Ia3db9fd62249777cd7c63f6c4af1568c79468728
2022-01-27 11:11:32 +01:00
Harald Welte 4304501f14 library: Move f_gen_{imsi,msisdn,imei} to L3_Common.ttcn
Change-Id: I26e1d19dc467d3231a009b49abf15c7a139c0782
2022-01-27 10:57:53 +01:00
Neels Hofmeyr c3c6ee6c63 bsc: fixup for conn cleanup, fixing three failing tests
Three tests fail after recent patch
"bsc: properly clean up conn after each test"
I9396efcabc085d2850244c6468b83c5f3a3ff3a2

In TC_assignment_emerg_setup_deny_bts(), do not expect an RR Rel.

In TC_assignment_emerg_setup_deny_msc() and TC_cm_reestablishment(),
drop the additional f_expect_dlcx_conns().

Related: OS#5337
Change-Id: I1d1d27f0927e640a430b24c6dc3d5d851a5c4cb9
2022-01-26 01:23:06 +01:00
Neels Hofmeyr 9c0f9c8871 bsc: logp("start") also for handler_mode := false
Change-Id: I4421a674055cd7013d21c52e9de6e369d1a72b6b
2022-01-23 01:21:12 +01:00
Neels Hofmeyr 4d4cd7e7e5 bsc: properly clean up conn after each test
Make all tests clean up BSSAP conn and RSL link. Now all
f_verify_talloc_count() in f_shutdown_helper() should pass, verifying no
conn or bsc_subscr leaks.

Related: OS#5337
Change-Id: I9396efcabc085d2850244c6468b83c5f3a3ff3a2
2022-01-23 00:13:53 +01:00
Neels Hofmeyr 6289af1197 bsc: f_perform_clear: ack all DLCX and RSL REL REQ
ACK any MGCP DLCX or RLL REL REQ during f_perform_clear(), which makes
it more universally applicable to invoke at the end of a test.

Related: OS#5337
Change-Id: Ie5b77c266a5d8f47edd187c474df281a799a81de
2022-01-23 00:13:51 +01:00
Neels Hofmeyr 189974920d bsc: detect subscr and conn leaks during f_shutdown_helper()
Invoke f_verify_talloc_count() for bsc_subscr and
gsm_subscriber_connection, expecting none to remain after each test.

This makes numerous tests fail, where the test does not properly release
the RSL and BSSAP connections. An upcoming patch fixes all of those
cases: I9396efcabc085d2850244c6468b83c5f3a3ff3a2

Related: OS#5337
Change-Id: I69d4c5c6f8d499bb7f0b96a48af045361433c57b
2022-01-23 00:13:07 +01: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
Neels Hofmeyr 8bdafe5be6 bsc: make perform_clear() work when VTY is not initialized
To be able to invoke perform_clear() also in tests where the VTY isn't
used, in f_logp() only access the VTY when it is actually ready.
Otherwise this causes an error and a failed test, for no good reason.

Related: OS#5337
Change-Id: I8116075f32937bd06ba14b426010bf6fec2ef402
2022-01-23 00:12:17 +01:00
Vadim Yanitskiy 589972fead PGW_Tests: update default values for mp_pgw_hostname/mp_pcrf_local_ip
The old values are not valid anymore when running against open5gs
version 2.4.2.  Most likely, the default addresses got changed
during the PGW split-up (now it's open5gs-smfd and open5gs-upfd).

Change-Id: I3dd7d1f0d4aebb94b8859e8d12e952917de35071
Related: SYS#5602
2022-01-20 19:38:36 +06: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 2803cd3d7d mgw: Introduce test TC_two_crcx_mdcx_and_iuup_rtp
This test validates we can connect 3G to 2G AMR calls fine.

Change-Id: I3627711d80c5e42d56e478c1c4ff3fb5b27adfdf
2022-01-17 09:11:21 +00:00
Pau Espin 121f27ff32 bsc: Fix test TC_rll_sapi_n_reject_dlci_cc expectancies
Cause GSM0808_CAUSE_MS_NOT_EQUIPPED is to be transmitted only in the case
BSC receives a RelInd from the MS/BTS. In this test, an ErrorInd is
sent, as in TC_rll_err_ind_sapi_n_reject, so it is expected that the
BSC will send the N_Reject message with cause
GSM0808_CAUSE_BSS_NOT_EQUIPPED.

Related: OS#4728
Related: SYS#5047
Fixes: 999ceb6637
Change-Id: Ieebe3465b31d98fcae0e2c1993477c5021c99b3b
2022-01-12 13:22:09 +01: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
Daniel Willmann 095b3e0a23 deps: Use upstream IPL4asp after SCTP-related patches were merged
Change-Id: I073afe64741dd8149349da9e2494aaa86b9ab4aa
2022-01-11 15:56:30 +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 a6b9c4ced5 mgw: Introduce test TC_two_crcx_mdcx_and_iuup
Related: OS#1937
Change-Id: I0866fb499c6d426386d9811d075a7fe8386c5cb1
2022-01-05 11:27:16 +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
Neels Hofmeyr 6cc90ebcac bsc: fix ho-out test failures: cleanup neighbor cfg cruft
In the out-of-this-BSC handover tests, a neighbor config of LAC 99 left
behind from a previous test obstructed the test from working:

 % BTS 0 already had neighbor LAC:99 ARFCN-BSIC:123-45
 % ERROR: duplicate Cell ID in neighbor config, with differing ARFCN+BSIC: LAC:99 ARFCN-BSIC:123-any

Add a 'no neighbor lac 99' before configuring the neighbor via VTY.

Also add the missing neighbor config to
f_tc_srvcc_eutran_to_geran_ho_out_main().

Affects tests:
BSC_Tests.TC_ho_out_of_this_bsc
BSC_Tests.TC_srvcc_eutran_to_geran_ho_out
BSC_Tests.TC_srvcc_eutran_to_geran_ho_out_forbid_fast_return

Change-Id: I7a7c97a47a06abb59c0d89638c6b503ab66eb359
2022-01-04 13:32:59 +00: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
Daniel Willmann 4a8c45f0ac deps: Update SCTPasp to fix SCTP kernel ABI breakage
Change-Id: I257ab571eef1a7ef18998ad0976b1992482e74c4
Related: OS#5366
2021-12-22 16:16:51 +00: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
Harald Welte cfbc4b7a83 doc: Always annotate codec port types in case of IPL4/UD ports
Change-Id: Icee6eeb4a526ff5cbeb8b01df8149c488875455e
2021-12-22 14:24:50 +00:00
Harald Welte 233e3e143c doc: Re-order ports in RAN_Emulation_CT
Bring it in-line with all other test components: user-facing ports at
the top, IUT-facing ports at the bottom.

Change-Id: I1001601f5bb7c9beb40fd0ddd404c55e3d211608
2021-12-21 15:32:27 +01:00
Harald Welte 16872adf2d doc: Add dotty graph of BTS_Tests component hierarchy
Change-Id: I42d5d67cae290f4b8b330b7800cb5337a9745ce3
2021-12-21 15:27:04 +01:00
Harald Welte 7a6adc1685 doc: Add dotty graphs of BSC + MSC test component hierarchy
Change-Id: I5b83a7f733eee4e4ab710985ee8dc21315ebebca
2021-12-21 15:27:00 +01:00
Harald Welte 03b179fcf6 Add dotty graphs of the component hierarchy for Gb and RAN
These graphs show the component hierarchy and which ports of which
component are connected where.

Change-Id: I79badbcdbbf03d69de3a1a18241c7a9537c161bf
2021-12-21 13:16:36 +01: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 637beabd09 hnodeb: Use alive-type components for infrastructure components
See 7138913d66 for more information.

Change-Id: I342b172aec58542be8c24228f488a635f84bda5a
2021-12-20 12:45:21 +01:00
Oliver Smith 9678c22cec ttcn3-tcpdump-stop: add timeout for talloc report
Prevent the script from idling for several minutes without any output if
obtaining the talloc report does not work. It seems to get killed
eventually, but trying for 5s should be enough.

Change-Id: I1bc5baeb94ecd25e1cdab98b060b99747c19d1f9
2021-12-17 12:25:29 +01:00
Pau Espin 2514245bbd hnodeb: Adapt HNBLIF to latest changes
Change-Id: I50a1b9be579ace9f0f85c6c68b5648d504f5f51c
2021-12-16 16:39:36 +00:00
Oliver Smith fbf3345065 ttcn3-tcpdump-start.sh: don't hardcode binary paths
After replacing debian-stretch-titan with debian-bullseye-titan, tcpdump
does not run anymore, the binary is in /usr/bin and not in /usr/sbin.

Related: OS#4969
Change-Id: I18c88c45c7522c1120ca42cd48d67fe8f155cd39
2021-12-16 12:17:45 +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