Commit Graph
2194 Commits
Author SHA1 Message Date
Tobias Brunner 3ef091815f testing: Run test scripts in a subshell so we can properly cancel them
This fixes handling of SIGINT (CTRL+C) so we don't continue with the
next potentially hanging command (e.g. several pings after another that
fail because a required SA didn't come up correctly).  We try to kill
the PID for every SIGINT in case the first one arrived before the
subshell was started.  The `TDUP_<host>` variables are not updated in
the main shell when `stop_tcpdump` is called from the subshell, so
it is called redundantly during the cleanup (removed the useless guard
there and use pkill to suppress any messages if no process is found).

If we get interrupted during one of the init/cleanup WAIT_FOR waits,
we just let them running in the background when exiting the script.
They should generally not do any harm (and be terminated once the next
run is attempted, which might require a rebuild during development
anyway).

Since a103f3a284 ("testing: Add options to only run pre- or posttest
scripts of a scenario") we can now also skip the remaining steps easily.

However, we do run the posttest script to clean up properly (e.g.
terminate the daemons, restore firewall rules etc.).  That's also why
it's not running in a subshell.
2026-07-06 19:01:19 +02:00
Tobias Brunner fa56cca73b testing: Format link to test results as OSC 8 hyperlink
Useful for terminals that support these (but maybe don't parse URLs
automatically).
2026-07-01 09:28:07 +02:00
Tobias Brunner 7eefadca67 Use wolfSSL 5.9.2 for tests 2026-06-29 17:45:29 +02:00
Andreas Steffen 5973ff8e41 Version bump to 6.0.7 2026-06-07 19:54:14 +02:00
Tobias Brunner 18a94525a7 Revert "testing: Ignore unknown memory in leak detective"
This reverts commit b998695344.

Seems like this is not necessary anymore.  Possibly because of
8ff3238027 ("openssl: Prevent OpenSSL from using posix_memalign() if
LD is enabled").
2026-05-22 14:33:28 +02:00
Tobias Brunner 93cf3de1fc Use Botan 3.12.0 for tests 2026-05-08 12:00:15 +02:00
Andreas Steffen 4d709df8b2 Version bump to 6.0.6 2026-04-22 07:55:01 +02:00
Tobias Brunner 1ee7e10940 testing: Fix typo regarding ML-KEM in description 2026-04-15 15:01:40 +02:00
Tobias Brunner e8e34c4b33 Use wolfSSL 5.9.1 for tests 2026-04-09 09:53:36 +02:00
Tobias Brunner 440b7e7940 Use Botan 3.11.1 for tests 2026-04-01 19:33:09 +02:00
Andreas Steffen 62f5d17c12 Version bump to 6.0.5 2026-03-23 13:41:52 +01:00
Tobias Brunner 0fcece9fff Use wolfSSL 5.9.0 for tests 2026-03-19 09:18:08 +01:00
Andreas Steffen 8fd2c3a3bc Version bump to 6.0.5dr1 2026-03-12 18:37:36 +01:00
Tobias Brunner 8a6f9ba70e kernel-netlink: Don't fallback to peer address as gateway/nexthop
This doesn't really seem useful (perhaps it was before we started to
configure the outbound interface on our routes). And it can actually
cause the route installation to fail e.g. for routes over point-to-point
interfaces where we'd get "Error: Nexthop has invalid gateway" errors.

Note that we can't return NULL if we find an interface as e.g. the updown
plugin uses this method to determine the outbound interface (it ignores
the nexthop), which it passes to the script.  If we returned NULL, it
would pass "unknown" instead, which would cause the firewall rules to
mismatch.  While it seems that 0.0.0.0/:: is ignored as nexthop by the
kernel on the installed route, I still explicitly ignore such addresses
to avoid any unintended side-effects.

The automatic route installation in the ikev2/shunt-manual-prio scenario
had to be disabled on the clients.  The reason is that the route in table
220 won't have a nexthop set (the peers are directly connected), so when
trying to reach alice or venus via SSH, which matches the port-specific
bypass policies for which we don't install throw routes, the hosts will
do ARP requests for the target IPs instead of routing the packets via
moon.

Closes strongswan/strongswan#2548
2026-02-20 12:44:55 +01:00
Tobias Brunner a7c03a415e testing: Add scenarios to test ICMP forwarding 2026-02-12 16:21:37 +01:00
Tobias Brunner 5b0d506215 testing: Remove unused revocation and constraints plugins for swanctl
swanctl doesn't do any (online) certificate validation, it just parses
and or decrypts them and passes them on to the daemon.
2026-02-06 11:21:34 +01:00
Tobias Brunner 7973080969 testing: Add a reauthentication to ikev2/dhcp-static-client-id
This verifies that we don't release the lease when the old SA is
deleted during the reauthentication.
2026-02-05 17:57:07 +01:00
Tobias Brunner d20a0116b2 Use Botan 3.10.0 for tests
Clean up leak-detective whitelist for newer Botan versions but add
`botan_private_key_load` as `botan_privkey_load*` won't show up anymore
without bfd-backtraces due to inlining if we don't call it directly.

Ref: https://github.com/randombit/botan/discussions/4868
2025-12-12 15:58:31 +01:00
Andreas Steffen d1c259f44b Version bump to 6.0.4 2025-12-12 15:32:29 +01:00
Andreas Steffen 96468d2891 Merge branch 'master' into testing-per-cpu-sas 2025-12-08 08:46:51 +01:00
Andreas Steffen 909f52875e Version bump to 6.0.4rc1 2025-12-08 08:22:18 +01:00
Tobias Brunner 1454bd7bcf testing: Make per-CPU SAs scenarios more predictable by pinning IRQs to vCPUs
This ensures that packets on sun are processed on a particular CPU and
not randomly on one, which causes expected SAs not to get created or
other weird things.
2025-12-03 11:42:54 +01:00
Tobias Brunner 831d8454df Use wolfSSL 5.8.4 for tests
Also remove the --enable-md4 option.  We never supported MD4 via wolfSSL,
as it's not available via the hash API we use (would require explicit
MD4-specific functions and structures).
2025-11-21 10:49:18 +01:00
Andreas Steffen 472dcd8bb5 Version bump to 6.0.3 2025-10-27 14:02:59 +01:00
Andreas Steffen 4cf88da4d7 Version bump 6.0.3rc1 2025-10-24 15:21:52 +02:00
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
16fcdb460a ("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