All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Wainer dos Santos Moschetta <wainersm@redhat.com>
Cc: peter.maydell@linaro.org,
	"Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-devel@nongnu.org, "Cleber Rosa" <crosa@redhat.com>
Subject: Re: [PATCH v1 3/6] tests/avocado: clean-up socket directory after run
Date: Mon, 23 Nov 2020 09:23:14 +0000	[thread overview]
Message-ID: <87tutgo29p.fsf@linaro.org> (raw)
In-Reply-To: <3bc76afb-e459-1324-d1ef-aba53faf6220@redhat.com>


Wainer dos Santos Moschetta <wainersm@redhat.com> writes:

> On 11/17/20 2:36 PM, Alex Bennée wrote:
>> Previously we were leaving temporary directories behind. While the
>> QEMUMachine does make efforts to clean up after itself the directory
>> belongs to the calling function. We use TemporaryDirectory to wrap
>> this although we explicitly clear the reference in tearDown() as it
>> doesn't get cleaned up otherwise.
>
> This patch fixes the problem introduced on patch 02 of this series.

It didn't introduce the problem in patch 2, it just moved it. The
mkdtemp() was never cleaned up before.

>
>>
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>   tests/acceptance/avocado_qemu/__init__.py | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/tests/acceptance/avocado_qemu/__init__.py b/tests/acceptance/avocado_qemu/__init__.py
>> index 3033b2cabe..bf54e419da 100644
>> --- a/tests/acceptance/avocado_qemu/__init__.py
>> +++ b/tests/acceptance/avocado_qemu/__init__.py
>> @@ -171,8 +171,8 @@ class Test(avocado.Test):
>>               self.cancel("No QEMU binary defined or found in the build tree")
>>   
>>       def _new_vm(self, *args):
>> -        sd = tempfile.mkdtemp(prefix="avocado_qemu_sock_")
>> -        vm = QEMUMachine(self.qemu_bin, sock_dir=sd)
>> +        self._sd = tempfile.TemporaryDirectory(prefix="avo_qemu_sock_")
>
> Double-checking that you really meant "avo" or if your fingers forgot to 
> type the remaining letters. :)

Hmm yeah I should probably just be consistent with the name in both
patches.

>
> - Wainer
>
>> +        vm = QEMUMachine(self.qemu_bin, sock_dir=self._sd.name)
>>           if args:
>>               vm.add_args(*args)
>>           return vm
>> @@ -193,6 +193,7 @@ class Test(avocado.Test):
>>       def tearDown(self):
>>           for vm in self._vms.values():
>>               vm.shutdown()
>> +        self._sd = None
>>   
>>       def fetch_asset(self, name,
>>                       asset_hash=None, algorithm=None,


-- 
Alex Bennée


  reply	other threads:[~2020-11-23  9:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-17 17:36 [PATCH for 5.3-rc3 v1 0/6] testing fixes (avocado, gitlab) Alex Bennée
2020-11-17 17:36 ` [PATCH v1 1/6] scripts/ci: clean up default args logic a little Alex Bennée
2020-11-20 20:42   ` Wainer dos Santos Moschetta
2020-11-17 17:36 ` [PATCH v1 2/6] tests: add prefixes to the bare mkdtemp calls Alex Bennée
2020-11-17 17:56   ` Philippe Mathieu-Daudé
2020-11-18  9:44   ` Thomas Huth
2020-11-20 18:55   ` Wainer dos Santos Moschetta
2020-11-17 17:36 ` [PATCH v1 3/6] tests/avocado: clean-up socket directory after run Alex Bennée
2020-11-20 18:59   ` Wainer dos Santos Moschetta
2020-11-23  9:23     ` Alex Bennée [this message]
2020-11-23 13:43       ` Wainer dos Santos Moschetta
2020-11-17 17:36 ` [PATCH v1 4/6] gitlab: move remaining x86 check-tcg targets to gitlab Alex Bennée
2020-11-18  9:51   ` Thomas Huth
2020-11-20 17:45   ` Wainer dos Santos Moschetta
2020-11-17 17:36 ` [PATCH v1 5/6] tests/docker: Install liblttng-ust-dev package in Ubuntu 20.04 image Alex Bennée
2020-11-17 17:36 ` [PATCH v1 6/6] gitlab-ci: Move trace backend tests across to gitlab Alex Bennée
2020-11-18  9:54   ` Thomas Huth
2020-11-20 14:35     ` Thomas Huth
2020-11-19 14:40 ` [PATCH for 5.2-rc3 v1 0/6] testing fixes (avocado, gitlab) Alex Bennée

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=87tutgo29p.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=crosa@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=wainersm@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.