From: Lennart Poettering Date: Thu, 21 Apr 2022 15:35:38 +0000 (+0200) Subject: test: make sure that SetCredential=/LoadCredential fallback won#t regress X-Git-Tag: v251-rc2~75^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6d085447fa63579a77387585b097e2558ea0f9da;p=thirdparty%2Fsystemd.git test: make sure that SetCredential=/LoadCredential fallback won#t regress --- diff --git a/test/units/testsuite-54.sh b/test/units/testsuite-54.sh index c8b685b675c..15b0d5c2db1 100755 --- a/test/units/testsuite-54.sh +++ b/test/units/testsuite-54.sh @@ -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 \