mirror of
https://github.com/systemd/systemd
synced 2024-10-15 20:45:09 +00:00
test: add simple fstab credential test
This commit is contained in:
parent
3a065dfc29
commit
51235f2fe6
|
@ -15,6 +15,7 @@ QEMU_CREDS=(
|
||||||
"-smbios type=11,value=io.systemd.credential.binary:binarysmbioscredential=bWFnaWNiaW5hcnlkYXRh"
|
"-smbios type=11,value=io.systemd.credential.binary:binarysmbioscredential=bWFnaWNiaW5hcnlkYXRh"
|
||||||
"-smbios type=11,value=io.systemd.credential.binary:sysusers.extra=dSBjcmVkdGVzdHVzZXIK"
|
"-smbios type=11,value=io.systemd.credential.binary:sysusers.extra=dSBjcmVkdGVzdHVzZXIK"
|
||||||
"-smbios type=11,value=io.systemd.credential.binary:tmpfiles.extra=ZiAvdG1wL3NvdXJjZWRmcm9tY3JlZGVudGlhbCAtIC0gLSAtIHRtcGZpbGVzc2VjcmV0Cg=="
|
"-smbios type=11,value=io.systemd.credential.binary:tmpfiles.extra=ZiAvdG1wL3NvdXJjZWRmcm9tY3JlZGVudGlhbCAtIC0gLSAtIHRtcGZpbGVzc2VjcmV0Cg=="
|
||||||
|
"-smbios type=11,value=io.systemd.credential.binary:fstab.extra=aW5qZWN0ZWQgL2luamVjdGVkIHRtcGZzIFgtbW91bnQubWtkaXIgMCAwCg=="
|
||||||
)
|
)
|
||||||
QEMU_OPTIONS="${QEMU_OPTIONS:-} ${QEMU_CREDS[*]}"
|
QEMU_OPTIONS="${QEMU_OPTIONS:-} ${QEMU_CREDS[*]}"
|
||||||
|
|
||||||
|
|
|
@ -304,6 +304,10 @@ systemd-run -p DynamicUser=yes -p 'LoadCredential=os:/etc/os-release' \
|
||||||
if ! systemd-detect-virt -q -c ; then
|
if ! systemd-detect-virt -q -c ; then
|
||||||
# Validate that the credential we inserted via the initrd logic arrived
|
# Validate that the credential we inserted via the initrd logic arrived
|
||||||
test "$(systemd-creds cat --system myinitrdcred)" = "guatemala"
|
test "$(systemd-creds cat --system myinitrdcred)" = "guatemala"
|
||||||
|
|
||||||
|
# Check that the fstab credential logic worked
|
||||||
|
test -d /injected
|
||||||
|
grep -q /injected /proc/self/mountinfo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
systemd-analyze log-level info
|
systemd-analyze log-level info
|
||||||
|
|
Loading…
Reference in a new issue