Lennart Poettering
de70ecb328
import-creds: add support for binary credentials specified on the kernel cmdline
2023-07-04 23:19:48 +02:00
Lennart Poettering
53888c3393
test: verify that the getty generator with creds works
2023-07-04 23:14:21 +02:00
Lennart Poettering
51235f2fe6
test: add simple fstab credential test
2023-07-04 23:09:39 +02:00
Lennart Poettering
4a262d5677
test: add test for initrd credentials
...
This extends the test framework a bit, and allows adding additional
initrds to the qemu invocation, which we use here to place credentials
in the new /run/systemd/@initrd/ credentials dir which are then passed
to the host.
2023-07-04 23:05:23 +02:00
Lennart Poettering
c86a95082b
systemctl: implement a new "whoami" verb, that just returns unit of caller/PID
2023-07-04 01:05:02 +01:00
Frantisek Sumsal
f2492d39ba
test: wait for the interface to become routable after reconfiguring
...
Since 6e8477edd3
TEST-75 started failing with:
[ 571.468298] testsuite-75.sh[46]: + for addr in "${DNS_ADDRESSES[@]}"
[ 571.468298] testsuite-75.sh[46]: + run delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[ 571.468899] testsuite-75.sh[562]: + tee /tmp/tmp.qKlHPbCCJZ
[ 571.469317] testsuite-75.sh[561]: + delv @fd00:dead:beef:cafe::1 -t A mail.signed.test
[ 571.501381] testsuite-75.sh[562]: ;; network unreachable resolving 'mail.signed.test/A/IN': fd00:dead:beef:cafe::1#53
[ 571.501564] testsuite-75.sh[562]: ;; resolution failed: SERVFAIL
[ 571.515457] testsuite-75.sh[46]: + grep -qF '; fully validated' /tmp/tmp.qKlHPbCCJZ
Let's wait for the dns0 interface to become routable again after
re-enabling IPv6 to, hopefully, mitigate this.
2023-07-04 08:10:11 +09:00
Lennart Poettering
f4b24db7c3
test: add test case for recent OnSuccess=/OnFailure= state machine changes
2023-07-03 17:31:25 +02:00
Frantisek Sumsal
69eeb6f15e
test: use correct path for systemd-battery-check
...
Follow-up to #28185 .
2023-06-29 13:06:42 +01:00
Yu Watanabe
be994c2640
battery-check: several follow-ups
...
Follow-ups for e3d4148d50
.
- add reference to initrd-battery-check.service in man page, and move
its section from 1 to 8,
- add link to man page in help message,
- introduce ERRNO_IS_NO_PLYMOUTH(),
- propagate error in battery_check_send_plymouth_message(),
- rename battery_check_send_plymouth_message() -> plymouth_send_message(),
- return earlier when the first battery level check passed to reduce
indentation,
- fix potential use of invalid fd on battery restored,
- do not use emoji for /dev/console,
- add simple test (mostly for coverity),
etc, etc...
2023-06-29 15:41:00 +09:00
Lennart Poettering
580a007bb6
test: add test for new XDG_STATE_HOME handling
2023-06-28 22:09:19 +02:00
Luca Boccassi
1c53c3bab1
Merge pull request #28178 from mrc0mmand/nss-tests
...
test: add a couple of tests for nss-myhostname & nss-mymachines
2023-06-28 19:41:11 +01:00
Frantisek Sumsal
0f90d4f0c3
test: add a couple of tests for nss-mymachines
2023-06-28 17:04:31 +02:00
Lennart Poettering
f70c90f5ca
analyze: add new "pcrs" verb
...
It shows the PCRs we know about along with their name strings and
current values.
2023-06-28 16:50:50 +02:00
Frantisek Sumsal
1a36d2672f
test: add a couple of tests for nss-myhostname
2023-06-28 11:07:46 +02:00
Luca Boccassi
8da88af877
Merge pull request #28064 from bluca/test_oomd_swap
...
TEST-55-OOMD: use 'stress' to create high pressure, ensure swap is set up correctly on Ubuntu CI
2023-06-26 19:39:07 +01:00
Frantisek Sumsal
7f5f781cf4
test: fix test service unit description
2023-06-26 15:54:01 +02:00
Luca Boccassi
72a28bf8ef
Merge pull request #28149 from mrc0mmand/test-machinectl-bump-container-size
...
test: bump the test container size to 64 MiB
2023-06-25 12:01:30 +01:00
Frantisek Sumsal
256c1ac9a8
test: bump the test container size to 64 MiB
...
As 32 MiB appears to be on the edge of barely enough on C8S:
[ 149.974689] testsuite-13.sh[601]: + dd if=/dev/zero of=/tmp/container.raw bs=1M count=32
[ 150.388423] testsuite-13.sh[1096]: 32+0 records in
[ 150.390721] testsuite-13.sh[1096]: 32+0 records out
[ 150.392450] testsuite-13.sh[1096]: 33554432 bytes (34 MB, 32 MiB) copied, 0.354336 s, 94.7 MB/s
[ 150.396422] testsuite-13.sh[601]: + mkfs.ext4 /tmp/container.raw
[ 150.472209] testsuite-13.sh[1097]: mke2fs 1.45.6 (20-Mar-2020)
[ 150.561303] testsuite-13.sh[1097]: Discarding device blocks: done
[ 150.565438] testsuite-13.sh[1097]: Creating filesystem with 32768 1k blocks and 8192 inodes
[ 150.568301] testsuite-13.sh[1097]: Filesystem UUID: d8e3c43b-0f1f-4e89-8c26-100e4a32b64f
[ 150.569777] testsuite-13.sh[1097]: Superblock backups stored on blocks:
[ 150.571135] testsuite-13.sh[1097]: 8193, 24577
[ 150.572751] testsuite-13.sh[1097]: Allocating group tables: done
[ 150.574294] testsuite-13.sh[1097]: Writing inode tables: done
[ 150.598696] testsuite-13.sh[1097]: Creating journal (4096 blocks): done
[ 150.604285] testsuite-13.sh[1097]: Writing superblocks and filesystem accounting information: done
[ 150.612309] testsuite-13.sh[601]: + mount -o loop /tmp/container.raw /tmp/mnt
[ 150.879736] testsuite-13.sh[601]: + cp -r /var/lib/machines/container1/bin ... /tmp/mnt
[ 152.347545] testsuite-13.sh[1104]: cp: cannot create directory '/tmp/mnt/var/log': No space left on device
[ 152.351739] testsuite-13.sh[1104]: cp: cannot create directory '/tmp/mnt/var/tmp': No space left on device
2023-06-24 20:51:27 +02:00
Frantisek Sumsal
4c88752ae5
test: show the subtest name together with the failing code
...
To make debugging slightly easier.
2023-06-24 20:44:33 +02:00
Luca Boccassi
f434f182cc
TEST-55-OOMD: use swap file instead of partition
...
The partition seems not to work on Ubuntu for some reason, use a
swap file instead
2023-06-24 11:48:51 +01:00
Luca Boccassi
937e82cb7d
TEST-55-OOMD: use 'stress' to create high pressure
...
The test fails on my machine, running Debian stable, because
testsuite-55-testbloat.service just swaps and never goes over the
limit, so it's not killed. Use 'stress' instead which seems to be
able to overwhelm the swap too.
2023-06-24 11:48:51 +01:00
Frantisek Sumsal
7eb9a4623d
test: drop timeout when running portablectl
...
The deadlock should be resolved by #28123 , so let's check if it's indeed
the case.
2023-06-24 10:35:12 +02:00
Frantisek Sumsal
f6b916d387
test: test the /boot endpoint under nspawn as well
...
Since #28144 should be now resolved by fb0e106
.
2023-06-24 10:33:14 +02:00
Lennart Poettering
9e35e9779d
Merge pull request #28144 from poettering/procfs-submounts-move
...
pid1: when setting up a new procfs instance for a service, mount submounts from host into it
2023-06-23 22:53:25 +02:00
Lennart Poettering
5ca8d2474c
test: ensure ProtectProc=invisible retains host submounts
2023-06-23 18:32:40 +02:00
Frantisek Sumsal
0651e71749
test: test transactions with cycles
...
Provides coverage for systemd/systemd#26872.
With systemd/systemd#26875 reverted:
[16444.287652] testsuite-03.sh[71]: + for i in {0..19}
[16444.287652] testsuite-03.sh[71]: + systemctl start transaction-cycle0.service
[16444.359503] systemd[1]: =================================================================
[16444.360321] systemd[1]: ==1==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6180002e578e at pc 0x7f73b25ec7a6 bp 0x7ffc5531c6f0 sp 0x7ffc5531be68
[16444.360798] systemd[1]:
[16444.361044] systemd[1]: READ of size 783 at 0x6180002e578e thread T0 (systemd)
[16444.391684] systemd[1]: #0 0x7f73b25ec7a5 (/lib64/libasan.so.5+0x557a5)
[16444.392167] systemd[1]: #1 0x7f73b260a1d5 in __interceptor_vasprintf (/lib64/libasan.so.5+0x731d5)
[16444.392442] systemd[1]: #2 0x7f73afa1d1e1 in log_format_iovec ../src/basic/log.c:996
[16444.392750] systemd[1]: #3 0x7f73afa1e7b6 in log_struct_internal ../src/basic/log.c:1058
[16444.393101] systemd[1]: #4 0x7f73b1979136 in transaction_verify_order_one ../src/core/transaction.c:392
[16444.393540] systemd[1]: #5 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.393946] systemd[1]: #6 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394262] systemd[1]: #7 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394532] systemd[1]: #8 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
[16444.394812] systemd[1]: #9 0x7f73b197ac82 in transaction_verify_order_one ../src/core/transaction.c:463
...
2023-06-23 14:37:07 +02:00
Luca Boccassi
0b1e55a616
Merge pull request #28109 from mrc0mmand/more-journal-shenanigans
...
test: cover a couple of missed code paths in journalctl/journald
2023-06-22 00:46:06 +01:00
Daan De Meyer
33885343cf
Merge pull request #27942 from DaanDeMeyer/root-ephemeral
...
core: Add RootEphemeral= setting
2023-06-21 17:24:39 +02:00
Frantisek Sumsal
51a05be9a2
test: cover a couple of missed code paths in journalctl/journald
2023-06-21 17:08:55 +02:00
Daan De Meyer
cdad1f1407
test: Add RootEphemeral= integration test
2023-06-21 12:48:48 +02:00
Luca Boccassi
01a6510a62
Merge pull request #28082 from mrc0mmand/more-journal-remote-tests
...
test: add a couple of tests for systemd-journal-{remote,upload}
2023-06-20 23:38:24 +01:00
Frantisek Sumsal
e43e60992e
test: add a couple of tests for systemd-journal-{remote,upload}
2023-06-20 15:31:22 +02:00
Lennart Poettering
7dad6de158
hostnamed: when parsing day/month of firmware date, force decimal parsing
...
safe_atou() by default determines the base from the prefix 0x, 0b, 0o
and for compat with just 0 for octal. This is not what we want here,
since the date components are padded with zeroes yet still decimal.
Hence force decimal parsing (and while we are at it, prohibit a couple
of unexpected decorations).
WIthout this we'd fail to parse any the 8th and 9th day of each months, as
well aus aug and september of every year, because these look like octal
numbers but cannot actually parsed as such.
Let's change the testcase to check for a date that exposes this
bheaviour.
2023-06-20 15:18:58 +02:00
Lennart Poettering
e7932afe1b
hostnamed: don't read DMI data within a container
...
If we run in a container we should show info about the container, not
the host.
2023-06-20 15:04:31 +02:00
Frantisek Sumsal
3f38d582d5
test: cover systemd-journal-remote --url=...
2023-06-19 23:42:00 +02:00
Luca Boccassi
55e1ff26a5
Merge pull request #28060 from mrc0mmand/remote-journal-tests
...
test: add a couple of tests for systemd-journal-gatewayd
2023-06-17 11:34:50 +01:00
Luca Boccassi
6acbb3f2fb
TEST-55-OOMD: improve ephemeral configuration readability
2023-06-17 00:08:09 +01:00
Luca Boccassi
565b13f8b2
TEST-55-OOMD: use /run/ for configuration instead of /etc/
...
Make sure configuration is ephemeral if the image is reused
2023-06-17 00:08:09 +01:00
Frantisek Sumsal
1d252ea2ae
test: add a couple of tests for systemd-journal-gatewayd
2023-06-16 20:42:43 +02:00
Kiran Vemula
5ed91481ab
resolved: added serve stale feature implementation of RFC 8767
...
serve stale feature to keep the DNS resource records beyond TTL to return them as stale records in case of upstream server is not reachable or returns negative response.
SD_RESOLVED_NO_STALE flag has been added to disable serving stale records via dbus.
added serve stale test cases to TEST-75-RESOLVED
Fixes : #21815
2023-06-16 10:20:15 +01:00
Frantisek Sumsal
e46b313a62
test: clean up the new test case a bit
...
Follow-up to 61cecfa0d8
.
2023-06-16 09:56:32 +02:00
zhmylove
61cecfa0d8
journalctl: add --truncate-newline option
2023-06-16 09:31:47 +02:00
Frantisek Sumsal
9a27ef092e
tree-wide: fix a couple of typos
...
As reported by Fossies.org.
2023-06-15 20:52:45 +02:00
Frantisek Sumsal
9457dd8bae
test: split TEST-04 into smaller chunks
2023-06-14 20:28:20 +02:00
Frantisek Sumsal
0ea6e6a526
test: exit on first failing subtest
...
Let's take a step back and revert back to the original behavior where we
exit on a first failing subtest. The current behavior makes fishing out the
failing test details quite unpleasant, and in certain situations the
journal may even be rotated away so we end up with no actionable logs.
2023-06-14 20:28:20 +02:00
Frantisek Sumsal
f087837c46
test: make sure ping works for unprivileged users
2023-06-13 10:15:27 +02:00
Frantisek Sumsal
bdee55672a
test: merge TEST-61-UNITTESTS-QEMU with TEST-02-UNITTESTS
...
The test was originally introduced for Ubuntu CI, as it uses
PREFER_NSPAWN=1, but it was subsequently disabled two years ago [0], so
it was pretty much useless. Let's merge it into TEST-02 and tweak it a
bit to run only certain tests under QEMU when $TEST_PREFER_NSPAWN is
set.
[0] b152adbfa9
2023-06-13 10:15:27 +02:00
Frantisek Sumsal
d5a937a62a
proc-cmdline: parse the whole /proc/cmdline
...
The kernel command line may contain newlines which kernel happily
accepts, but we'd ignore everything past the first newline. Let's fix
that by replacing read_one_line_file() with read_full_file().
2023-06-13 09:54:02 +02:00
Frantisek Sumsal
581427bd65
test: make coverage runs happy again
2023-06-11 12:29:59 +01:00
Daan De Meyer
bbfb25f4b9
creds: Add ImportCredential=
...
ImportCredential= takes a credential name and searches for a matching
credential in all the credential stores we know about it. It supports
globs which are expanded so that all matching credentials are loaded.
2023-06-08 14:09:18 +02:00