Skip to content

Commit

Permalink
fix: stop manually dropping dhcp6 key in integration test (#5267)
Browse files Browse the repository at this point in the history
This reverts the temporary changed introduced by PR #4855 that
manually dropped the "dhcp6" key from the post_network yaml
in the integration test "test_clean_boot_of_upgraded_package"
  • Loading branch information
a-dubs authored May 7, 2024
1 parent cf72d7f commit 8e8947b
Showing 1 changed file with 8 additions and 22 deletions.
30 changes: 8 additions & 22 deletions tests/integration_tests/test_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
FOCAL,
IS_UBUNTU,
MANTIC,
NOBLE,
)
from tests.integration_tests.util import verify_clean_log

Expand Down Expand Up @@ -144,28 +143,15 @@ def test_clean_boot_of_upgraded_package(session_cloud: IntegrationCloud):
assert post_json["v1"]["datasource"].startswith(
"DataSourceAzure"
)
if PLATFORM in ["gce", "qemu"] and CURRENT_RELEASE < NOBLE:
# GCE regenerates network config per boot AND
# GCE uses fallback config AND
# #4474 changed fallback configuration.
# Once the baseline includes #4474, this can be removed
pre_network = yaml.load(pre_network, Loader=yaml.Loader)
post_network = yaml.load(post_network, Loader=yaml.Loader)
for values in post_network["network"]["ethernets"].values():
values.pop("dhcp6")
assert yaml.dump(pre_network) == yaml.dump(post_network)
if CURRENT_RELEASE < MANTIC:
# Assert the full content is preserved including header comment
# since cloud-init writes the file directly and does not use
# netplan API to write 50-cloud-init.yaml.
assert pre_network == post_network
else:
if CURRENT_RELEASE < MANTIC:
# Assert the full content is preserved including header comment
# since cloud-init writes the file directly and does not use
# netplan API to write 50-cloud-init.yaml.
assert pre_network == post_network
else:
# Mantic and later Netplan API is used and doesn't allow
# cloud-init to write header comments in network config
assert yaml.safe_load(pre_network) == yaml.safe_load(
post_network
)
# Mantic and later Netplan API is used and doesn't allow
# cloud-init to write header comments in network config
assert yaml.safe_load(pre_network) == yaml.safe_load(post_network)

# Calculate and log all the boot numbers
pre_analyze_totals = [
Expand Down

0 comments on commit 8e8947b

Please sign in to comment.