Commit Graph
59469 Commits
Author SHA1 Message Date
Yu Watanabe 3228f89b8c udevadm-wait: introduce periodic timer for checking devices
When --initialized=no is specified, it is not necessary to wait
for uevents to be processed by udevd.
2022-08-29 13:44:42 +09:00
Yu Watanabe 23902d1c84 Revert "test: wait for loop device to be removed"
This reverts commit 1a0e065e9f.

This does not work as expected.

After `losetup --detach`, the kernel lazily removes the loop device.
But, systemd-dissect should gracefully handle that. If it does not, then
it is a bug in systemd-dissect.
Let's not hide the real issue in systemd-dissect.
2022-08-29 13:44:42 +09:00
adrian5 b72e5d9d8e man: Minor punctuation and word tweak 2022-08-29 11:29:57 +09:00
Yu Watanabe 8676bdb708 udev-util: minor cleanups for on_ac_power()
Follow-ups for #24420.
2022-08-28 21:46:45 +01:00
Luca Boccassi 704b0d8464 Merge pull request #24475 from yuwata/devpath
sd-device: introduce two helper functions for devnum
2022-08-28 21:09:10 +01:00
Yu Watanabe db68547998 network: drop unused timestamp 2022-08-28 09:18:34 +00:00
Yu Watanabe 0bfe2aa378 test-64: run one more subtest on non-KVM environment with relaxed condition 2022-08-28 09:18:18 +00:00
Uriel Corfa c0a18932dc docs: fix incorrect env var name for credentials directory
CREDENTIAL_PATH appears nowhere in the systemd source code.
$CREDENTIALS_DIRECTORY is what is used instead.
2022-08-28 17:35:58 +09:00
Yu Watanabe c4c9714464 shell-completion: drop unused $mode
Fixes #24473.
2022-08-28 08:11:26 +00:00
Yu Watanabe 381e48aa36 udevadm: replace find_device_from_path() with sd_device_new_from_path() 2022-08-28 08:10:22 +00:00
Yu Watanabe 8d2a55025b test-network: add missing online check 2022-08-28 08:07:25 +00:00
Yu Watanabe 53c8590f8d udev: do not kill workers when requested to set the same log level currently assigned
Also refuse invalid log level.
2022-08-28 08:06:25 +00:00
Yu Watanabe f86d991dd4 udev/net: drop unused timestamp 2022-08-28 07:49:46 +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 ca8228295e tree-wide: use devpath_from_devnum() and device_open_from_devnum()
Fixes #24465.
2022-08-28 10:10:50 +09:00
Yu Watanabe 42899bcee5 sd-device: skip to check diskseq if device is not initialized 2022-08-28 10:10:44 +09:00
Yu Watanabe ff65036cfe sd-device: introduce device_open_from_devnum() 2022-08-28 09:08:21 +09:00
Yu Watanabe f79fdea6fd sd-device: introduce devpath_from_devnum() 2022-08-28 09:08:21 +09:00
Yu Watanabe 4492b5d804 devnum-util: split-out device_path_make_inaccessible() 2022-08-28 09:08:21 +09:00
Yu Watanabe a2ded81f73 sd-device: rename device-util.c -> device-filter.c
The functions provided by the file are only used in sd-device.
2022-08-28 09:08:21 +09:00
Yu Watanabe 1100561cc7 growfs,repart: fix misuse of sd_device_get_devpath()
Follow-up for 0f79b3469f.

To obtain device node, sd_device_get_devname() must be used.
2022-08-28 09:08:21 +09:00
Yu Watanabe d5ef8d1b08 test-64: extend timeout for slower env e.g. non-kvm 2022-08-28 09:03:14 +09:00
Yu Watanabe 6dd3b818bb tree-wide: fix typo 2022-08-28 00:03:36 +09:00
Swapnil Devesh e4c346f789 hwdb: Add Dell Professional Sound Bar AE515 2022-08-27 23:40:16 +09:00
Yu Watanabe 5c467ef4fb loop-util: use filter provided by sd_device_enumerator 2022-08-27 11:32:11 +00:00
Yu Watanabe 989e350218 Merge pull request #24468 from yuwata/test-udev-debug
test: enable udev debug log
2022-08-27 18:18:30 +09: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
Yu Watanabe a3dd119b35 Merge pull request #23764 from enr0n/oomd-allow-managed-oom-preference
oomd: allow ManagedOOMPreference on all cgroups
2022-08-27 14:05:10 +09:00
Frantisek Sumsal 91685cf9f1 Merge pull request #24463 from mrc0mmand/ubuntu-ci-tweaks
(Not only) Ubuntu CI tweaks
2022-08-26 21:31:50 +00:00
Devendra Tewari 0f79b3469f systemd-growfs: use sd_device_new_from_devnum()
Use sd_device_new_from_devnum() instead of
device_path_make_major_minor_sysfs().
2022-08-26 20:33:03 +01: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
Nick Rosbrook b814de3054 oomd: fix off-by-one when dumping kill candidates
When we kill a cgroup that is towards the end of the sorted candidate
list (i.e. when we have to resort to killing a candidate with
ManagedOOMPreference=avoid), this cgroup is not logged in the candidate
list. This is due to an off-by-one error when assigning dump_until.
2022-08-26 12:40:58 -04:00
Nick Rosbrook 58b2f0d1f5 man: update ManagedOOMPreference entry to reflect new behavior 2022-08-26 12:40:58 -04:00
Nick Rosbrook 39f9eee882 oomd: add tests for oomd_fetch_cgroup_oom_preference
Add a new test function, test_oomd_fetch_cgroup_oom_preference, to test
the ManagedOOMPreference logic. For starters, cut the relevant tests out
of test_oomd_cgroup_context_acquire_and_insert, and add them to the new
function. Then, expand these tests to cover the new behavior.
2022-08-26 12:40:58 -04:00
Nick Rosbrook 652a4efb66 oomd: loosen the restriction on ManagedOOMPreference
The ManagedOOMPreference property is only honored on cgroups which are
owned by root. This precludes anyone from setting ManagedOOMPreference
on cgroups managed by user managers.

Loosen this restriction in the following way: when processing a
monitored cgroup for kill candidates, honor the ManagedOOMPreference
setting if the monitored cgroup and cgroup candidate are owned by the
same user. This allows unprivileged users to configure
ManagedOOMPreference on their cgroups without affecting the kill
priority of ancestor cgroups.

N.B. that since swap kill operates globally to kill the largest
candidate, it is not appropriate to apply this logic to the swap kill
scenario. Therefore, the existing restriction on ManagedOOMPreference
will remain when calculating candidates for swap kill.

Add a new function, oomd_fetch_cgroup_oom_preference, to assist with
this new logic. To simplify things, move the `user.oomd_{avoid,omit}`
xattr reads to this function so that the xattr reads and uid checks are
performed all at once.
2022-08-26 12:40:58 -04:00
Nick Rosbrook b1cd8ed420 core/cgroup: allow setting oomd xattrs from user manager
The extended attributes 'user.oomd_avoid' and 'user.oomd_omit' are used
to store the setting of the ManagedOOMPrefernce property. Since these
are user extended attributes, the access permissions are defined by the
file permissions, and there is no need to guard this from user managers.
2022-08-26 12:40:58 -04:00
Sonali Srivastava 31a07872fa sleep: doc update for multiple battery, acpi_btp support and freeze/thaw user.slice 2022-08-26 17:38:36 +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