From ff10fc0914a8b29acc23348d7848439a5eb4960a Mon Sep 17 00:00:00 2001 From: James Falcon Date: Thu, 2 Dec 2021 22:08:34 -0600 Subject: testing: Remove date from final_message test (SC-638) (#1127) --- tests/integration_tests/modules/test_combined.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/integration_tests/modules/test_combined.py b/tests/integration_tests/modules/test_combined.py index 758c96fa..26a8397d 100644 --- a/tests/integration_tests/modules/test_combined.py +++ b/tests/integration_tests/modules/test_combined.py @@ -74,23 +74,16 @@ class TestCombined: """Test that final_message module works as expected. Also tests LP 1511485: final_message is silent. - - It's possible that if this test is run within a minute or so of - midnight that we'll see a failure because the day in the logs - is different from the day specified in the test definition. """ client = class_client log = client.read_from_file('/var/log/cloud-init.log') - # Get date on host rather than locally as our host could be in a - # wildly different timezone (or more likely recording UTC) - today = client.execute('date "+%a, %d %b %Y"') expected = ( - 'This is my final message!\n' - r'\d+\.\d+.*\n' - '{}.*\n' - 'DataSource.*\n' - r'\d+\.\d+' - ).format(today) + "This is my final message!\n" + r"\d+\.\d+.*\n" + r"\w{3}, \d{2} \w{3} \d{4} \d{2}:\d{2}:\d{2} \+\d{4}\n" # Datetime + "DataSource.*\n" + r"\d+\.\d+" + ) assert re.search(expected, log) -- cgit v1.2.3