Commit Graph

11 Commits

Author SHA1 Message Date
Eric Wild ca27dffea7 clean up the net and attached containers to ensure reliable test starts
We can't create the net if it exists, and it can't be removed until all
attached containers are dead, so ensure this is the case upon net
creation. This fixes test failures due to stale nets and half-killed
test runs.

Change-Id: Id6d13b233ebfd808d8dfe83b6d1d1ba20c3392c8
2019-07-05 15:16:17 +02:00
Harald Welte b40355a588 jenkins-common.sh: Don't rebuild debian-stretch-build during fix_perms
When fixing the permissions at the end of a test run, it really doesn't
matter if we're running a current debian-stretch-build image, or if we
are using an ancient one.  All we need is a 'chmod' binary.

Change-Id: Ib008ee72f40aeefb307c0ba74a57b70daae9d07b
Related: OS#4060
2019-06-13 11:46:34 +02:00
Oliver Smith a8be3ff52f jenkins-common.sh: pull upstream base images
Prevent building docker images on top of outdated Debian images, where
the package download feeds have been disabled. Use 'docker build --pull'
instead of 'docker build', whenever the "FROM" line in the Dockerfile
does not contain '$USER' (meaning this is an upstream image).

Checking the FROM line is necessary, as downloading '$USER' images will
fail (we never upload those).

Related: OS#3869
Change-Id: I1076bbb7d77bdc99f5d60d641c09ce965fb9dfc6
2019-04-02 11:38:26 +02:00
Harald Welte 7c53c9e60d Switch all osmo-*-master and ttcn3-*-test from jessie to stretch
Jessie will be EOL in June 2019, let's make the switch to stretch
before that.

Change-Id: I37a534d07081f3d321869c86d49d03171c8da0c6
2019-03-30 09:56:36 +00:00
Daniel Willmann 4cc752799c Fix permissions when collecting logs
Use the debian-jessie-build container to ensure all files under
${VOL_BASE_DIR} are readable.
Call this directly from collect_logs so we handle all ttcn3 jobs.

Fixes: OS#3800
Change-Id: I124c554eee69ec5586547d3c96b8ec571e0653a7
2019-02-22 18:52:59 +01:00
Oliver Smith c9fcc6e8a5 jenkins-common.sh: exit if image fails to build
docker_images_require() must fail when a new image can not be built,
even if an old image already exists.

We have this situation in a lot of the -latest tests right now, which
makes it harder to find the actual error.

Note that we can't simply use #!/bin/sh -e in all the jenkins.sh
scripts that source jenkins_common.sh, because they must be able to
clean up the docker containers on failure. So they can't abort
somewhere in the middle of the scripts. We could rewrite them to do the
clean up in a trap, but this should be done in a separate commit.

Related: OS#3767
Change-Id: I7039089457b62b8798a79c5efd62bd91622986d3
2019-01-25 10:35:01 +01:00
Oliver Smith a89aa7f803 jenkins-common.sh: add docker_images_require()
This new function can be used on top of each *-test/jenkins.sh to
automatically build the required Docker images before starting a
testsuite.

The top-level Makefile should also be able to build all Docker images
on which a job depends. But in that Makefile the list of dependencies
can not be specified dynamically, as it will be necessary for OS#3268:
ttcn3-mgw-test may depend on osmo-mgw-latest or on osmo-mgw-master.

This will be used by Idbb708ab16cb71bab5069127945b63388222369e.

Related: OS#3268
Change-Id: I0afdf3400282634fca9b31d57eaeedd6b5c28aa1
2018-10-26 08:11:44 +00:00
Neels Hofmeyr 18392ee604 jenkins.sh: stay in the jenkins workspace, not in /tmp
On jenkins, place all logs and manage docker volumes in the workspace instead
of a /tmp/* dir. Use $WORKSPACE/logs as docker volume base to begin with, thus
there needs to be no copy from /tmp to $WORKSPACE/logs.

On non-jenkins runs, place all in a /tmp/* dir still, but also skip copying of
the logs: just have a /tmp/logs symlink to the last tmpdir.

Change-Id: I8cf6014725ae8ba602be5f3ec31dfb8e49ff993e
2018-05-02 09:36:57 +00:00
Neels Hofmeyr 2f61bf81e9 jenkins.sh: have one common function to collect logs
To remove code dup and prepare a change to where logs are written, add
collect_logs() to jenkins_common.sh and call that from each jenkins.sh after
the tests are done.

The 'rm -rf' is already done before a test starts. No need to do that again
after each test.

Change-Id: I5d8472ec36b07c828685b1bd7718e31392d168a3
2018-04-24 13:46:05 +00:00
Neels Hofmeyr 9f5131ab9d jenkins.sh: drop obsolete VOL_SUITE_DIR
Subdirs' jenkins.sh scripts create their own subdirs without exception.

Change-Id: Iaf428cde0f4d3efbdb31d7af434aa82425c1bc5f
2018-04-24 13:46:03 +00:00
Harald Welte d770629280 jenkins: Add shared jenkins-common.sh
the common script contains some copy+pasted parts between the different
jobs.
2018-02-06 20:20:49 +00:00