IPA_Emulation.ttcn: Add call to support dis/enabling CCM management
This allows eg. a user to let the Emulation do the inital handshake, and then pass control of eg. IPA PING/PONG messages directly to the user afterwards.
I ran the generic version of all testsuites in the Osmocom jenkins with eclipse-titan 11.1.0. Bump titan_min where we have the same result as with 9.0.0.
The only testsuite that still didn't work the same is the gbproxy testsuite (OS#6800), keep titan_min=9.0.0 there for now.
stp: Fix recent regression introduced in TC_ipa_to_m3ua_patch_sccp
The introduced function f_SCCP_UDT() had the calling+called param order swapped with regards to previous templates. Change the order to first have "calling" (src) and then "called" (dst) as already done in ts_SCCP_UDT. While at it, change the ts_SCCP_UDT params to accept template (value) to make it easier for callers.
Add a sleep 1 to ensure the BSSGP flow Ack flows before removing the SNS. Further add a data weight to the other NSVC to have at least one valid NSVC with data weights. Otherwise the NSEI would become unavailable.
remsim: bankd: add TC for creating a mapping with a busy client
Test if a busy client is implicit removed when creating a new mapping for the same client with a different bankd slot.
After a desynchronisation between the server and bankd happen (e.g. restart the server), the server might request a mapping between a client slot and a bankd slot while the bankd still has a different mapping for the same client slot.
Example before this commit: * server -> bankd: New Mapping (client 1/0, bankd 1/0) * server <- bankd: Ack * Restart server * server -> bankd: New Mapping (client 1/0, bankd 2/0) * server <- bankd: Ack (implicit remove mapping to bankd 1/0)
bsc: generic: Introduce test TC_stat_msc_sctp_disconnected
Take the chance to properly configure all ASP/AS data statically, in order to be able to access them through VTY as well as have the setup properly documented in the config files.
stp: Support expect RFC466 4.5.1 DUNA after ASP ACT
libosmo-sigtran recently introduced support in SG role to send DUNA for unreachablew destinations when a peer ASP becomes activated. This is currently sent upon first ASP going active, since it's the time where SG assumes the ASP peer may need that information.
Make all "add_argument" calls consistently have one function argument in one line, instead of only having it in some places, and have all arguments in one line in others. Having one function arg in one line is enforced via ruff format when having a comma at the end of the function call.
Add a new --asan option for building Osmocom libraries and programs from source with address sanitizer enabled. This works by adding sanitize.opts to osmo-dev's gen_makefile.py, which in turn adds --enable-sanitize to most Osmocom projects.
The --autoreconf-in-src-copy argument for gen_makefile.py must be moved up, so the list of *.opts files is not interrupted by another type of argument that causes argument parsing to fail.
bsc-sccplite: Fix override of opc of incoming msgs
This patch fixes a regression introduced recently in a patch. We basically revert that line change. This fixes osmo-bsc crashes spotted during ttcn3-bsc-test-sccplite.
bsc: Avoid running TC_stat_msc_sctp_disconnected in latest
The osmo-stp in latest release, aside from not yet implementing the "shutdown" cmd (which is known and hence test was expected to fail there), has a side effect of ending up with a broken state after restarting the ASP during got_parent() VTY node exit, where ASP is ends up in ASP_DOWN and AS in AS_ACTIVE. This generates failures in all tests after this one._
StatsD_Checker: Keep polling IUT if waiting for convergence
The wait_converge feature was implemented and used so far only against IUTs which used also the snapshot feature, due to not having a VTY which allows both resetting and triggering a status report manually. Instead, those relied on IUT reporting changes at a given frequency.
If the wait_converge feature is requested and polling mode is used, then make sure we poll once per second after last received statsd UDP msg.
bsc: TC_mscpool_sccp_n_pcstate_detaches_msc: wait for AS to become unavailable
Otherwise race conditions can ocurr, specially since during some time the AS can be in PENDING state until finally going into DOWN state and notifying the peer.
hnbgw: Use static sigtran config between osmo-hnbgw and osmo-stp
This allows referencing/accessing the specific ASP in osmo-stp, which will be needed in a follow-up commit to test IUT behavior when the SCTP conn is dropped.
hnbgw: swap first MSC and SGSN PC to be usual default ones
0.23.1 and 0.23.4 are default remote PCs to be used by osmo-hnbgw to reach MSC and SGSN respectively, if no config is provided. In this testsuite config, however, they were swapped, which is confusing. Swap back the values so they match the default ones in osmo-hnbgw.
msc: Use static sigtran config between osmo-msc and osmo-stp
This allows referencing/accessing the specific ASP in osmo-stp, which will be needed in a follow-up commit to test IUT behavior when the SCTP conn is dropped.
RAN_Emulation: Fix handling of IMSI in RANAP Paging
The IMSI in RANAP Paging messages is encoded in octetstring BCD format. We need to decode it before using it, since we use plain hexstrings everywhere in the module to manage IMSIs.
Take the chance to clean up and improve logging on related lines, both for BSSAP and RANAP.
GSUP Fix missing IMSI template present restriction in tr_GSUP_SAI_REQ
I got this DTE while running SGSN_Tests_Iu.TC_attach_pdp_act_user: """ GSUP_Templates.ttcn:381 Dynamic test case error: Restriction `present' on template of type hexstring violated. """
According to GSUP documentation, the IMSI param is mandatory. Upon fixing it, the compiler found the user causing the problem: """ BSSGP_ConnHdlr.ttcn:797.49: error: Restriction on template formal parameter does not allow usage of any or omit """
sgsn: Use static sigtran config between osmo-sgsn and osmo-stp
This allows referencing/accessing the specific ASP in osmo-stp, which will be needed in a follow-up commit to test IUT behavior when the SCTP conn is dropped.
sgsn: Introduce test TC_stat_rnc_sctp_disconnected
The commit doesn't validate everything it should, because passing the indication from osmo-iuh's iu_client to app (osmo-sgsn) is not supported in current API, and hence the statsd metrics are not yet implemented in osmo-sgsn.
Still, this test already validates that osmo-sgsn is capable of surviving an sctp link down event in IuPS, and continue to work afterwards. IT also allows easily debugging this scenario by inspecting pcap files, logs, etc.
smlc: Use static sigtran config between osmo-msc and osmo-stp
This allows referencing/accessing the specific ASP in osmo-stp, which will be needed in a follow-up commit to test IUT behavior when the SCTP conn is dropped.
When the UE wants to transfer data, the Service Request must have the type data. Remove the default of f_service_request() to force explicit defining it.
When parsing testenv.cfg files, the titan_min version gets compared with the installed titan version. This fails with a python trace if titan is not installed. Catch this earlier by running the requirements check first, which ensures ttcn3_compiler is avaiable or gives a helpful error message:
[testenv] Missing program: ttcn3_compiler [testenv] Install eclipse-titan, e.g. from osmocom:latest: [testenv] https://osmocom.org/projects/cellular-infrastructure/wiki/Binary_Packages
Fixes: 18eef740 ("testenv: support using multiple titan versions") Change-Id: I09ed7af5b236aeffd910d7c0a1a0b63a78631ade
rsync is needed by osmo-dev for the autoreconf-in-src-copy feature that testenv uses.
* Don't require rsync when running in podman. This is not necessary anymore since 92b3784 ("testenv: remove copy_ttcn3_hacks_dir").
* Combine the "if not testenv.args.binary_repo" code path with the "if not testenv.args.podman" code path, as --binary_repo can't be set without --podman.
ngap: Fix deviation in ASN1 from TS 38.413 version 17.5.0
I originally copied the ASN1 files from https://forge.etsi.org/rep/int/5g-core/ngap.git directory ttcn/LibNGAP/lib/asn1, commit fa43d01e202379a969e991a9454d9c6c6930b5b5.
Apparently one file contained a deviation from the 3GPP content and it was also fixed in ngap.git in 47e7239dd80f2f12a4cbcdd7977ca0a32356f3be.
I found out this problem when trying to use this ASN1 file to generate new libfftranscode, which then failed to properly decode DownlinkNASTransport due to the deviation.
Remove the part about caching logic of docker containers, as most testsuites don't use docker-playground anymore. The main reason for using commits here is that we have exact commits when doing regression testing.
Replace the verbose license header with the SPDX version while at it.
This commit adds initial support to issue a successful PDU Session Establishment procedure towards the 5GC, getting a ready-to-use GTPU session with IPv4 addr + TEID + UE IP address.
commit has to our nas.git fork is updated in order to have multiple fixes and improvements needed to have everything working fine.
GTPv1U and GTPv2C are 2 different protocols, working on 2 different ports, on 2 different sockets. Hence, it makes no sense to put them together, since some tests may want to use only the control-plane, others may want to use the user-plane, etc. Morevoer, GTPv1U can be used together with both GTPv2C anf GTPv1C.
This commit also fixes the confusion where TEIC and TEID were not properly separated in GTPv2_Emulation.
GTPv1U_Emulation: support multiple client ports per GTP1U_ConnHdlr
This feature is already present in GTP1U code of GTP_Emulation. That part of the code will be removed and ported to use GTPv1U_Emulation, so we need to also support this feature here.
* Move T_Guard to MTC, there's no need to have multiple of them (one per ConnHdlr). * Call f_init_handler() internally so it doesn't need to be called by each ConnHdlr test. * Change function attribute friend to private
testenv: Dockerfile: use debian archive for deb10 libssl pkg
As Debian 10 is EOL, this debian 10 package we are still using here to make mongodb work is getting removed from the mirrors. Currently some still have it, some have deleted it already. Use the archive instead.
When building programs from source, don't look only in $install_dir/bin, but also in $install_dir/usr/bin for the binaries. osmo-s1gw installs to usr/bin with recent changes and other programs may do this too.
The current NGAP and 5G auth code is now working fine, so disable debug logging. Keep it commented out so it can be re-enabled at any time if some related topic needs to be debugged (will eventually happen).
open5gs-dbctl tool is called in batches of multiple IMSIs to speed up setup, since each call takes fractions of seconds to complete. mongosh called by open5gs-dbctl actually uses quite a lot of CPU and RAM resources, hence limit the amount of parallel runs to a fair amount (eg. running the 256 of them in parallel froze my workstation with 16GB of RAM).
NGAP_Templates: Fixes and improvements for UEContextReleaseComplete
The existing templates for UEContextReleaseComplete were completelly wrong, probably due to copy-paste when introducing them. This commit fixes all those problems and allows passing optional parameters.
* procedureCode was wrong * Criticality of several fields was wrong * Type of resource list was wrong, and marked as mandatory while it was optional.
Remove the unused limit_section argument in testenv.osmo_dev.make(). The idea was to use osmo-dev to build programs where no packages are available when using --binary-packages, but this didn't work because when using --binary-packages, we must install all package dependencies from the binary repository (so testing nightly / latest use the expected library versions). Nowadays this use case is handled by podman_install.from_source_* functions without using osmo-dev.
Pass the targets we are about to build to osmo-dev's gen_makefile script. This has two advantages:
1) Check early if a target isn't known by the current osmo-dev version, displaying a useful error to the user instead of just failing during make later on:
ERROR: filter_projects_deps_targets: can't find project osmo-new-project in projects_deps!
[testenv] gen_makefile.py from osmo-dev failed! [testenv] Your osmo-dev.git clone might be outdated, try: [testenv] $ git -C /home/user/code/osmo-dev pull
2) Parsing the generated Makefile when running "make" after generating it doesn't cause a noticable delay anymore. On my machine (with many Osmocom git repos cloned in osmo-dev's src dir) it went from several seconds to instantly.
When running tests manually I oftentimes end up with hundreds of *.log files in testsuite directories. The present patch adds a convenience target for removing them.
This patch adds testcases for the silent-call feature:
* MSC_Tests.TC_silent_call_start_stop Test starting and stopping silent call via the VTY. * MSC_Tests.TC_silent_call_active_conn Test initiating a silent call while there's an active connection. The MSC is expected to be smart and reject such an attempt.
ngap: Add template for UEContextReleaseReq without PDU Session List
That's the only optional IE in the message. Add a separate template to be able to transmit with that IE set, similar to what's already done in m_n2_InitialContextSetupRequest_withPDUSessionList().
Allow building the podman image for another distribution. This was mostly implemented already, but due to the missing --distro argument for "./testenv.py init podman" it could not be used yet.
Make sure that the value for --distro is supported early on, instead of only checking it if --binary-repo is set while trying to add the binary repository.
Add an apt-pin to ensure packages from the Osmocom repositories get preferred over Debian's packages. I just ran into this with osmo-mgw, where we have 1.4.0 in osmocom:latest and Debian 13 has 1.14.0+dfsg1-2, which counts as higher version. This results in the wrong package being selected, and also in an error later on when trying to install related debug packages from our repository:
The following packages have unmet dependencies: osmo-mgw-dbgsym : Depends: osmo-mgw (= 1.14.0) but 1.14.0+dfsg1-2 is to be installed