Skip to content

Commit

Permalink
tests: update nocloud deprecation test for boundary version (#5474)
Browse files Browse the repository at this point in the history
  • Loading branch information
blackboxsw authored Jul 1, 2024
1 parent 681b7de commit ee1b25b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions tests/integration_tests/datasources/test_nocloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@
from pycloudlib.lxd.instance import LXDInstance

from cloudinit.subp import subp
from cloudinit.util import should_log_deprecation
from tests.integration_tests.instances import IntegrationInstance
from tests.integration_tests.integration_settings import PLATFORM
from tests.integration_tests.releases import CURRENT_RELEASE, FOCAL
from tests.integration_tests.util import (
get_feature_flag_value,
override_kernel_command_line,
verify_clean_boot,
verify_clean_log,
Expand Down Expand Up @@ -193,9 +195,18 @@ def test_smbios_seed_network(self, client: IntegrationInstance):
assert client.execute("cloud-init clean --logs").ok
client.restart()
assert client.execute("test -f /var/tmp/smbios_test_file").ok
assert "'nocloud-net' datasource name is deprecated" in client.execute(
"cloud-init status --format json"
version_boundary = get_feature_flag_value(
client, "DEPRECATION_INFO_BOUNDARY"
)
# nocloud-net deprecated in version 24.1
if should_log_deprecation("24.1", version_boundary):
log_level = "DEPRECATED"
else:
log_level = "INFO"
client.execute(
rf"grep \"{log_level}]: The 'nocloud-net' datasource name is"
' deprecated" /var/log/cloud-init.log'
).ok


@pytest.mark.skipif(PLATFORM != "lxd_vm", reason="Modifies grub config")
Expand Down

0 comments on commit ee1b25b

Please sign in to comment.