summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Falcon <james.falcon@canonical.com>2021-12-02 22:08:34 -0600
committerGitHub <noreply@github.com>2021-12-02 21:08:34 -0700
commitff10fc0914a8b29acc23348d7848439a5eb4960a (patch)
tree7a5b25485ebd085c81fdf132f6ad3c6085740330
parentcf38c2cbc5875813fbb9858f45e5b95789b7ffea (diff)
downloadvyos-cloud-init-ff10fc0914a8b29acc23348d7848439a5eb4960a.tar.gz
vyos-cloud-init-ff10fc0914a8b29acc23348d7848439a5eb4960a.zip
testing: Remove date from final_message test (SC-638) (#1127)
-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)