Skip to content

Commit

Permalink
Merge pull request #295 from mulkieran/maxDiffNone
Browse files Browse the repository at this point in the history
Max diff none
  • Loading branch information
mulkieran authored Nov 26, 2024
2 parents 627395c + 55ba9cc commit ee78c1c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
3 changes: 1 addition & 2 deletions stratis_cli_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ def setUp(self):
super().setUp()

self._post_test_checks = RunPostTestChecks()
self._post_test_checks.setUp()

def tearDown(self):
"""
Expand All @@ -195,7 +194,7 @@ def tearDown(self):
"""
super().tearDown()

self._post_test_checks.tearDown()
self._post_test_checks.teardown()

def _test_permissions(self, command_line, permissions, exp_stdout_empty):
"""
Expand Down
3 changes: 1 addition & 2 deletions stratisd_cert.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ def setUp(self):
super().setUp()

self._post_test_checks = RunPostTestChecks()
self._post_test_checks.setUp()

def tearDown(self):
"""
Expand All @@ -191,7 +190,7 @@ def tearDown(self):
"""
super().tearDown()

self._post_test_checks.tearDown()
self._post_test_checks.teardown()

def _unittest_set_property(
self, object_path, param_iface, dbus_param, dbus_value, exception_name
Expand Down
22 changes: 19 additions & 3 deletions testlib/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@ class PoolMetadataMonitor(unittest.TestCase):
Manage verification of consistency of pool-level metadata.
"""

maxDiff = None

def _check_encryption_information_consistency(self, pool_object_path, metadata):
"""
Check whether D-Bus and metadata agree about encryption state of pool.
Expand Down Expand Up @@ -302,6 +304,8 @@ class SysfsMonitor(unittest.TestCase):
Manage verification of sysfs files for devices.
"""

maxDiff = None

def run_check(self):
"""
Run the check.
Expand Down Expand Up @@ -339,6 +343,8 @@ class SymlinkMonitor(unittest.TestCase):
Manage verification of device symlinks.
"""

maxDiff = None

def run_check(self):
"""
Run the check.
Expand All @@ -361,6 +367,8 @@ class FilesystemSymlinkMonitor(unittest.TestCase):
Verify that devicmapper devices for filesystems have corresponding symlinks.
"""

maxDiff = None

def run_check(self, stop_time):
"""
Check that the filesystem links on the D-Bus and the filesystem links
Expand Down Expand Up @@ -433,6 +441,8 @@ class DbusMonitor(unittest.TestCase):
Manage starting and stopping the D-Bus monitor script.
"""

maxDiff = None

def setUp(self):
"""
Set up the D-Bus monitor for a test run.
Expand Down Expand Up @@ -587,16 +597,22 @@ def __str__(self):
return self.value


class RunPostTestChecks(unittest.TestCase):
class RunPostTestChecks:
"""
Manage running post test checks
"""

def setUp(self):
def __init__(self):
"""
Set up checks that need to be started before test is run.
"""
self.dbus_monitor = DbusMonitor()
self.dbus_monitor.setUp()

def tearDown(self):
def teardown(self):
"""
Run post-test checks after test is completed.
"""
stop_time = time.monotonic_ns()
self.dbus_monitor.run_check(stop_time)

Expand Down

0 comments on commit ee78c1c

Please sign in to comment.