From: Stefan Berger <stefanb@linux.vnet.ibm.com>
To: peter.maydell@linaro.org, qemu-devel@nongnu.org
Cc: marcandre.lureau@gmail.com, clg@redhat.com,
lena.voytek@canonical.com, Stefan Berger <stefanb@linux.ibm.com>
Subject: [PATCH] tests: Adjust path for swtpm state to use path under /var/tmp/
Date: Wed, 6 Nov 2024 13:07:51 -0500 [thread overview]
Message-ID: <20241106180751.6859-1-stefanb@linux.vnet.ibm.com> (raw)
From: Stefan Berger <stefanb@linux.ibm.com>
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
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')
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}')
--
2.34.1
next reply other threads:[~2024-11-06 18:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-06 18:07 Stefan Berger [this message]
2024-11-07 7:15 ` [PATCH] tests: Adjust path for swtpm state to use path under /var/tmp/ Cédric Le Goater
2024-11-07 11:09 ` Peter Maydell
2024-11-07 11:58 ` Stefan Berger
2024-11-07 14:44 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241106180751.6859-1-stefanb@linux.vnet.ibm.com \
--to=stefanb@linux.vnet.ibm.com \
--cc=clg@redhat.com \
--cc=lena.voytek@canonical.com \
--cc=marcandre.lureau@gmail.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanb@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).