All Projects → osmocom → docker-playground

osmocom / docker-playground

Licence: other
Osmocom dockerfiles, mostly for test automation; mirror of https://gitea.osmocom.org/osmocom/docker-playground

Programming Languages

shell
77523 projects
Dockerfile
14818 projects
Makefile
30231 projects
scheme
763 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to docker-playground

osmo-bts
Osmocom GSM Base Transceiver Station (BTS); mirrored from https://gitea.osmocom.org/cellular-infrastructure/osmo-bts
Stars: ✭ 51 (+240%)
Mutual labels:  gsm, cellular-network, telecommunications, 3gpp, osmocom
osmo-msc
Osmocom implementation of 3GPP Mobile Swtiching Centre (MSC); mirrored from https://gitea.osmocom.org/cellular-infrastructure/osmo-msc
Stars: ✭ 21 (+40%)
Mutual labels:  gsm, umts, cellular-network, 3gpp, osmocom
openbsc
Historical archive of ancient, unsupported old OpenBSC + OsmoNITB; Use OsmoBSC and OsmoMSC now! Mirrored from https://gitea.osmocom.org/cellular-infrastructure/openbsc
Stars: ✭ 52 (+246.67%)
Mutual labels:  gsm, 3gpp, osmocom
bts-ce-lite
BTS-CE-Lite (Boda-Lite) is a cross platform vendor and technology agnostic telecommunication network management desktop application
Stars: ✭ 24 (+60%)
Mutual labels:  gsm, umts
ergw
erGW - Erlang implementations of GGSN or P-GW
Stars: ✭ 72 (+380%)
Mutual labels:  umts, 3gpp
bromelia
A Python micro framework for building Diameter protocol applications.
Stars: ✭ 26 (+73.33%)
Mutual labels:  cellular-network, 3gpp
GSMSim
GSM Library for SIMCOM Modules on Arduino.
Stars: ✭ 99 (+560%)
Mutual labels:  gsm
sems-yeti
YETI application for SEMS core
Stars: ✭ 15 (+0%)
Mutual labels:  telecommunications
FreePhone
FreePhone es un proyecto de investigación sobre privacidad en dispositivos móviles. Con este repositorio pretendemos liberar toda la experiencia acumulada durante la creación de un smartphone casero.
Stars: ✭ 57 (+280%)
Mutual labels:  gsm
Lwgsm
Lightweight AT commands parser for SimCOM GSM modules
Stars: ✭ 201 (+1240%)
Mutual labels:  gsm
awesome-rtc
📡 A curated list of awesome Real Time Communications resources
Stars: ✭ 196 (+1206.67%)
Mutual labels:  telecommunications
SDR-Detector
GSM Scanner, RTL-SDR, StingWatch, Meteor
Stars: ✭ 56 (+273.33%)
Mutual labels:  gsm
node-gsm
📲 gsm modem module for node.js
Stars: ✭ 23 (+53.33%)
Mutual labels:  gsm
RFMap
RFMap - Radio Frequency Mapper
Stars: ✭ 23 (+53.33%)
Mutual labels:  gsm
simtrace2
Osmocom SIM card tracer, v2.0; mirror of https://gitea.osmocom.org/sim-card/simtrace2
Stars: ✭ 54 (+260%)
Mutual labels:  gsm
Osmocom Bb
Mirrored from git://git.osmocom.org/osmocom-bb
Stars: ✭ 222 (+1380%)
Mutual labels:  gsm
smsc
Flexible and scalable GSM Short Message Center (SMSC)
Stars: ✭ 23 (+53.33%)
Mutual labels:  gsm
ngic-rtc
NGIC-RTC is Control User Plane Separated (CUPS) architecture 3GPP TS23501 based implementation of EPC Service and Packet Gateway functions (SGW, PGW)
Stars: ✭ 54 (+260%)
Mutual labels:  3gpp
cellular-network-configs
Configurations for using LimeSDR hardware with Osmocom and OpenAirInterface etc.
Stars: ✭ 43 (+186.67%)
Mutual labels:  osmocom
3GPP-Overall-Architecture
3GPP Overall Architecture and Specifications including Release-17
Stars: ✭ 234 (+1460%)
Mutual labels:  3gpp

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="https://downloads.osmocom.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://downloads.osmocom.org/packages/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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].