Commit Graph

4289 Commits

Author SHA1 Message Date
Philipp Maier c58a455520 WIP: eIM_Tests: add testsuite for an eIM
Change-Id: Iba72ee00d10aba7831feedadacd943bf943de53e
Related: SYS#6824
2024-05-16 16:33:27 +02:00
Philipp Maier 485c77b99c IPA_Tests: fix matching of tr_provideEimPackageResult_ePRAndNotif
The template tr_provideEimPackageResult_ePRAndNotif got extended and
has now default parameters that break TC_proc_euicc_pkg_dwnld_exec_rollback,
so we must set euiccPackageResult to "?" to restore the original conditions
of the testcase.

Related: SYS#6563
Change-Id: I1e8c83a317619673cd091da585e44af1a6d8c866
2024-05-16 16:33:27 +02:00
Philipp Maier 6e04d17719 SGP32Definitions_Templates: improve tr/ts_provideEimPackageResult_ePRAndNotif
The template tr_provideEimPackageResult_ePRAndNotif has a fixed eUICC package,
let's turn the contained eUICC package into a template parameter so that
we can define the eUICC package templates separately. To be complete, let's
also add a ts_provideEimPackageResult_ePRAndNotif

Related: SYS#6824
Change-Id: If04be6407eb41274b378571147ab469d449eac4a
2024-05-16 16:33:27 +02:00
Philipp Maier ee47821ff9 SGP32Definitions_Templates: improve tr/ts_getEimPackageResponse_euiccPkgReq
The template ts_getEimPackageResponse_euiccPkgReq has a fixed eUICC package,
let's turn the contained eUICC package into a template parameter so that
we can define the eUICC package templates separately. To be complete, let's
also add a tr_getEimPackageResponse_euiccPkgReq

Related: SYS#6824
Change-Id: Ibcea9063f25cc8ba90b53c34218c766fa5cab895
2024-05-16 16:33:27 +02:00
Philipp Maier bff633723a SGP32Definitions_Templates: add new template
We do not have a template for the EsipaMessageFromIpaToEim message
that contains the HandleNotification field with the
profileInstallationResult, so lets add one.

Related: SYS#6824
Change-Id: Ic5d1b2ea1d3d7de20fbcb029b36e9f9daa27cce0
2024-05-16 16:33:27 +02:00
Philipp Maier 3b7bad3da8 SGP32Definitions_Templates: add new template
We do not have a template for the GetBoundProfilePackageRequestEsipa,
so lets add one.

Change-Id: I90b699de01c0476262f0e25c196a147e0ccd44aa
Related: SYS#6824
2024-05-16 16:33:27 +02:00
Philipp Maier 49ae9f9d07 RSPDefinitions_Templates: split off profileInstallationResultData into templates
The field profileInstallationResultData in tr/ts_profileInstallationResult
is also present in SGP.32 messages, so lets split this field into a separate
template so that we can use it in the SGP32Definitions_Templates as
well.

Related: SYS#6824
Change-Id: Ie38443f86ed2d8d758f894ff4276ac4109cd2e6d
2024-05-16 16:33:27 +02:00
Philipp Maier c0045ca586 RSPDefinitions_Templates: split off downloadResponseOk into templates
The field downloadResponseOk in tr/ts_prepareDownloadResponse is also
present in SGP.32 messages, so lets split this field into a separate
template so that we can use it in the SGP32Definitions_Templates as
well.

Change-Id: Id29e2aafee4ff37c25037c75f97f280784b57619
Related: SYS#6824
2024-05-16 16:29:13 +02:00
Philipp Maier 29c2a09c52 RSPDefinitions_Templates: add default values to templates
The templates ts_getBoundProfilePackageRequest and
ts_getBoundProfilePackageResponse have no default values for their
parameters.

Change-Id: I6b26f70962ad1258c7a43b22a6778883288d0876
Related: SYS#6824
2024-05-16 16:29:13 +02:00
Philipp Maier 119ac3f60b IPAd_Tests: improve comments, add spec referenes
Related: SYS#6563
Change-Id: I5e321b17d24df622c428193ae6ad6fc0dfc9a097
2024-05-16 16:29:13 +02:00
Philipp Maier c50a8d4a9c IPAd_Tests: fix terminology
When testing the profile download we call it "direct" profile
download, but we actually mean "indirect" profile download.

Related: SYS#6563
Change-Id: I971ed877f76abaa3e05bc05d3e20a0fd1f19982d
2024-05-16 14:29:01 +00:00
Philipp Maier 9df873401f IPAd_Tests: expect TERMINAL CAPABILITIES
An IPAd may send TERMINAL CAPABILITIES when it starts to talk to the eUICC.

Related: SYS#6563
Change-Id: Ie0627685a300a478c39858abe1b5bb0f97f6d3fe
2024-05-16 14:28:25 +00:00
Pau Espin 5badb2191d remsim: Move PIPEasp generic helper code to library/PIPEasp_Templates.ttcn
This way code can be used and extended for other testsuites.

Change-Id: I4a5ededbd958c87537f84155092b6a6cd715865a
2024-05-15 14:37:25 +02:00
Pau Espin a2812ec0da asterisk: Initial IMS registration
This patch is a step towards testing IMS.
So far only the code infrstrastructure to handle the 1st REGISTER
(outside IPSEC) is provided. It can already be seen how Asterisk
sends the second REGISTER over IPSEC, but there's no means to test it
yet in TTCN-3. This will be done in a follow-up patch, which may take
some work.

Change-Id: Idb3b19ccd82cad25948106b2c72aa424d7f79cd8
2024-05-15 13:52:49 +02:00
Pau Espin 5c36a657d7 SIP_Templates: Always set Content-Length
According to RFC3261 7.4.2, 7.5, 20.14 Content-Length SHOULD be set over
any transport, and MUST be set over TCP.
Hence, make sure we set it in all cases.
This allows Asterisk being able to decode SIP messages sent to it over a
TCP connection, since it uses the Content-Length field to look up for
message boundaries over the TCP stream.

Change-Id: I26e444fe466b4742d74ef5a6e371ce8488a5afcf
2024-05-15 13:52:49 +02:00
Pau Espin 52cc2e5510 SIP_Templates: Allow passing Server field
This field is used by an IMS core.

Change-Id: I7816eb4565fb027a2902c60c600a75b96dc293bc
2024-05-15 13:52:49 +02:00
Pau Espin 13c50ac466 SIP_Templates: Allow passing UserAgent field
This way it can be set to omit, since this field is not set by an IMS
core.

Change-Id: Ib1e3e66b8fe46ad2626b07193dfcaa594f26352e
2024-05-15 13:52:49 +02:00
Pau Espin 1b5f7ba3ac SIP_Templates: Add ts_SIP_Response_Trying
Similar to ts_SIP_Response_Ringing. We also have the counterpart tr_*
for both Trying and Ringing. This is needed in a follow-up patch.

Change-Id: I05d8be9ce8860c610c509670392e14f1096fdddb
2024-05-15 13:52:49 +02:00
Pau Espin cb3a15b6d0 SIP_Templates: Allow passing 'Allow' field
Change-Id: I10dd36d8c0ef8dbcbb58016c9684d877a0455b03
2024-05-15 13:52:40 +02:00
Pau Espin 7f41156603 SIP_Templates: Allow passing Security_server field
Change-Id: I7ee3d6dace39c784b0ec900d58a55421ac967269
2024-05-15 11:51:47 +00:00
Vadim Yanitskiy 96c6afa996 sgsn: fix f_send_l3_initial_ue(): indicate PS domain, not CS
Change-Id: Ic499bcd036ef02d4e3ac7a94ccc3ff141df9b17b
2024-05-15 01:37:36 +05:00
Vadim Yanitskiy 3bed6a4634 sgsn: fix TC_iu_attach_geran_rau: register the new TLLI
We're getting a new TLLI assigned during the attach procedure (see
Allocated P-TMSI in the GMM Attach Accept message), which needs to
be registered in order to receive BSSGP PDUs from BSSGP_Emulation.

Change-Id: Idafcbd7e44a523a26dc34dc72e38ff879782148e
2024-05-15 01:33:34 +05:00
Vadim Yanitskiy e42f8d634d sgsn: reset encryption in SGSN_Tests_Iu.f_vty_config()
Ensure the expected default UEA configuration, which is always
reset properly even if one of the testcases aborts due to a DTE.

Change-Id: Ic2c5a11e86e4349796fa7508076ac27ef22815cd
2024-05-15 00:55:30 +05:00
Vadim Yanitskiy b5a002edbf sgsn: fix TC_iu_attach failing for recent -master
Since recently, osmo-sgsn is requesting encryption (UEA1 + UEA2)
in RANAP Security Mode Command by default [1].  The testcase
TC_iu_attach is assuming no encryption (UEA0) and thus failing.

Fix this by explicitly setting UEA0 via the VTY, similarly to
what testcase TC_iu_attach_encr does.

Change-Id: Ibaf83db1ab0f82f7e934e89ae3f6c19d014be197
Related: [1] osmo-sgsn.git I4eb9451b4267fc1436ed90a55ff200cf36f16bf6
2024-05-15 00:55:30 +05:00
Vadim Yanitskiy f0bbadc13b sgsn: add Iu specific, module local f_init()
Change-Id: Iea23b847b363da518a8dc121405522df9e4e0f77
2024-05-15 00:55:30 +05:00
Pau Espin 73f6a314df SIP_Templates: Allow passing Require,Security-client,Supported fields to REGISTER templates
These fields are used in IMS.

Change-Id: I20a0df5633db8c0e7732659c1316b85e63317afc
2024-05-10 20:31:41 +02:00
Pau Espin 89d8c952b9 SIP_Templates: Allow passing WwwAuthenticate to ts_SIP_msgh_std
The field could already be passed to its tr_* counterpart, but not the
the ts_* one.

Change-Id: Ibc6cc5320f24ce82165c1b2140bad30cb356f8ae
2024-05-10 20:28:25 +02:00
Pau Espin 2a8333733a SIP_Templates: Allow setting transport in Via templates
This is needed when using IMS, since TCP is used.

Change-Id: Id45491615bcb5c074ef4fc298cbb24b2e034972d
2024-05-10 20:23:23 +02:00
Pau Espin 77976a6b15 asterisk: Use ActionID field in Action Login
It's a good practice to tag Actions with an ActionID to do proper
matching of the response once it comes back. It also helps reading a
dump of the conversation if there were events in between.

Change-Id: Iec320762ff0cca86319f7374b53c642f08a6e6df
2024-05-10 16:22:46 +02:00
Pau Espin 941ca3caa1 AMI_Functions: Tx ActionID instead of ActionId
The AMI documentation webpage mentions "ActionId", but Asterisk is
always returning "ActionID" in all response messages.
Any of the 2 is parsed fine by Asterisk since the keys are case
insensitive, but anyway let's use same case as what Asterisk is actually
transmitting to make reading of output easier.

Change-Id: I8097e461fd0cadfa780d52ab1666e41b9d2b8a0e
2024-05-10 16:22:46 +02:00
Pau Espin 21c084f6ce AMI_Function: Match field keys in case insensitive way
As per [1], "Keys are case insensitive".

[1] https://docs.asterisk.org/Configuration/Interfaces/Asterisk-Manager-Interface-AMI/AMI-v2-Specification/

Change-Id: I9080f617c4e7272b9dd67d616069ac9350411f3c
2024-05-10 16:22:46 +02:00
Pau Espin 4757be713f SIP_Emulation: Handle SIP REGISTER from peer
This is needed when emulating an IMS core.

Change-Id: I49dfe54434113eb8b75306a3a8ddda940fa14743
2024-05-10 16:22:46 +02:00
Pau Espin 01f1df8ef8 asterisk: Implement AMI_Adapter using IPL4 instead of TELNET
Change Telnet_PT to a regular TCP socket for the AMI interface.

I started using Telnet_PT port since initial use of the interface
was done through telnet, but it's not really a telnet interface and
stuff starts becoming difficult to maintain properly when events
(generated by Asterisk at any time) arrive.

The current TEXT decoder/encoder from Titan seems to be struggling in 2
scenarios, so for now we are adding some workarounds in
dec_AMI_Msg_ext() before calling it in order to be able to go forward
and avoid errors:
1- Fields of format "MyFieldName: \r\n" (empty value). I tried changing
the "value" field in record AMI_Field to "optional", but then apparently
the TEXT decoder fails to decode values consisting of several words.
Ideally, I'd expect the TEXT decoder to put an empty "" string in the
"value" field in that case if "optional" is not flagged in the record.
2- Fields of format "MyFieldName: foobar: hey there \r\n" containing a
": " token in the value. I'd expect TEXT decoder to put all subsequent
strings in the last field "value" if no more fields are described in the
record.

Change-Id: Icaf2860c1dd4befa4498f0d176cfadf26cfa8d1d
2024-05-10 16:22:17 +02:00
Pau Espin bcb4e82d16 asterisk: Introduce AMI_Adapter_CT
This allows to keep string handling totally internal to the AMI_Adapter
component, which also means now the CLIENT port acts asynchronously on
full AMI messages.
This allows for instance using activated altsteps to ignore events or
answer to them.

Change-Id: Ibf230d2302fecf443f34e1c4d4acfd4802f4cc79
2024-05-09 17:54:29 +02:00
Pau Espin 9c83471a5b Misc_Helpers.ttcn: Add some more string handling API helpers
These are currently used by code in AMI_Functions doing some workaround
for TEXT decoder limitations.

They can be merged independently now since anyway they are totally
generic and may be useful for future users.

Change-Id: I3d6da125a10807b7a2f3ecad8145a046a322c7d6
2024-05-09 17:54:29 +02:00
Pau Espin 4362dbd088 asterisk/AMI_Functions: improvements to implement PJSIPRegister
Change-Id: Ibc4ff6eaad84f67d33c1211dc5e39294ce1c8fac
2024-05-09 15:25:52 +00:00
Pau Espin f0862ed483 Misc_Helpers: f_str_split(): Fix parse with len(delimiter) > 1
Change-Id: I1ac53635deea82a501f2a8c7a94faf501ddf7afd
2024-05-09 15:25:52 +00:00
Oliver Smith a4b72ce8f4 hnbgw: skip f_statsd_expect for latest
Fix that 6 tests started failing on ttcn3-hnbgw-test-latest with e.g.:
  Timeout waiting for metrics
        HNBGW_Tests.ttcn:2885 HNBGW_Tests control part
        HNBGW_Tests.ttcn:1536 TC_rab_assign_fail testcase

Fixes: 904b5f1a ("hnbgw: Implement validation of [some] counters")
Change-Id: I0cd47728308757fe6eaaaed1581fbbec03a09cf7
2024-05-09 08:29:38 +00:00
Philipp Maier 2cb1251360 HTTP_Adapter: fix request sending in f_http_tx_request
The function f_http_tx_request has two parameters to spcifiy the body
part of the HTTP request (body and binary_body). The function only
sends a request when either body or binary_body is populated, but not
when none of the two is populated. This means requests without body
part (e.g. a GET request) can not be sent.

There is also no proper interlocking between body and binary_body. We
should make sure that this situation does not occur.

Related: SYS#6824
Change-Id: I258ee6209c35d0601f5a4d82423d2f5c6fbb03cc
2024-05-08 15:50:07 +00:00
Pau Espin 0dd3f269f5 SIP_Templates: tr_SIP_REGISTER(): Pass via field directly as a param
Similar to other templates which already required it.
There's no user of this template (yet).

Change-Id: I9fe477370e028543b04dee35a3285ddae6bb2c59
2024-05-07 14:48:59 +00:00
Pau Espin ac8a05432f asterisk: Initial steps to emulate IMS core
Add the initial infrastructure to manage 2 SIPmsg_PT ports, one for the
local SIP UAs and one for the IMS core.
Still missing:
* Trigger Asterisk (through AMI) to do the initial connect + register to it
* Configure ipsec after Unauthorized response from IMS core

Change-Id: Ibbbadd54b7facf4ef7384499704e742f482a1252
2024-05-07 14:48:59 +00:00
Pau Espin 1a77134664 SIP_Emulation: Rename component id
Remove the dash character, since it makes it impossible to reference the
component name under TESTPORT_PARAMETERS in .default/.cfg files.

While at it, actually, allow the test to provide a full id instead of
always appending the suffix to it. This provides more freedom on the
testsuite to provide a fitting component name.

Change-Id: Iecefe7d98a5842872f1efc55e013f672186ef1a8
2024-05-07 14:48:59 +00:00
Harald Welte 0266017299 Revert "hnbgw: osmo-hnbgw.cfg: Update file to make it similar to the one in docker-playground"
This reverts commit e9c6c7b97e which
breaks all of the test cases reliably.  I'm surprised how it got
submitted in the first place, as it can never have worked.  It uses
127.0.0.1:2905 on both the STP and the HNBGW side.

Change-Id: Ia7d9a743e0359ce7220c42597ded670967d562a9
2024-05-06 18:57:39 +00:00
Philipp Maier 916b5fa8ec SGP32Definitions: add ts template for authenticateClientRequestEsipa
The template ts_authenticateClientRequestEsipa is still missing, let's
add one.

Related: SYS#6824
Change-Id: I9490a2ee59a89511876bb1055a056a43fbf172bb
2024-04-30 12:03:17 +02:00
Philipp Maier 3583475784 RSPDefinitions: add defaults values to ts_authenticateClientResponseEs9
The template ts_authenticateClientResponseEs9 has no default values,
let's add some default values to make it easier to use

Related: SYS#6824
Change-Id: I07d942a58a3c1c29c37fcaa50d3a274ce8b026bc
2024-04-30 12:03:17 +02:00
Philipp Maier d7ccd01432 RSPDefinitions: add separate template for CtxParams1
Fields of type CtxParams1 are used in other messages too, so it might be
helpful to add a separate template for them.

Related: SYS#6824
Change-Id: Iba6c3780f9f3aec5742d53b3bd7b0c0392b25761
2024-04-30 12:03:17 +02:00
Philipp Maier b1e2fe4842 RSPDefinitions: add defaults for initiateAuthenticationResponse/Request
Related: SYS#6824
Change-Id: I3842569f36dfb94e61afffaa03353b552e001c72
2024-04-30 12:03:17 +02:00
Philipp Maier 746f43e371 RSPDefinitions: add separate template for serverSigned1
The field serverSigned1 is used in many messages, so it might be helpful
to add a separate template for it.

Change-Id: Ic50676ac2863173b72765afc44794a56d03413a5
Related: SYS#6824
2024-04-30 12:03:17 +02:00
Philipp Maier 0957b1b22c HTTP_Adaptor: allow keeping an HTTP client connection
At the moment the HTTP_Adaptor automatically creates a new connection,
performs the HTTP request and closes the connection again. This means
the connection lives only for a single request. Let's add some
flexibility so that we can perform multiple consecutive requests
through the same connection.

Change-Id: Ic6994c504143820dde498c1a2bad2ad6a523dd70
Related: SYS#6824
2024-04-30 12:03:17 +02:00
Philipp Maier 28e7ad3721 HTTP_Adapter: add support for binary messages
The HTTP_Adapter currently only supports text only HTTP messages. However,
the HTTPmsg testport API also has a way to deal with binary HTTP messages.

Related: SYS#6824
Change-Id: I18340f19ed462bf80af683dc9f2831b602f4bdf7
2024-04-30 12:03:17 +02:00