Skip to content

Commit

Permalink
test: webhook require_deprecation msg on 24.3 (#5731)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackboxsw committed Sep 23, 2024
1 parent 869d624 commit d1ce9b4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion tests/integration_tests/reporting/test_webhook_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@

import pytest

from cloudinit import lifecycle
from tests.integration_tests.instances import IntegrationInstance
from tests.integration_tests.util import (
ASSETS_DIR,
get_feature_flag_value,
verify_clean_boot,
verify_clean_log,
)
Expand Down Expand Up @@ -51,7 +53,18 @@ def test_webhook_reporting(client: IntegrationInstance):
"cloud-init status --wait"
)
verify_clean_log(client.read_from_file("/var/log/cloud-init.log"))
verify_clean_boot(client)
version_boundary = get_feature_flag_value(
client, "DEPRECATION_INFO_BOUNDARY"
)
message = "Unsupported configuration: boot stage called by PID"
deprecation_messages = []
if lifecycle.should_log_deprecation("24.3", version_boundary):
deprecation_messages.append(message)
else:
assert client.execute(
f"grep 'INFO]: {message}' /var/log/cloud-init.log"
).stdout.strip(), f"Did not find expected log: {message}"
verify_clean_boot(client, require_deprecations=deprecation_messages)

server_output = client.read_from_file(
"/var/tmp/echo_server_output"
Expand Down

0 comments on commit d1ce9b4

Please sign in to comment.