Skip to content

Commit

Permalink
tests/tpm-vm: use a shorter dev name on older LXD releases
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
  • Loading branch information
simondeziel committed Jun 25, 2024
1 parent 64a37bf commit befec11
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/tpm-vm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ lxc stop "${vmName}" --force
# TPM names are included on the swtpm socket path and long socket paths can cause problems if not handled correctly.
echo "==> Test handling TPMs with long names"
longName="tpm-device-with-long-name-for-testing"
# XXX: LXD releases 5.21 and earlier don't support long names (yet)
if echo "${LXD_SNAP_CHANNEL}" | grep -E '^([45]\.0|5\.21)/'; then
echo "::warning::${LXD_SNAP_CHANNEL} detected, using a shorter name"
longName="notSoLongName"
fi
lxc config device add "${vmName}" "${longName}" tpm
lxc start "${vmName}"
waitInstanceReady "${vmName}"
Expand Down

0 comments on commit befec11

Please sign in to comment.