1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00
Commit Graph

3199 Commits

Author SHA1 Message Date
Yu Watanabe
0bfe2aa378 test-64: run one more subtest on non-KVM environment with relaxed condition 2022-08-28 09:18:18 +00:00
Yu Watanabe
8d2a55025b test-network: add missing online check 2022-08-28 08:07:25 +00:00
Yu Watanabe
a1bed4e41d test-64: relax number of partitions used in testcase_simultaneous_events() to speed up non-KVM environment 2022-08-28 07:48:14 +00:00
Yu Watanabe
d5ef8d1b08 test-64: extend timeout for slower env e.g. non-kvm 2022-08-28 09:03:14 +09:00
Frantisek Sumsal
9c524a07f6 test: reload knotd after committing all zone changes
Otherwise, on Ubuntu, the DS RRs sometimes won't get propagated
correctly to parent zones for some reason, ending in a loop:

```
knotd[70]: info: [test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [signed.test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [signed.test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [signed.test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [signed.test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [signed.test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [signed.test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [signed.test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
knotd[70]: info: [signed.test.] DS check, outgoing, remote 10.0.0.1@53, KSK submission check: negative
...
```

causing DNSSEC verification fails. I'm not sure why that happens (yet)...
2022-08-27 11:27:04 +02:00
Frantisek Sumsal
fa17101b8e test: fix delv trust anchors location on Ubuntu
delv on Ubuntu defaults to /etc/bind/bind.keys instead of /etc/bind.keys
when reading trust anchors, so let's create a symlink to make the test
work there as well.

Resolves: #24453
2022-08-27 11:27:04 +02:00
Frantisek Sumsal
57063a4ab2 test: fix typo 2022-08-27 11:27:04 +02:00
Frantisek Sumsal
ad3d0c8a30 test: drop old DS records if present
This makes the test re-runnable without having to go through the cleanup
and setup phases again.
2022-08-27 11:27:02 +02:00
Yu Watanabe
20d4b3ccd1 test-50-dissect: generate debugging logs of udevd 2022-08-27 15:14:19 +09:00
Yu Watanabe
e867b0163b test-58-repart: use udevadm control instead of creating service drop-in 2022-08-27 15:14:19 +09:00
Frantisek Sumsal
12ee072db5 test: make the virt detection quiet
Follow-up to cde09b07df.
2022-08-26 19:18:20 +02:00
Frantisek Sumsal
cd15f7f6d1 test: set the default QEMU and nspawn timeouts to 30 minutes
Set both timeouts to some reasonable values instead of just `infinity`
to provide some form of a safe-net in case the test goes haywire and the
environment didn't set the timeouts itself (like our CIs do).
2022-08-26 19:16:45 +02:00
Frantisek Sumsal
3c833171bd test: respect the global $QEMU_TIMEOUT
CIs set QEMU and nspawn timeouts by themselves which reflect their needs
and possibilities, so let's respect that value, instead of using one
pre-set value which might or might not work for all of them.

Both Ubuntu CI and CentOS CI set these values themselves.
2022-08-26 19:16:45 +02:00
Frantisek Sumsal
10d7ed12c9 test: use a unique machine name for each nspawn test
to avoid scope clashing in case some previous test crashed and/or didn't
clean up properly. Currently all test machines are called `root`, since
the name is automagically derived from the container path (in this case
`/var/tmp/systemd-test.XXXXXX/root`).

E.g. (from Ubuntu CI):
```
[23:10:12] --x-- Running TEST-71-HOSTNAME --x--
make: Entering directory '/tmp/autopkgtest.5LjnBV/build.0mE/systemd/test/TEST-71-HOSTNAME'
+ make -C TEST-71-HOSTNAME setup run
TEST-71-HOSTNAME SETUP: test hostnamed
Reusing existing cached image /tmp/autopkgtest.5LjnBV/build.0mE/systemd/test/TEST-71-HOSTNAME/../default.img → /tmp/autopkgtest.5LjnBV/build.0mE/systemd/test/default.img
'/var/tmp/systemd-test.1yy2SS/default.img' -> '/tmp/autopkgtest.5LjnBV/build.0mE/systemd/test/default.img'
I: Masking supporting services
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-hwdb-update.service' -> '/dev/null'
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-journal-catalog-update.service' -> '/dev/null'
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-networkd.service' -> '/dev/null'
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-networkd.socket' -> '/dev/null'
'/var/tmp/systemd-test.1yy2SS/root/etc/systemd/system/systemd-resolved.service' -> '/dev/null'
TEST-71-HOSTNAME RUN: test hostnamed
+ env --unset=UNIFIED_CGROUP_HIERARCHY --unset=SYSTEMD_NSPAWN_UNIFIED_HIERARCHY timeout --foreground 1200 /bin/systemd-nspawn --register=no --kill-signal=SIGKILL --directory=/var/tmp/systemd-test.1yy2SS/root --setenv=SYSTEMD_UNIT_PATH=/usr/lib/systemd/tests/testdata/testsuite-71.units:/usr/lib/systemd/tests/testdata/units: /lib/systemd/systemd systemd.unit=testsuite.target systemd.wants=testsuite-71.service systemd.wants=end.service
Spawning container root on /var/tmp/systemd-test.1yy2SS/root.
Press ^] three times within 1s to kill container.
Failed to allocate scope: Unit root.scope already exists.
E: nspawn failed with exit code 1
```
2022-08-26 19:16:45 +02:00
Frantisek Sumsal
6ef1262d63 test: bump the reboot timeout to 60 seconds
As the reboot might take a bit on oversaturated hypervisors (spotted in
Ubuntu CI).
2022-08-26 19:16:45 +02:00
Frantisek Sumsal
528ba54bbe
Merge pull request #24440 from mrc0mmand/TEST-64-tweaks
A couple of TEST-64 tweaks to make it usable without KVM
2022-08-26 17:16:24 +00:00
Luca Boccassi
34f166d601
Merge pull request #24456 from yuwata/network-tcp-congctl
network: introduce TCPCongestionControlAlgorithm=
2022-08-26 18:04:51 +01:00
Frantisek Sumsal
9def084861 test: temporarily (?) disable TEST-64 in Ubuntu CI
The machines are still way too slow for the test to work properly
without accel.
2022-08-26 15:40:34 +02:00
Frantisek Sumsal
6a9c497768 test: bump the base VM memory to 768M
as with 512M some tests occasionally trip off OOM-killer (e.g.
TEST-64 + multipath).
2022-08-26 15:40:34 +02:00
Frantisek Sumsal
b307c22757 test: lower the # of iterations with plain QEMU 2022-08-26 15:40:34 +02:00
Frantisek Sumsal
092499b9f6 test: require KVM only for specific sub-tests
since other sub-tests run relatively fine with TCG as well.
2022-08-26 15:40:34 +02:00
Frantisek Sumsal
cde09b07df test: check for other hypervisors as well
EC2 machines run on Xen, so account for that as well when checking KVM
availability.
2022-08-26 15:40:34 +02:00
Frantisek Sumsal
1678bd2f81 test: lower the # of mpath devices to 16
to make the test suitable for slower machines.
2022-08-26 15:40:34 +02:00
Yu Watanabe
93e898d624 test-network: add test for TCPCongestionControlAlgorithm= 2022-08-26 19:47:27 +09:00
Yu Watanabe
dc7c21f001 network: introduce TCPCongestionControlAlgorithm=
Closes #24432.
2022-08-26 19:47:23 +09:00
Lennart Poettering
ce610af143 tmpfiles: in C lines, make missing source graceful error
I don't see where it would ever be a good thing that file copies done
via tmpfiles.d/ C lines cause the tmpfiles operation to fail if their
source happens to be missing. It's a problem if we can't set up the
destination properly (which is the job of systemd-tmpfiles after all),
but if the source is simply missing (NB: setting up the source is the job of
of the rules writer) this shouldn't be a problem.

This is useful for copying stuff into place if it happens to exist. For
example, if systemd-stub passes additional data into the initrd's
/.extra/ directory, we can copy it into a better place (e.g. /run/) with
this, where it will survive the initrd→host transition.

This mirrors behaviour of the recently added "^" line modifier which may
be used source "w" lines from credentials – there two the behaviour is
to simply skip the line if the source is missing.
2022-08-26 11:11:48 +02:00
Yu Watanabe
1a0e065e9f test: wait for loop device to be removed
Follow-up for bca762ce1a.

Fixes #24450.
2022-08-26 07:38:38 +00:00
Zbigniew Jędrzejewski-Szmek
4ccde410a3 tree-wide: change --kill-who to --kill-whom
getopt allows non-ambiguous abbreviations, so backwards-compat is maintained, and
people can use --kill-who (or even shorter abbreviations). English is flexible,
so in common speach people would use both forms, even if "whom" is technically
more correct. The advantage of using the longer form in the code is that we
effectively allow both forms, so we stop punishing people who DTGCT¹, but still
allow people to use the spoken form if they prefer.

1. Do the gramatically correct thing
2022-08-26 11:15:44 +09:00
Andrew Stone
dc06321fe3 job: Don't discard propagated restart jobs when unit is activating
When a service unit Requires= a socket, and the socket is restarted while the
service is in state=activating, the propagated restart is being discarded. This
is contrary to the documentation for Requires=, which states "this unit will be
stopped (or restarted) if one of the other units is explicitly stopped (or
restarted)".
2022-08-25 16:38:23 -07:00
Andrew Stone
01532c2d16 test: Move testsuite-03 units to .units directory 2022-08-25 16:32:31 -07:00
Frantisek Sumsal
0f1f562974 test: make TEST-63 more reliable on slower machines
Otherwise we might never hit the trigger limit and wait indefinitely.

Found when trying to run the test on an EC2 xen machine without a nested
virt in CentOS CI (in preparations for some ... unforseseen consequences).
2022-08-25 16:21:39 +00:00
Lennart Poettering
5b9ae04c65
Merge pull request #24242 from msekletar/terminate-idle-sessions
Add option to stop idle sessions after specified timeout
2022-08-25 11:39:42 +02:00
Luca Boccassi
298b3de6d4
Merge pull request #24370 from keszybz/sysusers-equivs
Use /bin/bash for root shell and suppress some warnings from sysusers
2022-08-24 21:35:28 +01:00
Michal Sekletar
5aa633db22 tests: add test for StopIdleSessionSec= option 2022-08-24 14:50:52 +02:00
Zbigniew Jędrzejewski-Szmek
8a7adccbdb various: try to use DEFAULT_USER_SHELL for root too
/bin/sh as a shell is punishing. There is no good reason to make
the occasional root login unpleasant.

Since /bin/sh is usually /bin/bash in compat mode, i.e. if one is
available, the other will be too, /bin/bash is almost as good as a default.
But to avoid a regression in the situation where /bin/bash (or
DEFAULT_USER_SHELL) is not installed, we check with access() and fall back
to /bin/sh. This should make this change in behaviour less risky.

(FWIW, e.g. Fedora/RHEL use /bin/bash as default for root.)

This is a follow-up of sorts for 53350c7bba,
which added the default-user-shell option, but most likely with the idea
of using /bin/bash less ;)

Fixes #24369.
2022-08-24 10:02:46 +02:00
Luca Boccassi
c8bc7519c8 service: set TRIGGER_UNIT= and TRIGGER_TIMER_REALTIME_USEC/MONOTONIC_USEC on activation by timer unit
Same as path unit, best effort.
2022-08-23 21:19:54 +01:00
Luca Boccassi
4c42032854 service: set TRIGGER_UNIT= and TRIGGER_PATH= on activation by path unit
When a service is triggered by a path unit, pass the
path unit name and the path that triggered it via env vars
to the spawned processes.
Note that this is best-effort, as there might be many triggers
at the same time, but we only get woken up by one.
2022-08-23 20:38:08 +01:00
Luca Boccassi
d4f38ff036 test-63: convert to full shell script and generalize
Will add more path unit tests later
2022-08-23 20:04:41 +01:00
Frantisek Sumsal
bca762ce1a test: wait for the lodev to get properly initialized
Otherwise we might start writing to one of its partition before the
respective node is created under /dev, resulting in... interesting
stuff.

Resolves: #24390
2022-08-23 17:38:43 +00:00
Luca Boccassi
712e0b4792
Merge pull request #23893 from yuwata/core-mount-re-read-mountinfo
core/mount: adjust deserialized state based on if the corresponding mountinfo entry exists or not
2022-08-23 12:46:39 +01:00
Frantisek Sumsal
3398a73254 test: install /etc/default/knot if available as well
The knot.service on Ubuntu Jammy loads an env file which we didn't
install, causing the service to fail:

```
knot.service: Will spawn child (service_enter_start_pre): /usr/sbin/knotc
knot.service: Failed to load environment files: No such file or directory
knot.service: Failed to run 'start-pre' task: No such file or directory
knot.service: Failed with result 'resources'.
knot.service: Service will not restart (restart setting)
```
2022-08-23 11:26:35 +01:00
eggfly
6b5e82408d fix typos 2022-08-23 10:53:47 +02:00
Lennart Poettering
8ef6106de4
Merge pull request #24392 from poettering/chase-symlinks-more-stuff
some tweaks to chase_symlinks() and port some code from prefix_roota() over
2022-08-22 18:41:14 +02:00
Yu Watanabe
760971125d test: make TEST-58-REPART support nspawn 2022-08-22 17:00:38 +02:00
Yu Watanabe
2b21522e82 test: merge test-repart.sh and TEST-58-REPART 2022-08-22 17:00:38 +02:00
Yu Watanabe
5996f11679 test: modernize TEST-58-REPART 2022-08-22 17:00:38 +02:00
Lennart Poettering
3979ea8644 hwdb-test: don't rely on --root= quirk
Previously, the test would rely on the fact that systemd-hwdb would
follow symlinks outside of the --root= hierarchy. That's a bug however,
and systemd-hwdb shouldn't do that. Hence let's remove the fact that the
test relies on it, so that we can then fix systemd-hwdb (specifically:
conf_files_list()) accordingly.
2022-08-22 14:07:45 +02:00
Zbigniew Jędrzejewski-Szmek
87c696f247 sysusers: use log_syntax (changes prefix from '[%s:%u]' to '%s:%u:')
This makes the sysusers use the same message convention as other tools.
Also adds the prefix in a few places.
2022-08-22 12:52:25 +02:00
Yu Watanabe
1283eea8f4 test: add test case for chassis type 2022-08-22 19:26:31 +09:00
Yu Watanabe
b249834bc3 test-network: add test for issue #24377
The issue has been already fixed by
b05e52000b (PR #24020).
2022-08-20 20:50:02 +09:00
Yu Watanabe
5bd2a7c580 test-network: add helper functions for reading logs of networkd 2022-08-20 20:35:18 +09:00
Yu Watanabe
1af39ef2f6 test: wait for whole block device instead of partition
In 'udevadm lock' the device /dev/loopX is locked instead of
/dev/loopXp1. Hence, 'udevadm wait' should wait for /dev/loopX.

For some reasons, the kernel sometimes does not emit uevent for
partitions, and 'udevadm wait' for partitions may fail.

Fixes #24360.
2022-08-20 09:01:14 +09:00
Frantisek Sumsal
bea9d62bdb test: correctly process multiline strings in $KERNEL_APPEND
Some tests (like TEST-02) set a multiline string to $KERNEL_APPEND
(which is a valid thing to do), unfortunately we'd use only the first
line of it and throw the rest away, e.g:

```
$ printf "%s" "$x"
hello

this is a multiline

kernel command line
$ read -ra out <<< "$x"
$ printf "%s" "${out[@]}"
hello
```

Let's use readarray/mapfile instead to avoid this:

```
$ readarray out <<< "$x"
$ printf "%s" "${out[@]}"
hello

this is a multiline

kernel command line

```
2022-08-19 22:31:32 +01:00
Michal Sekletar
466266c172 rules: import previous SYSTEMD_READY state for suspended DM devices and skip other rules
We can't get any FS meta-data from a suspended device. Hence defer
making any plugged/unplugged decisions, i.e. we just import whatever was
previous state and skip processing all other rules.

Thanks Lennart Poettering <lennart@poettering.net> for suggesting this
solution.
2022-08-19 20:13:47 +01:00
Lennart Poettering
d8776eed9b TEST-70-TPM2: use "truncate" to generate disk image
Let'se operate on a sparse file here, to reuduce memory use.
2022-08-19 16:34:30 +02:00
Lennart Poettering
be06a84c8d TEST-70-TPM2: actually enable systemd-measure test
A bit emberassing that this never worked.
2022-08-19 14:54:30 +02:00
Yu Watanabe
3af934bceb test-network: add tests for IPv4ACD and renewing DHCP address 2022-08-18 15:44:53 +09:00
Yu Watanabe
fd022b1da5 test-network: drop unused .network file 2022-08-18 15:44:53 +09:00
Luca Boccassi
5ad8116a87 test: expect libdevmapper failure in TEST-50-DISSECT
libdevmapper/device mapper driver can return semi-random failures when
opening verity devices, and we have fallback code to deal with it.
But the test was not expecting the fallback path, so it became unreliable.

Fixes https://github.com/systemd/systemd/issues/23866
2022-08-18 01:35:06 +01:00
Yu Watanabe
0161378cf7
Merge pull request #24333 from yuwata/sysctl
sysctl: improve performance for applying glob pattern
2022-08-17 21:56:15 +09:00
Yu Watanabe
59edcf2b64 test-network: add/update module check
For https://github.com/systemd/systemd-centos-ci/pull/517.
2022-08-17 10:05:20 +00:00
Yu Watanabe
fa9bd36937 test: add tests for glob sysctl pattern 2022-08-17 14:30:20 +09:00
Yu Watanabe
86fc149c69 test: use assertions in sysctl tests 2022-08-17 14:30:20 +09:00
Yu Watanabe
3f75892dd2 test: do not use sysctl.d to store test conf
Otherwise, late invocations of systemd-sysctl, especially through udev
rules may fail.
2022-08-17 14:30:20 +09:00
Luca Boccassi
e4e6cfaad0
Merge pull request #24301 from yuwata/network-tuntap
network/tuntap: introduce KeepFileDescriptor= setting
2022-08-16 23:06:16 +01:00
Yu Watanabe
21d0ed68ee test-network: add tests for MTUBytes= for bridge master and ports
Prompted by #24311.
2022-08-16 21:46:40 +00:00
Kai Lueke
1abe15fe9d man: Correct information on sysext masking
While I had tested that a symlink to /dev/null works to "mask" a sysext
I must have gotten something wrong and thus the instructions in
519c2f0d6b don't work. What works,
at least at the moment, is to instead have an empty directory with the
extension name under /etc/extensions/.
Correct the info in the man page and add a test for it.
2022-08-16 20:43:51 +01:00
Yu Watanabe
ae014ecb3d test-network: add tests for KeepCarrier= for tuntap interfaces 2022-08-16 21:57:35 +09:00
Yu Watanabe
f8b7c17764 network/tuntap: introduce KeepCarrier= setting
Closes #24267.
2022-08-16 21:57:31 +09:00
Lennart Poettering
e228d48b9e
Merge pull request #24263 from pothos/sysext-for-static-binaries
sysext: Support distribution-independent extensions with static binaries
2022-08-15 13:34:54 +02:00
Kai Lueke
16c1ca0db4 sysext: introduce ARCHITECTURE field to match host architecture
When an extension image has binaries they should match the host
architecture. Currently there is no way to specify this requirement.
Introduce an ARCHITECTURE field in the extension's release file that
may be set to prevent loading on the wrong host architecture.
Since this new field is introduced late, we don't want to make
specifying it mandatory as it would break existing sysext images.

See https://github.com/systemd/systemd/issues/24061
2022-08-15 10:54:32 +02:00
Kai Lueke
ab4d43c54e sysext: support distribution-independent extensions using ID=_any
A sysext image that merely contains static binaries has no dependency
on the host distribution and should be able to be used anywhere.
Support the special '_any' value for the ID field in the extension to
opt-out of ID and VERSION_ID/SYSEXT_LEVEL matching.

See https://github.com/systemd/systemd/issues/24061
2022-08-15 10:51:01 +02:00
Yu Watanabe
3f504b892b network/bridge: fix UseBPDU= and AllowPortToBeRoot=
Fixes bugs caused by 7f9915f0de.

Fixes #24268.
2022-08-14 06:56:05 +09:00
Yu Watanabe
85b1a14d70 test-network: use "systemctl restart" to restart networkd 2022-08-14 03:56:01 +09:00
Yu Watanabe
93f5ae6ba2 test-network: also set StartLimitIntervalSec=0 for systemd-networkd.socket
The socket unit is frequently restarted during the test.
2022-08-14 03:49:00 +09:00
Jan B
7fd55538aa tests: systemd-cryptenroll: unlock volume with keyfile 2022-08-11 12:32:52 +02:00
Lennart Poettering
46cfc85f7e
Merge pull request #23848 from yuwata/core-device-systemd-wants
core: fix SYSTEMD_WANTS and StopWhenUnneeded=
2022-08-10 14:43:25 +02:00
Yu Watanabe
23b3819209 test-network: split out qdisc and wait-online tests from NetworkdNetworkTests 2022-08-09 19:37:50 +09:00
Yu Watanabe
4c7d13f4b2 test-network: split test_qdisc() and test_qdisc2()
And check module availability in each tests.

This also sorts qdisc tests.
2022-08-09 19:37:50 +09:00
Yu Watanabe
854f989958 test-network: check qdisc feature by module existence 2022-08-09 19:37:50 +09:00
Yu Watanabe
5cdc7c89cb test-network: rename tun99 and tap99
The names seem to be used in AWS.

This also merges test_tun() and test_tap().
2022-08-09 19:37:49 +09:00
Yu Watanabe
17479d51cc test-network: show stdout and stderr on failure in check_output() 2022-08-09 19:37:49 +09:00
Yu Watanabe
66504b22e2 test-network: drop unused text= arguments 2022-08-09 19:37:49 +09:00
Yu Watanabe
b05c4d6bbf test-network: also run timesyncd under sanitizer or valgrind 2022-08-09 19:37:49 +09:00
Yu Watanabe
67a9b3ec94 test-network: use timedatectl in build directory 2022-08-09 19:37:49 +09:00
Lennart Poettering
65a667c49c
Merge pull request #23511 from diabonas/tpm2-pin-systemd-gpt-auto-generator
cryptsetup: make systemd-gpt-auto-generator work with TPM2 and PIN
2022-08-08 15:40:03 +02:00
João Loureiro
5ded3917a1
Fix issue with system time set back (#24131)
Fixes #6036
2022-08-08 15:32:19 +02:00
Jonas Witschel
559a1d35d5 cryptsetup: test unlocking using a TPM2 LUKS2 token plugin with a PIN
Test the functionality implemented in the previous commit ("cryptsetup: ask for
PIN when trying to activate using a LUKS2 token plugin"): when "tpm2-device" is
not specified, systemd-cryptsetup calls crypt_activate_by_token_pin() to try to
unlock using a LUKS2 token plugin, test whether this is able to obtain the
provided PIN.
2022-08-05 12:22:27 +02:00
Yu Watanabe
14e7bc2e77
Merge pull request #23367 from yuwata/core-mount
core/mount: fix dependency issues
2022-08-05 13:48:23 +09:00
Yu Watanabe
49ad287292 test-network: support the case that l2tp module is not supported
Hopefully fixes the issue reported at
https://github.com/systemd/systemd-centos-ci/pull/517#issuecomment-1205399798.
2022-08-04 18:39:04 +00:00
Yu Watanabe
413f20b4ac test: add test case for mount unit dependencies 2022-08-05 01:35:38 +09:00
Michal Sekletar
03860190fe scope: allow unprivileged delegation on scopes
Previously it was possible to set delegate property for scope, but you
were not able to allow unprivileged process to manage the scope's cgroup
hierarchy. This is useful when launching manager process that  will run
unprivileged but is supposed to manage its own (scope) sub-hierarchy.

Fixes #21683
2022-08-04 17:01:13 +02:00
Frantisek Sumsal
a552061ebb test: skip the relevant test case if systemd-measure is not present
systemd-measure is not built without gnu-efi, which is the case, for
example, on ppc64le. Let's skip the relevant test case in this case
instead of failing.

```
The Meson build system
Version: 0.58.2
...
Host machine cpu family: ppc64
Host machine cpu: ppc64le
...
Message: Skipping systemd-measure.1 because HAVE_GNU_EFI is false
...
[  115.711775] testsuite-70.sh[745]: + cat
[  115.741996] testsuite-70.sh[832]: + /usr/lib/systemd/systemd-measure calculate --linux=/tmp/tpmdata1 --initrd=/tmp/tpmdata2
[  115.754015] testsuite-70.sh[833]: + cmp - /tmp/result
[  115.758004] testsuite-70.sh[832]: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh: line 56: /usr/lib/systemd/systemd-measure: No such file or directory
[  115.773851] testsuite-70.sh[833]: cmp: EOF on - which is empty
[  115.983681] sh[835]: + systemctl poweroff --no-block
```
2022-08-04 13:18:47 +00:00
Luca Boccassi
33b7d7b284
Merge pull request #24141 from DaanDeMeyer/dissect-umount
dissect: Add systemd-dissect --umount
2022-08-04 01:02:55 +01:00
Luca Boccassi
872f9da4d8 integritysetup: do not use crypt_init_data_device after crypt_init
crypt_init_data_device() replaces the crypt_device struct with a
new allocation, losing the old one, which we get from crypt_init().
Use crypt_set_data_device() instead.

Enhance the test to cover this option too.
2022-08-04 00:58:57 +01:00
Daan De Meyer
ac1f1adfc6 dissect: Add systemd-dissect --umount
This command takes a mountpoint, unmounts it and makes sure the
underlying partition devices and block device are removed before
exiting.

To mirror the --mount operation, we also add a --rmdir option which
does the opposite of --mkdir, and a -U option which is a shortcut
for --umount --rmdir.
2022-08-03 20:55:32 +02:00
Frantisek Sumsal
03f5e9b221 test: optionally wait a bit when checking the mount unit
On fast systems we might race against systemd and check the mount unit
after mounting it way too early before systemd had a chance to react to
the change.

```
[    4.677701] H systemd[1]: Event source 0x210b3b0 (mount-monitor-dispatch) entered rate limit state.
...
[    4.863731] H testsuite-64.sh[812]: + mount /logsysfsRxx
[    4.865918] H kernel: EXT4-fs (vda2): mounted filesystem with ordered data mode. Opts: (null)
[    4.866213] H testsuite-64.sh[812]: + systemctl status /logsysfsRxx
[    4.877502] H testsuite-64.sh[919]: ○ logsysfsRxx.mount - /logsysfsRxx
[    4.877502] H testsuite-64.sh[919]:      Loaded: loaded (/etc/fstab; generated)
[    4.877502] H testsuite-64.sh[919]:      Active: inactive (dead)
[    4.877502] H testsuite-64.sh[919]:       Where: /logsysfsRxx
[    4.877502] H testsuite-64.sh[919]:        What: /dev/disk/by-uuid/deadbeef-dead-dead-beef-222222222222
[    4.877502] H testsuite-64.sh[919]:        Docs: man:fstab(5)
[    4.877502] H testsuite-64.sh[919]:              man:systemd-fstab-generator(8)
[    4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Processing implicit device dependencies
[    4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Added Requires dependency on /dev/disk/by-uuid/deadbeef-dead-dead-beef-222222222222
[    4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Added StopPropagatedFrom dependency on /dev/disk/by-uuid/deadbeef-dead-dead-beef-222222222222
[    4.895683] H sh[920]: + systemctl poweroff --no-block
[    4.906533] H systemd[1]: Found unit logsysfsRxx.mount at /run/systemd/generator/logsysfsRxx.mount (regular file)
[    4.906594] H systemd[1]: Preset files don't specify rule for logsysfsRxx.mount. Enabling.
[    4.906990] H systemd[1]: testsuite-64.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
[    4.907057] H systemd[1]: testsuite-64.service: Failed with result 'exit-code'.
[    4.907287] H systemd[1]: Failed to start testsuite-64.service.
[    4.955293] H systemd[1]: Starting end.service...
[    4.955736] H systemd-logind[809]: The system will power off now!
[    4.955868] H systemd-logind[809]: System is powering down.
[    4.975781] H systemd[1]: Event source 0x210b3b0 (mount-monitor-dispatch) left rate limit state.
[    4.975821] H systemd[1]: logsysfsRxx.mount: Processing implicit device dependencies
[    4.975857] H systemd[1]: logsysfsRxx.mount: Added Requires dependency on /dev/vda2
[    4.975893] H systemd[1]: logsysfsRxx.mount: Added StopPropagatedFrom dependency on /dev/vda2
[    4.975928] H systemd[1]: Unit blockdev@dev-vda2.target has alias blockdev@.target.
[    4.975967] H systemd[1]: logsysfsRxx.mount: Added After dependency on /dev/vda2
[    4.976081] H systemd[1]: logsysfsRxx.mount: Changed dead -> mounted
```
2022-08-03 15:39:19 +00:00
Frantisek Sumsal
d2efca1c12
Merge pull request #24178 from mrc0mmand/libgcc_s
test: install libgcc_s.so.1 explicitly if available
2022-08-03 07:22:19 +00:00
Frantisek Sumsal
134d4f1b9d test: be a bit more verbose about shared library symlinks
For example:
```
D: Installing /usr/lib64/libz.so.1.2.11
D: Creating symlink /usr/lib64/libz.so.1.2.11 -> /usr/lib64/libz.so.1
D: Creating extra symlink: /lib64/libz.so
D: Installing /usr/lib64/libgcc_s-12-20220507.so.1
D: Creating symlink /usr/lib64/libgcc_s-12-20220507.so.1 -> /usr/lib64/libgcc_s.so.1
```
2022-08-02 18:28:43 +02:00
Frantisek Sumsal
5f347d3160 test: install libgcc_s.so.1 explicitly if available
Since the library is dlopen()ed by libpthread and required during
pthread_exit()/pthread_cancel(), let's install it explicitly if available to
avoid unexpected fails in tests. This also consolidates all related
workarounds for this library across the test scripts.
2022-08-02 18:28:35 +02:00
Lennart Poettering
984638cde7 test: add trivial test for systemd-measure 2022-08-02 10:28:49 +02:00
Yu Watanabe
e4e0b239f6 test-network: add test case for #23197 2022-08-02 03:43:04 +09:00
Yu Watanabe
3cf9c51e97 test: restart logind before cleaning up sessions
Hopefully, fixes #24040.
2022-07-31 00:15:47 +09:00
Yu Watanabe
54d5c126d3 test: do not restart getty@tty2 automatically 2022-07-31 00:15:47 +09:00
Yu Watanabe
fe9d58b25a test: terminate session and user on cleanup 2022-07-31 00:15:47 +09:00
Lennart Poettering
8f304b991c
Merge pull request #23991 from yuwata/udev-reload
udev: reload rules and builtins only when mtime of a config changed
2022-07-25 11:20:08 +02:00
Quentin Deslandes
e88748c17e sysctl: add --strict option to fail if sysctl does not exists
systemd-sysctl currently fails silently under any of these conditions:
- Missing permission to write a sysctl.
- Invalid sysctl (path doesn't exists).
- Ignore failure flag ('-' in front of the sysctl name).

Because of this behaviour, configuration issues can go unnoticed as
there is no way to detect those unless going through the logs.

--strict option forces systemd-sysctl to fail if a sysctl is invalid or
if permission are insufficient. Errors on sysctl marked as "ignore
failure" will still be ignored.
2022-07-25 10:15:43 +02:00
Yu Watanabe
32ab27afe8 test-network: reload udevd when .link file is copied/removed 2022-07-23 15:05:22 +09:00
Yu Watanabe
c9fbe0bd10
Merge pull request #24074 from yuwata/network-dhcp6-rapid-commit
network: dhcp6: re-introduce RapidCommit= setting
2022-07-23 08:10:01 +09:00
Yu Watanabe
8015e25870 test: wait for user service or slice to be finished
Hopefully fixes #24040.
2022-07-22 19:47:09 +00:00
Yu Watanabe
91a7afdeae test-network: add tests for RapidCommit= 2022-07-22 21:28:24 +09:00
Yu Watanabe
b1eaae53a2 test-network: drop unnecessary call of systemctl
As the units are not started at that stage.
2022-07-22 10:36:00 +09:00
Yu Watanabe
249b7eccf7 test-network: drop unnecessary default argument 2022-07-22 10:34:33 +09:00
Yu Watanabe
87b308c825 test-network: do not stop/restart udevd and related socket units
That's not necessary. Moreover, if the socket units are stopped in
`setUpModule()`, then there exists a short timespan that we cannot call
`udevadm control`, as the control socket may not be opened yet.

If we run whole tests, then the first test is
NetworkctlTests.test_altname, and it calls `udevadm control` in `setUp()`.
Hence, the test may fail.

Fixes https://github.com/systemd/systemd-centos-ci/pull/512#issuecomment-1191591008.
2022-07-22 10:31:38 +09:00
Lennart Poettering
a0f4426d0f tmpfiles: automatically provision /etc/issue.d/ + /etc/motd.d/ + /etc/hosts from credentials 2022-07-21 00:06:22 +02:00
Lennart Poettering
1d77721f30 tmpfiles: accept additional tmpfiles lines via credential 2022-07-20 23:53:22 +02:00
licunlong
864d1a4f66 test: add a testcase for reexecuting with background mount job 2022-07-20 21:06:54 +09:00
Evgeny Vereshchagin
e99e4e4fec
Merge pull request #24025 from DaanDeMeyer/mkosi-sanitizers
mkosi: Changes to allow booting with sanitizers in mkosi
2022-07-18 19:24:51 +03:00
Daan De Meyer
7ca9563ca1 mkosi: Remove usage of deprecated option names/sections 2022-07-18 16:54:58 +02:00
Yu Watanabe
5509518193
Merge pull request #24047 from dtardon/list-users-linger
Add linger status to `loginctl list-users`
2022-07-18 15:05:25 +09:00
David Tardon
283db37a20 test: merge grep | awk calls 2022-07-17 20:26:09 +02:00
David Tardon
6083f7a604 test: add a simple test for list-users 2022-07-17 20:26:09 +02:00
Lennart Poettering
3acb6edef3 sysusers: allow defining additional sysusers lines via credentials 2022-07-16 00:47:22 +09:00
Lennart Poettering
9fbb7df7bc
Merge pull request #24011 from poettering/condition-cred
pid1: add new condition type "ConditionCredential=" for checking for credentials passed into the system
2022-07-15 15:03:49 +02:00
Lennart Poettering
708daf42d8 tmpfiles: optionally, decode string to write to files with base64
This is useful to use "f" or "w" to write arbitrary binary files to
disk, or files with newlines and similar (for example to provision SSH
host keys and similar).
2022-07-15 11:55:03 +02:00
Lennart Poettering
351f7d5143 fuzz: add ConditionCredential= to fuzz files, and sort their sections 2022-07-15 10:53:45 +02:00
Lennart Poettering
4f80cfca5e pid1: add mechanism for conditionalizing units/network/netdev/link based on credentials passed in
This is useful when provisioning systems via nspawn/qemu and running
specific services only if specific data is passed into the system.
2022-07-15 10:53:45 +02:00
Lennart Poettering
8de7de462b pid1: import creds from SMBIOS too, not just qemu's fw_cfg
This imports credentials also via SMBIOS' "OEM vendor string" section,
similar to the existing import logic from fw_cfg.

Functionality-wise this is very similar to the existing fw_cfg logic,
both of which are easily settable on the qemu command line.

Pros and cons of each:

SMBIOS OEM vendor strings:
   - pro: fast, because memory mapped
   - pro: somewhat VMM independent, at least in theory
   - pro: qemu upstream sees this as the future
   - pro: no additional kernel module needed
   - con: strings only, thus binary data is base64 encoded

fw_cfg:
   - pro: has been supported for longer in qemu
   - pro: supports binary data
   - con: slow, because IO port based
   - con: only qemu
   - con: requires qemu_fw_cfg.ko kernel module
   - con: qemu upstream sees this as legacy
2022-07-15 08:31:34 +09:00
Yu Watanabe
3f5ef8aeac
Merge pull request #24019 from yuwata/network-ipv4ll
network: refuse 169.254.0.0/24 and 169.254.255.0/24
2022-07-15 07:59:13 +09:00
Yu Watanabe
dfeb5a076a
Merge pull request #24016 from poettering/sysctl-cred-extra
sysctl: also process sysctl requests via the "sysctl.extra" credential
2022-07-15 04:20:35 +09:00
Yu Watanabe
72c747e6d1 test-network: add a test case for IPv4LLStartAddress= 2022-07-15 04:01:56 +09:00
Yu Watanabe
c1dd250f18
Merge pull request #23927 from AndreKalb/feature/ipv4-link-local-start-address
network: Feature IPv4 link-local start address
2022-07-15 03:21:26 +09:00
Lennart Poettering
39f0d1d2e7 sysctl: also process sysctl requests via the "sysctl.extra" credential 2022-07-14 18:02:58 +02:00
Michal Sekletar
527e0e8188 Revert "tests: add test for handling of background sessions"
This reverts commit bf40417c7c.
2022-07-14 11:07:13 +02:00
Andre Kalb
34b63c9e45 network: Add support to select an IPv4 link-local start address 2022-07-13 23:57:18 +02:00
David Tardon
9ac0855b61 test: add test for org.freedesktop.login1.Session SetType 2022-07-13 13:53:13 +02:00
David Tardon
bd681a7eb0 test: ensure cleanup functions return success
Otherwise the return value of the last command is propagated, which may
cause spurious test failures. E.g., pkill returns 1 if no process
matched, which may be a problem in cleanup session:

cleanup_session() {
...

    pkill -u "$(id -u logind-test-user)"
    sleep 1
    pkill -KILL -u "$(id -u logind-test-user)"
}

If there are no remaining processes when the final pkill runs, it will
return 1 and therefore cleanup_session will return 1 as well.
2022-07-13 13:53:13 +02:00
Yu Watanabe
f54dce2d4f test-network: save and restore timezone
Several DHCP client tests change the system timezone.
Let's save the current timezone at the beginning, and restore it with
the saved value at the end.
2022-07-13 10:30:48 +02:00
Yu Watanabe
e11d0e3925 test-network: wait for L2TP tunnels being removed
Fixes #23985.
2022-07-13 02:36:14 +02:00
Yu Watanabe
e755ad61ba test-network: support to remove routing policy rules with l3mdev flag 2022-07-11 22:39:26 +02:00
Yu Watanabe
b5dac5b0de test-network: merge stdout and stderr of invoked command by call()
Otherwise, the logs may be messed up.
2022-07-11 22:38:21 +02:00
Yu Watanabe
a962d85797 test-network: various cleanups
- introduce several helper functions
- do not list unit files, but remove the runtime unit directory in
  tearDown().
- do not list used interfaces, but remove all interfaces previously not
  exists in tearDown().
- save routes and routing policy rules before running tests, and flush
  unnecessary routes and rules in each tearDown() calls.
- drop many time.sleep() calls.
- call tearDown() after each sub tests.
- shorten code.
- several coding style fixes.
- etc, etc...

Hopefully, this improves performance of the test.
2022-07-11 19:57:24 +02:00
Yu Watanabe
286bf3a940 test-network: extend timeout for DHCP lease to be expired
Fixes #23964.
2022-07-11 16:54:45 +02:00
Yu Watanabe
37611ccb19 test-network: use wait_operstate() at one more place 2022-07-09 12:20:11 +09:00
Yu Watanabe
894ff7d1ab test-network: suppress periodic output in wait_operstate() 2022-07-09 12:19:52 +09:00
Yu Watanabe
163d095fc3 test-network: disable debugging logs from networkctl, resolvectl, and so on 2022-07-09 12:19:20 +09:00
Yu Watanabe
589af70b87 test-network: merge two DHCPv6 client tests 2022-07-09 11:44:25 +09:00
Yu Watanabe
4b31fc88ac test-network: replace sleep with wait_address() and wait_address_dropped() 2022-07-09 11:44:25 +09:00
Yu Watanabe
0730e3767d test-network: merge two more tests with test_dhcp_client_ipv4_only 2022-07-09 11:44:25 +09:00
Yu Watanabe
3d8e0aa2de test-network: merge tests for UseDNS= 2022-07-09 11:44:25 +09:00
Yu Watanabe
2d7a594fee test-network: merge two IPv4LL tests 2022-07-09 11:44:25 +09:00
Yu Watanabe
15519a81ac test-network: drop test_dhcp_client_ipv4_ipv6
As the test is covered by test_dhcp_client_reuse_address_as_static.
2022-07-09 11:44:25 +09:00
Yu Watanabe
2b6a24a602 test-network: check DHCPv4 address in more detail
Also, this drops redundant address check through networkctl.
2022-07-09 11:44:25 +09:00
Yu Watanabe
e81083f2d8 test-network: drop 25-dhcp-v4-server-veth-peer.network 2022-07-09 11:44:25 +09:00
Yu Watanabe
b17947d9cf test-network: drop meaningless test
On DHCPv6 lease renew, the kernel do not drop static routes, and hence
we do not try to reassign them. Hence, the test is mostly meaningless.
2022-07-09 11:44:25 +09:00
Yu Watanabe
063c7e9b13 test-network: introduce read_dnsmasq_log_file() helper function
This reduces the number of times that the log file is read.
Also, dropped unnecessary dump of the log file.
2022-07-09 11:44:25 +09:00
Yu Watanabe
a102a52c34 test-network: shorten sleep time a bit
Network interfaces will be ready after lease is acquired.
Hence, it is not necessary to wait more than lease time.
2022-07-09 11:44:25 +09:00
Yu Watanabe
1a8e1d7853 test-network: introduce read_link_state_file() helper function 2022-07-09 11:44:21 +09:00
Yu Watanabe
9d9fd4ad0a test: start test user session before idle action setting is changed
Otherwise, idle action may be triggered before starting the test user
session.

This also introduce create_session() and cleanup_session() helper
functions.

Fixes #23952.
2022-07-08 16:14:38 +00:00
Yu Watanabe
18f2638f48 test-network: merge DHCP client tests to improve performance 2022-07-08 13:04:02 +00:00
Yu Watanabe
74af762551 test: use timeout command to improve performance
c.f. #23723.
2022-07-08 07:02:13 +09:00
Yu Watanabe
d64c7623ab test: remove /failed and /testok before running test script 2022-07-08 07:00:02 +09:00
Yu Watanabe
0d6217efc1
Merge pull request #23937 from mrc0mmand/test-tweaks
Several ASan-related test suite tweaks
2022-07-08 06:25:57 +09:00
Frantisek Sumsal
8fec14a7d3 test: use PBKDF2 with capped iterations instead of Argon2
to reduce the amount of resources the test needs (similarly to TEST-24
where we do the same thing).
2022-07-07 20:54:41 +02:00
Frantisek Sumsal
1e42972958 test: make TEST-64 a bit more ASan friendly
Reduce the number of iterations in some of the test cases, since they
generate a huge amount of uevents and basically DoS udev (which can't
keep up while being slowed down by ASan). To avoid this, let's reduce
the number of iterations and bump the timeout when running under ASan,
since we're not interested in performance in such cases.
2022-07-07 20:54:41 +02:00
Frantisek Sumsal
0a62b8f705 test: avoid overriding an already existing EXIT handler
TEST-70 specified its own EXIT handler, which replaced the
`cleanup_loopdev` handler, so the loop device was always hanging around
once this test was run. Let's use the new `add_at_exit_handler()` stuff
to mitigate this.
2022-07-07 20:17:34 +02:00
Frantisek Sumsal
b92c3df242 test: allow multiple handlers for the EXIT signal
Bash allows only one handler per signal, so let's overcome this
limitation by having one dedicated EXIT signal which runs all registered
handlers from all over the place.
2022-07-07 20:17:34 +02:00
Frantisek Sumsal
98b27937cb test: bump the data partition size if we don't strip binaries
so we can run TEST-24 under sanitizers as well.

Also, when at it, use the 'named-fields' sfdisk format to make the code
a bit more descriptive without needing a manual.
2022-07-07 19:17:05 +02:00
Frantisek Sumsal
fdb70dd922 test: create an ASan wrapper for getent and su
since they "suffer" from the same issue as `login` and other binaries
that load PAM stuff
2022-07-07 19:17:05 +02:00
Yu Watanabe
63663a0f0f test: several cleanups for TEST-35-LOGIN
- use test_append_files() to install additional commands
- drop use of expect
- include assert.sh and use assertions at several places
- use timeout command at several places
- always use logind-test-user
- etc
2022-07-07 13:15:00 +00:00
Michal Sekletar
bf40417c7c tests: add test for handling of background sessions 2022-07-07 10:11:43 +09:00
Yu Watanabe
948fce5118 test: fix typo 2022-07-07 09:33:11 +09:00
Yu Watanabe
99080ed3f0
Merge pull request #23396 from msekletar/fix-idle-action-lock
logind: remember our idle state and use it to detect idle level transitions
2022-07-07 07:42:51 +09:00
Yu Watanabe
917c6bb4b3
Merge pull request #23916 from keszybz/assorted-patches
Assorted patches
2022-07-06 14:15:50 +09:00
Zbigniew Jędrzejewski-Szmek
cec3e9a774 fuzz: rename samples to avoid long test names 2022-07-05 21:49:12 +02:00
nl6720
0e68582323 tree-wide: link to docs.kernel.org for kernel documentation
https://www.kernel.org/ links to https://docs.kernel.org/ for the documentation.
See https://git.kernel.org/pub/scm/docs/kernel/website.git/commit/?id=ebc1c372850f249dd143c6d942e66c88ec610520

These URLs are shorter and nicer looking.
2022-07-04 19:56:53 +02:00
Yu Watanabe
7c38952e68
Merge pull request #23104 from mrc0mmand/resolved-tests
Introduce systemd-resolved test suite
2022-07-04 23:46:16 +09:00
Michal Sekletar
181656fc0f tests: verify that Lock D-Bus signal is sent when IdleAction=lock 2022-07-04 14:22:15 +02:00
Frantisek Sumsal
fb6f25d7b9 test: Introduce systemd-resolved test suite
Resolves: #19599
2022-07-04 12:21:55 +02:00
Frantisek Sumsal
17082e8ac1 test: resize the terminal automagically with INTERACTIVE_DEBUG=yes 2022-07-04 09:41:06 +02:00
Frantisek Sumsal
8afe2f53b2 test: install /usr/libexec/vi as well
since `/bin/vi` (at least on Fedora) is a shell wrapper which runs
either `/bin/vim` or `/usr/libexec/vi` based on availability.
2022-07-04 09:41:06 +02:00
Nick Rosbrook
ddbc88188c test: copy libgcc_s.so.1 to TPM2 test image on Debian-like systems
On Ubuntu, cryptsetup does not link against libgcc_s.so.1 which leads to
the following test failure in TEST-70-TPM2:

 systemd[1]: Starting testsuite-70.service...
 systemd[329]: testsuite-70.service: Executing: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh
 testsuite-70.sh[329]: + export SYSTEMD_LOG_LEVEL=debug
 testsuite-70.sh[329]: + SYSTEMD_LOG_LEVEL=debug
 testsuite-70.sh[329]: + img=/var/tmp/test.img
 testsuite-70.sh[329]: + dd if=/dev/zero of=/var/tmp/test.img bs=1024k count=20 status=none
 testsuite-70.sh[329]: + echo -n passphrase
 testsuite-70.sh[329]: + cryptsetup luksFormat -q --use-urandom /var/tmp/test.img /tmp/passphrase
 testsuite-70.sh[333]: libgcc_s.so.1 must be installed for pthread_exit to work
 testsuite-70.sh[329]: /usr/lib/systemd/tests/testdata/units/testsuite-70.sh:
     line 12: 333 Aborted (core dumped) cryptsetup luksFormat -q --use-urandom $img /tmp/passphrase

To fix this, manually install libgcc_s.so.1 to the test image if running
on Debian-like systems.
2022-07-02 15:01:30 +01:00
Frantisek Sumsal
d1b1bbfbfa test: add a simple test for daemon-reexec 2022-07-02 05:23:03 +09:00
Michael Biebl
41d6f3bf4d Use https for freedesktop.org
grep -l -r http:// | xargs sed -E -i s'#http://(.*).freedesktop.org#https://\1.freedesktop.org#'
2022-06-28 13:10:05 +02:00
Yu Watanabe
9fd1f8eea9 test: add udev tests for SYSTEMD_WANTS
For issue #23410.
2022-06-28 08:25:56 +09:00
Yu Watanabe
386427cfcf test: disable echo earlier 2022-06-28 06:34:18 +09:00
Frantisek Sumsal
53008d0714 test: drop unnecessary || :
since we use `set +e` in the cleanup handler.
2022-06-26 22:06:02 +02:00
Frantisek Sumsal
eda0e525d3 test: run TEST-21 in nspawn only if $TEST_PREFER_NSPAWN is set
so we can run it under nspawn in CIs which don't support nested KVM, but
avoid running it twice (both under nspawn and qemu) in CIs which support
both methods.
2022-06-26 22:06:02 +02:00
Frantisek Sumsal
71cde065b5 test: make TEST-21-DFUZZER work in containers
by avoiding fuzzing networkd and timesyncd when running in a container.
2022-06-26 22:06:02 +02:00
Yu Watanabe
a32badc5a6 Revert "networkd: NetLabel integration"
This reverts PR #23269 and its follow-up commit. Especially,
2299b1cae3 (partially), and
3cf63830ac.

The PR was merged without final approval, and has several issues:
- The NetLabel for static addresses are not assigned, as labels are
  stored in the Address objects managed by Network, instead of Link.
- If NetLabel is specified for a static address, then the address
  section will be invalid and the address will not be configured,
- It should be implemented with Request object,
- There is no test about the feature.
2022-06-22 22:34:26 +09:00
Yu Watanabe
b48ed70c79 Revert NFTSet feature
This reverts PR #22587 and its follow-up commit. More specifically,
2299b1cae3 (partially),
e176f855278d5098d3fecc5aa24ba702147d42e0,
ceb46a31a01b3d3d1d6095d857e29ea214a2776b, and
51bb9076ab8c050bebb64db5035852385accda35.

The PR was merged without final approval, and has several issues:
- OSS fuzz reported issues in the conf parser,
- It calls synchrnous netlink call, it should not be especially in PID1,
- The importance of NFTSet for CGroup and DynamicUser may be
  questionable, at least, there was no justification PID1 should support
  it.
- For networkd, it should be implemented with Request object,
- There is no test for the feature.

Fixes #23711.
Fixes #23717.
Fixes #23719.
Fixes #23720.
Fixes #23721.
Fixes #23759.
2022-06-22 22:23:58 +09:00
Frantisek Sumsal
dc350e78fe test: allow overriding $QEMU_MEM when running w/ ASan 2022-06-21 14:03:57 +02:00
Frantisek Sumsal
56e8ee55d5 test: make the shutdown routine a bit more "robust"
Replace the call to the `end.service` with `systemctl poweroff`, since
it seems to cause issues no matter what `--job-mode=` is used:

```
[  129.070993] testsuite-21.sh[380]: ++ systemctl start --job-mode=flush end.service
[  129.154985] testsuite-21.sh[912]: Failed to start end.service: Transaction for end.service/start is destructive (sysinit.target has 'stop' job queued, but 'start' is included in transaction).
[  129.159636] testsuite-21.sh[912]: See system logs and 'systemctl status end.service' for details.
```

Also, add a "safety net" which bypasses the manager and does the
poweroff directly, since sometimes the D-Bus call performed by
`systemctl` might timeout (as the manager might be still processing data
from the fuzzing):

```
[  115.776778] sh[894]: + systemctl poweroff --no-block
[  166.164242] testsuite-21.sh[893]: Failed to start transient service unit: Connection timed out
[  166.269289] sh[894]: Call to PowerOff failed: Connection timed out
```
2022-06-21 12:11:43 +02:00
Frantisek Sumsal
5309b56505 test: drop the at_exit() coredump check
since we don't truncate the journal anymore.
2022-06-21 10:13:48 +02:00
Frantisek Sumsal
d3eb4159c9 test: make dfuzzer less verbose
Otherwise it oversaturates the journal, which in some cases can't keep
up with the load of messages (due to the performance penalty caused by
sanitizers), and gets killed by a watchdog.
2022-06-21 10:04:03 +02:00
Frantisek Sumsal
5dffa6b032 test: always force a new image for dfuzzer
Otherwise we might end up with an image containing broken service
symlinks and other things, which break certain parts of the test.
2022-06-21 10:01:30 +02:00
Frantisek Sumsal
0897048500 test: use saved process PID instead of %%
As the `%%` specifier might fail if the current job (i.e. the last
background job) already finished:

```
[   61.692196] testsuite-04.sh[656]: ++ systemd-id128 new
[   61.705407] testsuite-04.sh[263]: + ID=912cb8f8ef304153a123f772bb0fe9e0
[   61.706318] testsuite-04.sh[657]: + systemd-cat -t 912cb8f8ef304153a123f772bb0fe9e0 bash -c 'echo parent; (echo child) & wait'
[   61.720940] testsuite-04.sh[263]: + PID=657
[   61.721126] testsuite-04.sh[263]: + wait %%
[   61.723014] testsuite-04.sh[263]: /usr/lib/systemd/tests/testdata/units/testsuite-04.sh: line 96: wait: %%: no such job
```
2022-06-20 17:56:09 +00:00
Frantisek Sumsal
d768243a95 test: skip TEST-21-DFUZZER without ASan
as the test is quite time consuming and it yields more useful reports
when the target app is built with sanitizers.
2022-06-19 16:22:35 +02:00
Frantisek Sumsal
354b3364aa test: fuzz our dbus interfaces with dfuzzer 2022-06-19 16:22:35 +02:00
Frantisek Sumsal
508a7f04b3 test: make masking of supplementary services configurable 2022-06-19 11:27:41 +02:00