This is a more realistic scenario (race condition) that reproduces an assertion failure in osmo-msc (OS#6756). We already do have TC_mo_ussd_evil_ms reproducing the problem, but this scenario is unrealistic when using a "normal" (not "evil") MS/UE.
library/MGCP_Emulation: Fix Dynamic test case error returning unbound value
As spotted today while running HNBGW_Tests.TC_rab_assignment, probably after upgrade to titan 11: 17:54:36.223786 1570 MGCP_Emulation.ttcn:241 Dynamic test case error: Copying an unbound charstring value.
The error happened because in that failure path the component running the function was not stopped, and hence an unset variable was returned. Hence, make sure we tear everything down (including component going through the failure path).
deps/nas.git already has some Auth related functionaltities to calculate XRES*, but I couldn't get them to generate proper output. Furthermore, using them directly would include a lot of churn we don't want: * ttcn: Otherwise ttcn/Lib_NG_NAS/LIB_NG_NAS_Functions.ttcn brings in tons of dependencies about Emulation stuff which is not interesting for us. * .cc: We want to implement our own low level functions using our eclipse Titan API, as well as our own C lib dependencies (because some code for those dependencies is not really available in the repo).
Hence, instead use our own milenage.c implementation imported from libosmocore (actually from a slightly modified self-contained copy we already ported to some development branch of asterisk VoLTE project).
With this patch it is already possible to detect SQN Out-of-sync and answer with an Auth Failure, then get a new Auth Req from network and properly answer with an Auth Resp which the network likes and hence answers with a Security Mode Command.
NGAP_Emulation: Fix match on DownlinkNASTransport with different list of IEs
The existing receive templates match only a given set of parameters. Some of them are optional, so they wouldn't match the template if added. Match based on procedureCode instead.
Add the minimum required eclipse-titan version to each testenv.cfg. This is in preparation for a future patch that will allow using a different eclipse-titan version, depending on titan_min in the config and a new --titan-version argument.
Supporting this is desired because: * We can't simply upgrade from 9.0.0 to 11.1.0 as there are regressions with some of the testsuites, but we need 11.1.0 for at least one new testsuite. * By quickly switching between the versions we can check for regressions easily.
Move testenv.testsuite.ttcn3_hacks_dir to testenv.ttcn3_hacks_dir. It makes more sense there as the path to osmo-ttcn3-hacks is used by many modules, not just the testenv.testsuite module, and it prevents a cyclic import with future patches when testenv.testsuite will import testenv.testenv_cfg.
Install eclipse-titan versions 9.0.0 and 11.1.0 into /opt/eclipse-titan-$version inside the podman container by using the new optdir packages. Choose the appropriate version by setting related environment variables. Use the version in $PATH on the host, unless /opt/eclipse-titan-$version is also present on the host system.
Add a new --titan-version argument to explicitly set a version to use when running a testsuite.
Rewrite the version check code to take titan_min, --titan-version and the host version (if not using optdir) into account.
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.