Commit Graph

52 Commits

Author SHA1 Message Date
Vadim Yanitskiy 78fde8b936 ttcn3-*-test: set OSMO_SUT_{HOST,PORT} for more testsuites
Let's also retrieve talloc reports for these testsuites.

Change-Id: Iaa94dd200fdb98962b784cb507c9995096232dc9
2024-03-25 17:35:13 +00:00
Oliver Smith 6a8118dad8 ttcn3: use debian-bookworm-titan
Related: OS#6057
Change-Id: I2017dd3888670c475b96e692d911a433484f3df9
2023-08-14 09:28:24 +00:00
Pau Espin 666488c8e4 ttcn3-*: Update test setup after Osmocom CNI release 202302
Change-Id: If34b043a55177e6c0d1be3949fc2a2682258cc84
2023-02-08 12:36:27 +01:00
Oliver Smith f997b4e771 network_create: find free subnet automatically
Try multiple subnet numbers until successfully creating a network. This
way we can run the same ttcn3 testsuite multiple times in parallel
without conflicts (e.g. once against latest, once against nightly). Also
we don't need to make sure each new testsuite has a unique subnet
number anymore.

I've considered also adjusting network_bridge_create, but that gets used
exclusively by osmo-ran/jenkins.sh, a script which we don't actually run
in jenkins. It seems that in this script it makes more sense to not get
a random subnet number.

Related: OS#5802
Change-Id: I57152b08ef0f38e17e7019a8df032189b03f56cf
2023-01-16 15:19:29 +00:00
Pau Espin 5761378906 ttcn3-mgw: Increase number of enpoints in osmo-mgw.cfg
This is needed by test TC_crcx_osmux_257

Related: osmo-ttcn3-hacks.git Change-Id I74e6c760e076fe2547b6297a54524255fb8b
Related: SYS#5987
Change-Id: I14e3abdf63c585e4518b0c0a61dbc57e6710a998
2022-10-07 13:25:24 +02:00
Pau Espin 8bf8057668 ttcn3-mgw: jenkins.sh Fix centos tests
The sed lines dropping the new configs must be applied to any non-master
run.

Fixes: e077fec684
Change-Id: I369bb61f3979bd9118fad17c3d202253411ba14b
2022-10-07 13:25:24 +02:00
Pau Espin e077fec684 ttcn3-mgw: Set osmux bind-ip(-v6) VTY configs
Until now we forgot to properly configure the osmux socket local ip, but
that was fine because 0.0.0.0 was taken as a default.
With addition of IPv6, this changed, and the socket is not bound unless
an IP address is set (to allow conditional use of IPv4, IPv6 or both).

Depends: osmo-mgw.git Change-Id I446cd7da217e9f4a74995d7784ae55dcc60a29b7
Change-Id: Ib7e9428a10238fae395a1707d6034dc5c97b9024
2022-10-05 08:45:45 +00:00
Pau Espin a719a8db61 Use gerrit as osmo-ttcn3-hacks.git git remote
Other remotes are mirrors of gerrit one, which means there's some delay
between pushing some ref to the gerrit remote and having them available
in the mirrors.
Hence, it becomes annoying while developing and new stuff to test is
pushed. Let's simply use gerrit since it's the master remote.

Change-Id: Ic87c196f8b91a3a3e6ddde2cca36482ce7070df7
2022-09-20 12:09:32 +02:00
Oliver Smith 38f7fcb265 */.release: remove
These files are in .gitignore and get generated at the end of running
'make'. Remove them to have less cluttered 'git grep' output.

Change-Id: Ie5bf05220359ac0941f62cc86ed843363548784a
2022-07-06 12:36:26 +02:00
Harald Welte 0f74af6083 titan: move from debian-stetch-titan to debian-bullseye-titan
So far we were executing all our TTCN-3  tests from a container
image with Debian stretch (9) plus a custom more recent eclipse-titan
package from the osmocom feed.

Let's update the container base OS from stretch (9) to bullseye (11)
while using the same packaged eclipse-titan version (8.0.0) for running
the tests.  So this should be a low-risk change, as titan runtime
remains identical.

I've executed all test suites locally and couldn't see any regressions.

Related: OS#4969
Change-Id: Ib3bdfa3bec8f8ef42c55ca61cdee8fbca923874f
2021-12-16 11:40:17 +01:00
Oliver Smith 305ce55b74 ttcn3: write Osmocom repository to configs
Write a line like 'Misc_Helpers.mp_osmo_repo := "nightly"' into the
TTCN-3 config file (e.g. BSC_Tests.cfg), before starting the testsuite.
This allows executing different code paths in the tests based on the
repository.

Related: OS#5327
Change-Id: Ic06532f7a67e59458652c5cf4c8f6fee8113e703
2021-11-26 18:12:50 +01:00
Philipp Maier f31b6adb99 osmo-mgw.cfg: configure control interface
The configuration file of osmo-mgw lacks the control interface
configuration.

Change-Id: I309db472e22d0258bf31a4f5865a89364ed7af2c
2021-08-20 11:14:38 +02:00
Philipp Maier a102bfef54 osmo-mgw: add missing statsd configuration
The recently added test TC_dlcx_wildcarded depends on statsd information
from osmo-mgw but in the osmo-mgw configuration no statsd is configured.

Change-Id: Ic4f0c57f56fe400bdb9a1948917f0eeb1d7e7427
Related: SYS#5535
2021-08-12 15:44:02 +00:00
Philipp Maier 5c3ad38f83 MGCP_Test: set STATSVTY.CTRL_HOSTNAME
The the following patch I61e23e264bc85eb36d07431c7839fb445c110947
introduces the stats interface on the MGCP_Test testsuite. This means
that STATSVTY.CTRL_HOSTNAME must be set up correctly, otherwise all
testcases will fail.

Change-Id: I693cc17dbf6836e7a74b34111671b6e589744a63
Related: SYS#5535
2021-08-06 14:11:23 +00:00
Harald Welte d883114318 osmo-mgw: Use DSCP value in valid range (<= 63)
DSCP is a 6-bit value, it cannot be 184.

Change-Id: I72133e6ac5674577595f9d98e3fc68f8d741819c
2021-04-28 19:28:36 +02:00
Oliver Smith 033c6ab1be */jenkins.sh: set -e after setting clean up trap
Abort the script and trigger the clean up script, whenever any of the
commands below to prepare the testsuite are failing. This saves time
with figuring out why suddenly all or most tests are failing, and avoids
running the entire testsuite on jenkins if it's obviously not going to
work.

Related: OS#3208
Change-Id: Ie68da2affda8c96b3a515a857a921a05f1bf8ef7
2021-02-26 09:32:34 +01:00
Oliver Smith 12b961942a jenkins-common.sh: add common clean up trap
Add set_clean_up_trap() in jenkins-common.sh and run it at the beginning
of the jenkins.sh files. Move the common clean up code from the end of
every jenkins.sh file into clean_up_common(), which gets called by the
trap. Add a custom clean_up() function to those jenkins.sh files that
need additional clean up.

Replace explicit container stop commands (for containers attached to the
docker network) with one call to network_clean() in clean_up_common(). It
kills all containers attached to the docker network.

The motivation for this change is the upcoming optional build of initrd
and kernel during ttcn3-ggsn-test/jenkins.sh. After building these, a
short smoke test will be performed to make sure we can boot the kernel
and initrd, before continuing to run the entire testsuite against it. If
building or the smoke test fails, we must do a proper clean up of the
network and fix permissions.

Related: OS#3208
Change-Id: I807c6221d22fec31db23e2516e477a3eb43347fb
2021-02-26 09:32:06 +01:00
Pau Espin c63a131a60 Remove test backward compatibility with older osmo-* versions
These changes are no longer needed since master versions of whole CNI
have been recently released.

Related: OS#5042
Change-Id: I6f491b58d4576b22c8ff3ab56a7b9e17163a8739
2021-02-25 16:41:47 +01:00
Oliver Smith 6f6724178b ttcn3: use REGISTRY arg with debian-stretch-titan
Allow jenkins to fetch the image from our private docker registry.
Outside of jenkins, the image is built locally just like before.

Related: OS#5017
Change-Id: I46cc176ea09d8badc359b627d7ce2f459211258c
2021-02-11 16:27:23 +01:00
Oliver Smith 2b38b8e779 ttcn3: move shared run code to script
While I'm at it with tidying up the Dockerfiles, create a
ttcn3-docker-run.sh with shared run code.

Related: OS#5017
Change-Id: Id90769707158f0488eca2313c57b99ea7a4a27c8
2021-02-11 15:45:40 +01:00
Oliver Smith 914a486ef1 debian-stretch-titan: prepare: start/stop links
Create symlinks to ttcn3-*-start.sh and ttcn3-*-stop.sh in the
prepare.sh script instead of in each of the ttcn3 Dockerfiles.

Related: OS#5017
Change-Id: I634cf71cff7936efe6e0461d21dc1119de922ada
2021-02-11 15:45:40 +01:00
Oliver Smith 892d910444 ttcn3: move prepare code to shared script
Move the git fetch/checkout code and make call to build the testsuite,
to debian-stretch-titan/ttcn3-docker-prepare.sh. In the next patch, I
will extend the script to update deps right before building too (e.g.
because OSMO_TTCN3_BRANCH changed).

Related: OS#5017
Change-Id: I4b5bedf058dc527e821f9b7204c632820e671af9
2021-02-11 15:45:40 +01:00
Oliver Smith 61fed0ad39 ttcn3: move initial clone to debian-stretch-titan
Clone the osmo-ttcn3-hacks and all dependency repositories less often by
moving related commands to the shared debian-stretch-titan image.

Remove the 'git checkout -f -B master origin/master' line, because the
master branch is checked out by default.

While at it, move the shared "git config" commands too, and move them
before cloning the repositories, so they don't run again whenever the
deps change (logic to invalidate the cache if deps change will be added
in the next patch).

Related: OS#5017
Change-Id: I2bb142dce061eba4b6a828c4e435510e309989fd
2021-02-11 15:45:40 +01:00
Oliver Smith db3f98113c ttcn3: remove /root/projects/git symlink
Remove leftover from old TTCN-3 build scripts, before refactoring ttcn3
Dockerfiles. This line has already been removed in 357ec806 from 2017 for
ggsn-test.

In osmo-ttcn3-hacks.git, this is only referenced in the obsolete
bin/install.script (looks like we could remove that, together with the
rest of the bin dir?).

Related: OS#5017
Change-Id: Id23e7fae58ba246916a38aa0a10035d4f67f7588
2021-02-11 15:45:40 +01:00
Pau Espin c90560f64f ttcn3-mgw: Update module param addresses naming to support ipv6
Depends: osmo-ttcn3-hacks.git Change-Id Ia393d7175de277ec8fa524ba74bf3b150b74c766

Change-Id: I2840eeee8ae53dc8bdf96ce7b6c76e4c8e0af859
2020-09-08 20:12:25 +02:00
Pau Espin 1f45fb08ff jenkins-common.sh: Add function to print docker network related parameters
Change-Id: Ie00561de7a4494065156a124565e2190151e6019
2020-08-27 12:49:43 +02:00
Daniel Willmann 49fa190470 ttcn3-mgw-test: Removing the e1 config options on latest
Fixes the test failure on ttcn3-mgw-test-latest

Change-Id: I3143ba905a77fabd1074dbd618c7ae48fa92a77a
2020-08-25 11:30:59 +02:00
Philipp Maier 02bd8bc60e osmo-mgw.cfg: fix config file + add E1 trunk
The config file of osmo-mgw has an incorrect indentation. Also no E1
trunk is configured, so that the E1 related tests fail. Lets fix this.

Change-Id: I3b19afc0809bd56e9fe0f5e968e1c000d29f4abd
2020-08-18 21:01:50 +02:00
Harald Welte 306a51dd30 Enable IPv6 in docker networking
We previously only allocated IPv4 sub-nets to the network segments
created with 'docker network'.  Let's fix that by assigning both
IPv4 and IPv6 address ranges to each docker network.

Related: OS#4700
Change-Id: I8802208fddcce1ffa57e5626575d23d02b320d99
2020-08-13 15:01:58 +00:00
Neels Hofmeyr 04c20edefd collect core dumps: '--ulimit core=-1' and WORKDIR=/data everywhere
Change-Id: Ief73b53ed9da6f5af82975bc36d851277d5d3185
2020-06-21 20:58:22 +00:00
Oliver Smith 5505b95a15 ttcn3-*-test: remove implicit dependencies
Don't list debian-stretch-build and debian-stretch-titan as dependencies
anymore, now that docker_images_require finds them automatically.

Related: OS#4564
Change-Id: I3cb6b693f3dd9df84fb29c0217bb3dae454cc18f
2020-05-30 09:14:06 +02:00
Oliver Smith f48c09d3bc ttcn3-*-test/jenkins*.sh: add $DOCKER_ARGS
Allow to pass options to each "docker run" line in the various
jenkins.sh scripts. I'm using this to run the testsuites and Osmocom
components in docker with the same configurations as jenkins, but with
Osmocom and testsuite binaries built outside and mounted into the
containers:

DOCKER_ARGS="-v /usr/local:/usr/local:ro -v $hacks:/osmo-ttcn3-hacks:ro"

This allows very short test cycles without a second set of configs. The
full script that makes use of this feature is in osmo-dev.git,
ttcn3/ttcn3.sh.

Change-Id: I8d1f78aee926f8f6ec0b704e16639bc83f525816
2020-05-06 06:22:12 +00:00
Pau Espin 8b060352f2 ttcn3-mgw: Drop not longer existing mp_enable_conn_timeout_test
It was removed since latest osmo-mgw release is nowadays 1.7.0.

Depends: osmo-ttcn3-hacks.git I537c0f5fd6f9e18e111c773c0e42e5f1120ce2f4
Change-Id: Ia457546431e0c3bb3148f4886644ed3fa2513835
2020-01-05 11:22:36 +00:00
Pau Espin c3f157b939 Update ttcn3-*/jenkins.sh to log stdout+stderr of process to log file
This way we get VTY parsing failures as well as backtraces upon process
crash.

Related: OS#4212
Change-Id: I3d9f6de638dbc07391a32c6a0cbd469dc5adf2b5
2019-11-20 17:17:45 +01:00
Pau Espin 65bc0ae407 ttcn-*: Fix gsmtap log not enabled
gsmtap log won't be sending any message unless it is allowed by "logging
filter all 1".

Change-Id: Ibf8062c0d962f2572a07623e6f06936df0d42c67
2019-10-04 15:50:50 +02:00
Oliver Smith c2ed5bb201 ttcn3-*: enable GSMTAP logging
Configure each osmo-* program to send GSMTAP log output to the IP of the
docker container, which runs the testsuite (and therefore runs tcpdump).

Related: https://lists.osmocom.org/pipermail/openbsc/2019-June/012946.html
Change-Id: I99e74f6ffb5b7d566cec35995bf067df414968d8
2019-07-10 09:34:39 +02:00
Oliver Smith 7721e142dc ttcn3-mgw-test-latest: disable conn_timeout_test
Depends: I8bbf15baa45679d5812a5a9184520ef9b9e73bba (osmo-ttcn3-hacks)
Change-Id: I05ff77246462ba90e8704969e0982662027ad630
2019-06-28 11:22:02 +02:00
Oliver Smith 88a74a5de1 ttcn3-{hlr,mgw,pcu}-test: log to file
Add missing file output which all other tests already have.

Related: OS#4067
Change-Id: Ifb4a39e6e2987f4dc04369508fe0dff0913a02ff
2019-06-24 13:52:06 +00:00
Pau Espin ee49c7ba88 ttcn3-*: Enable extended-timestamp in VTY cfg
Having extended-timestamp allows for easier matching between osmo-*.log
files and pcap traces.

Change-Id: I98cdc0adc24edc966d5648d2c215c6ad7c749209
2019-06-03 17:59:42 +02:00
Oliver Smith 61f2be7bd4 Fix git checkout for branches and commits
Replace 'git checkout -f -B $BRANCH origin/$BRANCH && \' in all
Dockerfiles that accept branch variables ($OSMO_TTCN3_BRANCH,
$OSMO_MGW_BRANCH, ...) with the following:
	git checkout $BRANCH && \
	(git symbolic-ref -q HEAD && git reset --hard origin/$BRANCH || exit 1); \

This allows using branch names and commit hashes in the $BRANCH
variables. Using commits is needed for the bisect script added in [1].

The second line ("(git symbolic...") checks if we are in detached HEAD
state after the checkout, and if we are not, pulls in all new commits
from origin/$BRANCH. Note that it ends in ';' instead of '&&', because
the command in the next line should be executed even if
"git symbolic-ref" does not exit with 0 (detached HEAD state).

Here is an example, to illustrate that the new command does the right
thing. Clone a repository and be 50 commits behind origin/master:
$ git clone "https://git.osmocom.org/osmo-mgw"
$ cd osmo-mgw
$ git reset --hard origin/master~50

With BRANCH="master":
$ git checkout master && \
  (git symbolic-ref -q HEAD && git reset --hard origin/master || exit 1); \
  echo "done"
Already on 'master'
...
done
$ git status
Your branch is up-to-date with 'origin/master'.

With BRANCH="85978d":
$ git checkout 85978d && \
  (git symbolic-ref -q HEAD && git reset --hard origin/85978d || exit 1); \
  echo "done"
Note: checking out '85978d'.
...
done
$ git status
HEAD detached at 85978dad

Related previous changes:
* [2] made it work for commit hashes, but broke using branch names other
      than master, and pulling in new commits from master
* [3] made branches other than master work again, but did not fix
      pulling in new commits from master
* [4] reverted [3] and the git checkout related part from [2]

[1] Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f
[2] Change-Id: If3bc5fae07cf63c4fef68306be4c4328660bc869
[3] Change-Id: I2ff745c8d19b777d876170d5717c082ceb68a1f3
[4] Change-Id: Ie6da0f9ea96f11407e38545a6b3cf22ef9cadc25

Related: OS#4015
Change-Id: I4004980baf0b7d6096702b6f3067ccbdb369a28c
2019-05-22 11:18:56 +02:00
Harald Welte 06ac6e455e Revert "Simplify git checkout, allow branches and commits"
Unfortuately this commit will check out *local* master (i.e. the
previous checkout) rather than the origin/master as it's supposed to
be. This means that ever since merging this patch, our ttcn3 tests
were running some "undefined" stale versions and not current master.

This reverts commit 26565bb729.

Change-Id: Ie6da0f9ea96f11407e38545a6b3cf22ef9cadc25
2019-05-21 17:53:11 +02:00
Oliver Smith 26565bb729 Simplify git checkout, allow branches and commits
Replace the following statements:

a) "git checkout -f -B $BRANCH origin/$BRANCH"
b) "git checkout -f -B $BRANCH $BRANCH"

with:

c) "git checkout -f $BRANCH"

Regarding a), we don't need to specify 'origin/' for each branch, since
we are cloning the repositories in the same Dockerfile, and therefore we
know for sure that there is only one remote and branch names won't be
ambiguous. Removing the 'origin/' allows to put commit hashes into the
branch variables (like done in the new bisect script [1]).

Version b) does not work with branch names:
$ git checkout -f -B osmith/check-imei-before-lu osmith/check-imei-before-lu
fatal: Cannot update paths and switch to branch 'osmith/check-imei-before-lu' at the same time.
Did you intend to checkout 'osmith/check-imei-before-lu' which can not be resolved as commit?

New version c) works with both commits and branches, and it is shorter.

[1] Change-Id: I11f7e61a9b30d58a0fdfcaf77dde447806bf661f

Change-Id: I2ff745c8d19b777d876170d5717c082ceb68a1f3
2019-05-07 10:24:52 +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
Harald Welte cffe1022b5 print branch name and git commit hash during docker container build
This is quite useful when looking at jenkins logs to know which exact
version was built at the time.

Change-Id: Id52c382b454e2beecf46820752aeff15b2c1a0ae
2019-03-29 16:40:40 +00:00
Philipp Maier 2e9ef62349 ttcn3-mgw_test: Configure VTY interface
The testsuite did not support VTY access in the past, so VTY access was
unconfigured. Lets add the required lines to the configuration files

Depends: osmo-mgw If383f81af3306f8f5bdf50152498ae1303d390df
Change-Id: Ife949c61156222de3026280071226ef6f5dbd959
Related: OS#3807
2019-02-20 17:21:14 +01:00
Oliver Smith ccf62eb231 jenkins.sh: IMAGE_SUFFIX, docker_images_require()
Default value "master" of the IMAGE_SUFFIX environment variable can be
changed to "latest" to test the latest stable builds instead of the
nightly ones. Use docker_images_require() to make sure that the required
images are existing and up-to-date before running the tests.

Related: OS#3268
Change-Id: Idbb708ab16cb71bab5069127945b63388222369e
2018-10-26 10:19:05 +02:00
Harald Welte ff3dc6e45f ensure well-formed config files
Change-Id: Id687e63c418e2e955ccbb92f2420a80fc0704ea4
2018-09-26 09:27:38 +00:00
Oliver Smith 7ed7a2bdd2 Fix "'laforge/debian-jessie-build' not found"
Instead of hardcoding laforge's username in all FROM statements in the
Dockerfiles, make use of the USER variable (as passed through by the
"make/Makefile" with "docker build --build-arg USER=..."). Thanks to
fixeria for proposing this fix!

This requires running docker-ce, old versions of docker (such as the
one in the official repositories of the latest Fedora) don't support
variables in the FROM line. But docker-ce can be installed after
adding docker's 3rd party repositories.

Closes: OS#3457

Change-Id: Ic5f11c8a4e247f632cb6aea6d147e94c53e0130f
2018-09-06 15:17:06 +02:00
Pau Espin 618505f98f ttcn3-*: Merge logfiles no matter resolution of tests
Previous to this commit, log messages were not being merged if tests
were resolved as failed (test-suite.sh ending with exit code != 0),
which can happen if at least one test failed.

Change-Id: If293fc2d3182ef2a7b997faa8b41129a9dd89c45
2018-07-06 14:50:47 +02:00
Neels Hofmeyr 5d2ffd0abf ttcn3-{mgw,ggsn}-test: use VOL_BASE_DIR from jenkins-common.sh
Do not brush over VOL_BASE_DIR with a new temp dir, since jenkins-common.sh has
already figured out where these should run.

Should fix jenkins job build failures for mgw and ggsn, after the merge of
I8cf6014725ae8ba602be5f3ec31dfb8e49ff993e.

Change-Id: Iee034df93bf8e8b995262749cf4654886032af2b
2018-05-03 14:26:50 +02:00