]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: fix env var name of persistent handle used for testing so it is removed after...
authorDan Streetman <ddstreet@ieee.org>
Tue, 7 Nov 2023 17:18:08 +0000 (12:18 -0500)
committerDan Streetman <ddstreet@ieee.org>
Tue, 7 Nov 2023 17:28:56 +0000 (12:28 -0500)
The cleanup uses PERSISTENT_HANDLE while the test uses PERSISTENT, so change
the test to use PERSISTENT_HANDLE so it's cleaned up (i.e. removed from the
tpm) after the test.

test/units/testsuite-70.cryptsetup.sh

index 98a188fd1e28efd14c263f5672c3b31630d6005f..3c09bd73b6eed41544324005f9ba7043bf7c144b 100755 (executable)
@@ -168,16 +168,16 @@ systemd-cryptenroll --wipe-slot=tpm2 "$IMAGE"
 PRIMARY=/tmp/primary.ctx
 tpm2_createprimary -c "$PRIMARY"
 PERSISTENT_LINE=$(tpm2_evictcontrol -c "$PRIMARY" | grep persistent-handle)
-PERSISTENT="0x${PERSISTENT_LINE##*0x}"
+PERSISTENT_HANDLE="0x${PERSISTENT_LINE##*0x}"
 tpm2_flushcontext -t
 
 systemd-cryptenroll --wipe-slot=tpm2 "$IMAGE"
-PASSWORD=passphrase systemd-cryptenroll --tpm2-device=auto --tpm2-seal-key-handle="${PERSISTENT#0x}" "$IMAGE"
+PASSWORD=passphrase systemd-cryptenroll --tpm2-device=auto --tpm2-seal-key-handle="${PERSISTENT_HANDLE#0x}" "$IMAGE"
 systemd-cryptsetup attach test-volume "$IMAGE" - tpm2-device=auto,headless=1
 systemd-cryptsetup detach test-volume
 
 systemd-cryptenroll --wipe-slot=tpm2 "$IMAGE"
-PASSWORD=passphrase systemd-cryptenroll --tpm2-device=auto --tpm2-seal-key-handle="$PERSISTENT" "$IMAGE"
+PASSWORD=passphrase systemd-cryptenroll --tpm2-device=auto --tpm2-seal-key-handle="$PERSISTENT_HANDLE" "$IMAGE"
 systemd-cryptsetup attach test-volume "$IMAGE" - tpm2-device=auto,headless=1
 systemd-cryptsetup detach test-volume