In 2017, Osmocom started to create extensive tests suites for the Cellular Network Infrastructure elements. Those suites are written in the TTCN-3 programming language and use the compiler and executor of the Eclipse_TITAN project. There are special cases, but in general, the idea is to test one component (e.g. osmo-mgw) independently.

As TITAN can only generate and parse ASN.1 BER encoding, but the Iu-CS, Iu-PS and Iuh interfaces are using APER encoding, sysmocom is providing a proprietary transcoding library called libfftranscode. Debian9 amd64 packages are available from https://ftp.osmocom.org/binaries/libfftranscode/

We don't like to depend on proprietary software, but given that there is no FOSS ASN.1 compiler that can parse all ASN.1 constructs of the RANAP/RUA/HNBAP specs and parse + generate both BER and APER, this is the lesser evil. Note that the dependency to this proprietary library is only required for the TTCN3 test suite and not a runtime dependency of any of the Osmocom programs itself.

This is the much easier way to run the test suite. No manual configuration of Osmocom programs or the test suite are required. Both the Osmocom program (Implementation Under Test) as well as the test suite are packaged as docker containers, which are then executed next to each other using a docker network with the "right" addresses between IUT and testsuite.

Also, using this setup you will be guaranteed to run in the exact same environment as the automatically-executed tests on jenkins.osmocom.org, i.e. your results should be exactly identical, without any differences introduced by your runtime environment, whether specific library versions or intentional or inadvertent configuration differences.

Make sure you have docker-ce installed (not to be confused with the possibly outdated version that may be shipped in your distribution's repositories). Check that the version string contains -ce as follows:

$ docker -v
Docker version 18.06.1-ce, build e68fc7a

Next, add yourself to the docker group, log off and on again, and verify that you can use docker with your user:

This is the most complicated bit to set-up, as you will have to run the respective Osmocom Program (Implementation Under Test) in the right configuration with all the IP addresses, port numbers, config file, etc. exactly like it's expected by the test suite.

You will need a deeper understanding about how the test suite works, and what its requirement are. Oftentimes looking at how it's done in the Docker scripts is helpful.

As stated above certain parts of the testsuite require libfftranscode! If the build fails this might be the issue.

While you can try to use any version of Eclipse TITAN, for the best possible experience it's a good idea to use the same version as Osmocom uses in the dockerized environment. As can be seen in the Dockerfile, this (currently) points to the eclipse-titan package from the Latest_Builds on Debian 9.0":.

Start the component that is about to get tested with the config that the testsuite expects. Again, with mgw as example. If you don't have a suitable config file, use the one from Jenkins and replace all IPs with 127.0.0.1.

Running whole testsuites may take a long time. If you only want to run one specific test, or a subset of tests, open up the _*Test.cfg file in the folder of the testsuite and edit the [EXECUTE] section. For example, in MGCP_Test.cfg from the mgw folder it looks like the following:

The only line that is not commented out is MGCP_Test.control. This *.control line will cause all tests to be executed. So comment this line out, and then activate one of the lines of which you would like to execute the tests (see the example below). Then execute the testsuite as usually, and it will skip all commented out tests.