Message ID | 20241107131539.36843-2-stefanb@linux.ibm.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [PULL,v1,1/1] tests: Adjust path for swtpm state to use path under /var/tmp/ | expand |
On Thu, 7 Nov 2024 at 13:15, Stefan Berger <stefanb@linux.ibm.com> wrote: > > To avoid AppArmor-related test failures when functional test are run from > somewhere under /mnt, adjust the path to swtpm's state to use an AppArmor- > supported path, such as /var/tmp, which is provided by the python function > tempfile.TemporaryDirectory(). > > An update to swtpm's AppArmor profile is also being done to support /var/tmp. > > Link: https://lore.kernel.org/qemu-devel/CAFEAcA8A=kWLtTZ+nua-MpzqkaEjW5srOYZruZnE2tB6vmoMig@mail.gmail.com/ > Link: https://github.com/stefanberger/swtpm/pull/944 > Tested-by: Peter Maydell <peter.maydell@linaro.org> > Fixes: f04cb2d00d5c ("tests/functional: Convert most Aspeed machine tests") > Reviewed-by: Cédric Le Goater <clg@redhat.com> > Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> > --- > tests/functional/test_arm_aspeed.py | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/tests/functional/test_arm_aspeed.py b/tests/functional/test_arm_aspeed.py > index 9761fc06a4..a574b1e521 100644 > --- a/tests/functional/test_arm_aspeed.py > +++ b/tests/functional/test_arm_aspeed.py > @@ -227,11 +227,11 @@ def test_arm_ast2600_evb_buildroot_tpm(self): > > image_path = self.ASSET_BR2_202302_AST2600_TPM_FLASH.fetch() > > - socket_dir = tempfile.TemporaryDirectory(prefix="qemu_") > - socket = os.path.join(socket_dir.name, 'swtpm-socket') > + tpmstate_dir = tempfile.TemporaryDirectory(prefix="qemu_") > + socket = os.path.join(tpmstate_dir.name, 'swtpm-socket') This is missing the comment that I suggested adding in code review. thanks -- PMM
diff --git a/tests/functional/test_arm_aspeed.py b/tests/functional/test_arm_aspeed.py index 9761fc06a4..a574b1e521 100644 --- a/tests/functional/test_arm_aspeed.py +++ b/tests/functional/test_arm_aspeed.py @@ -227,11 +227,11 @@ def test_arm_ast2600_evb_buildroot_tpm(self): image_path = self.ASSET_BR2_202302_AST2600_TPM_FLASH.fetch() - socket_dir = tempfile.TemporaryDirectory(prefix="qemu_") - socket = os.path.join(socket_dir.name, 'swtpm-socket') + tpmstate_dir = tempfile.TemporaryDirectory(prefix="qemu_") + socket = os.path.join(tpmstate_dir.name, 'swtpm-socket') subprocess.run(['swtpm', 'socket', '-d', '--tpm2', - '--tpmstate', f'dir={self.vm.temp_dir}', + '--tpmstate', f'dir={tpmstate_dir.name}', '--ctrl', f'type=unixio,path={socket}']) self.vm.add_args('-chardev', f'socket,id=chrtpm,path={socket}')