]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: add simple fstab credential test
authorLennart Poettering <lennart@poettering.net>
Thu, 29 Jun 2023 19:52:57 +0000 (21:52 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 4 Jul 2023 21:09:39 +0000 (23:09 +0200)
test/TEST-54-CREDS/test.sh
test/units/testsuite-54.sh

index 68f97ce9533f934d75207f79bff1b4babadd5cf2..1d14e0a8c9798b3c155b49a29f0ecfb9e77b9d81 100755 (executable)
@@ -15,6 +15,7 @@ QEMU_CREDS=(
     "-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:tmpfiles.extra=ZiAvdG1wL3NvdXJjZWRmcm9tY3JlZGVudGlhbCAtIC0gLSAtIHRtcGZpbGVzc2VjcmV0Cg=="
+    "-smbios type=11,value=io.systemd.credential.binary:fstab.extra=aW5qZWN0ZWQgL2luamVjdGVkIHRtcGZzIFgtbW91bnQubWtkaXIgMCAwCg=="
 )
 QEMU_OPTIONS="${QEMU_OPTIONS:-} ${QEMU_CREDS[*]}"
 
index ca7e11fc46388c10bb315ca1f4955528ce295f5e..bcc7313d6fd4aafacfe7cb9cf3aac6d10eeefc1a 100755 (executable)
@@ -304,6 +304,10 @@ systemd-run -p DynamicUser=yes -p 'LoadCredential=os:/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"
+
+    # Check that the fstab credential logic worked
+    test -d /injected
+    grep -q /injected /proc/self/mountinfo
 fi
 
 systemd-analyze log-level info