Fix test_two_criticals output test

This commit is contained in:
Aaron Whitehouse 2022-03-23 21:44:20 +00:00
parent a7fd743228
commit f0fd435fa6
1 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ class TestsWithZpool(unittest.TestCase):
# But we cannot be sure about the exact time as test execution could be different on
# different machines, so ignore the bits that may be different.
self.assertEqual(return_info.stdout[:49], b"WARN: sanoid-test-1 newest hourly snapshot is 1h ")
self.assertEqual(return_info.stdout[-31:], b"s old (should be < 1h 30m 0s)\n")
self.assertEqual(return_info.stdout[-30:], b"s old (should be < 1h 30m 0s)\n")
self.assertEqual(return_info.returncode, 1)
def test_two_criticals(self):
@ -127,7 +127,7 @@ class TestsWithZpool(unittest.TestCase):
self.assertEqual(return_info.stdout[:49], b"CRIT: sanoid-test-1 newest hourly snapshot is 6h ")
self.assertEqual(return_info.stdout[comma_location - 28:comma_location], b"s old (should be < 6h 0m 0s)")
self.assertEqual(return_info.stdout[comma_location:comma_location + 51], b", CRIT: sanoid-test-2 newest hourly snapshot is 6h ")
self.assertEqual(return_info.stdout[-29:], b"s old (should be < 6h 0m 0s)")
self.assertEqual(return_info.stdout[-29:], b"s old (should be < 6h 0m 0s)\n")
self.assertEqual(return_info.returncode, 1)