aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorOliver Smith <osmith@sysmocom.de>2018-10-11 14:54:57 +0200
committerOliver Smith <osmith@sysmocom.de>2018-10-26 12:11:08 +0200
commitfb87e1b19b024feac57d7995a1c232b81cacbf39 (patch)
treef1a8ddf7d7c88527c45ce4ae19238eb0fde22354 /README.md
parent96a0c5f73afce09eca1a1407ecd7799b3fd2634b (diff)
Remove top-level Makefile, explain why in README
Obsoleted by docker_images_require(). The top-level Makefile had the following drawbacks: * it was not maintained: many targets were missing, and some of the existing ones did not build anymore * make targets have the same names as the folders, so if they are not listed in the Makefile, it will assume that the target has been built already (prone to making mistakes) Extend README.md to describe how to run tests, container caching, how container dependencies are resolved now and the reasoning for doing it that way instead of using a top-level Makefile. Related: OS#3268 Change-Id: Id18a9a7a70f85127e6f6c9447d71764018bdb4ff
Diffstat (limited to 'README.md')
-rw-r--r--README.md71
1 files changed, 69 insertions, 2 deletions
diff --git a/README.md b/README.md
index bb354c0..adb6420 100644
--- a/README.md
+++ b/README.md
@@ -5,5 +5,72 @@ This repository contains some humble attempts at creating some Docker
containers + related stacks around Osmocom. So far, the main focus is
test automation.
-See http://laforge.gnumonks.org/blog/20170503-docker-overhyped/ for
-related rambling on why this doesn't work as well as one would want.
+## Running a testsuite
+All testsuite folders start with `ttcn3` or `nplab`. Run the following
+to build/update all required containers 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.
+* `NO_DOCKER_IMAGE_BUILD`: when set to `1`, it won't try to update the
+ containers (see "caching" below)
+
+## 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-jessie-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`:
+
+```shell
+. ../jenkins-common.sh
+IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
+docker_images_require \
+ "debian-jessie-build" \
+ "osmo-stp-$IMAGE_SUFFIX" \
+ "osmo-bsc-$IMAGE_SUFFIX" \
+ "osmo-bts-$IMAGE_SUFFIX" \
+ "debian-stretch-titan" \
+ "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](https://osmocom.org/issues/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`.
+
+## See also
+* [Overhyped Docker](http://laforge.gnumonks.org/blog/20170503-docker-overhyped/)
+ for related rambling on why this doesn't work as well as one would
+ want.
+* [Osmocom wiki: Titan TTCN3 Testsuites](https://osmocom.org/projects/cellular-infrastructure/wiki/Titan_TTCN3_Testsuites)