]> 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 3686e0ef137ba434c92b1a06afdefec4f29b9da9..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
@@ -314,6 +314,16 @@ if ! systemd-detect-virt -q -c ; then
     systemctl -P Wants show getty.target | grep -q container-getty@idontexist.service
 fi
 
+# 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
+
+cmp /tmp/vlcredsdata /tmp/vlcredsdata2
+rm /tmp/vlcredsdata /tmp/vlcredsdata2
+
 systemd-analyze log-level info
 
 touch /testok