Commit Graph

3813 Commits

Author SHA1 Message Date
Philipp Maier db9d894dda PCUIF_Components: add compatibility for PCU_IF_SAPI_PCH_DT
When we receive a PCUIF_DATA_REQ, f_BTS_CT_handler will mangle the
incoming message for us. The resulting BTS_CCCH_Block that is sent up to
the component not only contains the PCUIF message, but will also have
the already parsed MAC block attached. This currently only works for
PCU_IF_SAPI_PCH, but not for PCU_IF_SAPI_PCH_DT.

Let's add compatibility for PCU_IF_SAPI_PCH_DT.

Related: OS#5927
Change-Id: Ibaa6d170ef0f1f61b708a872a3c2364585063503
2023-07-20 10:42:51 +02:00
Philipp Maier 8e1a5ee4b4 GPRS_Components: use more suitable SAPI for DL TBF assignment
The function that assigns the downlink TBF f_ms_exp_dl_tbf_ass_ccch()
uses SAPI PCU_IF_SAPI_AGCH as default but actually downlink TBFs are
assigned via the PCH. This means we have to put PCU_IF_SAPI_PCH into the
parameter list on every function call, so it makes sense to change the
default to PCU_IF_SAPI_PCH and omit the SAPI when calling the function

Related: OS#5927
Change-Id: I49c59bad0162cb303669f6108201f154918b1db3
2023-07-20 10:42:50 +02:00
Philipp Maier ba272329b5 PCUIF_Types: add decoder for PCUIF_pch_dt
An encoder function enc_PCUIF_pch_dt exists, but we do not have a
decoder yet.

Related: OS#5927
Change-Id: I535aa45a676b87a8912e99bdb802bf29a23f1c89
2023-07-20 10:42:07 +02:00
Pau Espin 6c87ad95e2 hnbgw: Introduce module parameter mp_validate_talloc_asn1
This allows selectively disabling ASN.1 memory checks, which still fail
in current osmo-hnbgw-latest.

Change-Id: I5c18cf2d6797bcf0bef13d71ab0b69f1403b474f
2023-07-18 13:28:49 +00:00
Oliver Smith 98e24bcfa8 msc: TC_lu_and_mt/mo_csd: reduce call open time
Related: OS#4394
Change-Id: Ie733028f7953d5d9fa1907efdb19485dee93ece9
2023-07-18 09:33:52 +00:00
Oliver Smith 9c417f2066 msc: TC_lu_and_mo_csd: test multiple bearer services
Related: OS#4394
Change-Id: I74f983e1f5c0fef61018a9a5b92ed3b3cdbdfb5f
2023-07-18 09:33:52 +00:00
Oliver Smith 6f546a9a90 msc: f_call_hangup: add missing rx MNCC_REL_cnf
Add the missing rx of MNCC_REL_cnf to f_call_hangup for the MO case
(called with release_by_ms = false, see f_mo_call()).

This is in preparation for running f_mo_call several times in a row to
test multiple bearer services in a CSD test (follow up patch). Without
this patch, calling f_mo_call_establish() for the second time fails to
rx the MNCC_RTP_CREATE because the REL cnf is still in the port. This
leads to a timeout of X2 and OsmoMSC sending a CC RELEASE.

Adjust the log numbers next to f_call_hangup to re-use numbers 2 and 3
from above, as only one of the two code paths gets executed (similar to
numbers 5 and 6 below).

Related: OS#4394
Change-Id: Ia2ed7ce092e73e17c4243e83bfd239ead8266b49
2023-07-18 09:33:52 +00:00
Oliver Smith 8cf75abec9 msc: TC_lu_and_mt_csd: test multiple bearer services
Related: OS#4394
Depends: osmo-msc I7297cc481fbe36355b5231ca800cf566a1ee93c0
Change-Id: Idf6502c826a441b8dd18257c85f9a3323883825e
2023-07-18 09:33:52 +00:00
Andreas Eversberg db99cb0378 MGW_Tests: Add test for "confecho" connection.
The test uses two connections: "confecho" and "sendonly". It is expected
that "confecho" connection receives as many RTP packets as it sends,
because it echoes back its packets. It is also expected that "sendonly"
connection receives the same amount of RTP packets.

Change-Id: I7df4a58ad9287a564b2daf7548b882c03787f7f2
2023-07-18 07:08:23 +00:00
Philipp Maier 74d776a2b1 MME_Tests: add Gn interface
To test the planned Gn connectivity support in open5gs MME the testsuite
also requires support for such an interface. This patch adds the
connection handler, provided by GTP_Emulation.ttcn to the connection
handler in MME_Tests.ttcn, along with a simple GTP ECHO REQUEST
testcase.

Related: OS#5760
Change-Id: I38b668df15b3dd10542b4aa8790b9ea33c1f9635
2023-07-17 12:37:53 +00:00
Philipp Maier 5c1b5f2c04 GTP_Emulation: make GTPU optional
When using the GTP_Emulation connection handler one has to configure a
GTPC and a GTPU link. However in some situations (e.g. when testing the
Gn interface of an 5g MME) only GTPC may be required. So lets make the
GTPU link optional.

Related: OS#5760
Change-Id: I509a229fcaf02ea5149df42816af27bba46d3bff
2023-07-17 12:37:53 +00:00
Vadim Yanitskiy ce65a0f61a BTS_Tests: also test TCH/EFS (EFR) in TC_speech_no_rtp_tchf
Also add TODO comments for TCH/AFS and TCH/AHS.

Change-Id: I272b4343f895889f6cb3e0d3aba2c63b4eab08a2
Related: SYS#5919, OS#4823
2023-07-14 14:48:01 +00:00
Vadim Yanitskiy 982ac2d1e2 BTS_Tests: call f_shutdown() in TC_speech_no_rtp_tch[fh]
We need to call f_shutdown() to properly terminate all components.
All (at least speech related) testcases do this function call.

Change-Id: Ib706fe3d9901f9cd1a0efa7d9ffd3b5b8a4472d7
2023-07-14 14:48:01 +00:00
Vadim Yanitskiy cc92ba77ab BTS_Tests: properly release TCH in f_TC_speech_no_rtp()
Otherwise we're getting a DTE when trying to run this function more
than once in a single testcase (e.g. when testing different channel
modes).  This is already done properly in f_TC_speech_rtp().

Change-Id: I290789153bea4b128af29dcf7c52da16b64c4108
Related: SYS#5919, OS#4823
2023-07-14 14:48:01 +00:00
Vadim Yanitskiy 75ad9a63bb BTS_Tests: fix expectations in TC_speech_no_rtp_tch[fh]
This testcase is currently passing for both -master and -latest
versions of osmo-bts, despite their behavior is different:

* the -latest is sending FACCH frames with dummy LAPDm func=UI,
* the -master is sending invalid speech frames with inverted CRC3.

There is a bug in the 'tr_bad_frame' template definition: we expect
the payload to be present, while in real BFIs it's omitted.  So these
two testcases would always pass, even if the IUT would be sending dummy
bursts or sending nothing at all, because they were designed to fail on
receipt of a never-matching TRAFFIC.ind template.

Let's fix this and align our expectations with the current behavior
of the -master version of osmo-bts.  Note that sending invalid speech
frames with inverted CRC3 is not osmo-bts-trx specific behavior;
it's actually a replicated behavior of DSP based osmo-bts-sysmo.

Change-Id: Ic680002f60e598cfeeb448c517581b3506355e5b
Related: osmo-bts.git I78106802a0aa4af39859c75d29fe0e77037899fe
Related: SYS#5919, OS#4823
2023-07-14 14:48:01 +00:00
Andreas Eversberg 35874922b7 BSC_Tests_ASCI: Add test to seize or release uplink by MSC
The MSC will block (seize) or unblock (release) the uplink on one BSC,
if a talker requests or releases uplink on a different BSC. An UPLINK
BUSY or UPLINK FREE message es expected to be sent to the BTS.

Change-Id: I7ebf03662e81f59d76ca8d8fa29f581043053564
2023-07-12 16:21:44 +00:00
Andreas Eversberg 5e3dd362f6 BSC_Tests_ASCI: Do not expect UPLINK BUSY message
There is no UPLINK BUSY message sent by BSC, if the talker
requests/establishes the uplink. Due to timing reason, the message is
sent by the BTS itself towards the MS.

Change-Id: I2e3b866eca174ae212ea986980d508e48e31fa57
2023-07-12 16:21:44 +00:00
Andreas Eversberg c0870e5a08 BSC_Tests_ASCI: UPLINK FREE / UPLINK BUSY uses unit data
RSL_UNITDATA_REQ is used instead of RSL_DATA_REQ.

Change-Id: I224a520ed49ea79b95172bbc38c567a7c861abf4
2023-07-12 16:21:44 +00:00
Vadim Yanitskiy 89264bcee1 BTS_Tests: run TCH and SACCH loops in f_TC_speech_osmux()
I forgot to update this function in [1].  Let's make it consistent with
the f_TC_speech_rtp().  More details can be found in the linked patch.

Change-Id: I8c2f8bb4cc4b44378af5536893bc73fde368b3fe
Related: [1] Ifb69669b75df5b390d7056cefaf0ef1df69d9bd4
2023-07-12 22:26:27 +07:00
Vadim Yanitskiy 25823b7da1 BTS_Tests: print DL TCH length in f_TC_speech_osmux()
I forgot to update this function in [1].

Change-Id: I2a2dccd32aaf94afc31bd44f14fdc1cfdf554d2d
Related: [1] I5848bd8acd220c1c4d2db01b71bb57e785dc9de7
2023-07-12 22:26:27 +07:00
Vadim Yanitskiy d10c344b75 bts/osmo-bts.cfg: reduce {DPCU,DLIMB} logging verbosity
Change-Id: Ieb0768ac0db4d79eb45ca41dea941284cc55f407
2023-07-12 22:26:27 +07:00
Vadim Yanitskiy f6d20cb55d bts/BTS_Tests.default: bump default PCUIF version to 11
Without this change I cannot run BTS_Tests manually anymore:

Local verdict of MTC: fail reason:
    "BTS_Tests.ttcn:480 : Invalid PCU Version/BTS Number received"

Change-Id: If0046b44adb93fba7dced1ce06d5ddb9d7c75269
Fixes: 3b4abb86 "BTS_Tests: Add support for PCUIF protocol version 11"
2023-07-11 15:07:36 +00:00
Philipp Maier 845d18985f S1AP_Emulation: remove stray comment
Related: OS#5760
Change-Id: I55bfced12d573081311c55d363bfe7bd02fc816f
2023-07-11 14:56:33 +00:00
Philipp Maier 16ab839c3c S1AP_Templates: fix tr_S1AP_SetupResp
The S1 SETUP RESPONSE message may have an optional IE MME Name at the
beginning.

Related: OS#5760
Change-Id: I07513743142f519481530801d4e1185d55f6ea4b
2023-07-11 14:56:33 +00:00
Philipp Maier 7f521fe44a S1AP_Templates: fix tr_S1AP_SetupReq
The S1_SETUP_REQUEST may have an optional IE eNB_Name in between Global
eNB ID and Supported TAs

Related: OS#5760
Change-Id: Id4b52921053884e79349301598b75c264b7f058c
2023-07-11 14:56:33 +00:00
Vadim Yanitskiy 77b666f660 bts/expected-results.xml: expect TC_t200_n200 to pass
This testcase has been fixed in [1] and is currently passing.

Change-Id: I9bc81629a9baaf922a87ac95c8f69af343aacdf1
Related: [1] I2c328219b1a37d0f4623c5728143cd91976000a0
Related: OS#5972
2023-07-11 19:54:48 +07:00
Pau Espin 578fa193ae */osmo-stp.cfg: Explicitly define role & sctp-role
It was recently decided it's a good practice to always specify the role
 and sctp-role for all ASPs configured in the VTY, since it's an
 important configuration providing feedback on the network setup
 expectancies.

Change-Id: If48ca06f2cc3c0986daa5f6264d80138d468332a
2023-07-11 11:48:41 +00:00
Philipp Maier 7147c92010 S1AP_Emulation: add missing create_cb
At the moment we do not have a default implementation for the create_cb.
The create_cb is called to resolve the vc_conn to which a subscriber
communication belongs in case it is not found in the S1apAssociationTable,
then it is resolved from an S1apExpectTable instead.

The current implementation uses the IMSI as key to resolve the vc_conn
from the S1apExpectTable, this might not work since in S1AP the UE
context is identfied by an MME_UE_S1AP_ID / ENB_UE_S1AP_ID pair.

Related: OS#5760
Change-Id: I758e7c8d8cc445cf18acdd7a25dcde8846fd84e5
2023-07-11 12:48:52 +02:00
Philipp Maier bb8f05d280 S1AP_Emulation: delete UE association on S1AP_UeContextReleaseCmd
When a S1AP_UeContextReleaseCmd is received, the UE association should
be deleted.

Related: OS#5760
Change-Id: I8c6f7a780945ce34dabdc794aabab5d16a3a73aa
2023-07-11 12:43:50 +02:00
Philipp Maier 0ce67ab226 S1AP_Emulation: fix f_s1ap_id_table_del
When we search for the entry that we want to delete, we use the
ENB_UE_S1AP_ID as a search key, but we compare it against
mme_ue_s1ap_id. This is not correct, it should be compared against
enb_ue_s1ap_id

Change-Id: I8528af4e3fda0bc97f8b14785097434a6163bcc4
Related: OS#5760
2023-07-11 12:40:10 +02:00
Philipp Maier 05c6ab2209 S1AP_Templates: fix tr_S1AP_InitialCtxSetupResp
The INITIAL CONTEXT SETUP RESPONSE message may have optional elements at
the end.

Related: OS#5760
Change-Id: Ic28c94093e55db0dc1fa18d36e22d328788cb3fc
2023-07-11 12:29:51 +02:00
Philipp Maier 20bed06522 S1AP_Templates: cosmetic: fix sourcecode formatting
Change-Id: I6e70377315fdcc7ea6d0708fc6de87c335539282
Related: OS#5760
2023-07-10 19:40:29 +00:00
Neels Hofmeyr 7a48df158a hnbgw: prepare cn pool: add multiple MSCs and SGSNs
Change-Id: Ia29565cabc072de9aa46565b57232e1eda65874f
2023-07-10 15:34:57 +00:00
Neels Hofmeyr 75d905bbc7 hnbgw: verify empty talloc asn1_context at end of tests
This allowed me to find massive memory leaks in osmo-hnbgw: at the end
of each test, run f_shutdown_helper(), and in it query 'show talloc' for
an empty asn1_context.

Hence verify that all the scenarios run in these ttcn3 tests have no
asn1 de/encoding memory leaks.

Change-Id: I2948ee6f167369a2252f85b493e9653b93c7e4e9
2023-07-10 15:34:57 +00:00
Neels Hofmeyr 11ac91ca1a move f_str_split() from UPF_Tests to Osmocom_VTY_Functions
I want to use it in a new function f_verify_talloc_bytes() added to
Osmocom_VTY_Functions.ttcn in I2948ee6f167369a2252f85b493e9653b93c7e4e9.

Change-Id: I9ddd9977734efd7599481261f04df82620845cef
2023-07-10 15:34:57 +00:00
Neels Hofmeyr fffe79b868 hnbgw: tweak HNB name sent in HNBAP HNB Register
It helps when each distinct HNB has a different name showing in the
osmo-hnbgw.log.

Change-Id: I560415caba591a3f1139897c6ca4d31566f4c178
2023-07-10 15:34:57 +00:00
Neels Hofmeyr 497216f7de hnbgw: fix PLMN in g_hnb_cfg
To get 001-01, we need to encode the placeholder 0xf nibble.

Since recently, osmo-hnbgw cares about the PLMN in messages, in specific
cases: in upcoming CN pool tests, the PLMN is part of the algorithm that
picks the CN link. So let's encode 001-01 correctly.

Change-Id: I5299c521479dc25ea0f82d7d294d53942960d2cf
2023-07-10 15:34:57 +00:00
Neels Hofmeyr c0633b7e3d f_verify_talloc_count: mtc.stop
If the talloc count matching failed, immediately stop the failed test.

It is currently used by BSC_Tests.ttcn, and will soon also be used by
HNBGW_Tests.ttcn. These tests were used to uncover memory leaks, and
can now remain to guard against new leaks being introduced.

Change-Id: Id2b29beecf1c0652fb8d75e031e5c0dc9aa27975
2023-07-10 15:34:57 +00:00
Neels Hofmeyr b869dc895a hnbgw: comment
Change-Id: I8de926f5c05a83e15dd03a40638caceb5fedb4e2
2023-07-10 15:34:57 +00:00
Neels Hofmeyr cf6dc49a2c hnbgw: drop dead code from MSC_UnitdataCallback
This RANAP RESET code...

a) is not used:
osmo-hnbgw has only recently started sending RANAP UnitData by its own initiative.
Until very recently, osmo-hnbgw has only responded to receiving a RESET, with an ACK.
It has never sent a RESET message to the peer, here titan.

b) makes no sense implementation wise:
RANAP RESET handling is actually implemented in RAN_EMulation.ttcnpp.

c) makes no sense protocol wise:
The UnitDataCallback happens when osmo-hnbgw sends a RANAP UnitData to
titan: if at all, the only logical response would be a RESET ACK
message, not a RESET message.

Change-Id: Ie7b9022e991b63b945c7ec6e5c9f7c4eb5da4d7e
2023-07-10 15:34:57 +00:00
Vadim Yanitskiy 803af35d25 BTS_Tests: print length of received TCH payloads
Change-Id: I5848bd8acd220c1c4d2db01b71bb57e785dc9de7
2023-07-09 07:55:15 +00:00
Oliver Smith 3a33e5595b msc/BSC_ConnHdlr: f_mt_call: unregister IMSI
Fix the missing call to f_ran_unregister_imsi when running f_mt_call.

This is in preparation for calling f_mt_call multiple times during one
test, to test various CSD bearer services. Without this patch, it will
result in a "No space left in ImsiTable" error.

I've also considered adding it to f_call_hangup instead, but this gets
called by f_mo_call (mo instead of mt) as well, which does not run
f_ran_register_imsi.

Related: OS#4394
Change-Id: Ie9b180b95348d7e84650c14a331c5091a1e67d1f
2023-07-09 07:53:30 +00:00
Oliver Smith 07ebf96df6 library/RAN_Emulation: testcase.stop -> mtc.stop
Stop the MTC (main test component) on error, otherwise some tests don't
stop here and keep going forever.

MSC_Test_0-RAN(106)@7e006c664067: Unable to find to-be-destroyed IMSI in ImsiTable
MSC_Test_0-RAN(106)@7e006c664067: Dynamic test case error: testcase.stop
MSC_Test_0-RAN(106)@7e006c664067: setverdict(error): none -> error
MSC_Test_0-RAN(106)@7e006c664067: Final verdict of PTC: error
MSC_Test-GSUP-IPA(110)@7e006c664067: CCM Rx:{ msg_type := IPAC_MSGT_PING (0), u := omit }
MSC_Test-GSUP-IPA(110)@7e006c664067: CCM Tx:{ msg_type := IPAC_MSGT_PONG (1), u := omit }
MSC_Test-GSUP-IPA(110)@7e006c664067: CCM Rx:{ msg_type := IPAC_MSGT_PING (0), u := omit }
MSC_Test-GSUP-IPA(110)@7e006c664067: CCM Tx:{ msg_type := IPAC_MSGT_PONG (1), u := omit }
…

Change-Id: I8923975f6cb48f5f628e2ac5dc412f0f3ab97aab
2023-07-09 07:53:30 +00:00
Philipp Maier 3b4abb8618 BTS_Tests: Add support for PCUIF protocol version 11
The PCUIF protocol version 11 uses a more distinct (direct TLLI) way
to signal PAGING COMMAND and IMMEDIATE ASSIGNMENT messages towards the PCU.

Since OsmoBTS will soon fully support v.11 of the PCUIF protocol we need
to add compatibility in the OsmoBTS TTCN3 testsuite early. We also have
to stay compatible with older versions of OsmoBTS. The BTS_Tests.default
config still sets up mp_pcuif_version to version 10, so this will be the
default until we have full version 11 support in current master and
latest.

Related: OS#5927
Change-Id: I08de02e951e10bc8b4381cc2ad32e63f2747e3c4
2023-07-07 13:19:26 +00:00
Philipp Maier e640d8f80c PCU_Tests: test NACC procedure with UTRAN and E-UTRAN cell
When the PacketCellChangeNotification proposes an UTRAN or E-UTRAN cell,
then the PCU will not provide system information. Instead it will directly
conclude the NACC procedure with a PacketCellChangeContinue message.

Related: OS#6044
Change-Id: Idae86a458fd44ac81bab183ed1865b1c1bdbfd66
2023-07-05 12:23:02 +02:00
Philipp Maier 58c083302e PCU_Tests: verify that PacketCellChangeContine contains an ARFCN and BSIC
The testcase TC_nacc_outbound_success tests the NACC procedure. The cell
that is proposed in the PacketCellChangeNotification is a GERAN cell.
This means that the PCU should conclude the procedure with a
PacketCellChangeNotification that contains the ARFCN and BSIC of the
proposed cell. Let's make sure that this actually is the case.

Related: OS#6044
Change-Id: I4b8f3312088e3d2bc4b90702485e7c6a8d39f954
2023-07-05 10:16:18 +00:00
Philipp Maier 8d42651d79 PCUIF_Types: fix record PCUIF_pch_dt
The record PCUIF_pch_dt uses ALIGN(left) variants for imsi data. This is
not correct, since it would left-pad the data with zeros if it does not
fit the specified length. This is a problem with IMSIs shorter than 17
characters, because the left padded zeros would appear like a
null-string to the receiving end.

When the ALIGN(left) modifier is removed, the encoder will apply the
padding from the right. This will fill the unused space after the string
with zeros.

Related: OS#5927
Change-Id: I011eb2496b1422c49736b227dfa1e2a2d6096d67
2023-07-05 09:56:26 +00:00
Philipp Maier 6c5ba075aa HNBGW_Tests: use realistic codec name and payload type in MGCP
When we respond to the MGCP requests from OsmoHNBGW, we use codec name
"FOO" and payload type 23 in the SDP part of the response. This is
obviously an invalid codec and osmo-mgcp-client will not tolerate this
anymore. Let's use a more realistic payload type and codec name, like
112 and "VND.3GPP.IUFP"

Change-Id: Ib53ff7a878087b497e6ff27f786c9ab1297f3d5f
2023-07-04 16:53:40 +02:00
Philipp Maier 4a1e5dceb4 MME_Tests: add expected-results.xml
The MME_Tests miss an expected-results XML file

Related: OS#5760
Change-Id: I8cc1ef762fcdff8fe73d23a3945496aa995b4ae5
2023-07-04 15:20:04 +02:00
Vadim Yanitskiy 805d5b196d SGSN_Tests: fix compilation warnings (template restrictions)
This patch fixes multiple compilation warnings like this one:

  Inadequate restriction on the referenced template variable
  `attach_req', this may cause a dynamic test case error at runtime

Change-Id: Iee7760d3dcf2a35d7fe612ed80dc13c1d11e0897
2023-06-28 12:20:15 +00:00