]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - test/units/testsuite-54.sh
Merge pull request #30284 from YHNdnzj/fstab-wantedby-defaultdeps
[thirdparty/systemd.git] / test / units / testsuite-54.sh
index 8ba327a3b11773f9e28db607716f0d877affcdbb..c7d11cffe6ecefc41088cf6852f434a5b0dc6f9d 100755 (executable)
@@ -22,7 +22,7 @@ mount -t tmpfs -o size=1,nr_inodes=1 tmpfs /tmp/full
 
 # verb: setup
 # Run this first, otherwise any encrypted credentials wouldn't be decryptable
-# as we regnerate the host key
+# as we regenerate the host key
 rm -fv /var/lib/systemd/credential.secret
 systemd-creds setup
 test -e /var/lib/systemd/credential.secret
@@ -176,6 +176,7 @@ if systemd-detect-virt -q -c ; then
 elif [ -d /sys/firmware/qemu_fw_cfg/by_name ]; then
     # Verify that passing creds through kernel cmdline works
     [ "$(systemd-creds --system cat kernelcmdlinecred)" = "uff" ]
+    [ "$(systemd-creds --system cat waldi)" = "woooofffwufffwuff" ]
 
     # And that it also works via SMBIOS
     [ "$(systemd-creds --system cat smbioscredential)" = "magicdata" ]
@@ -313,8 +314,16 @@ if ! systemd-detect-virt -q -c ; then
     systemctl -P Wants show getty.target | grep -q container-getty@idontexist.service
 fi
 
-systemd-analyze log-level info
+# Decrypt/encrypt via varlink
+
+echo -n '{"data":"Zm9vYmFyCg=="}' > /tmp/vlcredsdata
+
+varlinkctl call /run/systemd/io.systemd.Credentials io.systemd.Credentials.Encrypt "$(cat /tmp/vlcredsdata)" | \
+    varlinkctl call /run/systemd/io.systemd.Credentials io.systemd.Credentials.Decrypt > /tmp/vlcredsdata2
 
-echo OK >/testok
+cmp /tmp/vlcredsdata /tmp/vlcredsdata2
+rm /tmp/vlcredsdata /tmp/vlcredsdata2
+
+systemd-analyze log-level info
 
-exit 0
+touch /testok