Commit Graph

79 Commits

Author SHA1 Message Date
Oliver Smith d7c50db104 ttcn3-ggsn-test: ignore failure to kill osmo-ggsn
Don't fail if osmo-ggsn can't be killed at the end of a testsuite
run. This happens currently with ttcn3-ggsn-test-kernel-latest-* jobs,
in the v6_only configurations, because osmo-ggsn latest doesn't support
ipv6 yet and exits. The jenkins.sh should keep going and try other
combinations, and exit without error in the end.

Fixes: d8c51cce ("ttcn3-ggsn-test: run with multiple configurations")
Change-Id: I6f3154a9ef114f31bcb5868ee09d1ebc10f35d07
2024-03-25 13:56:47 +00:00
Oliver Smith d8c51cce64 ttcn3-ggsn-test: run with multiple configurations
The kernel ttcn3-ggsn-tests have been failing since the osmo-ggsn
config for kernel-gtp has been adjusted for v4v6 instead of v4 only.

This new configuration caused a regression with:
* linux kernel without Pablo's GTP IPv6 patches
* latest stable release of osmo-ggsn, which does not support IPv6

As the kernel patches aren't merged yet, this caused all tests to fail.

Avoid this by running the ttcn3-ggsn-test with multiple configurations:
* v4_only: one APN with v4
* v6_only: one APN with v6
* v4v6_only: one APN with v4v6
* all: multiple APNs with all of the above

With this change, the tests running in the v4_only configuration will
pass again with the stable versions of osmo-ggsn, libgtpnl and kernel.
And with new versions, most test in the other configurations will pass
too.

As discussed with Harald, this does not only split up the configuration
for osmo-ggsn with kernel gtp-u, but also with the userspace
implementation. The "all" config currently only works with the
userspace gtp implementation (OS#6106).

Related: OS#6096
Depends: osmo-ttcn3-hacks I6d94a8b18200fbb2119406827b74b83e912e3ecc
Fixes: e24442f9 ("ttcn3-ggsn-test: kernel-gtp: add ipv6")
Change-Id: Ia2fe0c3ed4ccf06e72fd258d085e4a79cecd5f26
2024-03-25 12:21:12 +01:00
Oliver Smith 59dcbf762c ttcn3-ggsn-test: move confgs to subdirs
Prepare to add variations of the configs: move them to subdirs, so we
don't cullter the main directory.

Related: OS#6096
Change-Id: I03a06f9f516922c47e3092ff7d7c2c68b0852c1b
2024-03-25 12:21:12 +01:00
Oliver Smith 5946a075fa ttcn3-ggsn-test/jenkins: add functions for start ggsn/testsuite
Prepare to run start_ggsn and start_testsuite multiple times with
different configurations in a follow-up patch.

Related: OS#6096
Change-Id: I0754b0df5f1b0b162732c3db0797f65676553ab0
2024-03-25 12:21:12 +01:00
Oliver Smith 73348e51df ttcn3-ggsn-test: tweak log options
Change-Id: I6c3095f4d3378d2026d3720bc32e27ce4c8345b3
2024-03-04 09:32:07 +01:00
Oliver Smith f2786e8573 ttcn3-ggsn-test: enable dynamic debug
Enable loglevel=8, as otherwise the messages do not show up.

Change-Id: I048646c4f90233939809546d30c94c4218eedbb1
2024-03-04 09:31:34 +01:00
Oliver Smith e24442f9a9 ttcn3-ggsn-test: kernel-gtp: add ipv6
Related: OS#6096
Change-Id: If3549db216ff89bdb963744bb38015ad68d4cf6a
2024-02-28 10:06:32 +00:00
Oliver Smith e39bea3ae5 ttcn3-ggsn-test/fragment.config: add NET_NS, VETH
Build the kernel with NET_NS and VETH, so libgtpnl's qemu tests can
download the kernel and use it.

Related: OS#1952
Related: libgtpnl Ibf75514b866fffb11e90529e4705f126b23d7415
Change-Id: I6e893b64718f853b8595de36c090a1326db34419
2024-02-19 09:39:42 +00:00
Oliver Smith 15caf486bb open5gs configs: update to current format
Adjust open5gs configs to the new formats from:
https://github.com/open5gs/open5gs/pull/2739

This fixes all open5gs programs from crashing on startup with various
errors such as:
  11/21 07:39:25.971: [core] FATAL: epoll_init: Assertion `context->epfd >= 0' failed. (../lib/core/ogs-epoll.c:77)

Related: OS#6267
Change-Id: Idf2706f3904eb06e94cee0728faa17e72a6cf1f6
2023-11-23 16:30:51 +01:00
Oliver Smith 4836524115 open5gs configs: duplicate cfgs for latest/master
The config format just changed significantly in main/master. Duplicate
the configs, so we can run latest with the old versions.

Related: OS#6267
Change-Id: I2446695172b92ccf75305f878cb932a82e44fdd2
2023-11-23 16:30:51 +01:00
Oliver Smith 71a4f4c9ac open5gs configs: remove comments
A lot of these comments got outdated with recent config changes
in the related PR. Instead of syncing the comments again and having a
big diff, remove the comments once and then only have diffs of
actual config changes in future patches. This will make it easier to
maintain these configs.

Related: https://github.com/open5gs/open5gs/pull/2739
Change-Id: I67c2a198b9682e15e23a466380e62a976e6236cd
2023-11-23 16:30:51 +01:00
Oliver Smith 6a8118dad8 ttcn3: use debian-bookworm-titan
Related: OS#6057
Change-Id: I2017dd3888670c475b96e692d911a433484f3df9
2023-08-14 09:28:24 +00:00
Oliver Smith d9c2b81bf2 Cosmetic: ttcn3-ggsn-test: env vars -> README
Prepare to add more kernel related env vars. Instead of duplicating the
descriptions here, point to the README file.

Change-Id: I324f12930c5521e29312b309d6344ed5ffbd2581
2023-07-18 16:58:27 +02:00
Pau Espin c634cc7f75 ttcn3-ggsn: Speed up tests by lowering retransmission T3,N3 timers
Every test needs to wait for T3*N3 seconds before exiting in order to
make sure the queues waiting for duplicates are cleared, otherwise state
from previous state may affect next tests.
Since 1.10.0, osmo-ggsn supports having those timers changed through
VTY. Let's set them to a lower value than default specified by spec, in
order to speed up each test 15 seconds -> 2 seconds.

Only ttcn3-ggsn (against osmo-ggsn) and not ttcn3-ggsn-ogs (against
open5gs-smfd) is updated, since the later doesn't support changing the
default timer values using the config files yet.

Related: OS#5485
Change-Id: Ica346bd791a67b72fad597702d750383e8ac5895
2023-04-12 19:06:14 +02:00
Vadim Yanitskiy e893dcf18a ttcn3-ggsn-test-ogs: update open5gs-{smf,upf} config files
Change-Id: Ic92d73e93b47abb4fae99fc9bece0c93bf9b91ef
Related: I27adbab6a6b95ddf4c6d39803e4f7dd079f11a4c
Related: OS#5913
2023-02-27 10:43:43 +00:00
Oliver Smith d2827d91ce network_create: put SUBNET in NET_NAME
Fix the bug that running a test twice on the same host results in the
second test stopping the containers and network of the first test:

* Have the subnet name in the network name, so there's no collision of
  network names when cleaning up the network.

* Don't clean up the network when creating a new network. Rely on the
  clean up trap to clean up the network instead.

* Don't set NET_NAME when sourcing jenkins-common.sh anymore, as
  network_create will set it. There's also network_bridge_create, which
  only gets used by osmo-ran (which we don't run in jenkins). Add a
  check to this function to ensure NET_NAME is set before calling it,
  which osmo-ran is already doing.

Related: OS#5802
Change-Id: Ifcd384272c56d585e220e2588f2186dc110902ed
2023-01-17 09:39:52 +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
Oliver Smith 68cddfad72 ttcn3-ggsn-test: cp initrd-ggsn.sh to VOL_BASE_DIR
Prepare for a future patch where a free subnet will be figured out
automatically instead of having a hardcoded one, by moving
initrd-ggsn.sh to $VOL_BASE_DIR as the subnet will be replaced in files
in this directory.

Related: OS#5802
Change-Id: Ie4f35b77a2bff20f2a0479890a429754768cafd2
2022-12-22 13:26:41 +01:00
Pau Espin 0ecbb795c5 ttcn3-{pgw,ggsn}-test: Update smf.yml with new metrics section location
The "metrics" section was moved inside each program node to avoid
clashes when several network programs are run in the same process and
use the same config file.

Depends: open5gs.git 2d4fbf92eb1be9ffe84df6dc103ee7401d1d3b0f
Change-Id: Iae16bfccfbaaed37701e671ba619f8082f55506d
2022-11-21 11:28:52 +01:00
Vadim Yanitskiy ba5f99aac0 ttcn3-ggsn-test-ogs: update freeDiameter-smf.conf
Recent open5gs changed location of the TLS key and certificate files:

  commit 0859dd44530a944076c207c750188572effc2709
  Author: Sukchan Lee <acetcom@gmail.com>
  Date:   Sat Nov 12 09:37:43 2022 +0900

      Follow-up on #1865

Updating paths makes the open5gs-master work, however the -latest
still installs these files to '/etc/freeDiameter/'.  Let's remove
both 'TLS_Cred' and 'TLS_CA' params, we are not using TLS anyway.

Change-Id: Iacd7287f217db7a23ceece1d4508ef674b696d35
2022-11-15 22:41:23 +07: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
Pau Espin e7a5379e29 open5gs: Enable libmetrics prometheus implementation
metrics support using Prometheus has been recently added to open5gs
(28e40a0f1b9048768958344e213c69994be671f5). However, it is still not
enabled by default. Let's enable it and update open5gs config files to
make use of it.

Change-Id: I6ec827d66241e20d631f3a851457921718c168a0
2022-06-08 13:49:43 +02:00
Pau Espin 6e1a4e7df0 ttcn3-ggsn-test-ogs: set CAP_NET_RAW for open5gs-upfd
The SO_BINDTODEVICE feature (used for VRF) requires CAP_NET_RAW. Since
we run open5gs-upfd as user "osmocom", that seems to be causing some
permission problems under some systems (like jenkins). Let's make sure
we add the capabilitites to the binary before launching it as user
"osmocom".

Change-Id: I51ee6954a6c019a41cfcd50b2d99166316989d9b
2022-05-02 11:36:18 +02:00
Pau Espin a9b4a891a0 ttcn-ggsn: Configure open5gs-smfd to connect to TTCN3 OCS
Change-Id: I5a7ace64cefead2c05437ea75ba29ecc969d426e
2022-04-12 13:12:37 +02:00
Pau Espin 713468b295 ttcn3-{ggsn,pgw}-test: Avoid open5gs itself logging to a file
We already log stdout/stderr to a file, so there's no need to log a file
internally. We prefer logging that through stdout/stderr in order to
catch more stuff, like segfaults.

Change-Id: Ifdc010f26abdc8cefeec0c72a1f617911ec375d7
2022-04-07 20:40:12 +02:00
Pau Espin 6acec0cbd1 ttcn3-{pgw,ggsn}-tests: Add comment with procedure to get open5gs-smfd bt automatically
Some specific gdb commands need to be run in open5gs-smfd to get the
desired result (some signals need to be ignored).
gdb use is not enabled by default. Furthermore, if one wants to use it,
editing the Dockerfile to install gdb is required.

Change-Id: I1ac8b77e84d57040fc09964356bc8a01e5d721e3
2022-04-07 19:48:51 +02:00
Pau Espin cc7f9b4896 ttcn3-ggsn-ogs: Rename config files
Let's make names similar to what's used in PGW_Tests. Also, in
open5gs.git, config files don't contain the "d" at the end.

Change-Id: If56d1a890a4f1b80b4f04ae22644f9cb9cdd35f4
2022-04-07 19:36:56 +02:00
Pau Espin 913930f570 ttcn3-ggsn-ogs: Use new bind_dev config option for GTP sockets
This way we validate the feature is run and open5gs-smfd/upfd don't fail
when applying it.

Related: SYS#5846
Change-Id: Ie23db8ffb4868e4bc75783e2f6eb7a725b376ea7
2022-03-15 14:40:30 +01:00
Pau Espin 2f3aff2a23 ttcn3-ggsn-ogs: Change diameter node id to pcrf
This better identifies the peer, specially since we'll also connect to
an OCS in the future.

Depends: osmo-ttcn3-hacks.git Change- Id I1eb03d907b46c4bb24491f390ef468e831190e08
Change-Id: I4c9f90de1456cf1515c9a0608b44a44fa8acb311
2022-03-08 13:56:03 +01:00
Pau Espin 254464d830 ttcn3-ggsn: Modify configs to alloc bigger IPv4 pools
This is needed for test TC_lots_of_concurrent_pdp_ctx, which creates up
to 1000 pdp contexts.

Change-Id: If3344c8acc9bc3b43ed0a13af52807d2a6050a81
2022-02-25 17:59:22 +01:00
Pau Espin 107e1b9bca ttcn3-ggsn-test-ogs: Run all tests
Change-Id: If400fe325d3fc9a0df168d41b3a1fe68c0e37d2f
2022-02-21 10:36:26 +00: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/jenkins.sh, move one existing --rm in a later line
upwards so the linter can find it.

Related: SYS#5827, OS#5099
Related: https://github.com/jpetazzo/pipework/pull/248
Change-Id: I48b01c43fedf379b8a565eaab0369806d7831bd8
2022-02-14 08:56:27 +01:00
Pau Espin 45a2b5d817 ttcn3-ggsn-tests-ogs: Configuration fixes for IPv6 tests
Change-Id: I6fe98f6642bbd42376c9ed7353b58451c104eaca
2022-02-11 18:39:23 +00:00
Pau Espin 5095686e02 ttcn3-ggsn-tests-ogs: Set correct DNS address to get ping working
The DNS address provided is used by the test to ping. In osmo-ggsn, we
configured the DNS to be the shared address between GTPC and GTPU. In
open5gs, the addresses are different. Hence, let's pass the GTPU address
instead of the GTPC address to make the setup easier (no need to have
proper routing working between UPFD and SMFD containers).

Change-Id: I2a452ad871612d1c88b94579dadbe62b718b1475
2022-02-11 18:39:23 +00:00
Pau Espin 500f14e9db ttcn3-ggsn-test-ogs: Configure correct GTP-U GGSN address
Change-Id: Id42b591ba03f451e89b0e332edcf8f2cded9f444
2022-02-08 16:41:59 +00:00
Vadim Yanitskiy 4403dbb0a5 open5gs-master: ensure consistent install paths with '-latest'
This allows running TTCN-3 test cases against both '-latest' and
'-master' images using the same configuration files.

Change-Id: Ib4dcf3a9f77205dcdd0ff4932763e202cb89001c
Related: SYS#5602
2022-02-07 16:37:21 +06:00
Pau Espin 80ac90261b Add ttcn3-ggsn-ogs testsuite
This new setup allows running TTCN3 GGSN_Tests against open5gs, which
will soon gain GTPv1C support.

Change-Id: Ia6c122fce951d369a5d2362cbe99d10d61c15f49
2022-02-07 08:47:33 +00: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
Vadim Yanitskiy 709a30b536 ttcn3-{sgsn,ggsn}-test: set OSMO_SUT_{HOST,PORT}
This enables the test suite to obtain talloc reports between the
test case executions, which get stored together with the PCAP files.

Change-Id: I61fef7763e6445c231ff2664036e243a9ac96ff6
Related: Icd4c2d80db934535d499598282ed9416d8088163
2021-12-14 22:09:29 +03: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
Oliver Smith cb2a8326c1 kernel-test: don't try to use KVM if not available
Disable KVM if /dev/kvm is missing, as it is apparently the case on our
jenkins nodes. This makes the tests run a bit slower, but not much. Add
kernel_test_wait_for_vm to sleep until the VM is booted up (~5s instead
of ~1s without KVM), so the first test in the testsuite does not fail
when using KVM.

The variable is useful to test the non-KVM code path even if KVM is
available on the host.

Related: OS#3208
Change-Id: I1f337af1e2de6db05b22636bc31a535404235559
2021-02-26 16:18:26 +00:00
Oliver Smith 79e48fd3ae ttcn3-ggsn-test: add kernel test
Make it possible to run ttcn3-ggsn-test against osmo-ggsn with the GTP
kernel module. This feature is enabled by environment variables
explained in ttcn3-ggsn-test/jenkins.sh, and can either use the
pre-built kernel from Debian, or build a kernel from source.

The kernel runs inside QEMU inside the usual osmo-ggsn-master docker
image.

Thanks to Pau for providing the kernel config and kernel-test scripts
that this patch is based on! I ended up modifying them quite a bit to
fit the docker use case, and to build the initrd (so we can use the
stock debian kernel).

Related: OS#3208
Change-Id: I54e752048eed2a170a1cf4e0fd410de255b9de5d
2021-02-26 09:32:39 +01: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
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