iotests: fix leak of tmpdir in dry-run mode
commitc645bac4e06bf9642cc8e339d027a5d6ec54d811
authorDaniel P. Berrangé <berrange@redhat.com>
Mon, 5 Feb 2024 15:40:19 +0000 (5 15:40 +0000)
committerKevin Wolf <kwolf@redhat.com>
Wed, 7 Feb 2024 13:58:53 +0000 (7 14:58 +0100)
tree467a5767ec71f0591045791b9ddf8ce84c62d82f
parent1604c0493193273e4eac547f86fbd2845e7f9af4
iotests: fix leak of tmpdir in dry-run mode

Creating an instance of the 'TestEnv' class will create a temporary
directory. This dir is only deleted, however, in the __exit__ handler
invoked by a context manager.

In dry-run mode, we don't use the TestEnv via a context manager, so
were leaking the temporary directory. Since meson invokes 'check'
5 times on each configure run, developers /tmp was filling up with
empty temporary directories.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Message-ID: <20240205154019.1841037-1-berrange@redhat.com>
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
tests/qemu-iotests/check