]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: make sure that SetCredential=/LoadCredential fallback won#t regress
authorLennart Poettering <lennart@poettering.net>
Thu, 21 Apr 2022 15:35:38 +0000 (17:35 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Apr 2022 09:32:47 +0000 (11:32 +0200)
test/units/testsuite-54.sh

index c8b685b675c4268a0e3597e6afd5c4de97d9428a..15b0d5c2db1ba637efda0b0b2ae233a1bcd20d16 100755 (executable)
@@ -16,6 +16,12 @@ systemd-run -p LoadCredential=passwd:/etc/passwd \
 ( cat /etc/passwd /etc/shadow && echo -n wuff ) | cmp /tmp/ts54-concat
 rm /tmp/ts54-concat
 
+# Test that SetCredential= acts as fallback for LoadCredential=
+echo piff > /tmp/ts54-fallback
+[ "$(systemd-run -p LoadCredential=paff:/tmp/ts54-fallback -p SetCredential=paff:poff --pipe --wait systemd-creds cat paff)" = "piff" ]
+rm /tmp/ts54-fallback
+[ "$(systemd-run -p LoadCredential=paff:/tmp/ts54-fallback -p SetCredential=paff:poff --pipe --wait systemd-creds cat paff)" = "poff" ]
+
 # Verify that the creds are immutable
 systemd-run -p LoadCredential=passwd:/etc/passwd \
             -p DynamicUser=1 \