2169 Commits

Author SHA1 Message Date
Andreas Steffen
2b13873c0f Version bump to 6.0.3dr1 2025-09-22 18:57:54 +02:00
Tobias Brunner
1043fa32de testing: Add delay after qemu-nbd -c
Seems that there is a delay before the disk can be used when using newer
QEMU versions (e.g. on Debian trixie). We get errors like these:

  sfdisk: cannot open /dev/nbd0: Inappropriate ioctl for device

or

  mount: /srv/strongswan-testing/build/loop: special device /dev/nbd0p1 does not exist.

A sleep before the next command seems to help.

Also see [1].

[1] https://gitlab.com/qemu-project/qemu/-/issues/1413
2025-09-18 11:13:32 +02:00
Tobias Brunner
e9ebe49d44 testing: Add option to run tests without leak detective
This new option allows to disable leak detective to reduce the runtime
during development.  Either only for the command line (swanctl, pki etc.)
or optionally also for the daemon(s).

Disabling leak detective only for the CLI tools already brings a
considerable reduction in runtime (from 48m to 38m on my dev host) as
there are many such calls in the post-test stage.  Any leaks in those
tools are also a lot less of an issue than leaks in the daemon.  So using
this during development should be fine as long as a full test run is done
regularly (in particular before releases).  Disabling leak detective
completely further reduces the runtime (to 30m on my dev host). But that
should probably only be used for functional regression tests after
verifying new code didn't introduce new leaks.

This also fixes the service script which is used for charon-tkm since
16fcdb460afd ("charon-tkm: Don't use starter/stroke with charon-tkm anymore").
2025-09-18 11:13:32 +02:00
Tobias Brunner
906205b7ee testing: Use Debian trixie to test TKM 2025-09-18 11:13:32 +02:00
Tobias Brunner
a0a5bd7669 testing: Use Debian trixie 2025-09-18 11:13:32 +02:00
Tobias Brunner
f3cc9bec18 testing: Use proper directory for slapd PID files 2025-09-18 11:13:32 +02:00
Tobias Brunner
3aa7e1d418 testing: Increase memory for guest hosts to run Debian trixie
While some increase was necessary anyway because the idle system requires
about 5-10 MiB more memory, the main issue is resolving the code line and
function name in case of a memory leak.  Calling addr2line requires a lot
more memory than before.  Using backtraces via libbfd doesn't help either
because the trigger is the bfd_find_nearest_line() call we use as well.
And because we'd try to resolve all symbols that way (for whitelisting),
the memory overhead would be even higher and affect every shutdown, even
if no leak occurred.  It also causes a significant time overhead (running
all tests took 75m instead of 48m).

I also tested switching to ASAN/LSAN.  The peak memory usage is slightly
higher than when using libbfd, but enabling it also increased the runtime
overhead a lot (the daemon and swanctl both required about 10-20 MiB more
memory, not just during the shutdown).
2025-09-18 11:13:32 +02:00
Tobias Brunner
1767ba2a13 testing: Add support for Debian trixie base images 2025-09-18 11:13:32 +02:00
Tobias Brunner
518b8e4286 testing: Use pipx to install swidGenerator on Debian trixie
We could use the same approach on bookworm (if the base image is updated),
but just use the old approach there for now.
2025-09-18 11:13:32 +02:00
Tobias Brunner
fa1cd74712 testing: Install required packages in venv of updated strongTNC
Update revision for some dependency updates.  While python3-setuptools is
installed on the system, the venv apparently can't use it.  legacy-cgi is
required to use that old Django version with newer Python releases.
2025-09-18 11:13:32 +02:00
Tobias Brunner
ecc2e35713 testing: Update TKM RPC to be compatible with newer compilers 2025-09-18 11:13:32 +02:00
Tobias Brunner
b4a51f1719 testing: Use newer version of TKM on trixie
The API for libgmpada has change with 1.6 in a way that's not
backwards-compatible.  So we use a different revision that includes
the required changes depending on the Debian version.

This also adds support for esa_select(), to support seamless rekeyings,
which requires updating xfrm-ada as well.
2025-09-18 11:13:32 +02:00
Tobias Brunner
ddeb3c463e testing: Run commands in chroot in a login shell
Similar to the previous commit, this ensures we have the same environment
we do later on the system.
2025-09-18 11:13:32 +02:00
Tobias Brunner
870aa75eed testing: Start a login shell in chroot script
This ensures we have the same environment (e.g. stuff from /etc/profile.d)
as when logging in via SSH later.
2025-09-18 11:13:32 +02:00
Tobias Brunner
b998695344 testing: Ignore unknown memory in leak detective
This is set in two locations for systemd services and login shells. The
memory is freed by OPENSSL_cleanup().
2025-09-18 11:13:32 +02:00
Tobias Brunner
a9e3db6b79 testing: Pass base image codename to application Makefiles
Some might require it to use different revisions or commands.
2025-09-18 11:13:32 +02:00
Tobias Brunner
b51731e197 testing: Mount /proc in the chroot to make systemctl happy 2025-09-18 11:13:27 +02:00
Tobias Brunner
a418666f59 testing: Use new recommended approach to install key for custom apt repository
apt-key add is deprecated (and not available in trixie) as it makes the
available for all sources.  The recommended approach makes the key very
specifically available for just our repository.
2025-09-18 11:12:22 +02:00
Tobias Brunner
2025f630df testing: Remove unnecessary workaround for DHCP 2025-09-18 11:12:22 +02:00
Tobias Brunner
acaf4b2d17 testing: Move sysctl settings to sysctl.d and add some memory settings
Debian trixie doesn't provide a 99-sysctl.conf symlink in that directory
anymore.  The memory settings are also useful there as the default of
one changed and overbooking helps when forking a process with large
memory footprint (e.g. the IKE daemon).
2025-09-18 11:12:22 +02:00
Tobias Brunner
5e85ce17a2 testing: Remove xconsole config for rsyslogd
This produces a warning and we don't have X.
2025-09-18 11:12:22 +02:00
Tobias Brunner
dcb53e076b testing: Disable deprecated features in Botan
We keep MD5 enabled for now as we need it for TLS 1.0/1.1.  Once we
remove that we can reconsider (although, it's also needed for EAP-MD5
and since MD4 is disabled as well, which means EAP-MSCHAPv2 won't
be available, we'd be left with only EAP-GTC for simple username/password
authentication, which nobody else supports).
2025-08-22 12:07:55 +02:00
Tobias Brunner
6c813ddc13 Use wolfSSL 5.8.2 for tests 2025-07-19 12:11:29 +02:00
Andreas Steffen
23eb1e0945 Version bump to 6.0.2 2025-07-13 09:56:49 +02:00
Tobias Brunner
4c54550352 testing: Use alternative approach for retransmits in ikev1/dpd-restart scenario
With a long delay, the retransmit might not get sent before further tests
are evaluated on faster machines, while more retransmits should still allow
the scenario to succeed on slower ones.
2025-07-11 14:15:40 +02:00
Tobias Brunner
f88d824114 Fixed some typos, courtesy of codespell 2025-07-08 10:54:49 +02:00
Andreas Steffen
bd65a21ce0 Version bump to 6.0.2rc1 2025-07-07 18:25:37 +02:00
Andreas Steffen
1f42640c43 Version bump to 6.0.2dr3 2025-07-03 11:43:53 +02:00
Tobias Brunner
9a6aa2530e testing: Make sure ML-KEM scenarios use our ml plugin
We now support OpenSSL's implementation in the openssl plugin.  This
makes sure our plugin is used on at least one of the hosts if we ever
switch to an OpenSSL version that supports ML-KEM.

In the ikev2/rw-mlkem scenario the logic is reversed.  There the ml plugin
is preferred on moon to test the responder side (and carol for the
initiator) and dave will switch to OpenSSL if it ever provides ML-KEM.
2025-06-20 10:37:24 +02:00
Andreas Steffen
faf7ad2331 Version bump to 6.0.2dr2 2025-06-05 13:43:21 +02:00
Andreas Steffen
f9985d72e4 testing: soup plugin removed from test environment 2025-06-05 13:42:41 +02:00
Andreas Steffen
2fa8f4a90f Version bump to 6.0.2dr1 2025-06-04 19:58:23 +02:00
Tobias Brunner
dc4fef146a testing: Add ikev2/net2net-iptfs scenario 2025-05-28 16:37:47 +02:00
Tobias Brunner
b4a0eb3603 testing: Add config for Linux 6.14
This has IP-TFS enabled.
2025-05-28 16:37:46 +02:00
Tobias Brunner
b7d3349000 testing: Add ikev2/per-cpu-sas-encap-transport scenario
Tests transport mode and UDP encapsulation with random source ports.
Interestingly, the responder always uses the same SA to respond (maybe
due to the cache on the policy).
2025-05-28 16:35:27 +02:00
Tobias Brunner
3b2f8cf282 testing: Add ikev2/per-cpu-sas-encap scenario
Basically the same as the one without UDP encapsulation, but here the
outbound SAs use random source ports.
2025-05-28 16:35:27 +02:00
Tobias Brunner
bf34484d24 testing: Add per-CPU SA test scenario 2025-05-28 16:35:27 +02:00
Tobias Brunner
e24edb2991 testing: Configure multiple virtual CPUs for moon and sun
This allows testing per-CPU SAs by e.g. pinging over a specific CPU
via taskset.
2025-05-28 16:35:27 +02:00
Tobias Brunner
0edaadfc94 testing: Enable SMP support for latest kernels 2025-05-28 16:35:27 +02:00
Tobias Brunner
8f6e3c164a testing: Include the kernel build number 2025-05-28 16:35:26 +02:00
Tobias Brunner
8cb5918b0c testing: Add ikev2/net2net-route-narrow scenario 2025-05-28 16:01:00 +02:00
Tobias Brunner
7ec0101250 Include lib-prefix.m4 directly and remove gettext dependency
A recent gettext release (0.25 via Homebrew) installs the M4 macros in a
different location (<prefix>/share/gettext/m4 instead of
<prefix>/share/aclocal). According to the commit messages to avoid "bad
interactions between autoreconf and autopoint".  Since we only depend
on gettext for that macro and this move makes it complicated, we can also
just integrate the macro from gnulib directly (which gettext 0.18+ relies
on anyway).
2025-05-13 17:15:23 +02:00
Tobias Brunner
a1a477528f Use wolfSSL 5.8.0 for tests 2025-05-13 17:14:54 +02:00
Tobias Brunner
4249d721ec testing: Add rw-eap-id-switch scenario 2025-04-14 12:18:24 +02:00
Tobias Brunner
d7305a556f testing: Use blockdev instead of partprobe to load partitions
This avoids a dependency on parted as blockdev is in util-linux on
Debian/Ubuntu, which is installed by default.  And it might work more
reliably.
2025-04-10 08:31:09 +02:00
Tobias Brunner
353d5c130b testing: Use tar instead of recursive scp
It seems that scp is sometimes very slow (unclear what causes it as it's
not always the same).  Packing up the files with tar performs a lot
better in these situations.  And copying the files to multiple hosts
in parallel additionally helps to reduce the time required for these
steps.

Using --overwrite and -h preserves existing symlinks (e.g. for the users
file in /etc/freeradius/3.0) and overwrites the target file instead.
The -m option ignores timestamps when extracting the files as some target
files will be newer than the source.  Using -h when packing up files in
load-testconfig allows using symlinks in the test config dirs to files
on the host running the tests.
2025-04-07 14:54:48 +02:00
Tobias Brunner
d7eb3ed92e testing: Make ocsp.cgi in ikev2-multi-ca/ocsp-signers scenario executable 2025-04-07 14:54:48 +02:00
Tobias Brunner
a1ab256756 testing: Add some network utilities to the base image 2025-04-04 12:06:59 +02:00
Tobias Brunner
022f2d5f30 testing: Add option for a quick rebuild of strongSwan
This shaves off about 1 minute of build time on my machine.  We also
don't need the separate build step and can just run `make install`.
2025-04-04 12:06:59 +02:00
Tobias Brunner
02c43fa6e4 testing: Move removal of charon.pid into posttest section
Fixes: a103f3a2849f ("testing: Add options to only run pre- or posttest scripts of a scenario")
2025-04-04 12:06:59 +02:00