TPM smoketest vyos 1.5 / current

Hi, I’m hoping someone might be able to share any experience or confirm the correct or best way to get TPM smoke tests working?

My pipeline Raid1 Smoke tests are passing, and I am building functional 1.5 rolling ISOs. An exception has been the TPM smoke tests, and I’ve not been able to successful work through the issue be it with an Ubuntu 20.04 agent or a Debian 12 agent.

Current error:

vyos@vyos:~$ systemd-detect-virt
15:14:41  DEBUG - systemd-detect-virt
15:14:41  DEBUG - kvm
15:14:41   INFO - Running TPM encrypted config tests
15:14:41  DEBUG - vyos@vyos:~$ ls /dev/tpm0
15:14:41  DEBUG - ls /dev/tpm0
15:14:41  DEBUG - /dev/tpm0
15:14:41   INFO - Encrypting config to TPM
15:14:41  DEBUG - vyos@vyos:~$ encryption enable
15:14:41  DEBUG - encryption enable
15:14:41  DEBUG - Traceback (most recent call last):
15:14:41  DEBUG -   File "/usr/libexec/vyos/vyos-config-encrypt.py", line 26, in <module>
15:14:41  DEBUG -     from vyos.tpm import clear_tpm_key
15:14:41  DEBUG -   File "/usr/lib/python3/dist-packages/vyos/tpm.py", line 18, in <module>
15:14:41  DEBUG -     from vyos.util import rc_cmd
15:14:41  DEBUG - ModuleNotFoundError: No module named 'vyos.util'
15:15:13  ERROR - Timeout waiting for VyOS system
15:15:13  ERROR - Traceback (most recent call last):

There should be this path

from vyos.utils.process import rc_cmd

The bug report T6298

2 Likes

Also does the docker when running smoketests have a virtual TPM defined so the TPM can be tested?

Or would this need the ISO to be loaded on baremetal to complete the smoketest?