Commit Graph

4266 Commits

Author SHA1 Message Date
Yu Watanabe
4591efffc0 test: add basic tests for in_addr_prefix_covers_full() 2024-05-10 13:46:39 +09:00
Lennart Poettering
d6bfc3d889 pidfd: properly detect if libc offers pidfd syscalls and make use of them then
We never updated the meson checks when glibc finally learned about these
syscalls, address that.
2024-05-08 15:36:40 +02:00
Daan De Meyer
b438ebd7bc TEST-07-PID1: Fix race in aux-scope subtest
Currently test-aux-scope.service can get killed by the test before
it's had a chance to setup its signal handler. Make it Type=notify
to fix the race.

Fixes #32670 (hopefully)
2024-05-08 10:20:20 +02:00
Mike Yuan
158681f0f9 basic/mkdir: use timespec_store instead of _nsec for mkdir_p_root_full
Follow-up for 34c3d57474

O_RDONLY is dropped when O_DIRECTORY is specified, since
it's unnecessary and even arguably confusing here, as
the dir is modified.
2024-05-08 00:18:27 +08:00
David Tardon
3a5046782e test-bpf-foreign-programs: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon
2dd1676fa7 test-bpf-restrict-fs: pass the right error variable 2024-05-07 14:02:08 +02:00
David Tardon
1174ebb45f test-socket-bind: pass the right error variable 2024-05-07 14:02:08 +02:00
Moritz Sanft
34c3d57474 repart: respect SOURCE_DATE_EPOCH on mkdir_p_root
This let's systemd-repart respect the `SOURCE_DATE_EPOCH` environment
variable when creating directories in the local tree through `CopyFiles`
or `MakeDirectories`.

To do this, we pass a timestamp `ts` to `mkdir_p_root`, which it will
use to fix up `mtime` and `atime` of the directory it creates as
well as the `mtime` of the directory it creates the other directory *in*,
as the `mtime` of the latter is modified when creating a directory in it.

For the same reason, it also needs to fixup the `mtime` of the upper
directory when copying a file into it through `CopyFiles`.

If `SOURCE_DATE_EPOCH`, times are left as is. (`UTIME_OMIT`)
2024-05-07 09:29:58 +02:00
Daan De Meyer
38db5eff34 test: Only set environment variable if integration tests are enabled.
If we set it to '0' if integration tests are not enabled then we can't
enable them from the command line since environment from meson takes
priority over environment variables from the command line.

We also rename the related variables to avoid conflicts with the
existing integration_tests variable.
2024-05-06 10:56:54 +02:00
Yu Watanabe
4e494e6aac tree-wise: several cleanups for logging
- drop unnecessary SYNTHETIC_ERRNO() when the logger does not propagate
  error code,
- drop unnecessary '%m' in error message when the error code is
  specified with SYNTHETIC_ERRNO(),
- add missing full stop at the end of log message,
- use RET_GATHER(),
- add missing ", ignoring.",
- upeercase the first letter, etc., etc...
2024-05-01 04:41:06 +09:00
Luca Boccassi
e86e9ebf60 test: modernize test-dirent-util
Follow-up for 6a57d86bf9
2024-04-26 17:20:04 +01:00
Luca Boccassi
7d967aacce test: do not fail if mknod() fails in a build system
mknod fails in a Salsa container when building Debian packages, skip the check

Follow-up for 6a57d86bf9
2024-04-26 17:20:04 +01:00
Daan De Meyer
aa976d8788 tree-wide: Use log_setup() everywhere
Otherwise the default log target is the console and we won't use
the journal socket even if it is available.
2024-04-25 17:06:43 +02:00
Daan De Meyer
cf5e1b5d39 test: Skip meson integration tests if SYSTEMD_INTEGRATION_TESTS != 1
We cannot mark a test suite as excluded by default in meson. Instead,
let's require that SYSTEMD_INTEGRATION_TESTS=1 and skip any integration
test if it's not set. This is effectively the same as excluding it by
default. If the integration-test option is enabled, we'll set the
environment variable by default, just like we do with SYSTEMD_SLOW_TESTS
and the slow-tests meson option.
2024-04-25 17:06:40 +02:00
Zbigniew Jędrzejewski-Szmek
d851637ca6 core: drop unused param, move taint calculation to separate file
Follow-up for 2b28dfe6e6.

I also considered moving the function to src/basic, but since it's only used by
the manager, it doesn't seem useful.
2024-04-24 15:17:49 +02:00
Lennart Poettering
8b2f2a568d test: ensure all architecture ids we define definitely fit into .v/ patterns
Just some safety checks so that we never regress on this: make sure all
architectur IDs we define are embeddable safely in .v/ entry file names.
2024-04-22 20:28:33 +02:00
Luca Boccassi
c3411932b1 Merge pull request #32389 from keszybz/bin-sbin-merge
Try PATH without sbin even if compiled with split-bin=true
2024-04-22 13:07:48 +02:00
Zbigniew Jędrzejewski-Szmek
0f36a4c897 Try path without sbin even if compiled with split-bin=true
I'm working on the transition to merged sbin in Fedora. While the transition is
happening (and probably for a while after), we need to compile systemd with
split-bin=true to support systems upgraded from previous versions. But when the
system has been upgraded and already has /usr/sbin that is a symlink, be nice
and give $PATH without sbin.

We check for both /usr/sbin and /usr/local/sbin. If either exists and is not a
symlink to ./bin, we retain previous behaviour. This means that if both are
converted, we get the same behaviour as split-bin=false, and otherwise we
get the same behaviour as before.

sd-path uses the same logic. This is not a hot path, so I got rid of the nulstr
macros that duplicated the logic.
2024-04-22 09:53:24 +02:00
Daan De Meyer
26d79ab86d test-execute: Use new assertion macros 2024-04-22 09:42:29 +02:00
Daan De Meyer
dd8e82f0d6 test: Add ASSERT_ERROR() and ASSERT_ERROR_ERRNO()
For when we expect something to fail with a specific error.
2024-04-22 09:42:29 +02:00
Daan De Meyer
949d967964 test: Make sure test_fdset_close_others does not affect logging fds 2024-04-22 09:42:29 +02:00
Daan De Meyer
4b3e5fd91f test-bpf-restrict-fs: Add @application to allowed filesystems as well
We might be booting from virtiofs which is fuse so we need @application
as well.
2024-04-22 09:42:28 +02:00
Daan De Meyer
cbfc550000 test-bpf-firewall: Skip if ping is not available 2024-04-22 09:42:28 +02:00
Lennart Poettering
615906cdcf sd-id128: add an app-specific flavour of the invocation ID too 2024-04-20 12:10:42 +02:00
Luca Boccassi
565f6130b2 Merge pull request #32142 from bluca/portable_vpick
portable: support vpick
2024-04-19 20:34:16 +02:00