test: avoid leaking open loop devices
authorLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 16 Feb 2021 23:47:34 +0000 (23:47 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Feb 2021 17:55:05 +0000 (18:55 +0100)
commit0761da386a6cb0ced3721f2dee123fd983c71178
tree820db6fecf6c47e976aa3fa0c202772820797cb5
parent50fc7d7036ad9b36840896a67ba9ed7bb4c44016
test: avoid leaking open loop devices

When a subshell is used ('make' or 'make all') the LOOPDEV environment
variable, which is used to store the opened loop device, is lost.
So the cleanup on trap/exit doesn't do anything, and the loop
device used to mount the test image is left around.

Avoid using a subshell to fix the issue.
test/test-functions