summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMoustafa Moustafa <momousta@microsoft.com>2020-11-04 11:51:16 -0800
committerGitHub <noreply@github.com>2020-11-04 14:51:16 -0500
commitc86283f0d9fe8a2634dc3c47727e6218fdaf25e2 (patch)
treeeae09e3bc16bf144fcf3282d62ec5c44e15c550a /tests
parentf42359741a6446d3c4ef25266ec290ed6f925b3a (diff)
downloadvyos-cloud-init-c86283f0d9fe8a2634dc3c47727e6218fdaf25e2.tar.gz
vyos-cloud-init-c86283f0d9fe8a2634dc3c47727e6218fdaf25e2.zip
azure: enable pushing the log to KVP from the last pushed byte (#614)
This allows the cloud-init log to be pushed multiple times during boot, with the latest lines being pushed each time.
Diffstat (limited to 'tests')
-rw-r--r--tests/unittests/test_reporting_hyperv.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/unittests/test_reporting_hyperv.py b/tests/unittests/test_reporting_hyperv.py
index 3f63a60e..8f7b3694 100644
--- a/tests/unittests/test_reporting_hyperv.py
+++ b/tests/unittests/test_reporting_hyperv.py
@@ -237,7 +237,7 @@ class TextKvpReporter(CiTestCase):
instantiated_handler_registry.register_item("telemetry", reporter)
log_file = self.tmp_path("cloud-init.log")
azure.MAX_LOG_TO_KVP_LENGTH = 100
- azure.LOG_PUSHED_TO_KVP_MARKER_FILE = self.tmp_path(
+ azure.LOG_PUSHED_TO_KVP_INDEX_FILE = self.tmp_path(
'log_pushed_to_kvp')
with open(log_file, "w") as f:
log_content = "A" * 50 + "B" * 100
@@ -254,8 +254,9 @@ class TextKvpReporter(CiTestCase):
self.assertNotEqual(
event.event_type, azure.COMPRESSED_EVENT_TYPE)
self.validate_compressed_kvps(
- reporter, 1,
- [log_content[-azure.MAX_LOG_TO_KVP_LENGTH:].encode()])
+ reporter, 2,
+ [log_content[-azure.MAX_LOG_TO_KVP_LENGTH:].encode(),
+ extra_content.encode()])
finally:
instantiated_handler_registry.unregister_item("telemetry",
force=False)