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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user