summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/integration_tests/modules/test_combined.py19
1 files 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)