Skip to content

Commit ee78c1c

Browse files
authored
Merge pull request #295 from mulkieran/maxDiffNone
Max diff none
2 parents 627395c + 55ba9cc commit ee78c1c

3 files changed

Lines changed: 21 additions & 7 deletions

File tree

stratis_cli_cert.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ def setUp(self):
185185
super().setUp()
186186

187187
self._post_test_checks = RunPostTestChecks()
188-
self._post_test_checks.setUp()
189188

190189
def tearDown(self):
191190
"""
@@ -195,7 +194,7 @@ def tearDown(self):
195194
"""
196195
super().tearDown()
197196

198-
self._post_test_checks.tearDown()
197+
self._post_test_checks.teardown()
199198

200199
def _test_permissions(self, command_line, permissions, exp_stdout_empty):
201200
"""

stratisd_cert.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ def setUp(self):
181181
super().setUp()
182182

183183
self._post_test_checks = RunPostTestChecks()
184-
self._post_test_checks.setUp()
185184

186185
def tearDown(self):
187186
"""
@@ -191,7 +190,7 @@ def tearDown(self):
191190
"""
192191
super().tearDown()
193192

194-
self._post_test_checks.tearDown()
193+
self._post_test_checks.teardown()
195194

196195
def _unittest_set_property(
197196
self, object_path, param_iface, dbus_param, dbus_value, exception_name

testlib/infra.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ class PoolMetadataMonitor(unittest.TestCase):
238238
Manage verification of consistency of pool-level metadata.
239239
"""
240240

241+
maxDiff = None
242+
241243
def _check_encryption_information_consistency(self, pool_object_path, metadata):
242244
"""
243245
Check whether D-Bus and metadata agree about encryption state of pool.
@@ -302,6 +304,8 @@ class SysfsMonitor(unittest.TestCase):
302304
Manage verification of sysfs files for devices.
303305
"""
304306

307+
maxDiff = None
308+
305309
def run_check(self):
306310
"""
307311
Run the check.
@@ -339,6 +343,8 @@ class SymlinkMonitor(unittest.TestCase):
339343
Manage verification of device symlinks.
340344
"""
341345

346+
maxDiff = None
347+
342348
def run_check(self):
343349
"""
344350
Run the check.
@@ -361,6 +367,8 @@ class FilesystemSymlinkMonitor(unittest.TestCase):
361367
Verify that devicmapper devices for filesystems have corresponding symlinks.
362368
"""
363369

370+
maxDiff = None
371+
364372
def run_check(self, stop_time):
365373
"""
366374
Check that the filesystem links on the D-Bus and the filesystem links
@@ -433,6 +441,8 @@ class DbusMonitor(unittest.TestCase):
433441
Manage starting and stopping the D-Bus monitor script.
434442
"""
435443

444+
maxDiff = None
445+
436446
def setUp(self):
437447
"""
438448
Set up the D-Bus monitor for a test run.
@@ -587,16 +597,22 @@ def __str__(self):
587597
return self.value
588598

589599

590-
class RunPostTestChecks(unittest.TestCase):
600+
class RunPostTestChecks:
591601
"""
592602
Manage running post test checks
593603
"""
594604

595-
def setUp(self):
605+
def __init__(self):
606+
"""
607+
Set up checks that need to be started before test is run.
608+
"""
596609
self.dbus_monitor = DbusMonitor()
597610
self.dbus_monitor.setUp()
598611

599-
def tearDown(self):
612+
def teardown(self):
613+
"""
614+
Run post-test checks after test is completed.
615+
"""
600616
stop_time = time.monotonic_ns()
601617
self.dbus_monitor.run_check(stop_time)
602618

0 commit comments

Comments
 (0)