Osmocom docker containers
Go to file
Oliver Smith 8c04ad26ac Don't run "dpkg --add-architecture i386" on ARM
Building debian-stretch-jenkins on ARM currently results in a few
libraries getting installed for the i386 architecture. This results in
the following build failures for master-osmo-trx and master-osmo-pcu:

  checking for LIBGNUTLS... no
  configure: error: Package requirements (gnutls >= 2.12.0) were not met:

  No package 'gnutls' found

It is weird that we are only seeing this now, the dpkg-line has been in
debian-stretch-jenkins since the Dockerfile was added to osmo-ci four
years ago in Icb0406f96b0c18e77be51ad8317c2668fb23a45e. I'm also
wondering why it was added in the first place, and if we need it
anymore. In any case, running this on anything but x86_64 does not make
sense, so disable it there.

Change-Id: I8d890b7ebc7b99a4c79779709d1e56e0a5a6d4b9
2021-06-17 11:46:01 +02:00
alpine-build introduce 'REGISTRY' argument to all Dockerfiles 2020-11-02 17:02:26 +01:00
alpine-lighttpd Add Dockerfile for alpine Linux with lighttpd 2017-10-15 14:37:41 +00:00
arm-none-eabi-gcc-4.8.2 arm-none-eabi-gcc-4.8.2: install missing packages 2021-05-03 02:15:20 +02:00
bind9 Makefile support for our production infrastructure containers 2018-06-03 16:11:26 +00:00
centos8-build make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
centos8-obs-latest centos8-obs-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
centos8-repo-install-test centos8-repo-install-test: Upstream requires 'powertools' not 'PowerTools' 2020-12-09 17:09:32 +01:00
cgit cgit: Increase fastcgi timeout from default 60s to 120s 2020-10-03 12:43:20 +02:00
common Share a single instance of Release.key between all images 2021-03-10 18:47:03 +01:00
debian-buster-build Make respawn.sh a common part of *-build/-obs images 2021-03-10 18:46:29 +01:00
debian-buster-erlang make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
debian-buster-jenkins Don't run "dpkg --add-architecture i386" on ARM 2021-06-17 11:46:01 +02:00
debian-buster-simtrace2 make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
debian-jessie-build Make respawn.sh a common part of *-build/-obs images 2021-03-10 18:46:29 +01:00
debian-jessie-buildslave Don't run "dpkg --add-architecture i386" on ARM 2021-06-17 11:46:01 +02:00
debian-jessie-buildslave-st Fix "'laforge/debian-jessie-build' not found" 2018-09-06 15:17:06 +02:00
debian-jessie-osmocom make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
debian-sid-build Make respawn.sh a common part of *-build/-obs images 2021-03-10 18:46:29 +01:00
debian-stretch-build make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
debian-stretch-build-dist Share a single instance of Release.key between all images 2021-03-10 18:47:03 +01:00
debian-stretch-jenkins Don't run "dpkg --add-architecture i386" on ARM 2021-06-17 11:46:01 +02:00
debian-stretch-obs-latest make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
debian-stretch-titan make: add OSMOCOM_REPO_TESTSUITE_MIRROR 2021-05-04 09:30:48 +02:00
debian9-repo-install-test rename {debian => debian9}-repo-install-test 2021-01-25 09:24:03 +00:00
debian10-obs-submit debian10-obs-submit: new container 2021-04-29 13:09:05 +00:00
debian10-repo-install-test debian10-repo-install-test: new container 2021-01-25 09:24:03 +00:00
fpga-build fpga-build: don't write path to /etc/environment 2021-01-13 15:56:17 +01:00
gerrit gerrit: update to 3.2.7 for security reasons 2021-02-15 12:29:22 +01:00
git-daemon git-deamon: Make sure to create the git-daemon user 2018-07-21 09:38:52 +02:00
gitolite Makefile support for our production infrastructure containers 2018-06-03 16:11:26 +00:00
gr-gsm-master introduce 'REGISTRY' argument to all Dockerfiles 2020-11-02 17:02:26 +01:00
make make: add OSMOCOM_REPO_TESTSUITE_MIRROR 2021-05-04 09:30:48 +02:00
nplab-m3ua-test remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
nplab-sua-test remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
open5gs-master introduce 'REGISTRY' argument to all Dockerfiles 2020-11-02 17:02:26 +01:00
osmo-bsc-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-bsc-master */osmo-bsc.cfg: remove obsolete no-op parameters 2021-03-09 13:50:41 +01:00
osmo-bts-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-bts-master remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
osmo-cbc-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-cbc-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-cn-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-dev-on-debian-sid add debian-sid-build, osmo-dev-on-debian-sid 2017-12-06 01:45:42 +01:00
osmo-gbproxy-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-gbproxy-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-gerrit-libosmo make: use $(nproc) instead of hard-coded number of cores 2020-07-13 02:52:10 +07:00
osmo-ggsn-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-ggsn-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-gsm-tester osmo-gsm-tester: Update srsLTE references to srsRAN 2021-05-12 18:23:10 +02:00
osmo-hlr-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-hlr-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-hnbgw-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-hnbgw-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-mgw-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-mgw-master remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
osmo-msc-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-msc-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-nitb-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-nitb-master remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
osmo-ns-master Add ttcn3-ns-test-fr container 2021-03-31 10:17:14 +02:00
osmo-pcap-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-pcap-master Add osmo-pcap-master 2021-04-25 13:11:03 +02:00
osmo-pcu-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-pcu-master Make respawn.sh a common part of *-build/-obs images 2021-03-10 18:46:29 +01:00
osmo-ran make: add OSMOCOM_REPO_PATH 2021-05-04 09:30:48 +02:00
osmo-remsim-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-remsim-master osmo-remsim-master/Dockerfile: add missing libcsv-devel dependency 2021-03-09 10:34:48 +00:00
osmo-sgsn-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-sgsn-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-sip-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-sip-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-smlc-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-smlc-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmo-stp-latest osmo-*-latest: use OSMOCOM_REPO_VERSION 2021-05-04 09:30:48 +02:00
osmo-stp-master remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
osmo-uecups-master osmo-*-master: move common code to *-build 2021-03-04 14:45:51 +01:00
osmocom-bb-host-master make: add OSMOCOM_REPO_TESTSUITE_MIRROR 2021-05-04 09:30:48 +02:00
patchwork Makefile support for our production infrastructure containers 2018-06-03 16:11:26 +00:00
public-inbox add "public-inbox" Dockerfile + Makefiel 2018-10-07 16:27:31 +00:00
redmine redmine: Make changeset keywords work with OS# annotation 2021-02-10 16:57:26 +01:00
scripts kernel-test: verify REMOTE_NAME and URL 2021-03-01 08:50:57 +01:00
sctp-test Switch all osmo-*-master and ttcn3-*-test from jessie to stretch 2019-03-30 09:56:36 +00:00
sigtran-tests Switch all osmo-*-master and ttcn3-*-test from jessie to stretch 2019-03-30 09:56:36 +00:00
systemd Introduce osmo-ran docker image set up 2020-12-18 11:45:33 +00:00
tmp add non-working yml file with service/stack description 2017-05-03 20:50:12 +02:00
ttcn3-bsc-test remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
ttcn3-bsc-test-sccplite symlinks: ttcn3-bsc-test-sccplite 2018-10-26 10:19:05 +02:00
ttcn3-bsc-test-vamos add ttcn3-bsc-test-vamos 2021-06-05 20:33:22 +00:00
ttcn3-bscnat-test */jenkins.sh: set -e after setting clean up trap 2021-02-26 09:32:34 +01:00
ttcn3-bts-test ttcn3-bts-test/BTS_Tests.cfg: execute VAMOS specific test cases 2021-06-03 05:01:20 +02:00
ttcn3-cbc-test ttcn3-cbc-test: fix copy+paste error regarding osmo-stp.cfg 2021-02-28 11:15:18 +01:00
ttcn3-fr-test fr: kill the frnet container before trying to 'rm' it 2021-03-16 16:23:51 +00:00
ttcn3-gbproxy-test ttcn3-gbproxy-test*: Update gbproxy NS timers 2021-05-28 18:48:55 +02:00
ttcn3-gbproxy-test-fr ttcn3-gbproxy-test*: Update gbproxy NS timers 2021-05-28 18:48:55 +02:00
ttcn3-ggsn-test kernel-test: don't try to use KVM if not available 2021-02-26 16:18:26 +00:00
ttcn3-hlr-test ttcn3-hlr: Drop uneeded module param HLR_Tests.mp_hlr_supports_dgsm 2021-02-26 13:04:07 +01:00
ttcn3-mgw-test osmo-mgw: Use DSCP value in valid range (<= 63) 2021-04-28 19:28:36 +02:00
ttcn3-msc-test remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
ttcn3-nitb-sysinfo */jenkins.sh: set -e after setting clean up trap 2021-02-26 09:32:34 +01:00
ttcn3-ns-test Add ttcn3-ns-test-fr container 2021-03-31 10:17:14 +02:00
ttcn3-ns-test-fr Add ttcn3-ns-test-fr container 2021-03-31 10:17:14 +02:00
ttcn3-ns-test-sns Add ttcn3-ns-test-sns container 2021-03-30 22:38:45 +02:00
ttcn3-pcap-client-test Add ttcn3-pcap-client-test 2021-04-25 13:11:03 +02:00
ttcn3-pcu-test jenkins-common.sh: add image_suffix_is_latest 2021-05-21 16:24:58 +02:00
ttcn3-pcu-test-sns PCU: Differentiate between tests with classic and SNS Gb dialects 2019-03-14 21:38:44 +01:00
ttcn3-remsim-test */jenkins.sh: set -e after setting clean up trap 2021-02-26 09:32:34 +01:00
ttcn3-sccp-test */jenkins.sh: set -e after setting clean up trap 2021-02-26 09:32:34 +01:00
ttcn3-sgsn-test jenkins-common.sh: add image_suffix_is_latest 2021-05-21 16:24:58 +02:00
ttcn3-sip-test remove deprecated 'logging level all everything' from configs 2021-04-25 13:11:03 +02:00
ttcn3-smlc-test */jenkins.sh: set -e after setting clean up trap 2021-02-26 09:32:34 +01:00
ttcn3-stp-test jenkins-common.sh: add image_suffix_is_latest 2021-05-21 16:24:58 +02:00
ubuntu-zesty-build introduce 'REGISTRY' argument to all Dockerfiles 2020-11-02 17:02:26 +01:00
.gitignore Make respawn.sh a common part of *-build/-obs images 2021-03-10 18:46:29 +01:00
.gitreview add .gitreview 2018-04-12 09:20:24 +00:00
README.md jenkins-common.sh: support 2021q1 feed 2021-05-04 12:20:05 +02:00
jenkins-common.sh jenkins-common.sh: add image_suffix_is_latest 2021-05-21 16:24:58 +02:00
osmo-bisect.sh Add script to bisect test failures with ttcn3 and docker 2019-04-26 12:07:15 +02:00

README.md

Osmocom docker playground

This repository contains some humble attempts at creating some Docker containers + related stacks around Osmocom. So far, the main focus is test automation.

Running a testsuite

All testsuite folders start with ttcn3 or nplab. Run the following to build/update all required containers from the "master" branch and start a specific testsuite:

$ cd ttcn3-mgw-test
$ ./jenkins.sh

Environment variables:

  • IMAGE_SUFFIX: the version of the Osmocom stack to run the testsuite against. Default is master, set this to latest to test the last stable releases.
  • OSMO_TTCN3_BRANCH: osmo-ttcn3-hacks.git branch, which will be used when building a ttcn3-* docker image. Defaults to master.
  • OSMO_BSC_BRANCH, OSMO_MSC_BRANCH, ...: branch of the appropriate Osmocom project. Defaults to master.
  • NO_DOCKER_IMAGE_BUILD: when set to 1, it won't try to update the containers (see "caching" below)

More examples

latest (debian):

$ export IMAGE_SUFFIX="latest"
$ cd ttcn3-mgw-test
$ ./jenkins.sh

latest-centos8:

$ export IMAGE_SUFFIX="latest-centos8"
$ cd ttcn3-mgw-test
$ ./jenkins.sh

2021q1-centos8:

export OSMOCOM_REPO_TESTSUITE_MIRROR="http://download.opensuse.org"
export OSMOCOM_REPO_MIRROR="https://downloads.osmocom.org"
export OSMOCOM_REPO_PATH="osmo-maintained"
export OSMOCOM_REPO_VERSION="2021q1"
export IMAGE_SUFFIX="2021q1-centos8"
$ cd ttcn3-mgw-test
$ ./jenkins.sh

Kernel test

OsmoGGSN can be configured to either run completely in userspace, or to use the GTP-U kernel module. To test the kernel module, OsmoGGSN and the kernel module will run with a Linux kernel (either the pre-built one from Debian, or a custom built one) in QEMU inside docker. As of writing, ttcn3-ggsn-test is the only testsuite where it makes sense to test kernel modules. But the same environment variables could be used for other testsuites in the future.

Environment variables:

  • KERNEL_TEST: set to 1 to run the SUT in QEMU
  • KERNEL_TEST_KVM: set to 0 to disable KVM acceleration
  • KERNEL_BUILD: set to 1 to build the kernel instead of using the pre-built one
  • KERNEL_REMOTE_NAME: git remote name (to add multiple git repositories in the same local linux clone, default: net-next)
  • KERNEL_URL: git remote url (default: net-next.git on kernel.org)
  • KERNEL_BRANCH branch to checkout (default: master)

The OBS repository mirror consists of ${OSMOCOM_REPO_MIRROR}/${OSMOCOM_REPO_PATH}/${OSMOCOM_REPO_VERSION}, e.g. https://download.opensuse.org/repositories/network:/osmocom:/latest/.

Creating kernel config fragments

For the kernel tests, we are storing kernel config fragments in the git repository instead of full kernel configs. Generate them as follows:

$ cd _cache/linux
$ cp custom.config .config
$ make olddefconfig
$ cp .config custom-updated.config
$ make defconfig  # config to which to diff
$ scripts/diffconfig -m .config custom-updated.config > fragment.config

Verify that it was done right:

$ make defconfig
$ scripts/kconfig/merge_config.sh -m .config fragment.config
$ make olddefconfig
$ diff .config custom-updated.config  # should be the same

Building containers manually

Most folders in this repository contain a Dockerfile. Build a docker container with the same name as the folder like this:

$ cd debian-stretch-build
$ make

Caching

All folders named osmo-*-latest and osmo-*-master build the latest stable or most recent commit from master of the corresponding Osmocom program's git repository. When you have built it already, running make will only do a small HTTP request to check if the sources are outdated and skip the build in case it is still up-to-date.

Dependencies

Folders that don't have a jenkins.sh usually only depend on the container that is specified in the FROM line of their Dockerfile. Testsuites depend on multiple containers, they are defined on top of each jenkins.sh:

. ../jenkins-common.sh
IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
docker_images_require \
	"osmo-stp-$IMAGE_SUFFIX" \
	"osmo-bsc-$IMAGE_SUFFIX" \
	"osmo-bts-$IMAGE_SUFFIX" \
	"ttcn3-bsc-test"

Reasoning for this implementation

Before having the docker_images_require lines, there used to be a top-level Makefile for resolving dependencies between the containers. But it was prone to mistakes: when new folders in the repository were added without related targets in the Makefile, make would always assume that the targets where the always existing folders and therefore never build the containers.

In order to implement testing latest in addition to master (OS#3268), it would have been necessary to add further complexity to the Makefile. Instead it was decided to scrap the file, and just keep the short list of dependencies right above where they would be needed in the jenkins.sh.

Obtaining gdb backtrace from crash

If for instance TTCN3 test is producing a crash on a program running in docker, eg. osmo-msc, it is desirable to get a full crash report. This section describes how to do so.

First, open osmo-$program/Dockerfile and add lines to install gdb plus $program dependency debug packages. For instance:

+RUN    apt-get install -y --no-install-recommends \
+               gdb \
+               libosmocore-dbg libosmo-abis-dbg libosmo-netif-dbg libosmo-sigtran-dbg osmo-msc-dbg && \
+               apt-get clean

In same Dockerfile file, modify configure to build with debug symbols enabled and other interesting options, such as --enable-sanitize:

-       ./configure --enable-smpp --enable-iu && \
+       export CPPFLAGS="-g -O0 -fno-omit-frame-pointer" && \
+       export CFLAGS="-g -O0 -fno-omit-frame-pointer" && \
+       export CXXFLAGS="-g -O0 -fno-omit-frame-pointer" && \
+       ./configure --enable-smpp --enable-iu --enable-sanitize && \

Finally open the script you use to run the program (for instance ttcn3-$program-master/jenkins.sh), and modify it to launch the process using gdb, and to print a full backtrace when control returns to gdb (when the process crashes):

-/bin/sh -c "osmo-msc -c /data/osmo-msc.cfg >>/data/osmo-msc.log 2>&1"
+/bin/sh -c "gdb -ex 'run' -ex 'bt full' --arg osmo-msc -c /data/osmo-msc.cfg >>/data/osmo-msc.log 2>&1"

See also