Commit Graph

25 Commits

Author SHA1 Message Date
Oliver Smith 6a8118dad8 ttcn3: use debian-bookworm-titan
Related: OS#6057
Change-Id: I2017dd3888670c475b96e692d911a433484f3df9
2023-08-14 09:28:24 +00:00
Oliver Smith 4f459b779e docker kill: wait until containers are stopped
As "docker kill" / "docker container kill" (alias) doesn't block until
the given container stops, make sure to always run "docker wait"

Closes: OS#5928
Change-Id: I0242ece96541d8036ebbf8b0f498ebf231db26b5
2023-03-07 09:02:02 +00:00
Oliver Smith 46e4362ae2 FR testsuites: clean up all networks before start
Add a new network_clean_remove_all_ttcn3 function and use it in the fr
related testsuites to ensure no network is running before the test
starts. We just had the situation where the network link between
gtp0-deb10fr (where these testsuites run exclusively, and only one at a
time) and the jenkins host went down. And so the clean up trap
apparently did not run and starting a new test fails as the old network
still exists and has the network devices attached.

Related: OS#5802
Change-Id: I6a9464a11edcba978be08764bec9de19760a5c77
2023-01-30 13:45:30 +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/, 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 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 5e0efb16e8 ttcn3-fr-test/ make use of clean_up()
Move cleaning up logic to clean_up(), so it runs as part of the
clean_up_trap if any command in the previous code fails.

For example, if the first docker container started properly, but the
second docker container failed to start: without this patch, it would
just stop the script without running the clean up code.

Change-Id: I4624e37d5d2fa90b71b32d72067b3645f69805da
2022-02-22 12:06:38 +01:00
Oliver Smith 0f63ef4b6d ttcn3-fr-test/ revert docker run --rm
Revert the change of adding a --rm to the "docker run" commands done in

This script runs the containers in the background, waits until they are
done, copies the logs and then removes them afterwards.

Fix for:
  + docker kill jenkins-ttcn3-fr-test-384-frnet
  + docker logs --timestamps jenkins-ttcn3-fr-test-384-ttcn3-fr-test
  Error: No such container: jenkins-ttcn3-fr-test-384-ttcn3-fr-test

Change-Id: I56dc07820ccfa8ad6936764262a7c6c272e59c37
2022-02-22 12:00:12 +01:00
Oliver Smith 5c158b326a treewide: fix missing --rm for "docker run"
Add "--rm" to each "docker run" command, so they don't continuously fill
up disk space.

Fix this even in the pipework script. We don't use the code path there,
but by always having --rm after "docker run" (same line or next line),
a new lint script in osmo-ci I8ab9c291504475d670bdefc50c4524c5bdd4c880
can help us avoid this in the future.

In ttcn3-ggsn-test/, move one existing --rm in a later line
upwards so the linter can find it.

Related: SYS#5827, OS#5099
Change-Id: I48b01c43fedf379b8a565eaab0369806d7831bd8
2022-02-14 08:56:27 +01: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

Related: OS#5327
Change-Id: Ic06532f7a67e59458652c5cf4c8f6fee8113e703
2021-11-26 18:12:50 +01:00
Harald Welte 43b1f4a901 fr: kill the frnet container before trying to 'rm' it
+ docker container rm jenkins-ttcn3-fr-test-109-frnet jenkins-ttcn3-fr-test-109-ttcn3-fr-test
Error response from daemon: You cannot remove a running container 4f5ec7f412b2d37d00b2738b2bcddffada36efebfe7ce32ed196543ee436154e. Stop the container before attempting removal or force remove

Change-Id: I66ed0d073bdd6962f78da54232d6bc58adc09e2c
2021-03-16 16:23:51 +00:00
Vadim Yanitskiy c91f6c4df5 ttcn3-fr-test: store execution logs for both containers
Change-Id: I60e60bfdc9f6b8fde81189d35d0ca4e73e310cc7
2021-03-16 15:45:42 +01:00
Vadim Yanitskiy 241547a6ba ttcn3-fr-test: add missing TTCN3_PCAP_PATH for '-frnet' container
Change-Id: Ide1b10f342f1f9d2b3bf432291218ed057f51de8
2021-03-16 11:10:08 +01:00
Oliver Smith 033c6ab1be */ 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

Related: OS#3208
Change-Id: Ie68da2affda8c96b3a515a857a921a05f1bf8ef7
2021-02-26 09:32:34 +01:00
Oliver Smith 12b961942a add common clean up trap
Add set_clean_up_trap() in and run it at the beginning
of the files. Move the common clean up code from the end of
every file into clean_up_common(), which gets called by the
trap. Add a custom clean_up() function to those 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/ 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 ce824cc3e1 ttcn3-{fr,gbproxy}-test: use ttcn3-docker-run too
Move the shared pipework script to the base image, and call it in if WAIT_FOR_NETDEV is set. Use
as entrypoint in both Dockerfiles and remove the custom entrypoint
scripts (which are the same as now).

Related: OS#5017
Change-Id: I2889abe94ed522a205890e5cb39e09cbebfbd820
2021-02-11 15:45:40 +01:00
Oliver Smith 914a486ef1 debian-stretch-titan: prepare: start/stop links
Create symlinks to ttcn3-* and ttcn3-* in the 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/ 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

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
Harald Welte bd94a1443e ttcn3-fr-tests: Configure MTU to 1700
On our deb10fr VMs we have the modified kernel HDLC module supporting
the frame relay MTU up to 1700 bytes, so let's extend our tests to cover
that.  Mainline kernels only support 1500 bytes.

Depends: osmo-ttcn3-hacks.git I8e38ecf6b270c81bd73ee43b1fa0b259a999c14b
Change-Id: Id25532edbf5e1a918ad038723da464723d6f03f0
2021-02-04 15:01:57 +01:00
Harald Welte ed6163df50 ttcn3-fr-tests: Disable junit-xml generation for FRNET_Tests
FRNET_Tests is not a test suite, but just a stub against which we
execute FR_Tests.  Hence, we don't want it to generate a junit-xml,
as that doesn't contain any errors and only upsets our jenkins
test results analyzer, assuming the tests have failed.

Change-Id: Idec2bf8da30ccd211b21901d56979143ce3a172f
Requires: osmo-ttcn3-hacks.git Id296e62fb86731492d42370173a48f217b2fbdc0
2021-02-04 10:38:15 +01:00
Harald Welte 18564ba9c2 New ttcn3-fr-test container
Change-Id: I32433871e25de46ef58b70af46400cbb4dc0dbc5
2021-02-03 22:20:20 +01:00