summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTony Asleson <tasleson@redhat.com>2023-02-20 11:10:24 -0600
committerTony Asleson <tasleson@redhat.com>2023-02-20 12:01:53 -0600
commit993bd2ffc88003aa3392ddbe3364fd887b65b589 (patch)
tree56633d79392ee3be155618c95e37d05781e2c22e /test
parente18d60b336ac881599c1c68d9d3fff1ac8b6515d (diff)
downloadlvm2-993bd2ffc88003aa3392ddbe3364fd887b65b589.tar.gz
lvmdbustest: Check and remove lvm debug collection files
In setup/teardown ensure we check for and remove any lvm debug collection, to prevent FS from filling up.
Diffstat (limited to 'test')
-rwxr-xr-xtest/dbus/lvmdbustest.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/dbus/lvmdbustest.py b/test/dbus/lvmdbustest.py
index c07963525..685acd563 100755
--- a/test/dbus/lvmdbustest.py
+++ b/test/dbus/lvmdbustest.py
@@ -13,6 +13,7 @@ import signal
# noinspection PyUnresolvedReferences
import subprocess
import unittest
+import tempfile
from glob import glob
from subprocess import Popen, PIPE
@@ -253,6 +254,15 @@ def read_file_build_hash(fn):
return rc
+def remove_lvm_debug():
+ # If we are running the lvmdbusd daemon and collecting lvm debug data, check and
+ # clean-up after the tests.
+ tmpdir = tempfile.gettempdir()
+ for f in glob("lvmdbusd.lvm.debug.*.log", root_dir=tmpdir):
+ fn = os.path.join(tmpdir, f)
+ os.unlink(fn)
+
+
class DaemonInfo(object):
def __init__(self, pid):
# The daemon is running, we have a pid, lets see how it's being run.
@@ -417,6 +427,7 @@ class TestDbusService(unittest.TestCase):
self.addCleanup(self.clean_up)
self.vdo = supports_vdo()
+ remove_lvm_debug()
def _recurse_vg_delete(self, vg_proxy, pv_proxy, nested_pv_hash):
vg_name = str(vg_proxy.Vg.Name)
@@ -481,6 +492,8 @@ class TestDbusService(unittest.TestCase):
# print('Re-creating PV=', p)
self._pv_create(p)
+ remove_lvm_debug()
+
def _check_consistency(self):
# Only do consistency checks if we aren't running the unit tests
# concurrently