Luca Boccassi
d936595672
manager: restrict Dump*() to privileged callers or ratelimit
...
Dump*() methods can take quite some time due to the amount of data to
serialize, so they can potentially stall the manager. Make them
privileged, as they are debugging tools anyway. Use a new 'dump'
capability for polkit, and the 'reload' capability for SELinux, as
that's also non-destructive but slow.
If the caller is not privileged, allow it but rate limited to 10 calls
every 10 minutes.
2023-05-19 15:18:23 +01:00
Frantisek Sumsal
038efe6df1
test: build the SELinux test module on the host
...
Let's save some time and build the SELinux test module on the host
instead of a possibly unaccelerated VM. This brings the runtime of
TEST-06-SELINUX from ~12 minutes down to a ~1 minute.
2023-05-19 11:45:11 +02:00
Frantisek Sumsal
daeb95a1d8
test: drop generated stuff from the final coverage report
...
Let's drop stuff from the current $BUILD_DIR from the final coverage
report, as it's all generated files (mostly gperf) which we don't
really care about and it makes the Coveralls report confusing, since it
reports "source not available" for all such files.
2023-05-19 11:07:07 +02:00
Frantisek Sumsal
ff40235b9b
test: make the stress test slightly less stressful on slower machines
...
Without acceleration this part of the test takes over 10 minutes (!),
which feels quite unnecessary. Let's cut down the number of stuff we
dump to the journal in such case, but keep the original value if we run
with acceleration (since in that case it takes less than 10 seconds).
2023-05-19 10:48:15 +02:00
Yu Watanabe
65f2ff7998
Merge pull request #27685 from keszybz/the-semiannual-excercise-in-output-narrowing
...
The semiannual excercise in output narrowing
2023-05-19 03:04:47 +09:00
Yu Watanabe
ec0bd9611a
Merge pull request #27684 from mrc0mmand/more-nspawn-tests
...
test: further extend systemd-nspawn coverage
2023-05-19 03:00:54 +09:00
Luca Boccassi
8fb26ccd36
integration test: pass 'noresume' to qemu
...
When running on Debian/Ubuntu, I get a minute delay or so on every boot
because the local initramfs tries to resume from hibernation. This is
not really useful here, so always skip it
2023-05-18 16:45:55 +01:00
Frantisek Sumsal
2de77dbfc7
test: wrap setfacl when running with ASan
2023-05-18 17:30:36 +02:00
Zbigniew Jędrzejewski-Szmek
02e0f430a0
meson: rename "dist-check" suite to "dist"
...
*Now* one of those tests is the longest, let's make them a bit shorter.
2023-05-18 17:18:11 +02:00
Frantisek Sumsal
0d4519dd84
test: don't mount /sys & /proc if already mounted
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
cbd20ab41b
test: add a couple of tests for nspawn config files
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
28ed232639
test: create nspawn config files when collecting coverage
...
Which bind-mounts the $BUILD_DIR into the container. This whole coverage
thing is getting slightly ridiculous.
Follow-up to 3b2823a749
, but for non-machinectl containers.
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
d5a6ff8c18
test: cover --bind-user=
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
74696ba5ef
test: add a couple of sanity tests for --port=
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
cf260f799f
test: drop "check" from test case names
2023-05-18 16:50:24 +02:00
Frantisek Sumsal
f0193b4b63
test: exercise a couple of error paths in nspawn's OCI code as well
2023-05-18 16:50:24 +02:00
Zbigniew Jędrzejewski-Szmek
e2e736cbbd
fuzz: rename long samples
...
With those long filenames, output doesn't fit on the terminal.
2023-05-18 15:23:27 +02:00
Yu Watanabe
f0485be000
Merge pull request #27677 from mrc0mmand/test-followups
...
test: get rid of the busybox stuff
2023-05-18 17:47:02 +09:00
Frantisek Sumsal
a6dac790c8
test: explicitly use bash
...
To avoid unexpected surprised in CIs with different default shell.
2023-05-17 23:22:54 +02:00
Frantisek Sumsal
5656759d06
test: get rid of the busybox stuff
...
It already required a lot of workarounds, since the busybox utilities
often work differently than their "full" counterparts, and putting
the container together using our "tools" is quite simple anyway.
2023-05-17 23:22:54 +02:00
Frantisek Sumsal
c01f0184b9
test: mangle the machine ID only for the QEMU test part
...
systemd-nspawn doesn't like invalid machine IDs and refuses to boot with one:
TEST-74-AUX-UTILS RUN: Tests for auxiliary utilities
...
Spawning container TEST-74-AUX-UTILS--3 on /var/tmp/systemd-test-TEST-74-AUX-UTILS_3/root.
Press Ctrl-] three times within 1s to kill container.
Failed to read machine ID from container image: Structure needs cleaning
E: nspawn failed with exit code 1
Follow-up to b4d42a82eb
.
2023-05-17 15:10:22 +01:00
Frantisek Sumsal
7c6fa5bf16
test: move runas() to the shared utility library
2023-05-16 23:07:45 +02:00
Frantisek Sumsal
e71bac7222
test: make shellcheck happy again
...
No functional changes.
2023-05-16 23:07:45 +02:00
Frantisek Sumsal
16eb568766
test: merge TEST-48-START-STOP-NO-RELOAD into TEST-23-UNIT-FILE
2023-05-16 23:07:45 +02:00
Frantisek Sumsal
518c3e2722
test: merge TEST-49-RUNTIME-BIND-PATHS into TEST-23-UNIT-FILE
2023-05-16 23:07:45 +02:00
Frantisek Sumsal
ab1b2f22fd
test: clean up test artifacts
...
So we don't run into unexpected fails when two tests use the same paths.
2023-05-16 23:07:45 +02:00
Frantisek Sumsal
23cb7362f1
test: merge TEST-28-PERCENTJ-WANTEDBY into TEST-23-UNIT-FILE
2023-05-16 22:43:52 +02:00
Frantisek Sumsal
fb03fea2a2
test: merge TEST-56-EXIT-TYPE into TEST-19-CGROUP
...
And clean it up a bit.
2023-05-16 22:43:52 +02:00
Frantisek Sumsal
3999ea001a
test: rename TEST-19-DELEGATE to TEST-19-CGROUP
...
And clean it up a bit.
2023-05-16 22:43:52 +02:00
Frantisek Sumsal
5ff1c6fcde
test: introduce get_cgroup_hierarchy()
2023-05-16 22:43:52 +02:00
Frantisek Sumsal
cb153b4fe9
test: rename assert.sh to util.sh
...
So we can extend it with additional utility functions without making it
confusing.
No functional change.
2023-05-16 22:43:52 +02:00
Frantisek Sumsal
1fd24da616
test: merge TEST-33-CLEAN-UNIT into TEST-23-UNIT-FILE
2023-05-16 22:43:52 +02:00
Frantisek Sumsal
9245eb3cbd
test: merge TEST-27-STDOUTFILE into TEST-23-UNIT-FILE
2023-05-16 21:49:09 +02:00
Frantisek Sumsal
b4d42a82eb
test: merge TEST-14-MACHINE-ID into TEST-74-AUX-UTILS
2023-05-16 21:49:09 +02:00
Yu Watanabe
871a41f0ef
Merge pull request #27606 from YHNdnzj/loginctl-list-show-state
...
loginctl: list-{users,sessions}: add a column for showing state
2023-05-17 01:41:13 +09:00
Yu Watanabe
8c7dd49ad1
Merge pull request #27655 from yuwata/udev-net-assign-alternative-names-only-on-add-event
...
udev/net: assign alternative names only on add event
2023-05-17 01:39:40 +09:00
Frantisek Sumsal
a5a4d5a18e
Merge pull request #27651 from mrc0mmand/more-nspawn-tests
...
nspawn: OCI related fixes & tests
2023-05-16 17:26:25 +02:00
Mike Yuan
0313c41068
Merge pull request #27638 from YHNdnzj/upheldby-unit-file
...
unit-file: support UpheldBy= in [Install] settings (adding Upholds= deps from .upholds/)
2023-05-16 21:53:24 +08:00
Mike Yuan
306ff2e297
test: add test for state in loginctl list-{users,sessions}
2023-05-16 18:09:15 +08:00
Yu Watanabe
40b6b448bd
test: add tests for renaming network interface
2023-05-16 18:28:18 +09:00
Frantisek Sumsal
f00519b5b3
fuzz: update the base JSON for fuzz-nspawn-oci
2023-05-16 11:27:10 +02:00
Frantisek Sumsal
0d5896a949
test: add a couple of tests for nspawn's OCI stuff
2023-05-16 11:27:10 +02:00
Frantisek Sumsal
806b18240a
test: make $BUILD_DIR writable when rootfs is mounted read-only
...
Adjust two systemd-nspawn invocations where rootfs is mounted read-only,
to avoid gcov complaining.
2023-05-15 10:15:24 +02:00
Frantisek Sumsal
786f6d81f7
test: pass $BUILD_DIR as $COVERAGE_BUILD_DIR to the system manager
...
To make additional coverage-related tweaks slightly easier.
2023-05-15 10:06:54 +02:00
Mike Yuan
b5b1351317
test: add tests for UpheldBy= in [Install] section
2023-05-15 15:04:38 +08:00
Frantisek Sumsal
1c8bf49b67
test: update nspawn's basic config file used for fuzzing
2023-05-15 09:00:17 +02:00
Frantisek Sumsal
08d547a481
test: rename TEST-13-NSPAWN-SMOKE to TEST-13-NSPAWN
...
To make it consistent with the rest of the tests.
2023-05-14 19:32:07 +02:00
Frantisek Sumsal
703766408f
test: slightly extend the systemd-nspawn tests
2023-05-14 19:32:07 +02:00
Frantisek Sumsal
8416a15e5c
test: wait after sending a signal if necessary
...
On overloaded systems it might take a bit until the signal is sent,
processed, and the respective file is created.
2023-05-14 19:32:07 +02:00
Frantisek Sumsal
807626d1ce
test: install the overlayfs/loop modules unconditionally
2023-05-14 19:32:07 +02:00