qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tests: Adjust path for swtpm state to use path under /var/tm


From: Peter Maydell
Subject: Re: [PATCH] tests: Adjust path for swtpm state to use path under /var/tmp/
Date: Thu, 7 Nov 2024 14:44:18 +0000

On Thu, 7 Nov 2024 at 11:58, Stefan Berger <stefanb@linux.ibm.com> wrote:
>
>
>
> On 11/7/24 6:09 AM, Peter Maydell wrote:
> > On Wed, 6 Nov 2024 at 18:08, Stefan Berger <stefanb@linux.vnet.ibm.com> 
> > wrote:
> >>
> >> 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>
> >
> > Thanks for writing this patch. I can confirm that the test now
> > runs OK on my Ubuntu setup, so
>
> That's good to hear. However, it surprises me because the tests probably
> use /var/tmp/ as temp dir and that's no supported in the AppArmor
> profile yet.

On my machine the temporary directory that tempfile.TemporaryDirectory()
creates is under /tmp/. This matches what the Python docs say:
 https://docs.python.org/3/library/tempfile.html#tempfile.gettempdir
where if you haven't set TMPDIR, TEMP or TMP then you get /tmp/
(assuming it exists; you get /var/tmp if it doesn't).

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]