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.
This commit is contained in:
Lennart Poettering
2023-07-04 23:05:23 +02:00
parent bfa6d9cc64
commit 4a262d5677
3 changed files with 66 additions and 1 deletions
+5
View File
@@ -301,6 +301,11 @@ systemd-run -p DynamicUser=yes -p 'LoadCredential=os:/etc/os-release' \
--pipe \
true | cmp /etc/os-release
if ! systemd-detect-virt -q -c ; then
# Validate that the credential we inserted via the initrd logic arrived
test "$(systemd-creds cat --system myinitrdcred)" = "guatemala"
fi
systemd-analyze log-level info
echo OK >/testok